VTK  9.0.20210518
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 =========================================================================*/
29 #ifndef vtkDistanceRepresentation3D_h
30 #define vtkDistanceRepresentation3D_h
31 
33 #include "vtkInteractionWidgetsModule.h" // For export macro
34 
35 class vtkPoints;
36 class vtkPolyData;
37 class vtkPolyDataMapper;
38 class vtkActor;
39 class vtkVectorText;
40 class vtkFollower;
41 class vtkBox;
42 class vtkCylinderSource;
43 class vtkGlyph3D;
44 class vtkDoubleArray;
46 class vtkProperty;
47 
48 class VTKINTERACTIONWIDGETS_EXPORT vtkDistanceRepresentation3D : public vtkDistanceRepresentation
49 {
50 public:
55 
57 
61  void PrintSelf(ostream& os, vtkIndent indent) override;
63 
67  double GetDistance() override { return this->Distance; }
68 
70 
74  void SetGlyphScale(double scale);
75  vtkGetMacro(GlyphScale, double);
77 
82 
84 
88  void SetLabelPosition(double labelPosition);
89  vtkGetMacro(LabelPosition, double);
91 
93 
96  vtkSetClampMacro(MaximumNumberOfRulerTicks, int, 1, VTK_INT_MAX);
97  vtkGetMacro(MaximumNumberOfRulerTicks, int);
99 
101 
105  vtkGetObjectMacro(GlyphActor, vtkActor);
107 
109 
113  vtkGetObjectMacro(LabelActor, vtkFollower);
114  virtual void SetLabelActor(vtkFollower*);
116 
118 
123  double* GetPoint1WorldPosition() override;
124  double* GetPoint2WorldPosition() override;
125  void GetPoint1WorldPosition(double pos[3]) override;
126  void GetPoint2WorldPosition(double pos[3]) override;
127  void SetPoint1WorldPosition(double pos[3]) override;
128  void SetPoint2WorldPosition(double pos[3]) override;
130 
131  void SetPoint1DisplayPosition(double pos[3]) override;
132  void SetPoint2DisplayPosition(double pos[3]) override;
133  void GetPoint1DisplayPosition(double pos[3]) override;
134  void GetPoint2DisplayPosition(double pos[3]) override;
135 
137 
140  void BuildRepresentation() override;
141  double* GetBounds() override;
143 
145 
149  int RenderOpaqueGeometry(vtkViewport* viewport) override;
152 
154 
158  void SetLabelScale(double x, double y, double z)
159  {
160  double scale[3];
161  scale[0] = x;
162  scale[1] = y;
163  scale[2] = z;
164  this->SetLabelScale(scale);
165  }
166  virtual void SetLabelScale(double scale[3]);
167  virtual double* GetLabelScale();
169 
174 
175 protected:
178 
179  // The line
184 
185  // The distance label
189 
190  // Support internal operations
192 
193  // The 3D disk tick marks
202 
203  // Glyph3D scale
204  double GlyphScale;
206 
207  // The distance between the two points
208  double Distance;
209 
210  // Support GetBounds() method
212 
213  // Maximum number of ticks on the 3d ruler
215 
216  // Label title position
218 
219 private:
221  void operator=(const vtkDistanceRepresentation3D&) = delete;
222 
223  // Internal method to update the position of the label.
224  void UpdateLabelPosition();
225 };
226 
227 #endif
vtkPolyDataMapper
map vtkPolyData to graphics primitives
Definition: vtkPolyDataMapper.h:37
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:34
vtkDistanceRepresentation3D::LinePolyData
vtkPolyData * LinePolyData
Definition: vtkDistanceRepresentation3D.h:181
vtkDistanceRepresentation3D::LabelPosition
double LabelPosition
Definition: vtkDistanceRepresentation3D.h:217
vtkDistanceRepresentation3D::GlyphPolyData
vtkPolyData * GlyphPolyData
Definition: vtkDistanceRepresentation3D.h:196
vtkFollower
a subclass of actor that always faces the camera
Definition: vtkFollower.h:41
VTK_INT_MAX
#define VTK_INT_MAX
Definition: vtkType.h:155
vtkDistanceRepresentation3D::BuildRepresentation
void BuildRepresentation() override
Method to satisfy superclasses' API.
vtkDistanceRepresentation3D::MaximumNumberOfRulerTicks
int MaximumNumberOfRulerTicks
Definition: vtkDistanceRepresentation3D.h:214
vtkDistanceRepresentation3D::LabelText
vtkVectorText * LabelText
Definition: vtkDistanceRepresentation3D.h:186
vtkX3D::scale
@ scale
Definition: vtkX3D.h:235
vtkDistanceRepresentation3D::BoundingBox
vtkBox * BoundingBox
Definition: vtkDistanceRepresentation3D.h:211
vtkDistanceRepresentation3D::SetPoint1DisplayPosition
void SetPoint1DisplayPosition(double pos[3]) override
Methods to Set/Get the coordinates of the two points defining this representation.
vtkDistanceRepresentation3D::New
static vtkDistanceRepresentation3D * New()
Instantiate class.
vtkDistanceRepresentation.h
vtkDistanceRepresentation3D::SetPoint1WorldPosition
void SetPoint1WorldPosition(double pos[3]) override
Methods to Set/Get the coordinates of the two points defining this representation.
vtkDistanceRepresentation3D::SetLabelScale
virtual void SetLabelScale(double scale[3])
Scale text (font size along each dimension).
vtkDistanceRepresentation3D::GetPoint2WorldPosition
double * GetPoint2WorldPosition() override
Methods to Set/Get the coordinates of the two points defining this representation.
vtkDistanceRepresentation3D::Distance
double Distance
Definition: vtkDistanceRepresentation3D.h:208
vtkVectorText
create polygonal text
Definition: vtkVectorText.h:42
vtkDistanceRepresentation3D::LinePoints
vtkPoints * LinePoints
Definition: vtkDistanceRepresentation3D.h:180
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:39
vtkDistanceRepresentation3D::RenderTranslucentPolygonalGeometry
int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override
Methods required by vtkProp superclass.
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:188
vtkDistanceRepresentation
represent the vtkDistanceWidget
Definition: vtkDistanceRepresentation.h:36
vtkDistanceRepresentation3D::Glyph3D
vtkGlyph3D * Glyph3D
Definition: vtkDistanceRepresentation3D.h:199
vtkDistanceRepresentation3D::RenderOpaqueGeometry
int RenderOpaqueGeometry(vtkViewport *viewport) override
Methods required by vtkProp superclass.
vtkDistanceRepresentation3D::GetLabelScale
virtual double * GetLabelScale()
Scale text (font size along each dimension).
vtkDistanceRepresentation3D::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Standard VTK methods.
vtkDistanceRepresentation3D::GetPoint1DisplayPosition
void GetPoint1DisplayPosition(double pos[3]) override
Methods to Set/Get the coordinates of the two points defining this representation.
vtkDistanceRepresentation3D::LabelScaleSpecified
bool LabelScaleSpecified
Definition: vtkDistanceRepresentation3D.h:191
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:49
vtkDistanceRepresentation3D::LineActor
vtkActor * LineActor
Definition: vtkDistanceRepresentation3D.h:183
vtkActor
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:46
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:34
vtkDistanceRepresentation3D::GetBounds
double * GetBounds() override
Method to satisfy superclasses' API.
vtkDistanceRepresentation3D::GetPoint2WorldPosition
void GetPoint2WorldPosition(double pos[3]) override
Methods to Set/Get the coordinates of the two points defining this representation.
vtkDistanceRepresentation3D::GetLineProperty
virtual vtkProperty * GetLineProperty()
Convenience method to get the line actor property.
vtkDistanceRepresentation3D::GlyphPoints
vtkPoints * GlyphPoints
Definition: vtkDistanceRepresentation3D.h:194
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
Methods to Set/Get the coordinates of the two points defining this representation.
vtkCylinderSource
generate a cylinder centered at origin
Definition: vtkCylinderSource.h:37
vtkDistanceRepresentation3D::~vtkDistanceRepresentation3D
~vtkDistanceRepresentation3D() override
vtkTransformPolyDataFilter
transform points and associated normals and vectors for polygonal dataset
Definition: vtkTransformPolyDataFilter.h:46
vtkDistanceRepresentation3D::GlyphCylinder
vtkCylinderSource * GlyphCylinder
Definition: vtkDistanceRepresentation3D.h:197
vtkDistanceRepresentation3D::vtkDistanceRepresentation3D
vtkDistanceRepresentation3D()
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:45
vtkDistanceRepresentation3D::LabelMapper
vtkPolyDataMapper * LabelMapper
Definition: vtkDistanceRepresentation3D.h:187
vtkDistanceRepresentation3D::GlyphActor
vtkActor * GlyphActor
Definition: vtkDistanceRepresentation3D.h:201
vtkGlyph3D
copy oriented and scaled glyph geometry to every input point
Definition: vtkGlyph3D.h:107
vtkDistanceRepresentation3D::GlyphScale
double GlyphScale
Definition: vtkDistanceRepresentation3D.h:204
vtkDistanceRepresentation3D::GlyphVectors
vtkDoubleArray * GlyphVectors
Definition: vtkDistanceRepresentation3D.h:195
vtkBox
implicit function for a bounding box
Definition: vtkBox.h:39
vtkDistanceRepresentation3D::GlyphMapper
vtkPolyDataMapper * GlyphMapper
Definition: vtkDistanceRepresentation3D.h:200
vtkDistanceRepresentation3D::GlyphXForm
vtkTransformPolyDataFilter * GlyphXForm
Definition: vtkDistanceRepresentation3D.h:198
vtkDistanceRepresentation3D::GlyphScaleSpecified
bool GlyphScaleSpecified
Definition: vtkDistanceRepresentation3D.h:205
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:36
vtkProperty
represent surface properties of a geometric object
Definition: vtkProperty.h:62
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:67
vtkDistanceRepresentation3D::SetPoint2DisplayPosition
void SetPoint2DisplayPosition(double pos[3]) override
Methods to Set/Get the coordinates of the two points defining this representation.
vtkDistanceRepresentation3D::SetPoint2WorldPosition
void SetPoint2WorldPosition(double pos[3]) override
Methods to Set/Get the coordinates of the two points defining this representation.
vtkDistanceRepresentation3D::LineMapper
vtkPolyDataMapper * LineMapper
Definition: vtkDistanceRepresentation3D.h:182
vtkDistanceRepresentation3D::SetLabelActor
virtual void SetLabelActor(vtkFollower *)
Convenience method Get the label actor.
vtkDistanceRepresentation3D::SetLabelScale
void SetLabelScale(double x, double y, double z)
Scale text (font size along each dimension).
Definition: vtkDistanceRepresentation3D.h:158