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 
34 #include "vtkInteractionWidgetsModule.h" // For export macro
36 
37 class vtkPoints;
38 class vtkPolyData;
39 class vtkPolyDataMapper;
40 class vtkActor;
41 class vtkVectorText;
42 class vtkFollower;
43 class vtkBox;
44 class vtkCylinderSource;
45 class vtkGlyph3D;
46 class vtkDoubleArray;
48 class vtkProperty;
49 
50 
52 {
53 public:
56 
58 
60  void PrintSelf(ostream& os, vtkIndent indent);
62 
64 
65  virtual double GetDistance()
66  {return this->Distance;}
68 
70 
72  void SetGlyphScale(double scale);
73  vtkGetMacro(GlyphScale, double);
75 
78 
80 
82  void SetLabelPosition(double labelPosition);
83  vtkGetMacro(LabelPosition, double);
85 
87 
88  vtkSetClampMacro(MaximumNumberOfRulerTicks, int, 1, VTK_INT_MAX);
89  vtkGetMacro(MaximumNumberOfRulerTicks, int);
91 
93 
97 
99 
103 
105 
110  void GetPoint1WorldPosition(double pos[3]);
111  void GetPoint2WorldPosition(double pos[3]);
112  void SetPoint1WorldPosition(double pos[3]);
113  void SetPoint2WorldPosition(double pos[3]);
115 
116  void SetPoint1DisplayPosition(double pos[3]);
117  void SetPoint2DisplayPosition(double pos[3]);
118  void GetPoint1DisplayPosition(double pos[3]);
119  void GetPoint2DisplayPosition(double pos[3]);
120 
122 
123  virtual void BuildRepresentation();
124  virtual double *GetBounds();
126 
128 
130  virtual int RenderOpaqueGeometry(vtkViewport *viewport);
133 
135 
137  void SetLabelScale(double x, double y, double z)
138  {
139  double scale[3];
140  scale[0] = x;
141  scale[1] = y;
142  scale[2] = z;
143  this->SetLabelScale(scale);
144  }
145  virtual void SetLabelScale( double scale[3] );
146  virtual double * GetLabelScale();
148 
151 
152 protected:
155 
156  // The line
161 
162  // The distance label
166 
167  // Support internal operations
169 
170  // The 3D disk tick marks
179 
180  // Glyph3D scale
181  double GlyphScale;
183 
184  // The distance between the two points
185  double Distance;
186 
187  // Support GetBounds() method
189 
190  // Maximum number of ticks on the 3d ruler
192 
193  // Label title position
195 
196 private:
198  void operator=(const vtkDistanceRepresentation3D&); //Not implemented
199 
200  // Internal method to update the position of the label.
201  void UpdateLabelPosition();
202 };
203 
204 #endif
vtkPolyDataMapper
map vtkPolyData to graphics primitives
Definition: vtkPolyDataMapper.h:42
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:39
vtkDistanceRepresentation3D::LinePolyData
vtkPolyData * LinePolyData
Definition: vtkDistanceRepresentation3D.h:158
vtkgl::z
GLdouble GLdouble z
Definition: vtkgl.h:11754
vtkDistanceRepresentation3D::LabelPosition
double LabelPosition
Definition: vtkDistanceRepresentation3D.h:194
vtkDistanceRepresentation3D::GlyphPolyData
vtkPolyData * GlyphPolyData
Definition: vtkDistanceRepresentation3D.h:173
vtkFollower
a subclass of actor that always faces the camera
Definition: vtkFollower.h:46
VTK_INT_MAX
#define VTK_INT_MAX
Definition: vtkType.h:132
vtkGetObjectMacro
#define vtkGetObjectMacro(name, type)
Definition: vtkSetGet.h:232
vtkDistanceRepresentation3D::MaximumNumberOfRulerTicks
int MaximumNumberOfRulerTicks
Definition: vtkDistanceRepresentation3D.h:191
vtkDistanceRepresentation3D::LabelText
vtkVectorText * LabelText
Definition: vtkDistanceRepresentation3D.h:163
vtkDistanceRepresentation3D::SetPoint1WorldPosition
void SetPoint1WorldPosition(double pos[3])
vtkDistanceRepresentation3D::GetBounds
virtual double * GetBounds()
vtkDistanceRepresentation3D::BoundingBox
vtkBox * BoundingBox
Definition: vtkDistanceRepresentation3D.h:188
vtkgl::scale
GLenum GLenum GLenum GLenum GLenum scale
Definition: vtkgl.h:15942
vtkDistanceRepresentation3D::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkDistanceRepresentation3D::New
static vtkDistanceRepresentation3D * New()
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkDistanceRepresentation3D::GetPoint1WorldPosition
void GetPoint1WorldPosition(double pos[3])
vtkDistanceRepresentation3D::BuildRepresentation
virtual void BuildRepresentation()
vtkDistanceRepresentation3D::GetDistance
virtual double GetDistance()
Definition: vtkDistanceRepresentation3D.h:65
vtkInteractionWidgetsModule.h
vtkgl::x
GLint GLint GLint GLint GLint x
Definition: vtkgl.h:11318
vtkDistanceRepresentation.h
vtkDistanceRepresentation3D::SetLabelScale
virtual void SetLabelScale(double scale[3])
vtkDistanceRepresentation3D::Distance
double Distance
Definition: vtkDistanceRepresentation3D.h:185
vtkVectorText
create polygonal text
Definition: vtkVectorText.h:47
vtkDistanceRepresentation3D::RenderTranslucentPolygonalGeometry
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *viewport)
vtkDistanceRepresentation3D::LinePoints
vtkPoints * LinePoints
Definition: vtkDistanceRepresentation3D.h:157
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
vtkDistanceRepresentation3D::SetLabelPosition
void SetLabelPosition(double labelPosition)
vtkDistanceRepresentation3D::LabelActor
vtkFollower * LabelActor
Definition: vtkDistanceRepresentation3D.h:165
vtkDistanceRepresentation3D::GetPoint2WorldPosition
double * GetPoint2WorldPosition()
vtkSetClampMacro
#define vtkSetClampMacro(name, type, min, max)
Definition: vtkSetGet.h:143
vtkDistanceRepresentation
represent the vtkDistanceWidget
Definition: vtkDistanceRepresentation.h:36
vtkDistanceRepresentation3D::Glyph3D
vtkGlyph3D * Glyph3D
Definition: vtkDistanceRepresentation3D.h:176
vtkDistanceRepresentation3D::GetLabelScale
virtual double * GetLabelScale()
vtkDistanceRepresentation3D::LabelScaleSpecified
bool LabelScaleSpecified
Definition: vtkDistanceRepresentation3D.h:168
vtkDistanceRepresentation3D::SetPoint2DisplayPosition
void SetPoint2DisplayPosition(double pos[3])
vtkDistanceRepresentation3D
represent the vtkDistanceWidget
Definition: vtkDistanceRepresentation3D.h:52
vtkDistanceRepresentation3D::LineActor
vtkActor * LineActor
Definition: vtkDistanceRepresentation3D.h:160
vtkActor
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:51
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkDistanceRepresentation3D::GetPoint1DisplayPosition
void GetPoint1DisplayPosition(double pos[3])
vtkDistanceRepresentation3D::GetLineProperty
virtual vtkProperty * GetLineProperty()
vtkDistanceRepresentation3D::GlyphPoints
vtkPoints * GlyphPoints
Definition: vtkDistanceRepresentation3D.h:171
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkCylinderSource
generate a cylinder centered at origin
Definition: vtkCylinderSource.h:42
vtkTransformPolyDataFilter
transform points and associated normals and vectors for polygonal dataset
Definition: vtkTransformPolyDataFilter.h:51
vtkDistanceRepresentation3D::GlyphCylinder
vtkCylinderSource * GlyphCylinder
Definition: vtkDistanceRepresentation3D.h:174
vtkDistanceRepresentation3D::vtkDistanceRepresentation3D
vtkDistanceRepresentation3D()
vtkDistanceRepresentation3D::ReleaseGraphicsResources
virtual void ReleaseGraphicsResources(vtkWindow *w)
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:47
vtkDistanceRepresentation3D::LabelMapper
vtkPolyDataMapper * LabelMapper
Definition: vtkDistanceRepresentation3D.h:164
vtkDistanceRepresentation3D::GlyphActor
vtkActor * GlyphActor
Definition: vtkDistanceRepresentation3D.h:178
vtkDistanceRepresentation3D::~vtkDistanceRepresentation3D
~vtkDistanceRepresentation3D()
vtkGlyph3D
copy oriented and scaled glyph geometry to every input point
Definition: vtkGlyph3D.h:111
vtkDistanceRepresentation3D::GetPoint2DisplayPosition
void GetPoint2DisplayPosition(double pos[3])
vtkDistanceRepresentation3D::GlyphScale
double GlyphScale
Definition: vtkDistanceRepresentation3D.h:181
vtkDistanceRepresentation3D::GlyphVectors
vtkDoubleArray * GlyphVectors
Definition: vtkDistanceRepresentation3D.h:172
vtkBox
implicit function for a bounding box
Definition: vtkBox.h:41
vtkDistanceRepresentation3D::GlyphMapper
vtkPolyDataMapper * GlyphMapper
Definition: vtkDistanceRepresentation3D.h:177
vtkDistanceRepresentation3D::GetPoint2WorldPosition
void GetPoint2WorldPosition(double pos[3])
VTKINTERACTIONWIDGETS_EXPORT
#define VTKINTERACTIONWIDGETS_EXPORT
Definition: vtkInteractionWidgetsModule.h:15
vtkgl::y
GLint GLint GLint GLint GLint GLint y
Definition: vtkgl.h:11318
vtkDistanceRepresentation3D::RenderOpaqueGeometry
virtual int RenderOpaqueGeometry(vtkViewport *viewport)
vtkDistanceRepresentation3D::GlyphXForm
vtkTransformPolyDataFilter * GlyphXForm
Definition: vtkDistanceRepresentation3D.h:175
vtkDistanceRepresentation3D::GlyphScaleSpecified
bool GlyphScaleSpecified
Definition: vtkDistanceRepresentation3D.h:182
vtkDistanceRepresentation3D::SetPoint2WorldPosition
void SetPoint2WorldPosition(double pos[3])
vtkDistanceRepresentation3D::SetPoint1DisplayPosition
void SetPoint1DisplayPosition(double pos[3])
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:84
vtkDistanceRepresentation3D::GetLabelProperty
virtual vtkProperty * GetLabelProperty()
vtkDoubleArray
dynamic, self-adjusting array of double
Definition: vtkDoubleArray.h:49
vtkProperty
represent surface properties of a geometric object
Definition: vtkProperty.h:64
vtkDistanceRepresentation3D::SetGlyphScale
void SetGlyphScale(double scale)
vtkgl::w
GLubyte GLubyte GLubyte GLubyte w
Definition: vtkgl.h:12054
vtkDistanceRepresentation3D::LineMapper
vtkPolyDataMapper * LineMapper
Definition: vtkDistanceRepresentation3D.h:159
vtkDistanceRepresentation3D::SetLabelScale
void SetLabelScale(double x, double y, double z)
Definition: vtkDistanceRepresentation3D.h:137
vtkDistanceRepresentation3D::GetPoint1WorldPosition
double * GetPoint1WorldPosition()