ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
cvConstrainedLineRepresentation Class Reference

Extended LineRepresentation with distance display and ruler features. More...

#include <cvConstrainedLineRepresentation.h>

Inheritance diagram for cvConstrainedLineRepresentation:
Collaboration diagram for cvConstrainedLineRepresentation:

Public Member Functions

 vtkTypeMacro (cvConstrainedLineRepresentation, vtkLineRepresentation)
 
void PrintSelf (ostream &os, vtkIndent indent) override
 
virtual double GetDistance ()
 Get distance between the two points. More...
 
 vtkSetMacro (RulerMode, vtkTypeBool)
 Set/Get Ruler mode Ruler mode displays tick marks. More...
 
 vtkGetMacro (RulerMode, vtkTypeBool)
 
 vtkBooleanMacro (RulerMode, vtkTypeBool)
 
 vtkSetClampMacro (RulerDistance, double, 0, VTK_FLOAT_MAX)
 Set/Get Ruler distance (tick spacing) More...
 
 vtkGetMacro (RulerDistance, double)
 
 vtkSetClampMacro (NumberOfRulerTicks, int, 1, VTK_INT_MAX)
 Set/Get number of ruler ticks. More...
 
 vtkGetMacro (NumberOfRulerTicks, int)
 
void SetScale (double scale)
 Set/Get scale factor. More...
 
 vtkGetMacro (Scale, double)
 
 vtkSetStringMacro (LabelFormat)
 Set/Get distance label format. More...
 
 vtkGetStringMacro (LabelFormat)
 
 vtkSetStringMacro (LabelSuffix)
 Set/Get distance label suffix (e.g., " #1", " #2") More...
 
 vtkGetStringMacro (LabelSuffix)
 
 vtkSetMacro (ShowLabel, vtkTypeBool)
 Show/Hide distance label. More...
 
 vtkGetMacro (ShowLabel, vtkTypeBool)
 
 vtkBooleanMacro (ShowLabel, vtkTypeBool)
 
 vtkGetObjectMacro (AxisActor, vtkAxisActor2D)
 Get Axis Actor (for tick display) More...
 
 vtkGetObjectMacro (AxisProperty, vtkProperty2D)
 Get axis property (ParaView way) More...
 
void BuildRepresentation () override
 Override BuildRepresentation to update distance display. More...
 
int RenderOverlay (vtkViewport *viewport) override
 Override to render distance label and ticks. More...
 
int RenderOpaqueGeometry (vtkViewport *viewport) override
 
template<typename T >
void ReplaceHandleRepresentationsTyped ()
 Replace handle representations with custom types This is needed because vtkLineRepresentation's constructor calls InstantiateHandleRepresentation() before we can set custom handles. More...
 
void ReplaceHandleRepresentations (vtkPointHandleRepresentation3D *handle)
 Replace handle representations with custom types (runtime version) More...
 

Static Public Member Functions

static cvConstrainedLineRepresentationNew ()
 

Protected Member Functions

 cvConstrainedLineRepresentation ()
 
 ~cvConstrainedLineRepresentation () override
 

Protected Attributes

vtkTypeBool ShowLabel
 
char * LabelFormat
 
char * LabelSuffix
 
vtkTypeBool RulerMode
 
double RulerDistance
 
int NumberOfRulerTicks
 
vtkAxisActor2D * AxisActor
 
vtkProperty2D * AxisProperty
 
double Scale
 
double Distance
 

Detailed Description

Extended LineRepresentation with distance display and ruler features.

Combines the advantages of both:

  • vtkLineRepresentation: Supports LineHandle, XYZL constraints
  • vtkDistanceRepresentation: Distance display, ticks, Ruler mode

This allows us to have simultaneously:

  1. XYZ/L key constraint functionality
  2. Distance value display
  3. Ruler tick display
  4. UI synchronization

Definition at line 30 of file cvConstrainedLineRepresentation.h.

Constructor & Destructor Documentation

◆ cvConstrainedLineRepresentation()

