VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 
42 class VTKINTERACTIONWIDGETS_EXPORT vtkSphereHandleRepresentation
44 {
45 public:
47  static vtkSphereHandleRepresentation *New();
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
129  vtkActor *Actor;
130  vtkPolyDataMapper *Mapper;
132  // void Highlight(int highlight);
133 
134  // Do the picking
135  vtkCellPicker *CursorPicker;
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.
151  vtkProperty *Property;
152  vtkProperty *SelectedProperty;
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
virtual void SetWorldPosition(double pos[3])
virtual int ComputeInteractionState(int X, int Y, int modify=0)
abstract class for representing widget handles
virtual void StartWidgetInteraction(double eventPos[2])
virtual void SetHandleSize(double)
virtual void ReleaseGraphicsResources(vtkWindow *)
virtual void BuildRepresentation()=0
virtual void ShallowCopy(vtkProp *prop)
create a polygonal sphere centered at the origin
virtual int HasTranslucentPolygonalGeometry()
virtual void RegisterPickers()
virtual void WidgetInteraction(double newEventPos[2])
virtual void GetActors(vtkPropCollection *)
void PrintSelf(ostream &os, vtkIndent indent)
virtual void DeepCopy(vtkProp *prop)
virtual int RenderOpaqueGeometry(vtkViewport *vtkNotUsed(viewport))
virtual void PlaceWidget(double *vtkNotUsed(bounds[6]))
A spherical rendition of point in 3D space.
virtual void Highlight(int vtkNotUsed(highlightOn))
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *vtkNotUsed(viewport))
virtual void SetDisplayPosition(double pos[3])