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 =========================================================================*/
34 #ifndef vtkAbstractPolygonalHandleRepresentation3D_h
35 #define vtkAbstractPolygonalHandleRepresentation3D_h
36 
37 #include "vtkInteractionWidgetsModule.h" // For export macro
39 
40 class vtkProperty;
41 class vtkPolyDataMapper;
42 class vtkCellPicker;
45 class vtkMatrix4x4;
46 class vtkPolyData;
48 class vtkActor;
49 class vtkFollower;
50 class vtkVectorText;
51 
52 class VTKINTERACTIONWIDGETS_EXPORT vtkAbstractPolygonalHandleRepresentation3D
54 {
55 public:
56 
58 
62  void PrintSelf(ostream& os, vtkIndent indent);
64 
66 
69  virtual void SetWorldPosition(double p[3]);
70  virtual void SetDisplayPosition(double p[3]);
72 
74 
80 
82 
87  vtkGetObjectMacro(Property,vtkProperty);
88  vtkGetObjectMacro(SelectedProperty,vtkProperty);
90 
96 
98 
101  virtual void BuildRepresentation();
102  virtual void StartWidgetInteraction(double eventPos[2]);
103  virtual void WidgetInteraction(double eventPos[2]);
104  virtual int ComputeInteractionState(int X, int Y, int modify=0);
106 
108 
111  virtual void ShallowCopy(vtkProp *prop);
112  virtual void DeepCopy(vtkProp *prop);
113  virtual void GetActors(vtkPropCollection *);
115  virtual int RenderOpaqueGeometry(vtkViewport *viewport);
118  virtual double *GetBounds();
120 
122 
126  vtkSetMacro( LabelVisibility, int );
127  vtkGetMacro( LabelVisibility, int );
128  vtkBooleanMacro( LabelVisibility, int );
129  virtual void SetLabelText( const char * label );
130  virtual char * GetLabelText();
132 
134 
137  virtual void SetLabelTextScale( double scale[3] );
138  void SetLabelTextScale(double x, double y, double z)
139  {
140  double scale[3] = {x, y, z};
141  this->SetLabelTextScale(scale);
142  }
143  virtual double * GetLabelTextScale();
145 
147 
150  vtkGetObjectMacro( LabelTextActor, vtkFollower );
152 
158  virtual void SetUniformScale( double scale );
159 
161 
164  vtkSetMacro( HandleVisibility, int );
165  vtkGetMacro( HandleVisibility, int );
166  vtkBooleanMacro( HandleVisibility, int );
168 
169  void Highlight(int highlight);
170 
172 
183  vtkSetMacro( SmoothMotion, int );
184  vtkGetMacro( SmoothMotion, int );
185  vtkBooleanMacro( SmoothMotion, int );
187 
188 protected:
191 
198  double LastPickPosition[3];
199  double LastEventPosition[2];
206 
207  // Register internal Pickers within PickingManager
208  virtual void RegisterPickers();
209 
210  // Methods to manipulate the cursor
211  virtual void Translate(double *p1, double *p2);
212  virtual void Scale(double *p1, double *p2, double eventPos[2]);
213  virtual void MoveFocus(double *p1, double *p2);
214 
216 
217  // Given a motion vector defined by p1 --> p2 (p1 and p2 are in
218  // world coordinates), the new display position of the handle center is
219  // populated into requestedDisplayPos. This is again only a request for the
220  // new display position. It is up to the point placer to deduce the
221  // appropriate world co-ordinates that this display position will map into.
222  // The placer may even disallow such a movement.
223  // If "SmoothMotion" is OFF, the returned requestedDisplayPos is the same
224  // as the event position, ie the location of the mouse cursor. If its OFF,
225  // incremental offsets as described above are used to compute it.
226  void MoveFocusRequest( double *p1, double *p2,
227  double eventPos[2], double requestedDisplayPos[3] );
228 
229  int DetermineConstraintAxis(int constraint, double *x, double *startPickPos);
230 
240  virtual void UpdateHandle();
241 
245  virtual void UpdateLabel();
246 
247  // Handle the label.
254 
255 private:
257  void operator=(const vtkAbstractPolygonalHandleRepresentation3D&) VTK_DELETE_FUNCTION;
258 };
259 
260 #endif
261 
262 
vtkPolyDataMapper
map vtkPolyData to graphics primitives
Definition: vtkPolyDataMapper.h:43
vtkAbstractPolygonalHandleRepresentation3D::WaitingForMotion
int WaitingForMotion
Definition: vtkAbstractPolygonalHandleRepresentation3D.h:203
vtkAbstractPolygonalHandleRepresentation3D::Actor
vtkActor * Actor
Definition: vtkAbstractPolygonalHandleRepresentation3D.h:192
vtkAbstractPolygonalHandleRepresentation3D::SetSelectedProperty
void SetSelectedProperty(vtkProperty *)
vtkAbstractPolygonalHandleRepresentation3D::BuildRepresentation
virtual void BuildRepresentation()
Methods to make this class properly act like a vtkWidgetRepresentation.
vtkFollower
a subclass of actor that always faces the camera
Definition: vtkFollower.h:47
vtkAbstractPolygonalHandleRepresentation3D::ShallowCopy
virtual void ShallowCopy(vtkProp *prop)
Methods to make this class behave as a vtkProp.
vtkAbstractTransform
superclass for all geometric transformations
Definition: vtkAbstractTransform.h:51
vtkAbstractPolygonalHandleRepresentation3D::Mapper
vtkPolyDataMapper * Mapper
Definition: vtkAbstractPolygonalHandleRepresentation3D.h:193
vtkAbstractPolygonalHandleRepresentation3D::RenderTranslucentPolygonalGeometry
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *viewport)
vtkAbstractPolygonalHandleRepresentation3D::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkX3D::scale
@ scale
Definition: vtkX3D.h:229
vtkAbstractPolygonalHandleRepresentation3D::HandleVisibility
int HandleVisibility
Definition: vtkAbstractPolygonalHandleRepresentation3D.h:205
vtkAbstractPolygonalHandleRepresentation3D::SetWorldPosition
virtual void SetWorldPosition(double p[3])
Set the position of the point in world and display coordinates.
vtkAbstractPolygonalHandleRepresentation3D::LabelVisibility
int LabelVisibility
Definition: vtkAbstractPolygonalHandleRepresentation3D.h:248
vtkAbstractPolygonalHandleRepresentation3D::LabelAnnotationTextScaleInitialized
bool LabelAnnotationTextScaleInitialized
Definition: vtkAbstractPolygonalHandleRepresentation3D.h:252
vtkAbstractPolygonalHandleRepresentation3D::Highlight
void Highlight(int highlight)
vtkHandleRepresentation
abstract class for representing widget handles
Definition: vtkHandleRepresentation.h:59
vtkAbstractPolygonalHandleRepresentation3D
represent a user defined handle geometry in 3D while maintaining a fixed orientation w....
Definition: vtkAbstractPolygonalHandleRepresentation3D.h:54
vtkAbstractPolygonalHandleRepresentation3D::Translate
virtual void Translate(double *p1, double *p2)
vtkAbstractPolygonalHandleRepresentation3D::SetLabelTextScale
virtual void SetLabelTextScale(double scale[3])
Scale text (font size along each dimension).
vtkAbstractPolygonalHandleRepresentation3D::SetProperty
void SetProperty(vtkProperty *)
Set/Get the handle properties when unselected and selected.
vtkHandleRepresentation.h
vtkVectorText
create polygonal text
Definition: vtkVectorText.h:48
vtkAbstractPolygonalHandleRepresentation3D::HandleTransformFilter
vtkTransformPolyDataFilter * HandleTransformFilter
Definition: vtkAbstractPolygonalHandleRepresentation3D.h:194
vtkAbstractPolygonalHandleRepresentation3D::GetHandle
vtkPolyData * GetHandle()
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
vtkAbstractPolygonalHandleRepresentation3D::SetUniformScale
virtual void SetUniformScale(double scale)
The handle may be scaled uniformly in all three dimensions using this API.
vtkAbstractPolygonalHandleRepresentation3D::SelectedProperty
vtkProperty * SelectedProperty
Definition: vtkAbstractPolygonalHandleRepresentation3D.h:202
vtkAbstractPolygonalHandleRepresentation3D::CreateDefaultProperties
void CreateDefaultProperties()
vtkAbstractPolygonalHandleRepresentation3D::DetermineConstraintAxis
int DetermineConstraintAxis(int constraint, double *x, double *startPickPos)
vtkAbstractPolygonalHandleRepresentation3D::HandleTransform
vtkMatrixToLinearTransform * HandleTransform
Definition: vtkAbstractPolygonalHandleRepresentation3D.h:195
vtkAbstractPolygonalHandleRepresentation3D::LabelTextActor
vtkFollower * LabelTextActor
Definition: vtkAbstractPolygonalHandleRepresentation3D.h:249
vtkAbstractPolygonalHandleRepresentation3D::~vtkAbstractPolygonalHandleRepresentation3D
~vtkAbstractPolygonalHandleRepresentation3D()
vtkAbstractPolygonalHandleRepresentation3D::RenderOpaqueGeometry
virtual int RenderOpaqueGeometry(vtkViewport *viewport)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
vtkAbstractPolygonalHandleRepresentation3D::SetLabelText
virtual void SetLabelText(const char *label)
vtkAbstractPolygonalHandleRepresentation3D::ReleaseGraphicsResources
virtual void ReleaseGraphicsResources(vtkWindow *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
vtkMatrixToLinearTransform
convert a matrix to a transform
Definition: vtkMatrixToLinearTransform.h:41
vtkAbstractPolygonalHandleRepresentation3D::SetDisplayPosition
virtual void SetDisplayPosition(double p[3])
Handles usually have their coordinates set in display coordinates (generally by an associated widget)...
vtkAbstractPolygonalHandleRepresentation3D::UpdateHandle
virtual void UpdateHandle()
Update the actor position.
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:52
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkMatrix4x4
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:42
vtkAbstractPolygonalHandleRepresentation3D::GetTransform
virtual vtkAbstractTransform * GetTransform()
Get the transform used to transform the generic handle polydata before placing it in the render windo...
vtkAbstractPolygonalHandleRepresentation3D::HasTranslucentPolygonalGeometry
virtual int HasTranslucentPolygonalGeometry()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
vtkAbstractPolygonalHandleRepresentation3D::GetLabelText
virtual char * GetLabelText()
vtkAbstractPolygonalHandleRepresentation3D::ComputeInteractionState
virtual int ComputeInteractionState(int X, int Y, int modify=0)
vtkTransformPolyDataFilter
transform points and associated normals and vectors for polygonal dataset
Definition: vtkTransformPolyDataFilter.h:52
vtkAbstractPolygonalHandleRepresentation3D::vtkAbstractPolygonalHandleRepresentation3D
vtkAbstractPolygonalHandleRepresentation3D()
vtkAbstractPolygonalHandleRepresentation3D::MoveFocus
virtual void MoveFocus(double *p1, double *p2)
vtkAbstractPolygonalHandleRepresentation3D::Property
vtkProperty * Property
Definition: vtkAbstractPolygonalHandleRepresentation3D.h:201
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:48
vtkAbstractPolygonalHandleRepresentation3D::SmoothMotion
int SmoothMotion
Definition: vtkAbstractPolygonalHandleRepresentation3D.h:253
vtkAbstractPolygonalHandleRepresentation3D::LabelTextInput
vtkVectorText * LabelTextInput
Definition: vtkAbstractPolygonalHandleRepresentation3D.h:251
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkAbstractPolygonalHandleRepresentation3D::LabelTextMapper
vtkPolyDataMapper * LabelTextMapper
Definition: vtkAbstractPolygonalHandleRepresentation3D.h:250
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkProp
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:48
vtkAbstractPolygonalHandleRepresentation3D::ConstraintAxis
int ConstraintAxis
Definition: vtkAbstractPolygonalHandleRepresentation3D.h:200
vtkAbstractPolygonalHandleRepresentation3D::GetBounds
virtual double * GetBounds()
Methods to make this class behave as a vtkProp.
vtkAbstractPolygonalHandleRepresentation3D::SetLabelTextScale
void SetLabelTextScale(double x, double y, double z)
Definition: vtkAbstractPolygonalHandleRepresentation3D.h:138
vtkAbstractPolygonalHandleRepresentation3D::HandlePicker
vtkCellPicker * HandlePicker
Definition: vtkAbstractPolygonalHandleRepresentation3D.h:197
vtkAbstractPolygonalHandleRepresentation3D::WidgetInteraction
virtual void WidgetInteraction(double eventPos[2])
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:86
vtkAbstractPolygonalHandleRepresentation3D::WaitCount
int WaitCount
Definition: vtkAbstractPolygonalHandleRepresentation3D.h:204
vtkAbstractPolygonalHandleRepresentation3D::HandleTransformMatrix
vtkMatrix4x4 * HandleTransformMatrix
Definition: vtkAbstractPolygonalHandleRepresentation3D.h:196
vtkProperty
represent surface properties of a geometric object
Definition: vtkProperty.h:65
vtkAbstractPolygonalHandleRepresentation3D::GetActors
virtual void GetActors(vtkPropCollection *)
For some exporters and other other operations we must be able to collect all the actors or volumes.
vtkPropCollection
a list of Props
Definition: vtkPropCollection.h:39
vtkCellPicker
ray-cast cell picker for all kinds of Prop3Ds
Definition: vtkCellPicker.h:70
vtkAbstractPolygonalHandleRepresentation3D::SetHandle
void SetHandle(vtkPolyData *)
Set/get the handle polydata.
vtkAbstractPolygonalHandleRepresentation3D::StartWidgetInteraction
virtual void StartWidgetInteraction(double eventPos[2])
vtkAbstractPolygonalHandleRepresentation3D::UpdateLabel
virtual void UpdateLabel()
Opportunity to update the label position and text during each render.
vtkAbstractPolygonalHandleRepresentation3D::RegisterPickers
virtual void RegisterPickers()
Register internal Pickers in the Picking Manager.