VTK  9.0.1
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 
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 
157  int RenderOpaqueGeometry(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 
182 
183 protected:
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:37
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:34
vtkWidgetRepresentation.h
vtkAxesTransformRepresentation::ComputeInteractionState
int ComputeInteractionState(int X, int Y, int modify=0) override
vtkFollower
a subclass of actor that always faces the camera
Definition: vtkFollower.h:41
vtkAxesTransformRepresentation::vtkAxesTransformRepresentation
vtkAxesTransformRepresentation()
vtkAxesTransformRepresentation::LabelMapper
vtkPolyDataMapper * LabelMapper
Definition: vtkAxesTransformRepresentation.h:205
vtkX3D::scale
@ scale
Definition: vtkX3D.h:235
vtkAxesTransformRepresentation::GetOriginDisplayPosition
void GetOriginDisplayPosition(double pos[3])
vtkAxesTransformRepresentation::OnOrigin
@ OnOrigin
Definition: vtkAxesTransformRepresentation.h:119
vtkAxesTransformRepresentation::OnY
@ OnY
Definition: vtkAxesTransformRepresentation.h:121
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:60
vtkHandleRepresentation
abstract class for representing widget handles
Definition: vtkHandleRepresentation.h:56
vtkAxesTransformRepresentation::LinePoints
vtkPoints * LinePoints
Definition: vtkAxesTransformRepresentation.h:198
vtkAxesTransformRepresentation::GetOriginWorldPosition
double * GetOriginWorldPosition()
Methods to Set/Get the coordinates of the two points defining this representation.
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
vtkVectorText
create polygonal text
Definition: vtkVectorText.h:42
vtkAxesTransformRepresentation::Tolerance
int Tolerance
Definition: vtkAxesTransformRepresentation.h:192
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
vtkAxesTransformRepresentation::OnZ
@ OnZ
Definition: vtkAxesTransformRepresentation.h:122
vtkAxesTransformRepresentation::WidgetInteraction
void WidgetInteraction(double e[2]) override
vtkAxesTransformRepresentation::OnXEnd
@ OnXEnd
Definition: vtkAxesTransformRepresentation.h:123
vtkAxesTransformRepresentation::~vtkAxesTransformRepresentation
~vtkAxesTransformRepresentation() override
vtkAxesTransformRepresentation::RenderTranslucentPolygonalGeometry
int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override
vtkAxesTransformRepresentation::BuildRepresentation
void BuildRepresentation() override
Method to satisfy superclasses' API.
vtkActor
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:46
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:34
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::GetBounds
double * GetBounds() override
Get the bounds for this Prop as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
vtkAxesTransformRepresentation::LabelActor
vtkFollower * LabelActor
Definition: vtkAxesTransformRepresentation.h:206
vtkCylinderSource
generate a cylinder centered at origin
Definition: vtkCylinderSource.h:37
vtkAxesTransformRepresentation::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *w) override
Methods required by vtkProp superclass.
vtkTransformPolyDataFilter
transform points and associated normals and vectors for polygonal dataset
Definition: vtkTransformPolyDataFilter.h:46
vtkAxesTransformRepresentation::New
static vtkAxesTransformRepresentation * New()
Instantiate class.
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:45
vtkAxesTransformRepresentation::GetOriginWorldPosition
void GetOriginWorldPosition(double pos[3])
vtkAxesTransformRepresentation::SetOriginWorldPosition
void SetOriginWorldPosition(double pos[3])
vtkAxesTransformRepresentation::OnYEnd
@ OnYEnd
Definition: vtkAxesTransformRepresentation.h:124
vtkAxesTransformRepresentation::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkGlyph3D
copy oriented and scaled glyph geometry to every input point
Definition: vtkGlyph3D.h:106
vtkAxesTransformRepresentation::GetLabelProperty
virtual vtkProperty * GetLabelProperty()
Get the distance annotation property.
vtkAxesTransformRepresentation::OnX
@ OnX
Definition: vtkAxesTransformRepresentation.h:120
vtkBox
implicit function for a bounding box
Definition: vtkBox.h:39
vtkAxesTransformRepresentation::GlyphXForm
vtkTransformPolyDataFilter * GlyphXForm
Definition: vtkAxesTransformRepresentation.h:213
vtkAxesTransformRepresentation
represent the vtkAxesTransformWidget
Definition: vtkAxesTransformRepresentation.h:50
vtkAxesTransformRepresentation::RenderOpaqueGeometry
int RenderOpaqueGeometry(vtkViewport *viewport) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
vtkAxesTransformRepresentation::GlyphPoints
vtkPoints * GlyphPoints
Definition: vtkAxesTransformRepresentation.h:209
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::StartWidgetInteraction
void StartWidgetInteraction(double e[2]) override
vtkAxesTransformRepresentation::SetOriginDisplayPosition
void SetOriginDisplayPosition(double pos[3])
vtkAxesTransformRepresentation::GlyphActor
vtkActor * GlyphActor
Definition: vtkAxesTransformRepresentation.h:216
vtkDoubleArray
dynamic, self-adjusting array of double
Definition: vtkDoubleArray.h:36
vtkProperty
represent surface properties of a geometric object
Definition: vtkProperty.h:62
vtkAxesTransformRepresentation::GetLabelScale
virtual double * GetLabelScale()
vtkAxesTransformRepresentation::LabelFormat
char * LabelFormat
Definition: vtkAxesTransformRepresentation.h:195
vtkAxesTransformRepresentation::LineActor
vtkActor * LineActor
Definition: vtkAxesTransformRepresentation.h:201
vtkAxesTransformRepresentation::SetLabelScale
virtual void SetLabelScale(double scale[3])