VTK
vtkAbstractPolygonalHandleRepresentation3D.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkAbstractPolygonalHandleRepresentation3D.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 =========================================================================*/
33 #ifndef vtkAbstractPolygonalHandleRepresentation3D_h
34 #define vtkAbstractPolygonalHandleRepresentation3D_h
35 
36 #include "vtkInteractionWidgetsModule.h" // For export macro
38 
39 class vtkProperty;
40 class vtkPolyDataMapper;
41 class vtkCellPicker;
44 class vtkMatrix4x4;
45 class vtkPolyData;
47 class vtkActor;
48 class vtkFollower;
49 class vtkVectorText;
50 
53 {
54 public:
55 
57 
59  void PrintSelf(ostream& os, vtkIndent indent);
61 
63 
64  virtual void SetWorldPosition(double p[3]);
65  virtual void SetDisplayPosition(double p[3]);
67 
69 
73 
75 
79  vtkGetObjectMacro(SelectedProperty,vtkProperty);
81 
85 
87 
89  virtual void BuildRepresentation();
90  virtual void StartWidgetInteraction(double eventPos[2]);
91  virtual void WidgetInteraction(double eventPos[2]);
92  virtual int ComputeInteractionState(int X, int Y, int modify=0);
94 
96 
97  virtual void ShallowCopy(vtkProp *prop);
98  virtual void DeepCopy(vtkProp *prop);
99  virtual void GetActors(vtkPropCollection *);
101  virtual int RenderOpaqueGeometry(vtkViewport *viewport);
104  virtual double *GetBounds();
106 
108 
110  vtkSetMacro( LabelVisibility, int );
111  vtkGetMacro( LabelVisibility, int );
112  vtkBooleanMacro( LabelVisibility, int );
113  virtual void SetLabelText( const char * label );
114  virtual char * GetLabelText();
116 
118 
119  virtual void SetLabelTextScale( double scale[3] );
120  void SetLabelTextScale(double x, double y, double z)
121  {
122  double scale[3] = {x, y, z};
123  this->SetLabelTextScale(scale);
124  }
125  virtual double * GetLabelTextScale();
127 
129 
130  vtkGetObjectMacro( LabelTextActor, vtkFollower );
132 
136  virtual void SetUniformScale( double scale );
137 
139 
140  vtkSetMacro( HandleVisibility, int );
141  vtkGetMacro( HandleVisibility, int );
142  vtkBooleanMacro( HandleVisibility, int );
144 
145  void Highlight(int highlight);
146 
148 
158  vtkSetMacro( SmoothMotion, int );
159  vtkGetMacro( SmoothMotion, int );
160  vtkBooleanMacro( SmoothMotion, int );
162 
163 protected:
166 
173  double LastPickPosition[3];
174  double LastEventPosition[2];
181 
182  // Register internal Pickers within PickingManager
183  virtual void RegisterPickers();
184 
185  // Methods to manipulate the cursor
186  virtual void Translate(double *p1, double *p2);
187  virtual void Scale(double *p1, double *p2, double eventPos[2]);
188  virtual void MoveFocus(double *p1, double *p2);
189 
191 
192  // Given a motion vector defined by p1 --> p2 (p1 and p2 are in
193  // world coordinates), the new display position of the handle center is
194  // populated into requestedDisplayPos. This is again only a request for the
195  // new display position. It is up to the point placer to deduce the
196  // appropriate world co-ordinates that this display position will map into.
197  // The placer may even disallow such a movement.
198  // If "SmoothMotion" is OFF, the returned requestedDisplayPos is the same
199  // as the event position, ie the location of the mouse cursor. If its OFF,
200  // incremental offsets as described above are used to compute it.
201  void MoveFocusRequest( double *p1, double *p2,
202  double eventPos[2], double requestedDisplayPos[3] );
203 
204  int DetermineConstraintAxis(int constraint, double *x, double *startPickPos);
205 
213  virtual void UpdateHandle();
214 
216  virtual void UpdateLabel();
217 
218  // Handle the label.
225 
226 private:
228  void operator=(const vtkAbstractPolygonalHandleRepresentation3D&); //Not implemented
229 };
230 
231 #endif
232 
233 
vtkPolyDataMapper
map vtkPolyData to graphics primitives
Definition: vtkPolyDataMapper.h:42
vtkAbstractPolygonalHandleRepresentation3D::WaitingForMotion
int WaitingForMotion
Definition: vtkAbstractPolygonalHandleRepresentation3D.h:178
vtkgl::z
GLdouble GLdouble z
Definition: vtkgl.h:11754
vtkAbstractPolygonalHandleRepresentation3D::Actor
vtkActor * Actor
Definition: vtkAbstractPolygonalHandleRepresentation3D.h:167
vtkAbstractPolygonalHandleRepresentation3D::SetSelectedProperty
void SetSelectedProperty(vtkProperty *)
vtkAbstractPolygonalHandleRepresentation3D::BuildRepresentation
virtual void BuildRepresentation()
vtkFollower
a subclass of actor that always faces the camera
Definition: vtkFollower.h:46
vtkGetObjectMacro
#define vtkGetObjectMacro(name, type)
Definition: vtkSetGet.h:232
vtkAbstractPolygonalHandleRepresentation3D::ShallowCopy
virtual void ShallowCopy(vtkProp *prop)
vtkAbstractTransform
superclass for all geometric transformations
Definition: vtkAbstractTransform.h:50
vtkAbstractPolygonalHandleRepresentation3D::Mapper
vtkPolyDataMapper * Mapper
Definition: vtkAbstractPolygonalHandleRepresentation3D.h:168
vtkAbstractPolygonalHandleRepresentation3D::RenderTranslucentPolygonalGeometry
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *viewport)
vtkAbstractPolygonalHandleRepresentation3D::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkAbstractPolygonalHandleRepresentation3D::HandleVisibility
int HandleVisibility
Definition: vtkAbstractPolygonalHandleRepresentation3D.h:180
vtkAbstractPolygonalHandleRepresentation3D::SetWorldPosition
virtual void SetWorldPosition(double p[3])
vtkAbstractPolygonalHandleRepresentation3D::LabelVisibility
int LabelVisibility
Definition: vtkAbstractPolygonalHandleRepresentation3D.h:219
vtkAbstractPolygonalHandleRepresentation3D::LabelAnnotationTextScaleInitialized
bool LabelAnnotationTextScaleInitialized
Definition: vtkAbstractPolygonalHandleRepresentation3D.h:223
vtkgl::scale
GLenum GLenum GLenum GLenum GLenum scale
Definition: vtkgl.h:15942
vtkAbstractPolygonalHandleRepresentation3D::Highlight
void Highlight(int highlight)
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkHandleRepresentation
abstract class for representing widget handles
Definition: vtkHandleRepresentation.h:58
vtkAbstractPolygonalHandleRepresentation3D
represent a user defined handle geometry in 3D while maintaining a fixed orientation w....
Definition: vtkAbstractPolygonalHandleRepresentation3D.h:53
vtkAbstractPolygonalHandleRepresentation3D::Translate
virtual void Translate(double *p1, double *p2)
vtkAbstractPolygonalHandleRepresentation3D::SetLabelTextScale
virtual void SetLabelTextScale(double scale[3])
vtkInteractionWidgetsModule.h
vtkgl::x
GLint GLint GLint GLint GLint x
Definition: vtkgl.h:11318
vtkAbstractPolygonalHandleRepresentation3D::SetProperty
void SetProperty(vtkProperty *)
vtkHandleRepresentation.h
vtkVectorText
create polygonal text
Definition: vtkVectorText.h:47
vtkAbstractPolygonalHandleRepresentation3D::HandleTransformFilter
vtkTransformPolyDataFilter * HandleTransformFilter
Definition: vtkAbstractPolygonalHandleRepresentation3D.h:169
vtkAbstractPolygonalHandleRepresentation3D::GetHandle
vtkPolyData * GetHandle()
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
vtkAbstractPolygonalHandleRepresentation3D::SetUniformScale
virtual void SetUniformScale(double scale)
vtkAbstractPolygonalHandleRepresentation3D::SelectedProperty
vtkProperty * SelectedProperty
Definition: vtkAbstractPolygonalHandleRepresentation3D.h:177
vtkAbstractPolygonalHandleRepresentation3D::CreateDefaultProperties
void CreateDefaultProperties()
vtkAbstractPolygonalHandleRepresentation3D::DetermineConstraintAxis
int DetermineConstraintAxis(int constraint, double *x, double *startPickPos)
vtkAbstractPolygonalHandleRepresentation3D::HandleTransform
vtkMatrixToLinearTransform * HandleTransform
Definition: vtkAbstractPolygonalHandleRepresentation3D.h:170
vtkAbstractPolygonalHandleRepresentation3D::LabelTextActor
vtkFollower * LabelTextActor
Definition: vtkAbstractPolygonalHandleRepresentation3D.h:220
vtkAbstractPolygonalHandleRepresentation3D::~vtkAbstractPolygonalHandleRepresentation3D
~vtkAbstractPolygonalHandleRepresentation3D()
vtkAbstractPolygonalHandleRepresentation3D::RenderOpaqueGeometry
virtual int RenderOpaqueGeometry(vtkViewport *viewport)
vtkAbstractPolygonalHandleRepresentation3D::SetLabelText
virtual void SetLabelText(const char *label)
vtkAbstractPolygonalHandleRepresentation3D::ReleaseGraphicsResources
virtual void ReleaseGraphicsResources(vtkWindow *)
vtkMatrixToLinearTransform
convert a matrix to a transform
Definition: vtkMatrixToLinearTransform.h:40
vtkAbstractPolygonalHandleRepresentation3D::SetDisplayPosition
virtual void SetDisplayPosition(double p[3])
vtkAbstractPolygonalHandleRepresentation3D::UpdateHandle
virtual void UpdateHandle()
vtkAbstractPolygonalHandleRepresentation3D::MoveFocusRequest
void MoveFocusRequest(double *p1, double *p2, double eventPos[2], double requestedDisplayPos[3])
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
vtkMatrix4x4
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:39
vtkAbstractPolygonalHandleRepresentation3D::GetTransform
virtual vtkAbstractTransform * GetTransform()
vtkAbstractPolygonalHandleRepresentation3D::HasTranslucentPolygonalGeometry
virtual int HasTranslucentPolygonalGeometry()
vtkAbstractPolygonalHandleRepresentation3D::GetLabelText
virtual char * GetLabelText()
vtkAbstractPolygonalHandleRepresentation3D::ComputeInteractionState
virtual int ComputeInteractionState(int X, int Y, int modify=0)
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkTransformPolyDataFilter
transform points and associated normals and vectors for polygonal dataset
Definition: vtkTransformPolyDataFilter.h:51
vtkAbstractPolygonalHandleRepresentation3D::vtkAbstractPolygonalHandleRepresentation3D
vtkAbstractPolygonalHandleRepresentation3D()
vtkAbstractPolygonalHandleRepresentation3D::MoveFocus
virtual void MoveFocus(double *p1, double *p2)
vtkAbstractPolygonalHandleRepresentation3D::Property
vtkProperty * Property
Definition: vtkAbstractPolygonalHandleRepresentation3D.h:176
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:47
vtkAbstractPolygonalHandleRepresentation3D::SmoothMotion
int SmoothMotion
Definition: vtkAbstractPolygonalHandleRepresentation3D.h:224
vtkAbstractPolygonalHandleRepresentation3D::LabelTextInput
vtkVectorText * LabelTextInput
Definition: vtkAbstractPolygonalHandleRepresentation3D.h:222
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
vtkAbstractPolygonalHandleRepresentation3D::LabelTextMapper
vtkPolyDataMapper * LabelTextMapper
Definition: vtkAbstractPolygonalHandleRepresentation3D.h:221
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
vtkProp
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:50
vtkAbstractPolygonalHandleRepresentation3D::ConstraintAxis
int ConstraintAxis
Definition: vtkAbstractPolygonalHandleRepresentation3D.h:175
vtkAbstractPolygonalHandleRepresentation3D::GetBounds
virtual double * GetBounds()
vtkAbstractPolygonalHandleRepresentation3D::SetLabelTextScale
void SetLabelTextScale(double x, double y, double z)
Definition: vtkAbstractPolygonalHandleRepresentation3D.h:120
vtkAbstractPolygonalHandleRepresentation3D::HandlePicker
vtkCellPicker * HandlePicker
Definition: vtkAbstractPolygonalHandleRepresentation3D.h:172
VTKINTERACTIONWIDGETS_EXPORT
#define VTKINTERACTIONWIDGETS_EXPORT
Definition: vtkInteractionWidgetsModule.h:15
vtkAbstractPolygonalHandleRepresentation3D::WidgetInteraction
virtual void WidgetInteraction(double eventPos[2])
vtkgl::y
GLint GLint GLint GLint GLint GLint y
Definition: vtkgl.h:11318
vtkAbstractPolygonalHandleRepresentation3D::DeepCopy
virtual void DeepCopy(vtkProp *prop)
vtkAbstractPolygonalHandleRepresentation3D::Scale
virtual void Scale(double *p1, double *p2, double eventPos[2])
vtkAbstractPolygonalHandleRepresentation3D::GetLabelTextScale
virtual double * GetLabelTextScale()
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:84
vtkAbstractPolygonalHandleRepresentation3D::WaitCount
int WaitCount
Definition: vtkAbstractPolygonalHandleRepresentation3D.h:179
vtkgl::p
GLfloat GLfloat p
Definition: vtkgl.h:15717
vtkAbstractPolygonalHandleRepresentation3D::HandleTransformMatrix
vtkMatrix4x4 * HandleTransformMatrix
Definition: vtkAbstractPolygonalHandleRepresentation3D.h:171
vtkProperty
represent surface properties of a geometric object
Definition: vtkProperty.h:64
vtkAbstractPolygonalHandleRepresentation3D::GetActors
virtual void GetActors(vtkPropCollection *)
vtkPropCollection
a list of Props
Definition: vtkPropCollection.h:38
vtkCellPicker
ray-cast cell picker for all kinds of Prop3Ds
Definition: vtkCellPicker.h:69
vtkAbstractPolygonalHandleRepresentation3D::SetHandle
void SetHandle(vtkPolyData *)
vtkAbstractPolygonalHandleRepresentation3D::StartWidgetInteraction
virtual void StartWidgetInteraction(double eventPos[2])
vtkAbstractPolygonalHandleRepresentation3D::UpdateLabel
virtual void UpdateLabel()
vtkAbstractPolygonalHandleRepresentation3D::RegisterPickers
virtual void RegisterPickers()