cvConstrainedLineRepresentation::cvConstrainedLineRepresentation ( )
protected

Definition at line 30 of file cvConstrainedLineRepresentation.cpp.

References AxisActor, and AxisProperty.

◆ ~cvConstrainedLineRepresentation()

cvConstrainedLineRepresentation::~cvConstrainedLineRepresentation ( )
overrideprotected

Definition at line 86 of file cvConstrainedLineRepresentation.cpp.

References AxisActor, AxisProperty, LabelFormat, and LabelSuffix.

Member Function Documentation

◆ BuildRepresentation()

void cvConstrainedLineRepresentation::BuildRepresentation ( )
override

Override BuildRepresentation to update distance display.

Definition at line 119 of file cvConstrainedLineRepresentation.cpp.

References AxisActor, Distance, LabelFormat, LabelSuffix, NumberOfRulerTicks, RulerDistance, RulerMode, Scale, and ShowLabel.

Referenced by RenderOpaqueGeometry(), and RenderOverlay().

◆ GetDistance()

double cvConstrainedLineRepresentation::GetDistance ( )
virtual

Get distance between the two points.

Definition at line 103 of file cvConstrainedLineRepresentation.cpp.

◆ New()

static cvConstrainedLineRepresentation* cvConstrainedLineRepresentation::New ( )
static

◆ PrintSelf()

void cvConstrainedLineRepresentation::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
override

◆ RenderOpaqueGeometry()

int cvConstrainedLineRepresentation::RenderOpaqueGeometry ( vtkViewport *  viewport)
override

Definition at line 193 of file cvConstrainedLineRepresentation.cpp.

References AxisActor, BuildRepresentation(), and count.

◆ RenderOverlay()

int cvConstrainedLineRepresentation::RenderOverlay ( vtkViewport *  viewport)
override

Override to render distance label and ticks.

Definition at line 179 of file cvConstrainedLineRepresentation.cpp.

References AxisActor, BuildRepresentation(), and count.

◆ ReplaceHandleRepresentations()

void cvConstrainedLineRepresentation::ReplaceHandleRepresentations ( vtkPointHandleRepresentation3D *  handle)

Replace handle representations with custom types (runtime version)

Definition at line 209 of file cvConstrainedLineRepresentation.cpp.

◆ ReplaceHandleRepresentationsTyped()

template<typename T >
void cvConstrainedLineRepresentation::ReplaceHandleRepresentationsTyped ( )
inline

Replace handle representations with custom types This is needed because vtkLineRepresentation's constructor calls InstantiateHandleRepresentation() before we can set custom handles.

Template version for type-safe creation

Definition at line 115 of file cvConstrainedLineRepresentation.h.

◆ SetScale()

void cvConstrainedLineRepresentation::SetScale ( double  scale)

Set/Get scale factor.

Definition at line 111 of file cvConstrainedLineRepresentation.cpp.

References Scale.

◆ vtkBooleanMacro() [1/2]

cvConstrainedLineRepresentation::vtkBooleanMacro ( RulerMode  ,
vtkTypeBool   
)

◆ vtkBooleanMacro() [2/2]

cvConstrainedLineRepresentation::vtkBooleanMacro ( ShowLabel  ,
vtkTypeBool   
)

◆ vtkGetMacro() [1/5]

cvConstrainedLineRepresentation::vtkGetMacro ( NumberOfRulerTicks  ,
int   
)

◆ vtkGetMacro() [2/5]

cvConstrainedLineRepresentation::vtkGetMacro ( RulerDistance  ,
double   
)

◆ vtkGetMacro() [3/5]

cvConstrainedLineRepresentation::vtkGetMacro ( RulerMode  ,
vtkTypeBool   
)

◆ vtkGetMacro() [4/5]

cvConstrainedLineRepresentation::vtkGetMacro ( Scale  ,
double   
)

◆ vtkGetMacro() [5/5]

cvConstrainedLineRepresentation::vtkGetMacro ( ShowLabel  ,
vtkTypeBool   
)

