ParaView
vtkPointHandleRepresentationSphere.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPointHandleRepresentationSphere.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
27 #ifndef vtkPointHandleRepresentationSphere_h
28 #define vtkPointHandleRepresentationSphere_h
29 
30 #include "vtkHandleRepresentation.h"
31 #include "vtkPVVTKExtensionsDefaultModule.h" //needed for exports
32 
33 class vtkActor;
34 class vtkGlyph3D;
35 class vtkPoints;
36 class vtkPolyData;
37 class vtkPolyDataAlgorithm;
38 class vtkPolyDataMapper;
39 class vtkProperty;
40 
41 class VTKPVVTKEXTENSIONSDEFAULT_EXPORT vtkPointHandleRepresentationSphere
42  : public vtkHandleRepresentation
43 {
44 public:
49 
51 
54  vtkTypeMacro(vtkPointHandleRepresentationSphere, vtkHandleRepresentation);
55  void PrintSelf(ostream& os, vtkIndent indent);
57 
59 
64  void SetCursorShape(vtkPolyData* cursorShape);
65  vtkPolyData* GetCursorShape();
67 
73  virtual void SetDisplayPosition(double xyz[3]);
74 
76 
79  void SetProperty(vtkProperty*);
80  void SetSelectedProperty(vtkProperty*);
81  vtkGetObjectMacro(Property, vtkProperty);
82  vtkGetObjectMacro(SelectedProperty, vtkProperty);
84 
86 
91  virtual double* GetBounds();
92  virtual void BuildRepresentation();
93  virtual void StartWidgetInteraction(double eventPos[2]);
94  virtual void WidgetInteraction(double eventPos[2]);
95  virtual int ComputeInteractionState(int X, int Y, int modify = 0);
97 
99 
102  virtual void ShallowCopy(vtkProp* prop);
103  virtual void GetActors(vtkPropCollection*);
104  virtual void ReleaseGraphicsResources(vtkWindow*);
105  virtual int RenderOpaqueGeometry(vtkViewport* viewport);
107 
109 
112  vtkSetMacro(Scalar, double);
113  vtkGetMacro(Scalar, double);
115 
117 
120  void SetAddCircleAroundSphere(int);
121  vtkGetMacro(AddCircleAroundSphere, int);
122  vtkBooleanMacro(AddCircleAroundSphere, int);
124 
128  void Highlight(int highlight);
129 
130 protected:
133 
134  // Render the cursor
135  vtkActor* Actor;
136  vtkPolyDataMapper* Mapper;
137  vtkGlyph3D* Glypher;
138  vtkPolyData* CursorShape;
139  vtkPolyData* FocalData;
140  vtkPoints* FocalPoint;
141 
142  // Support picking
143  double LastPickPosition[3];
144  double LastEventPosition[2];
145 
146  // Methods to manipulate the cursor
148  void Translate(double eventPos[2]);
149  void Scale(double eventPos[2]);
150 
151  // A flag to use the disk source
153  vtkActor* DiskActor;
154  vtkPolyDataMapper* DiskMapper;
155  vtkGlyph3D* DiskGlypher;
156  void CreateDefaultDiskSource();
157 
158  // Properties used to control the appearance of selected objects and
159  // the manipulator in general.
160  vtkProperty* Property;
161  vtkProperty* SelectedProperty;
162  void CreateDefaultProperties();
163 
164  // The size of the hot spot.
165  int DetermineConstraintAxis(int constraint, double eventPos[2]);
168 
169  double Scalar;
170 
171 private:
173  void operator=(const vtkPointHandleRepresentationSphere&) VTK_DELETE_FUNCTION;
174 };
175 
176 #endif
represent the position of a point in display coordinates