VTK  9.0.20201030
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 =========================================================================*/
29 #ifndef vtkAxesTransformRepresentation_h
30 #define vtkAxesTransformRepresentation_h
31 
32 #include "vtkInteractionWidgetsModule.h" // For export macro
34 
36 class vtkPoints;
37 class vtkPolyData;
38 class vtkPolyDataMapper;
39 class vtkActor;
40 class vtkVectorText;
41 class vtkFollower;
42 class vtkBox;
43 class vtkCylinderSource;
44 class vtkGlyph3D;
45 class vtkDoubleArray;
47 class vtkProperty;
48 
49 class VTKINTERACTIONWIDGETS_EXPORT vtkAxesTransformRepresentation : public vtkWidgetRepresentation
50 {
51 public:
56 
58 
62  void PrintSelf(ostream& os, vtkIndent indent) override;
64 
66 
71  vtkGetObjectMacro(OriginRepresentation, vtkHandleRepresentation);
72  vtkGetObjectMacro(SelectionRepresentation, vtkHandleRepresentation);
74 
76 
81  double* GetOriginWorldPosition();
82  void GetOriginWorldPosition(double pos[3]);
83  void SetOriginWorldPosition(double pos[3]);
84  void SetOriginDisplayPosition(double pos[3]);
85  void GetOriginDisplayPosition(double pos[3]);
87 
99  vtkSetClampMacro(Tolerance, int, 1, 100);
100  vtkGetMacro(Tolerance, int);
102 
104 
109  vtkSetStringMacro(LabelFormat);
110  vtkGetStringMacro(LabelFormat);
112 
116  enum
117  {
118  Outside = 0,
125  OnZEnd
126  };
127 
129 
138  vtkSetClampMacro(InteractionState, int, Outside, OnZEnd);
140 
142 
145  void BuildRepresentation() override;
146  int ComputeInteractionState(int X, int Y, int modify = 0) override;
147  void StartWidgetInteraction(double e[2]) override;
148  void WidgetInteraction(double e[2]) override;
149  double* GetBounds() override;
151 
153 
156  void ReleaseGraphicsResources(vtkWindow* w) override;
157  int RenderOpaqueGeometry(vtkViewport* viewport) override;
158  int RenderTranslucentPolygonalGeometry(vtkViewport* viewport) override;
160 
162 
166  void SetLabelScale(double x, double y, double z)
167  {
168  double scale[3];
169  scale[0] = x;
170  scale[1] = y;
171  scale[2] = z;
172  this->SetLabelScale(scale);
173  }
174  virtual void SetLabelScale(double scale[3]);
175  virtual double* GetLabelScale();
177 
181  virtual vtkProperty* GetLabelProperty();
182 
183 protected:
185  ~vtkAxesTransformRepresentation() override;
186 
187  // The handle and the rep used to close the handles
190 
191  // Selection tolerance for the handles
193 
194  // Format for printing the distance
195  char* LabelFormat;
196 
197  // The line
202 
203  // The distance label
207 
208  // The 3D disk tick marks
217 
218  // Support GetBounds() method
220 
221  double LastEventPosition[3];
222 
223 private:
225  void operator=(const vtkAxesTransformRepresentation&) = delete;
226 };
227 
228 #endif
vtkPolyDataMapper
map vtkPolyData to graphics primitives
Definition: vtkPolyDataMapper.h:36
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:33
vtkWidgetRepresentation::StartWidgetInteraction
virtual void StartWidgetInteraction(double eventPos[2])
Definition: vtkWidgetRepresentation.h:135
vtkWidgetRepresentation.h
vtkFollower
a subclass of actor that always faces the camera
Definition: vtkFollower.h:40
vtkAxesTransformRepresentation::LabelMapper
vtkPolyDataMapper * LabelMapper
Definition: vtkAxesTransformRepresentation.h:205
vtkX3D::scale
Definition: vtkX3D.h:235
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:166
vtkAxesTransformRepresentation::GlyphCylinder
vtkCylinderSource * GlyphCylinder
Definition: vtkAxesTransformRepresentation.h:212
vtkWidgetRepresentation
abstract class defines interface between the widget and widget representation classes
Definition: vtkWidgetRepresentation.h:59
vtkHandleRepresentation
abstract class for representing widget handles
Definition: vtkHandleRepresentation.h:55
vtkAxesTransformRepresentation::LinePoints
vtkPoints * LinePoints
Definition: vtkAxesTransformRepresentation.h:198
vtkAxesTransformRepresentation::LabelText
vtkVectorText * LabelText
Definition: vtkAxesTransformRepresentation.h:204
vtkAxesTransformRepresentation::LineMapper
vtkPolyDataMapper * LineMapper
Definition: vtkAxesTransformRepresentation.h:200
vtkAxesTransformRepresentation::Glyph3D
vtkGlyph3D * Glyph3D
Definition: vtkAxesTransformRepresentation.h:214
vtkAxesTransformRepresentation::OriginRepresentation
vtkHandleRepresentation * OriginRepresentation
Definition: vtkAxesTransformRepresentation.h:188
vtkWidgetRepresentation::BuildRepresentation
virtual void BuildRepresentation()=0
vtkVectorText
create polygonal text
Definition: vtkVectorText.h:41
vtkAxesTransformRepresentation::Tolerance
int Tolerance
Definition: vtkAxesTransformRepresentation.h:192
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:38
vtkWidgetRepresentation::RenderTranslucentPolygonalGeometry
int RenderTranslucentPolygonalGeometry(vtkViewport *vtkNotUsed(viewport)) override
Definition: vtkWidgetRepresentation.h:216
vtkWidgetRepresentation::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
Definition: vtkWidgetRepresentation.h:213
vtkWidgetRepresentation::WidgetInteraction
virtual void WidgetInteraction(double newEventPos[2])
Definition: vtkWidgetRepresentation.h:136
vtkWidgetRepresentation::GetBounds
double * GetBounds() override
Methods to make this class behave as a vtkProp.
Definition: vtkWidgetRepresentation.h:208
vtkAxesTransformRepresentation::OnOrigin
Definition: vtkAxesTransformRepresentation.h:119
vtkAxesTransformRepresentation::OnZ
Definition: vtkAxesTransformRepresentation.h:122
vtkAxesTransformRepresentation::OnY
Definition: vtkAxesTransformRepresentation.h:121
vtkActor
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:45
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkAxesTransformRepresentation::SelectionRepresentation
vtkHandleRepresentation * SelectionRepresentation
Definition: vtkAxesTransformRepresentation.h:189
vtkAxesTransformRepresentation::GlyphVectors
vtkDoubleArray * GlyphVectors
Definition: vtkAxesTransformRepresentation.h:210
vtkAxesTransformRepresentation::GlyphMapper
vtkPolyDataMapper * GlyphMapper
Definition: vtkAxesTransformRepresentation.h:215
vtkAxesTransformRepresentation::BoundingBox
vtkBox * BoundingBox
Definition: vtkAxesTransformRepresentation.h:219
vtkAxesTransformRepresentation::LabelActor
vtkFollower * LabelActor
Definition: vtkAxesTransformRepresentation.h:206
vtkCylinderSource
generate a cylinder centered at origin
Definition: vtkCylinderSource.h:36
vtkTransformPolyDataFilter
transform points and associated normals and vectors for polygonal dataset
Definition: vtkTransformPolyDataFilter.h:45
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:44
vtkAxesTransformRepresentation::OnXEnd
Definition: vtkAxesTransformRepresentation.h:123
vtkGlyph3D
copy oriented and scaled glyph geometry to every input point
Definition: vtkGlyph3D.h:106
vtkBox
implicit function for a bounding box
Definition: vtkBox.h:38
vtkAxesTransformRepresentation::GlyphXForm
vtkTransformPolyDataFilter * GlyphXForm
Definition: vtkAxesTransformRepresentation.h:213
vtkAxesTransformRepresentation
represent the vtkAxesTransformWidget
Definition: vtkAxesTransformRepresentation.h:49
vtkWidgetRepresentation::RenderOpaqueGeometry
int RenderOpaqueGeometry(vtkViewport *vtkNotUsed(viewport)) override
Definition: vtkWidgetRepresentation.h:215
vtkAxesTransformRepresentation::GlyphPoints
vtkPoints * GlyphPoints
Definition: vtkAxesTransformRepresentation.h:209
vtkAxesTransformRepresentation::OnYEnd
Definition: vtkAxesTransformRepresentation.h:124
vtkAxesTransformRepresentation::LinePolyData
vtkPolyData * LinePolyData
Definition: vtkAxesTransformRepresentation.h:199
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
vtkAxesTransformRepresentation::GlyphPolyData
vtkPolyData * GlyphPolyData
Definition: vtkAxesTransformRepresentation.h:211
vtkAxesTransformRepresentation::GlyphActor
vtkActor * GlyphActor
Definition: vtkAxesTransformRepresentation.h:216
vtkDoubleArray
dynamic, self-adjusting array of double
Definition: vtkDoubleArray.h:35
vtkProperty
represent surface properties of a geometric object
Definition: vtkProperty.h:61
vtkAxesTransformRepresentation::LabelFormat
char * LabelFormat
Definition: vtkAxesTransformRepresentation.h:195
vtkAxesTransformRepresentation::LineActor
vtkActor * LineActor
Definition: vtkAxesTransformRepresentation.h:201
vtkAxesTransformRepresentation::OnX
Definition: vtkAxesTransformRepresentation.h:120
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.