VTK
vtkSphereHandleRepresentation.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkSphereHandleRepresentation.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 =========================================================================*/
29 #ifndef vtkSphereHandleRepresentation_h
30 #define vtkSphereHandleRepresentation_h
31 
32 #include "vtkInteractionWidgetsModule.h" // For export macro
34 #include "vtkSphereSource.h" // Needed for delegation to sphere
35 
36 class vtkSphereSource;
37 class vtkProperty;
38 class vtkActor;
39 class vtkPolyDataMapper;
40 class vtkCellPicker;
41 
44 {
45 public:
48 
50 
52  void PrintSelf(ostream& os, vtkIndent indent);
54 
56 
61  virtual void SetWorldPosition(double p[3]);
62  virtual void SetDisplayPosition(double p[3]);
64 
66 
72  vtkSetMacro(TranslationMode,int);
73  vtkGetMacro(TranslationMode,int);
74  vtkBooleanMacro(TranslationMode,int);
76 
77  void SetSphereRadius(double);
78  double GetSphereRadius();
79 
81 
82  void SetProperty(vtkProperty*);
83  void SetSelectedProperty(vtkProperty*);
84  vtkGetObjectMacro(Property,vtkProperty);
85  vtkGetObjectMacro(SelectedProperty,vtkProperty);
87 
89 
93  vtkSetClampMacro(HotSpotSize,double,0.0,1.0);
94  vtkGetMacro(HotSpotSize,double);
96 
99  virtual void SetHandleSize(double size);
100 
102 
104  virtual double *GetBounds();
105  virtual void BuildRepresentation();
106  virtual void StartWidgetInteraction(double eventPos[2]);
107  virtual void WidgetInteraction(double eventPos[2]);
108  virtual int ComputeInteractionState(int X, int Y, int modify=0);
109  virtual void PlaceWidget(double bounds[6]);
111 
113 
114  virtual void ShallowCopy(vtkProp *prop);
115  virtual void DeepCopy(vtkProp *prop);
116  virtual void GetActors(vtkPropCollection *);
117  virtual void ReleaseGraphicsResources(vtkWindow *);
118  virtual int RenderOpaqueGeometry(vtkViewport *viewport);
119  virtual int RenderTranslucentPolygonalGeometry(vtkViewport *viewport);
120  virtual int HasTranslucentPolygonalGeometry();
122 
123  void Highlight(int highlight);
124 protected:
127 
128  // the cursor3D
132  // void Highlight(int highlight);
133 
134  // Do the picking
136  double LastPickPosition[3];
137  double LastEventPosition[2];
138 
139  // Register internal Pickers within PickingManager
140  virtual void RegisterPickers();
141 
142  // Methods to manipulate the cursor
144  void Translate(double *p1, double *p2);
145  void Scale(double *p1, double *p2, double eventPos[2]);
146  void MoveFocus(double *p1, double *p2);
147  void SizeBounds();
148 
149  // Properties used to control the appearance of selected objects and
150  // the manipulator in general.
153  void CreateDefaultProperties();
154 
155  // The size of the hot spot.
156  double HotSpotSize;
157  int DetermineConstraintAxis(int constraint, double *x);
160 
161  // Current handle sized (may reflect scaling)
163 
164  // Control how translation works
166 
167 private:
169  void operator=(const vtkSphereHandleRepresentation&); //Not implemented
170 };
171 
172 #endif
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:52
virtual void SetWorldPosition(double pos[3])
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:50
virtual int ComputeInteractionState(int X, int Y, int modify=0)
abstract class for representing widget handles
abstract specification for Viewports
Definition: vtkViewport.h:46
represent surface properties of a geometric object
Definition: vtkProperty.h:63
virtual void StartWidgetInteraction(double eventPos[2])
virtual void SetHandleSize(double)
virtual void ReleaseGraphicsResources(vtkWindow *)
virtual void BuildRepresentation()=0
a list of Props
virtual void ShallowCopy(vtkProp *prop)
window superclass for vtkRenderWindow
Definition: vtkWindow.h:36
#define VTKINTERACTIONWIDGETS_EXPORT
create a polygonal sphere centered at the origin
virtual int HasTranslucentPolygonalGeometry()
a simple class to control print indentation
Definition: vtkIndent.h:38
virtual void RegisterPickers()
virtual void WidgetInteraction(double newEventPos[2])
virtual void GetActors(vtkPropCollection *)
void PrintSelf(ostream &os, vtkIndent indent)
virtual void DeepCopy(vtkProp *prop)
map vtkPolyData to graphics primitives
virtual int RenderOpaqueGeometry(vtkViewport *vtkNotUsed(viewport))
virtual void PlaceWidget(double *vtkNotUsed(bounds[6]))
ray-cast cell picker for all kinds of Prop3Ds
Definition: vtkCellPicker.h:68
A spherical rendition of point in 3D space.
virtual void Highlight(int vtkNotUsed(highlightOn))
static vtkObject * New()
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *vtkNotUsed(viewport))
virtual void SetDisplayPosition(double pos[3])