VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 =========================================================================*/
31 #ifndef __vtkAxesTransformRepresentation_h
32 #define __vtkAxesTransformRepresentation_h
33 
34 #include "vtkInteractionWidgetsModule.h" // For export macro
36 
38 class vtkPoints;
39 class vtkPolyData;
40 class vtkPolyDataMapper;
41 class vtkActor;
42 class vtkVectorText;
43 class vtkFollower;
44 class vtkBox;
45 class vtkCylinderSource;
46 class vtkGlyph3D;
47 class vtkDoubleArray;
49 class vtkProperty;
50 
51 
52 class VTKINTERACTIONWIDGETS_EXPORT vtkAxesTransformRepresentation : public vtkWidgetRepresentation
53 {
54 public:
56  static vtkAxesTransformRepresentation *New();
57 
59 
61  void PrintSelf(ostream& os, vtkIndent indent);
63 
65 
68  vtkGetObjectMacro(OriginRepresentation,vtkHandleRepresentation);
69  vtkGetObjectMacro(SelectionRepresentation,vtkHandleRepresentation);
71 
73 
76  double* GetOriginWorldPosition();
77  void GetOriginWorldPosition(double pos[3]);
78  void SetOriginWorldPosition(double pos[3]);
79  void SetOriginDisplayPosition(double pos[3]);
80  void GetOriginDisplayPosition(double pos[3]);
82 
90  vtkSetClampMacro(Tolerance,int,1,100);
91  vtkGetMacro(Tolerance,int);
93 
95 
98  vtkSetStringMacro(LabelFormat);
99  vtkGetStringMacro(LabelFormat);
101 
103  enum {Outside=0,OnOrigin,OnX,OnY,OnZ,OnXEnd,OnYEnd,OnZEnd};
104 
106 
113  vtkSetClampMacro(InteractionState,int,Outside,OnZEnd);
115 
117 
118  virtual void BuildRepresentation();
119  virtual int ComputeInteractionState(int X, int Y, int modify=0);
120  virtual void StartWidgetInteraction(double e[2]);
121  virtual void WidgetInteraction(double e[2]);
122  virtual double *GetBounds();
124 
126 
127  virtual void ReleaseGraphicsResources(vtkWindow *w);
128  virtual int RenderOpaqueGeometry(vtkViewport *viewport);
129  virtual int RenderTranslucentPolygonalGeometry(vtkViewport *viewport);
131 
133 
135  void SetLabelScale(double x, double y, double z)
136  {
137  double scale[3];
138  scale[0] = x;
139  scale[1] = y;
140  scale[2] = z;
141  this->SetLabelScale(scale);
142  }
143  virtual void SetLabelScale( double scale[3] );
144  virtual double * GetLabelScale();
146 
148  virtual vtkProperty *GetLabelProperty();
149 
150 protected:
153 
154  // The handle and the rep used to close the handles
157 
158  // Selection tolerance for the handles
160 
161  // Format for printing the distance
162  char *LabelFormat;
163 
164  // The line
165  vtkPoints *LinePoints;
167  vtkPolyDataMapper *LineMapper;
168  vtkActor *LineActor;
169 
170  // The distance label
171  vtkVectorText *LabelText;
172  vtkPolyDataMapper *LabelMapper;
173  vtkFollower *LabelActor;
174 
175  // The 3D disk tick marks
176  vtkPoints *GlyphPoints;
177  vtkDoubleArray *GlyphVectors;
182  vtkPolyDataMapper *GlyphMapper;
183  vtkActor *GlyphActor;
184 
185  // Support GetBounds() method
187 
188  double LastEventPosition[3];
189 
190 private:
192  void operator=(const vtkAxesTransformRepresentation&); //Not implemented
193 };
194 
195 #endif
generate a cylinder centered at origin
virtual int ComputeInteractionState(int X, int Y, int modify=0)
abstract class for representing widget handles
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:82
represent the vtkAxesTransformWidget
virtual void ReleaseGraphicsResources(vtkWindow *)
abstract class defines interface between the widget and widget representation classes ...
virtual void BuildRepresentation()=0
void SetLabelScale(double x, double y, double z)
copy oriented and scaled glyph geometry to every input point
Definition: vtkGlyph3D.h:110
virtual void WidgetInteraction(double newEventPos[2])
virtual int RenderOpaqueGeometry(vtkViewport *vtkNotUsed(viewport))
void PrintSelf(ostream &os, vtkIndent indent)
implicit function for a bounding box
Definition: vtkBox.h:40
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *vtkNotUsed(viewport))