◆ vtkGetObjectMacro() [1/2]

cvConstrainedLineRepresentation::vtkGetObjectMacro ( AxisActor  ,
vtkAxisActor2D   
)

Get Axis Actor (for tick display)

◆ vtkGetObjectMacro() [2/2]

cvConstrainedLineRepresentation::vtkGetObjectMacro ( AxisProperty  ,
vtkProperty2D   
)

Get axis property (ParaView way)

◆ vtkGetStringMacro() [1/2]

cvConstrainedLineRepresentation::vtkGetStringMacro ( LabelFormat  )

◆ vtkGetStringMacro() [2/2]

cvConstrainedLineRepresentation::vtkGetStringMacro ( LabelSuffix  )

◆ vtkSetClampMacro() [1/2]

cvConstrainedLineRepresentation::vtkSetClampMacro ( NumberOfRulerTicks  ,
int  ,
,
VTK_INT_MAX   
)

Set/Get number of ruler ticks.

◆ vtkSetClampMacro() [2/2]

cvConstrainedLineRepresentation::vtkSetClampMacro ( RulerDistance  ,
double  ,
,
VTK_FLOAT_MAX   
)

Set/Get Ruler distance (tick spacing)

◆ vtkSetMacro() [1/2]

cvConstrainedLineRepresentation::vtkSetMacro ( RulerMode  ,
vtkTypeBool   
)

Set/Get Ruler mode Ruler mode displays tick marks.

◆ vtkSetMacro() [2/2]

cvConstrainedLineRepresentation::vtkSetMacro ( ShowLabel  ,
vtkTypeBool   
)

Show/Hide distance label.

◆ vtkSetStringMacro() [1/2]

cvConstrainedLineRepresentation::vtkSetStringMacro ( LabelFormat  )

Set/Get distance label format.

◆ vtkSetStringMacro() [2/2]

cvConstrainedLineRepresentation::vtkSetStringMacro ( LabelSuffix  )

Set/Get distance label suffix (e.g., " #1", " #2")

◆ vtkTypeMacro()

cvConstrainedLineRepresentation::vtkTypeMacro ( cvConstrainedLineRepresentation  ,
vtkLineRepresentation   
)

Member Data Documentation

◆ AxisActor

vtkAxisActor2D* cvConstrainedLineRepresentation::AxisActor
protected

◆ AxisProperty

vtkProperty2D* cvConstrainedLineRepresentation::AxisProperty
protected

◆ Distance

double cvConstrainedLineRepresentation::Distance
protected

Definition at line 177 of file cvConstrainedLineRepresentation.h.

Referenced by BuildRepresentation().

◆ LabelFormat

char* cvConstrainedLineRepresentation::LabelFormat
protected

◆ LabelSuffix

char* cvConstrainedLineRepresentation::LabelSuffix
protected

◆ NumberOfRulerTicks

int cvConstrainedLineRepresentation::NumberOfRulerTicks
protected

Definition at line 173 of file cvConstrainedLineRepresentation.h.

Referenced by BuildRepresentation(), and PrintSelf().

◆ RulerDistance

double cvConstrainedLineRepresentation::RulerDistance
protected

Definition at line 172 of file cvConstrainedLineRepresentation.h.

Referenced by BuildRepresentation(), and PrintSelf().

◆ RulerMode

vtkTypeBool cvConstrainedLineRepresentation::RulerMode
protected

Definition at line 171 of file cvConstrainedLineRepresentation.h.

Referenced by BuildRepresentation(), and PrintSelf().

◆ Scale

double cvConstrainedLineRepresentation::Scale
protected

Definition at line 176 of file cvConstrainedLineRepresentation.h.

Referenced by BuildRepresentation(), PrintSelf(), and SetScale().

◆ ShowLabel

vtkTypeBool cvConstrainedLineRepresentation::ShowLabel
protected

Definition at line 166 of file cvConstrainedLineRepresentation.h.

Referenced by BuildRepresentation(), and PrintSelf().


The documentation for this class was generated from the following files: