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
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 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:47
represent surface properties of a geometric object
Definition: vtkProperty.h:66
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:85
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:39
copy oriented and scaled glyph geometry to every input point
Definition: vtkGlyph3D.h:111
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:46
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