 |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
Go to the documentation of this file.
8 #ifndef cvConstrainedLineRepresentation_h
9 #define cvConstrainedLineRepresentation_h
11 #include <vtkLineRepresentation.h>
12 #include <vtkPointHandleRepresentation3D.h>
34 void PrintSelf(ostream& os, vtkIndent indent)
override;
114 template <
typename T>
117 double p1[3] = {0, 0, 0};
118 double p2[3] = {0, 0, 0};
119 if (this->Point1Representation) {
120 this->Point1Representation->GetWorldPosition(p1);
122 if (this->Point2Representation) {
123 this->Point2Representation->GetWorldPosition(p2);
127 T* prototype = T::New();
130 if (this->Point1Representation) {
131 this->Point1Representation->Delete();
133 this->Point1Representation = T::New();
134 this->Point1Representation->ShallowCopy(prototype);
135 this->Point1Representation->SetWorldPosition(p1);
138 if (this->Point2Representation) {
139 this->Point2Representation->Delete();
141 this->Point2Representation = T::New();
142 this->Point2Representation->ShallowCopy(prototype);
143 this->Point2Representation->SetWorldPosition(p2);
146 if (this->LineHandleRepresentation) {
147 this->LineHandleRepresentation->Delete();
149 this->LineHandleRepresentation = T::New();
150 this->LineHandleRepresentation->ShallowCopy(prototype);
185 #endif // cvConstrainedLineRepresentation_h
int RenderOpaqueGeometry(vtkViewport *viewport) override
Definition: cvConstrainedLineRepresentation.cpp:193
vtkBooleanMacro(RulerMode, vtkTypeBool)
void SetScale(double scale)
Set/Get scale factor.
Definition: cvConstrainedLineRepresentation.cpp:111
int NumberOfRulerTicks
Definition: cvConstrainedLineRepresentation.h:173
void ReplaceHandleRepresentations(vtkPointHandleRepresentation3D *handle)
Replace handle representations with custom types (runtime version)
Definition: cvConstrainedLineRepresentation.cpp:209
void PrintSelf(ostream &os, vtkIndent indent) override
Definition: cvConstrainedLineRepresentation.cpp:277
vtkGetStringMacro(LabelFormat)
cvConstrainedLineRepresentation()
Definition: cvConstrainedLineRepresentation.cpp:30
static cvConstrainedLineRepresentation * New()
vtkTypeBool RulerMode
Definition: cvConstrainedLineRepresentation.h:171
virtual double GetDistance()
Get distance between the two points.
Definition: cvConstrainedLineRepresentation.cpp:103
vtkProperty2D * AxisProperty
Definition: cvConstrainedLineRepresentation.h:175
char * LabelSuffix
Definition: cvConstrainedLineRepresentation.h:168
vtkSetMacro(RulerMode, vtkTypeBool)
Set/Get Ruler mode Ruler mode displays tick marks.
vtkAxisActor2D * AxisActor
Definition: cvConstrainedLineRepresentation.h:174
vtkSetClampMacro(RulerDistance, double, 0, VTK_FLOAT_MAX)
Set/Get Ruler distance (tick spacing)
vtkTypeMacro(cvConstrainedLineRepresentation, vtkLineRepresentation)
void ReplaceHandleRepresentationsTyped()
Replace handle representations with custom types This is needed because vtkLineRepresentation's const...
Definition: cvConstrainedLineRepresentation.h:115
~cvConstrainedLineRepresentation() override
Definition: cvConstrainedLineRepresentation.cpp:86
int count
Definition: FileIOFactory.cpp:132
vtkGetObjectMacro(AxisActor, vtkAxisActor2D)
Get Axis Actor (for tick display)
Extended LineRepresentation with distance display and ruler features.
Definition: cvConstrainedLineRepresentation.h:30
vtkStandardNewMacro(cvConstrainedLineRepresentation)
vtkGetMacro(RulerMode, vtkTypeBool)
double RulerDistance
Definition: cvConstrainedLineRepresentation.h:172
char * LabelFormat
Definition: cvConstrainedLineRepresentation.h:167
vtkTypeBool ShowLabel
Definition: cvConstrainedLineRepresentation.h:166
void BuildRepresentation() override
Override BuildRepresentation to update distance display.
Definition: cvConstrainedLineRepresentation.cpp:119
double Scale
Definition: cvConstrainedLineRepresentation.h:176
vtkSetStringMacro(LabelFormat)
Set/Get distance label format.
double Distance
Definition: cvConstrainedLineRepresentation.h:177
int RenderOverlay(vtkViewport *viewport) override
Override to render distance label and ticks.
Definition: cvConstrainedLineRepresentation.cpp:179