VTK
vtkAxesTransformRepresentation.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkAxesTransformRepresentation.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 =========================================================================*/
32 #ifndef vtkAxesTransformRepresentation_h
33 #define vtkAxesTransformRepresentation_h
34 
35 #include "vtkInteractionWidgetsModule.h" // For export macro
37 
39 class vtkPoints;
40 class vtkPolyData;
41 class vtkPolyDataMapper;
42 class vtkActor;
43 class vtkVectorText;
44 class vtkFollower;
45 class vtkBox;
46 class vtkCylinderSource;
47 class vtkGlyph3D;
48 class vtkDoubleArray;
50 class vtkProperty;
51 
52 
53 class VTKINTERACTIONWIDGETS_EXPORT vtkAxesTransformRepresentation : public vtkWidgetRepresentation
54 {
55 public:
60 
62 
66  void PrintSelf(ostream& os, vtkIndent indent) override;
68 
70 
75  vtkGetObjectMacro(OriginRepresentation,vtkHandleRepresentation);
76  vtkGetObjectMacro(SelectionRepresentation,vtkHandleRepresentation);
78 
80 
85  double* GetOriginWorldPosition();
86  void GetOriginWorldPosition(double pos[3]);
87  void SetOriginWorldPosition(double pos[3]);
88  void SetOriginDisplayPosition(double pos[3]);
89  void GetOriginDisplayPosition(double pos[3]);
91 
103  vtkSetClampMacro(Tolerance,int,1,100);
104  vtkGetMacro(Tolerance,int);
106 
108 
113  vtkSetStringMacro(LabelFormat);
114  vtkGetStringMacro(LabelFormat);
116 
120  enum {Outside=0,OnOrigin,OnX,OnY,OnZ,OnXEnd,OnYEnd,OnZEnd};
121 
123 
132  vtkSetClampMacro(InteractionState,int,Outside,OnZEnd);
134 
136 
139  void BuildRepresentation() override;
140  int ComputeInteractionState(int X, int Y, int modify=0) override;
141  void StartWidgetInteraction(double e[2]) override;
142  void WidgetInteraction(double e[2]) override;
143  double *GetBounds() override;
145 
147 
150  void ReleaseGraphicsResources(vtkWindow *w) override;
151  int RenderOpaqueGeometry(vtkViewport *viewport) override;
152  int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override;
154 
156 
160  void SetLabelScale(double x, double y, double z)
161  {
162  double scale[3];
163  scale[0] = x;
164  scale[1] = y;
165  scale[2] = z;
166  this->SetLabelScale(scale);
167  }
168  virtual void SetLabelScale( double scale[3] );
169  virtual double * GetLabelScale();
171 
175  virtual vtkProperty *GetLabelProperty();
176 
177 protected:
179  ~vtkAxesTransformRepresentation() override;
180 
181  // The handle and the rep used to close the handles
184 
185  // Selection tolerance for the handles
187 
188  // Format for printing the distance
189  char *LabelFormat;
190 
191  // The line
196 
197  // The distance label
201 
202  // The 3D disk tick marks
211 
212  // Support GetBounds() method
214 
215  double LastEventPosition[3];
216 
217 private:
219  void operator=(const vtkAxesTransformRepresentation&) = delete;
220 };
221 
222 #endif
vtkPolyDataMapper
map vtkPolyData to graphics primitives
Definition: vtkPolyDataMapper.h:42
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:39
vtkWidgetRepresentation::StartWidgetInteraction
virtual void StartWidgetInteraction(double eventPos[2])
Definition: vtkWidgetRepresentation.h:136
vtkWidgetRepresentation.h
vtkFollower
a subclass of actor that always faces the camera
Definition: vtkFollower.h:46
vtkAxesTransformRepresentation::LabelMapper
vtkPolyDataMapper * LabelMapper
Definition: vtkAxesTransformRepresentation.h:199
vtkX3D::scale
Definition: vtkX3D.h:229
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkAxesTransformRepresentation::SetLabelScale
void SetLabelScale(double x, double y, double z)
Scale text (font size along each dimension).
Definition: vtkAxesTransformRepresentation.h:160
vtkAxesTransformRepresentation::GlyphCylinder
vtkCylinderSource * GlyphCylinder
Definition: vtkAxesTransformRepresentation.h:206
vtkWidgetRepresentation
abstract class defines interface between the widget and widget representation classes
Definition: vtkWidgetRepresentation.h:60
vtkHandleRepresentation
abstract class for representing widget handles
Definition: vtkHandleRepresentation.h:58
vtkAxesTransformRepresentation::LinePoints
vtkPoints * LinePoints
Definition: vtkAxesTransformRepresentation.h:192
vtkAxesTransformRepresentation::LabelText
vtkVectorText * LabelText
Definition: vtkAxesTransformRepresentation.h:198
vtkAxesTransformRepresentation::LineMapper
vtkPolyDataMapper * LineMapper
Definition: vtkAxesTransformRepresentation.h:194
vtkAxesTransformRepresentation::Glyph3D
vtkGlyph3D * Glyph3D
Definition: vtkAxesTransformRepresentation.h:208
vtkAxesTransformRepresentation::OriginRepresentation
vtkHandleRepresentation * OriginRepresentation
Definition: vtkAxesTransformRepresentation.h:182
vtkWidgetRepresentation::BuildRepresentation
virtual void BuildRepresentation()=0
vtkVectorText
create polygonal text
Definition: vtkVectorText.h:47
vtkAxesTransformRepresentation::Tolerance
int Tolerance
Definition: vtkAxesTransformRepresentation.h:186
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
vtkWidgetRepresentation::RenderTranslucentPolygonalGeometry
int RenderTranslucentPolygonalGeometry(vtkViewport *vtkNotUsed(viewport)) override
Definition: vtkWidgetRepresentation.h:223
vtkWidgetRepresentation::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
Definition: vtkWidgetRepresentation.h:220
vtkWidgetRepresentation::WidgetInteraction
virtual void WidgetInteraction(double newEventPos[2])
Definition: vtkWidgetRepresentation.h:137
vtkWidgetRepresentation::GetBounds
double * GetBounds() override
Methods to make this class behave as a vtkProp.
Definition: vtkWidgetRepresentation.h:215
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
vtkAxesTransformRepresentation::SelectionRepresentation
vtkHandleRepresentation * SelectionRepresentation
Definition: vtkAxesTransformRepresentation.h:183
vtkAxesTransformRepresentation::GlyphVectors
vtkDoubleArray * GlyphVectors
Definition: vtkAxesTransformRepresentation.h:204
vtkAxesTransformRepresentation::GlyphMapper
vtkPolyDataMapper * GlyphMapper
Definition: vtkAxesTransformRepresentation.h:209
vtkAxesTransformRepresentation::BoundingBox
vtkBox * BoundingBox
Definition: vtkAxesTransformRepresentation.h:213
vtkAxesTransformRepresentation::LabelActor
vtkFollower * LabelActor
Definition: vtkAxesTransformRepresentation.h:200
vtkCylinderSource
generate a cylinder centered at origin
Definition: vtkCylinderSource.h:42
vtkTransformPolyDataFilter
transform points and associated normals and vectors for polygonal dataset
Definition: vtkTransformPolyDataFilter.h:51
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:47
vtkGlyph3D
copy oriented and scaled glyph geometry to every input point
Definition: vtkGlyph3D.h:111
vtkBox
implicit function for a bounding box
Definition: vtkBox.h:41
vtkAxesTransformRepresentation::GlyphXForm
vtkTransformPolyDataFilter * GlyphXForm
Definition: vtkAxesTransformRepresentation.h:207
vtkAxesTransformRepresentation
represent the vtkAxesTransformWidget
Definition: vtkAxesTransformRepresentation.h:53
vtkWidgetRepresentation::RenderOpaqueGeometry
int RenderOpaqueGeometry(vtkViewport *vtkNotUsed(viewport)) override
Definition: vtkWidgetRepresentation.h:222
vtkAxesTransformRepresentation::GlyphPoints
vtkPoints * GlyphPoints
Definition: vtkAxesTransformRepresentation.h:203
vtkAxesTransformRepresentation::LinePolyData
vtkPolyData * LinePolyData
Definition: vtkAxesTransformRepresentation.h:193
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
vtkAxesTransformRepresentation::GlyphPolyData
vtkPolyData * GlyphPolyData
Definition: vtkAxesTransformRepresentation.h:205
vtkAxesTransformRepresentation::GlyphActor
vtkActor * GlyphActor
Definition: vtkAxesTransformRepresentation.h:210
vtkDoubleArray
dynamic, self-adjusting array of double
Definition: vtkDoubleArray.h:41
vtkProperty
represent surface properties of a geometric object
Definition: vtkProperty.h:66
vtkAxesTransformRepresentation::LabelFormat
char * LabelFormat
Definition: vtkAxesTransformRepresentation.h:189
vtkAxesTransformRepresentation::LineActor
vtkActor * LineActor
Definition: vtkAxesTransformRepresentation.h:195
vtkWidgetRepresentation::ComputeInteractionState
virtual int ComputeInteractionState(int X, int Y, int modify=0)
vtkWidgetRepresentation::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.