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 
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
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for instances of this class.
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:45
generate a cylinder centered at origin
virtual int ComputeInteractionState(int X, int Y, int modify=0)
abstract class for representing widget handles
abstract specification for Viewports
Definition: vtkViewport.h:44
represent surface properties of a geometric object
Definition: vtkProperty.h:61
virtual void StartWidgetInteraction(double eventPos[2])
vtkHandleRepresentation * SelectionRepresentation
transform points and associated normals and vectors for polygonal dataset
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:84
represent the vtkAxesTransformWidget
abstract class defines interface between the widget and widget representation classes ...
virtual void BuildRepresentation()=0
Subclasses of vtkWidgetRepresentation must implement these methods.
void SetLabelScale(double x, double y, double z)
Scale text (font size along each dimension).
double * GetBounds() override
Methods to make this class behave as a vtkProp.
dynamic, self-adjusting array of double
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
int RenderTranslucentPolygonalGeometry(vtkViewport *vtkNotUsed(viewport)) override
a simple class to control print indentation
Definition: vtkIndent.h:33
copy oriented and scaled glyph geometry to every input point
Definition: vtkGlyph3D.h:105
void ReleaseGraphicsResources(vtkWindow *) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
virtual void WidgetInteraction(double newEventPos[2])
int RenderOpaqueGeometry(vtkViewport *vtkNotUsed(viewport)) override
map vtkPolyData to graphics primitives
a subclass of actor that always faces the camera
Definition: vtkFollower.h:40
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
implicit function for a bounding box
Definition: vtkBox.h:38
represent and manipulate 3D points
Definition: vtkPoints.h:33
create polygonal text
Definition: vtkVectorText.h:41