VTK  9.1.0
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
35class vtkPoints;
36class vtkPolyData;
38class vtkActor;
39class vtkVectorText;
40class vtkFollower;
41class vtkBox;
43class vtkGlyph3D;
44class vtkDoubleArray;
46class vtkProperty;
47
48class VTKINTERACTIONWIDGETS_EXPORT vtkDistanceRepresentation3D : public vtkDistanceRepresentation
49{
50public:
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);
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
175protected:
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
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
219private:
221 void operator=(const vtkDistanceRepresentation3D&) = delete;
222
223 // Internal method to update the position of the label.
224 void UpdateLabelPosition();
225};
226
227#endif
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:155
implicit function for a bounding box
Definition: vtkBox.h:138
generate a cylinder centered at origin
represent the vtkDistanceWidget
void BuildRepresentation() override
Method to satisfy superclasses' API.
double * GetPoint1WorldPosition() override
Methods to Set/Get the coordinates of the two points defining this representation.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard VTK methods.
void SetPoint1DisplayPosition(double pos[3]) override
Methods to Set/Get the coordinates of the two points defining this representation.
virtual vtkProperty * GetLineProperty()
Convenience method to get the line actor property.
virtual vtkProperty * GetLabelProperty()
Get the distance annotation property.
int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override
Methods required by vtkProp superclass.
~vtkDistanceRepresentation3D() override
vtkTransformPolyDataFilter * GlyphXForm
static vtkDistanceRepresentation3D * New()
Instantiate class.
void SetLabelPosition(double labelPosition)
Set/Get position of the label title in normalized coordinates [0,1].
void SetPoint1WorldPosition(double pos[3]) override
Methods to Set/Get the coordinates of the two points defining this representation.
void SetLabelScale(double x, double y, double z)
Scale text (font size along each dimension).
void GetPoint2DisplayPosition(double pos[3]) override
Methods to Set/Get the coordinates of the two points defining this representation.
void SetGlyphScale(double scale)
Scale the glyphs used as tick marks.
void GetPoint1DisplayPosition(double pos[3]) override
Methods to Set/Get the coordinates of the two points defining this representation.
double * GetPoint2WorldPosition() override
Methods to Set/Get the coordinates of the two points defining this representation.
void SetPoint2WorldPosition(double pos[3]) override
Methods to Set/Get the coordinates of the two points defining this representation.
double * GetBounds() override
Method to satisfy superclasses' API.
void GetPoint2WorldPosition(double pos[3]) override
Methods to Set/Get the coordinates of the two points defining this representation.
void SetPoint2DisplayPosition(double pos[3]) override
Methods to Set/Get the coordinates of the two points defining this representation.
virtual double * GetLabelScale()
Scale text (font size along each dimension).
void GetPoint1WorldPosition(double pos[3]) override
Methods to Set/Get the coordinates of the two points defining this representation.
double GetDistance() override
Satisfy the superclasses API.
virtual void SetLabelScale(double scale[3])
Scale text (font size along each dimension).
int RenderOpaqueGeometry(vtkViewport *viewport) override
Methods required by vtkProp superclass.
virtual void SetLabelActor(vtkFollower *)
Convenience method Get the label actor.
void ReleaseGraphicsResources(vtkWindow *w) override
Methods required by vtkProp superclass.
represent the vtkDistanceWidget
dynamic, self-adjusting array of double
a subclass of actor that always faces the camera
Definition: vtkFollower.h:120
copy oriented and scaled glyph geometry to every input point
Definition: vtkGlyph3D.h:216
a simple class to control print indentation
Definition: vtkIndent.h:113
represent and manipulate 3D points
Definition: vtkPoints.h:143
map vtkPolyData to graphics primitives
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:195
represent surface properties of a geometric object
Definition: vtkProperty.h:171
transform points and associated normals and vectors for polygonal dataset
create polygonal text
abstract specification for Viewports
Definition: vtkViewport.h:47
window superclass for vtkRenderWindow
Definition: vtkWindow.h:39
#define VTK_INT_MAX
Definition: vtkType.h:155