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 =========================================================================*/
32 #ifndef vtkDistanceRepresentation3D_h
33 #define vtkDistanceRepresentation3D_h
34 
35 #include "vtkInteractionWidgetsModule.h" // For export macro
37 
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 vtkDistanceRepresentation3D : public vtkDistanceRepresentation
53 {
54 public:
59 
61 
65  void PrintSelf(ostream& os, vtkIndent indent) override;
67 
71  double GetDistance() override
72  {return this->Distance;}
73 
75 
79  void SetGlyphScale(double scale);
80  vtkGetMacro(GlyphScale, double);
82 
87 
89 
93  void SetLabelPosition(double labelPosition);
94  vtkGetMacro(LabelPosition, double);
96 
98 
101  vtkSetClampMacro(MaximumNumberOfRulerTicks, int, 1, VTK_INT_MAX);
102  vtkGetMacro(MaximumNumberOfRulerTicks, int);
104 
106 
110  vtkGetObjectMacro(GlyphActor, vtkActor);
112 
114 
118  vtkGetObjectMacro(LabelActor, vtkFollower);
119  virtual void SetLabelActor(vtkFollower *);
121 
123 
128  double* GetPoint1WorldPosition() override;
129  double* GetPoint2WorldPosition() override;
130  void GetPoint1WorldPosition(double pos[3]) override;
131  void GetPoint2WorldPosition(double pos[3]) override;
132  void SetPoint1WorldPosition(double pos[3]) override;
133  void SetPoint2WorldPosition(double pos[3]) override;
135 
136  void SetPoint1DisplayPosition(double pos[3]) override;
137  void SetPoint2DisplayPosition(double pos[3]) override;
138  void GetPoint1DisplayPosition(double pos[3]) override;
139  void GetPoint2DisplayPosition(double pos[3]) override;
140 
142 
145  void BuildRepresentation() override;
146  double *GetBounds() override;
148 
150 
154  int RenderOpaqueGeometry(vtkViewport *viewport) override;
157 
159 
163  void SetLabelScale(double x, double y, double z)
164  {
165  double scale[3];
166  scale[0] = x;
167  scale[1] = y;
168  scale[2] = z;
169  this->SetLabelScale(scale);
170  }
171  virtual void SetLabelScale( double scale[3] );
172  virtual double * GetLabelScale();
174 
179 
180 protected:
183 
184  // The line
189 
190  // The distance label
194 
195  // Support internal operations
197 
198  // The 3D disk tick marks
207 
208  // Glyph3D scale
209  double GlyphScale;
211 
212  // The distance between the two points
213  double Distance;
214 
215  // Support GetBounds() method
217 
218  // Maximum number of ticks on the 3d ruler
220 
221  // Label title position
223 
224 private:
226  void operator=(const vtkDistanceRepresentation3D&) = delete;
227 
228  // Internal method to update the position of the label.
229  void UpdateLabelPosition();
230 };
231 
232 #endif
vtkPolyDataMapper
map vtkPolyData to graphics primitives
Definition: vtkPolyDataMapper.h:43
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:40
vtkDistanceRepresentation3D::LinePolyData
vtkPolyData * LinePolyData
Definition: vtkDistanceRepresentation3D.h:186
vtkDistanceRepresentation3D::LabelPosition
double LabelPosition
Definition: vtkDistanceRepresentation3D.h:222
vtkDistanceRepresentation3D::GlyphPolyData
vtkPolyData * GlyphPolyData
Definition: vtkDistanceRepresentation3D.h:201
vtkFollower
a subclass of actor that always faces the camera
Definition: vtkFollower.h:47
VTK_INT_MAX
#define VTK_INT_MAX
Definition: vtkType.h:159
vtkDistanceRepresentation3D::BuildRepresentation
void BuildRepresentation() override
Method to satisfy superclasses' API.
vtkDistanceRepresentation3D::MaximumNumberOfRulerTicks
int MaximumNumberOfRulerTicks
Definition: vtkDistanceRepresentation3D.h:219
vtkDistanceRepresentation3D::LabelText
vtkVectorText * LabelText
Definition: vtkDistanceRepresentation3D.h:191
vtkX3D::scale
@ scale
Definition: vtkX3D.h:229
vtkDistanceRepresentation3D::BoundingBox
vtkBox * BoundingBox
Definition: vtkDistanceRepresentation3D.h:216
vtkDistanceRepresentation3D::SetPoint1DisplayPosition
void SetPoint1DisplayPosition(double pos[3]) override
vtkDistanceRepresentation3D::New
static vtkDistanceRepresentation3D * New()
Instantiate class.
vtkDistanceRepresentation.h
vtkDistanceRepresentation3D::SetPoint1WorldPosition
void SetPoint1WorldPosition(double pos[3]) override
vtkDistanceRepresentation3D::SetLabelScale
virtual void SetLabelScale(double scale[3])
vtkDistanceRepresentation3D::GetPoint2WorldPosition
double * GetPoint2WorldPosition() override
vtkDistanceRepresentation3D::Distance
double Distance
Definition: vtkDistanceRepresentation3D.h:213
vtkVectorText
create polygonal text
Definition: vtkVectorText.h:48
vtkDistanceRepresentation3D::LinePoints
vtkPoints * LinePoints
Definition: vtkDistanceRepresentation3D.h:185
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:38
vtkDistanceRepresentation3D::RenderTranslucentPolygonalGeometry
int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override
vtkDistanceRepresentation3D::SetLabelPosition
void SetLabelPosition(double labelPosition)
Set/Get position of the label title in normalized coordinates [0,1].
vtkDistanceRepresentation3D::LabelActor
vtkFollower * LabelActor
Definition: vtkDistanceRepresentation3D.h:193
vtkDistanceRepresentation
represent the vtkDistanceWidget
Definition: vtkDistanceRepresentation.h:37
vtkDistanceRepresentation3D::Glyph3D
vtkGlyph3D * Glyph3D
Definition: vtkDistanceRepresentation3D.h:204
vtkDistanceRepresentation3D::RenderOpaqueGeometry
int RenderOpaqueGeometry(vtkViewport *viewport) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
vtkDistanceRepresentation3D::GetLabelScale
virtual double * GetLabelScale()
vtkDistanceRepresentation3D::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkDistanceRepresentation3D::GetPoint1DisplayPosition
void GetPoint1DisplayPosition(double pos[3]) override
vtkDistanceRepresentation3D::LabelScaleSpecified
bool LabelScaleSpecified
Definition: vtkDistanceRepresentation3D.h:196
vtkDistanceRepresentation3D::GetPoint1WorldPosition
double * GetPoint1WorldPosition() override
Methods to Set/Get the coordinates of the two points defining this representation.
vtkDistanceRepresentation3D
represent the vtkDistanceWidget
Definition: vtkDistanceRepresentation3D.h:53
vtkDistanceRepresentation3D::LineActor
vtkActor * LineActor
Definition: vtkDistanceRepresentation3D.h:188
vtkActor
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:52
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkDistanceRepresentation3D::GetBounds
double * GetBounds() override
Get the bounds for this Prop as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
vtkDistanceRepresentation3D::GetPoint2WorldPosition
void GetPoint2WorldPosition(double pos[3]) override
vtkDistanceRepresentation3D::GetLineProperty
virtual vtkProperty * GetLineProperty()
Convenience method to get the line actor property.
vtkDistanceRepresentation3D::GlyphPoints
vtkPoints * GlyphPoints
Definition: vtkDistanceRepresentation3D.h:199
vtkDistanceRepresentation3D::GetPoint1WorldPosition
void GetPoint1WorldPosition(double pos[3]) override
Methods to Set/Get the coordinates of the two points defining this representation.
vtkDistanceRepresentation3D::GetPoint2DisplayPosition
void GetPoint2DisplayPosition(double pos[3]) override
vtkCylinderSource
generate a cylinder centered at origin
Definition: vtkCylinderSource.h:43
vtkDistanceRepresentation3D::~vtkDistanceRepresentation3D
~vtkDistanceRepresentation3D() override
vtkTransformPolyDataFilter
transform points and associated normals and vectors for polygonal dataset
Definition: vtkTransformPolyDataFilter.h:52
vtkDistanceRepresentation3D::GlyphCylinder
vtkCylinderSource * GlyphCylinder
Definition: vtkDistanceRepresentation3D.h:202
vtkDistanceRepresentation3D::vtkDistanceRepresentation3D
vtkDistanceRepresentation3D()
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:48
vtkDistanceRepresentation3D::LabelMapper
vtkPolyDataMapper * LabelMapper
Definition: vtkDistanceRepresentation3D.h:192
vtkDistanceRepresentation3D::GlyphActor
vtkActor * GlyphActor
Definition: vtkDistanceRepresentation3D.h:206
vtkGlyph3D
copy oriented and scaled glyph geometry to every input point
Definition: vtkGlyph3D.h:112
vtkDistanceRepresentation3D::GlyphScale
double GlyphScale
Definition: vtkDistanceRepresentation3D.h:209
vtkDistanceRepresentation3D::GlyphVectors
vtkDoubleArray * GlyphVectors
Definition: vtkDistanceRepresentation3D.h:200
vtkBox
implicit function for a bounding box
Definition: vtkBox.h:42
vtkDistanceRepresentation3D::GlyphMapper
vtkPolyDataMapper * GlyphMapper
Definition: vtkDistanceRepresentation3D.h:205
vtkDistanceRepresentation3D::GlyphXForm
vtkTransformPolyDataFilter * GlyphXForm
Definition: vtkDistanceRepresentation3D.h:203
vtkDistanceRepresentation3D::GlyphScaleSpecified
bool GlyphScaleSpecified
Definition: vtkDistanceRepresentation3D.h:210
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:86
vtkDistanceRepresentation3D::GetLabelProperty
virtual vtkProperty * GetLabelProperty()
Get the distance annotation property.
vtkDistanceRepresentation3D::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *w) override
Methods required by vtkProp superclass.
vtkDoubleArray
dynamic, self-adjusting array of double
Definition: vtkDoubleArray.h:42
vtkProperty
represent surface properties of a geometric object
Definition: vtkProperty.h:67
vtkDistanceRepresentation3D::SetGlyphScale
void SetGlyphScale(double scale)
Scale the glyphs used as tick marks.
vtkDistanceRepresentation3D::GetDistance
double GetDistance() override
Satisfy the superclasses API.
Definition: vtkDistanceRepresentation3D.h:71
vtkDistanceRepresentation3D::SetPoint2DisplayPosition
void SetPoint2DisplayPosition(double pos[3]) override
vtkDistanceRepresentation3D::SetPoint2WorldPosition
void SetPoint2WorldPosition(double pos[3]) override
vtkDistanceRepresentation3D::LineMapper
vtkPolyDataMapper * LineMapper
Definition: vtkDistanceRepresentation3D.h:187
vtkDistanceRepresentation3D::SetLabelActor
virtual void SetLabelActor(vtkFollower *)
vtkDistanceRepresentation3D::SetLabelScale
void SetLabelScale(double x, double y, double z)
Scale text (font size along each dimension).
Definition: vtkDistanceRepresentation3D.h:163