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 
33 #include "vtkSphereSource.h" // Needed for delegation to sphere
34 
35 class vtkSphereSource;
36 class vtkProperty;
37 class vtkActor;
38 class vtkPolyDataMapper;
39 class vtkCellPicker;
40 
43 {
44 public:
47 
49 
51  void PrintSelf(ostream& os, vtkIndent indent);
53 
55 
60  virtual void SetWorldPosition(double p[3]);
61  virtual void SetDisplayPosition(double p[3]);
63 
65 
71  vtkSetMacro(TranslationMode,int);
72  vtkGetMacro(TranslationMode,int);
73  vtkBooleanMacro(TranslationMode,int);
75 
76  void SetSphereRadius(double);
77  double GetSphereRadius();
78 
80 
81  void SetProperty(vtkProperty*);
82  void SetSelectedProperty(vtkProperty*);
83  vtkGetObjectMacro(Property,vtkProperty);
84  vtkGetObjectMacro(SelectedProperty,vtkProperty);
86 
88 
92  vtkSetClampMacro(HotSpotSize,double,0.0,1.0);
93  vtkGetMacro(HotSpotSize,double);
95 
98  virtual void SetHandleSize(double size);
99 
101 
103  virtual double *GetBounds();
104  virtual void BuildRepresentation();
105  virtual void StartWidgetInteraction(double eventPos[2]);
106  virtual void WidgetInteraction(double eventPos[2]);
107  virtual int ComputeInteractionState(int X, int Y, int modify=0);
108  virtual void PlaceWidget(double bounds[6]);
110 
112 
113  virtual void ShallowCopy(vtkProp *prop);
114  virtual void DeepCopy(vtkProp *prop);
115  virtual void GetActors(vtkPropCollection *);
116  virtual void ReleaseGraphicsResources(vtkWindow *);
117  virtual int RenderOpaqueGeometry(vtkViewport *viewport);
118  virtual int RenderTranslucentPolygonalGeometry(vtkViewport *viewport);
119  virtual int HasTranslucentPolygonalGeometry();
121 
122  void Highlight(int highlight);
123 protected:
126 
127  // the cursor3D
131  // void Highlight(int highlight);
132 
133  // Do the picking
135  double LastPickPosition[3];
136  double LastEventPosition[2];
137 
138  // Methods to manipulate the cursor
140  void Translate(double *p1, double *p2);
141  void Scale(double *p1, double *p2, double eventPos[2]);
142  void MoveFocus(double *p1, double *p2);
143  void SizeBounds();
144 
145  // Properties used to control the appearance of selected objects and
146  // the manipulator in general.
149  void CreateDefaultProperties();
150 
151  // The size of the hot spot.
152  double HotSpotSize;
153  int DetermineConstraintAxis(int constraint, double *x);
156 
157  // Current handle sized (may reflect scaling)
159 
160  // Control how translation works
162 
163 private:
165  void operator=(const vtkSphereHandleRepresentation&); //Not implemented
166 };
167 
168 #endif
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:49
virtual void SetWorldPosition(double pos[3])
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:49
virtual int ComputeInteractionState(int X, int Y, int modify=0)
abstract class for representing widget handles
abstract specification for Viewports
Definition: vtkViewport.h:45
represent surface properties of a geometric object
Definition: vtkProperty.h:61
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:35
create a polygonal sphere centered at the origin
virtual int HasTranslucentPolygonalGeometry()
a simple class to control print indentation
Definition: vtkIndent.h:37
virtual void WidgetInteraction(double newEventPos[2])
#define VTK_WIDGETS_EXPORT
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:66
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])