VTK  9.2.6
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 class VTKINTERACTIONWIDGETS_EXPORT vtkAxesTransformRepresentation : public vtkWidgetRepresentation
53 {
54 public:
59 
61 
65  void PrintSelf(ostream& os, vtkIndent indent) override;
67 
69 
74  vtkGetObjectMacro(OriginRepresentation, vtkHandleRepresentation);
75  vtkGetObjectMacro(SelectionRepresentation, vtkHandleRepresentation);
77 
79 
84  double* GetOriginWorldPosition();
85  void GetOriginWorldPosition(double pos[3]);
86  void SetOriginWorldPosition(double pos[3]);
87  void SetOriginDisplayPosition(double pos[3]);
88  void GetOriginDisplayPosition(double pos[3]);
90 
96 
102  vtkSetClampMacro(Tolerance, int, 1, 100);
103  vtkGetMacro(Tolerance, int);
105 
107 
112  vtkSetStringMacro(LabelFormat);
113  vtkGetStringMacro(LabelFormat);
115 
119  enum
120  {
121  Outside = 0,
128  OnZEnd
129  };
130 
132 
141  vtkSetClampMacro(InteractionState, int, Outside, OnZEnd);
143 
145 
148  void BuildRepresentation() override;
149  int ComputeInteractionState(int X, int Y, int modify = 0) override;
150  void StartWidgetInteraction(double e[2]) override;
151  void WidgetInteraction(double e[2]) override;
152  double* GetBounds() override;
154 
156 
159  void ReleaseGraphicsResources(vtkWindow* w) override;
160  int RenderOpaqueGeometry(vtkViewport* viewport) override;
161  int RenderTranslucentPolygonalGeometry(vtkViewport* viewport) override;
163 
165 
169  void SetLabelScale(double x, double y, double z)
170  {
171  double scale[3];
172  scale[0] = x;
173  scale[1] = y;
174  scale[2] = z;
175  this->SetLabelScale(scale);
176  }
177  virtual void SetLabelScale(double scale[3]);
178  virtual double* GetLabelScale();
180 
184  virtual vtkProperty* GetLabelProperty();
185 
186 protected:
188  ~vtkAxesTransformRepresentation() override;
189 
190  // The handle and the rep used to close the handles
193 
194  // Selection tolerance for the handles
196 
197  // Format for printing the distance
198  char* LabelFormat;
199 
200  // The line
205 
206  // The distance label
210 
211  // The 3D disk tick marks
220 
221  // Support GetBounds() method
223 
224  double LastEventPosition[3];
225 
226 private:
228  void operator=(const vtkAxesTransformRepresentation&) = delete;
229 };
230 
231 #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:51
generate a polygonal cylinder centered at the origin
virtual int ComputeInteractionState(int X, int Y, int modify=0)
abstract class for representing widget handles
abstract specification for Viewports
Definition: vtkViewport.h:55
represent surface properties of a geometric object
Definition: vtkProperty.h:67
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:90
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:38
int RenderTranslucentPolygonalGeometry(vtkViewport *vtkNotUsed(viewport)) override
a simple class to control print indentation
Definition: vtkIndent.h:39
copy oriented and scaled glyph geometry to every input point
Definition: vtkGlyph3D.h:112
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:43
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:41
represent and manipulate 3D points
Definition: vtkPoints.h:39
create polygonal text
Definition: vtkVectorText.h:47