VTK
vtkDistanceRepresentation3D.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkDistanceRepresentation3D.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 __vtkDistanceRepresentation3D_h
32 #define __vtkDistanceRepresentation3D_h
33 
35 
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 
51 {
52 public:
55 
57 
59  void PrintSelf(ostream& os, vtkIndent indent);
61 
63 
64  virtual double GetDistance()
65  {return this->Distance;}
67 
69 
71  void SetGlyphScale(double scale);
72  vtkGetMacro(GlyphScale, double);
74 
76  virtual vtkProperty *GetLineProperty();
77 
79 
81  void SetLabelPosition(double labelPosition);
82  vtkGetMacro(LabelPosition, double);
84 
86 
87  vtkSetClampMacro(MaximumNumberOfRulerTicks, int, 1, VTK_LARGE_INTEGER);
88  vtkGetMacro(MaximumNumberOfRulerTicks, int);
90 
92 
94  vtkGetObjectMacro(GlyphActor, vtkActor);
96 
98 
100  vtkGetObjectMacro(LabelActor, vtkFollower);
102 
104 
107  double* GetPoint1WorldPosition();
108  double* GetPoint2WorldPosition();
109  void GetPoint1WorldPosition(double pos[3]);
110  void GetPoint2WorldPosition(double pos[3]);
111  void SetPoint1WorldPosition(double pos[3]);
112  void SetPoint2WorldPosition(double pos[3]);
114 
115  void SetPoint1DisplayPosition(double pos[3]);
116  void SetPoint2DisplayPosition(double pos[3]);
117  void GetPoint1DisplayPosition(double pos[3]);
118  void GetPoint2DisplayPosition(double pos[3]);
119 
121 
122  virtual void BuildRepresentation();
123  virtual double *GetBounds();
125 
127 
128  virtual void ReleaseGraphicsResources(vtkWindow *w);
129  virtual int RenderOpaqueGeometry(vtkViewport *viewport);
130  virtual int RenderTranslucentPolygonalGeometry(vtkViewport *viewport);
132 
134 
136  void SetLabelScale(double x, double y, double z)
137  {
138  double scale[3];
139  scale[0] = x;
140  scale[1] = y;
141  scale[2] = z;
142  this->SetLabelScale(scale);
143  }
144  virtual void SetLabelScale( double scale[3] );
145  virtual double * GetLabelScale();
147 
149  virtual vtkProperty *GetLabelProperty();
150 
151 protected:
154 
155  // The line
160 
161  // The distance label
165 
166  // Support internal operations
168 
169  // The 3D disk tick marks
178 
179  // Glyph3D scale
180  double GlyphScale;
182 
183  // The distance between the two points
184  double Distance;
185 
186  // Support GetBounds() method
188 
189  // Maximum number of ticks on the 3d ruler
191 
192  // Label title position
194 
195 private:
197  void operator=(const vtkDistanceRepresentation3D&); //Not implemented
198 
199  // Internal method to update the position of the label.
200  void UpdateLabelPosition();
201 };
202 
203 #endif