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 =========================================================================*/
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 
50 class VTKINTERACTIONWIDGETS_EXPORT vtkAxesTransformRepresentation : public vtkWidgetRepresentation
51 {
52 public:
57 
59 
63  void PrintSelf(ostream& os, vtkIndent indent) override;
65 
67 
72  vtkGetObjectMacro(OriginRepresentation,vtkHandleRepresentation);
73  vtkGetObjectMacro(SelectionRepresentation,vtkHandleRepresentation);
75 
77 
82  double* GetOriginWorldPosition();
83  void GetOriginWorldPosition(double pos[3]);
84  void SetOriginWorldPosition(double pos[3]);
85  void SetOriginDisplayPosition(double pos[3]);
86  void GetOriginDisplayPosition(double pos[3]);
88 
100  vtkSetClampMacro(Tolerance,int,1,100);
101  vtkGetMacro(Tolerance,int);
103 
105 
110  vtkSetStringMacro(LabelFormat);
111  vtkGetStringMacro(LabelFormat);
113 
117  enum {Outside=0,OnOrigin,OnX,OnY,OnZ,OnXEnd,OnYEnd,OnZEnd};
118 
120 
129  vtkSetClampMacro(InteractionState,int,Outside,OnZEnd);
131 
133 
136  void BuildRepresentation() override;
137  int ComputeInteractionState(int X, int Y, int modify=0) override;
138  void StartWidgetInteraction(double e[2]) override;
139  void WidgetInteraction(double e[2]) override;
140  double *GetBounds() override;
142 
144 
147  void ReleaseGraphicsResources(vtkWindow *w) override;
148  int RenderOpaqueGeometry(vtkViewport *viewport) override;
149  int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override;
151 
153 
157  void SetLabelScale(double x, double y, double z)
158  {
159  double scale[3];
160  scale[0] = x;
161  scale[1] = y;
162  scale[2] = z;
163  this->SetLabelScale(scale);
164  }
165  virtual void SetLabelScale( double scale[3] );
166  virtual double * GetLabelScale();
168 
172  virtual vtkProperty *GetLabelProperty();
173 
174 protected:
176  ~vtkAxesTransformRepresentation() override;
177 
178  // The handle and the rep used to close the handles
181 
182  // Selection tolerance for the handles
184 
185  // Format for printing the distance
186  char *LabelFormat;
187 
188  // The line
193 
194  // The distance label
198 
199  // The 3D disk tick marks
208 
209  // Support GetBounds() method
211 
212  double LastEventPosition[3];
213 
214 private:
216  void operator=(const vtkAxesTransformRepresentation&) = delete;
217 };
218 
219 #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:60
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:79
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:34
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