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 
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 *);
118  virtual int RenderOpaqueGeometry(vtkViewport *viewport);
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.
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
vtkPolyDataMapper
map vtkPolyData to graphics primitives
Definition: vtkPolyDataMapper.h:42
vtkSphereHandleRepresentation::SetProperty
void SetProperty(vtkProperty *)
vtkSphereHandleRepresentation::vtkSphereHandleRepresentation
vtkSphereHandleRepresentation()
vtkSphereHandleRepresentation::MoveFocus
void MoveFocus(double *p1, double *p2)
vtkGetObjectMacro
#define vtkGetObjectMacro(name, type)
Definition: vtkSetGet.h:232
vtkSphereHandleRepresentation::GetSphereRadius
double GetSphereRadius()
vtkSphereHandleRepresentation::GetBounds
virtual double * GetBounds()
vtkSphereHandleRepresentation::ConstraintAxis
int ConstraintAxis
Definition: vtkSphereHandleRepresentation.h:143
vtkSphereHandleRepresentation::CurrentHandleSize
double CurrentHandleSize
Definition: vtkSphereHandleRepresentation.h:162
vtkSphereHandleRepresentation::Mapper
vtkPolyDataMapper * Mapper
Definition: vtkSphereHandleRepresentation.h:130
vtkSphereHandleRepresentation::CursorPicker
vtkCellPicker * CursorPicker
Definition: vtkSphereHandleRepresentation.h:135
vtkSphereHandleRepresentation::RenderOpaqueGeometry
virtual int RenderOpaqueGeometry(vtkViewport *viewport)
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkHandleRepresentation
abstract class for representing widget handles
Definition: vtkHandleRepresentation.h:58
vtkInteractionWidgetsModule.h
vtkgl::x
GLint GLint GLint GLint GLint x
Definition: vtkgl.h:11318
vtkSphereHandleRepresentation::Sphere
vtkSphereSource * Sphere
Definition: vtkSphereHandleRepresentation.h:131
vtkSphereHandleRepresentation::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkSphereHandleRepresentation::New
static vtkSphereHandleRepresentation * New()
vtkHandleRepresentation.h
vtkSphereHandleRepresentation::ShallowCopy
virtual void ShallowCopy(vtkProp *prop)
vtkSphereHandleRepresentation::TranslationMode
int TranslationMode
Definition: vtkSphereHandleRepresentation.h:165
vtkSphereHandleRepresentation::Actor
vtkActor * Actor
Definition: vtkSphereHandleRepresentation.h:129
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
vtkSphereHandleRepresentation::StartWidgetInteraction
virtual void StartWidgetInteraction(double eventPos[2])
vtkSphereHandleRepresentation::DeepCopy
virtual void DeepCopy(vtkProp *prop)
vtkSetClampMacro
#define vtkSetClampMacro(name, type, min, max)
Definition: vtkSetGet.h:143
vtkSphereHandleRepresentation::SetSphereRadius
void SetSphereRadius(double)
vtkSphereHandleRepresentation::WaitingForMotion
int WaitingForMotion
Definition: vtkSphereHandleRepresentation.h:158
vtkSphereHandleRepresentation::ReleaseGraphicsResources
virtual void ReleaseGraphicsResources(vtkWindow *)
vtkSphereHandleRepresentation::SizeBounds
void SizeBounds()
vtkSphereSource
create a polygonal sphere centered at the origin
Definition: vtkSphereSource.h:46
vtkSphereHandleRepresentation
A spherical rendition of point in 3D space.
Definition: vtkSphereHandleRepresentation.h:44
vtkSphereHandleRepresentation::PlaceWidget
virtual void PlaceWidget(double bounds[6])
vtkActor
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:51
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkSphereHandleRepresentation::BuildRepresentation
virtual void BuildRepresentation()
vtkSphereHandleRepresentation::SetWorldPosition
virtual void SetWorldPosition(double p[3])
vtkSphereSource.h
vtkSphereHandleRepresentation::Highlight
void Highlight(int highlight)
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:47
vtkSphereHandleRepresentation::HotSpotSize
double HotSpotSize
Definition: vtkSphereHandleRepresentation.h:156
vtkSphereHandleRepresentation::~vtkSphereHandleRepresentation
~vtkSphereHandleRepresentation()
vtkSphereHandleRepresentation::Property
vtkProperty * Property
Definition: vtkSphereHandleRepresentation.h:151
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
vtkProp
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:50
vtkSphereHandleRepresentation::WidgetInteraction
virtual void WidgetInteraction(double eventPos[2])
vtkSphereHandleRepresentation::SelectedProperty
vtkProperty * SelectedProperty
Definition: vtkSphereHandleRepresentation.h:152
vtkSphereHandleRepresentation::Translate
void Translate(double *p1, double *p2)
VTKINTERACTIONWIDGETS_EXPORT
#define VTKINTERACTIONWIDGETS_EXPORT
Definition: vtkInteractionWidgetsModule.h:15
vtkSphereHandleRepresentation::GetActors
virtual void GetActors(vtkPropCollection *)
vtkSphereHandleRepresentation::HasTranslucentPolygonalGeometry
virtual int HasTranslucentPolygonalGeometry()
vtkSphereHandleRepresentation::RegisterPickers
virtual void RegisterPickers()
vtkgl::p
GLfloat GLfloat p
Definition: vtkgl.h:15717
vtkSphereHandleRepresentation::WaitCount
int WaitCount
Definition: vtkSphereHandleRepresentation.h:159
vtkSphereHandleRepresentation::SetHandleSize
virtual void SetHandleSize(double size)
vtkSphereHandleRepresentation::Scale
void Scale(double *p1, double *p2, double eventPos[2])
vtkProperty
represent surface properties of a geometric object
Definition: vtkProperty.h:64
vtkSphereHandleRepresentation::RenderTranslucentPolygonalGeometry
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *viewport)
vtkSphereHandleRepresentation::SetDisplayPosition
virtual void SetDisplayPosition(double p[3])
vtkPropCollection
a list of Props
Definition: vtkPropCollection.h:38
vtkCellPicker
ray-cast cell picker for all kinds of Prop3Ds
Definition: vtkCellPicker.h:69
vtkSphereHandleRepresentation::ComputeInteractionState
virtual int ComputeInteractionState(int X, int Y, int modify=0)
vtkSphereHandleRepresentation::CreateDefaultProperties
void CreateDefaultProperties()
vtkSphereHandleRepresentation::DetermineConstraintAxis
int DetermineConstraintAxis(int constraint, double *x)
vtkSphereHandleRepresentation::SetSelectedProperty
void SetSelectedProperty(vtkProperty *)
vtkgl::size
GLsizeiptr size
Definition: vtkgl.h:11843