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