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:
[legend]
Collaboration diagram for cvConstrainedLineRepresentation:
[legend]

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 cvConstrainedLineRepresentation * New ()
 

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

Constructor & Destructor Documentation

◆ cvConstrainedLineRepresentation()

cvConstrainedLineRepresentation::cvConstrainedLineRepresentation ( )
protected

References AxisActor, and AxisProperty.

◆ ~cvConstrainedLineRepresentation()

cvConstrainedLineRepresentation::~cvConstrainedLineRepresentation ( )
overrideprotected

Member Function Documentation

◆ BuildRepresentation()

void cvConstrainedLineRepresentation::BuildRepresentation ( )
override

Override BuildRepresentation to update distance display.

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.

◆ New()

static cvConstrainedLineRepresentation* cvConstrainedLineRepresentation::New ( )
static

◆ PrintSelf()

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

◆ RenderOpaqueGeometry()

int cvConstrainedLineRepresentation::RenderOpaqueGeometry ( vtkViewport *  viewport)
override

◆ RenderOverlay()

int cvConstrainedLineRepresentation::RenderOverlay ( vtkViewport *  viewport)
override

Override to render distance label and ticks.

References AxisActor, BuildRepresentation(), and count.

◆ ReplaceHandleRepresentations()

void cvConstrainedLineRepresentation::ReplaceHandleRepresentations ( vtkPointHandleRepresentation3D *  handle)

Replace handle representations with custom types (runtime version)

◆ 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

◆ SetScale()

void cvConstrainedLineRepresentation::SetScale ( double  scale)

Set/Get scale factor.

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  ,
1  ,
VTK_INT_MAX   
)

Set/Get number of ruler ticks.

◆ vtkSetClampMacro() [2/2]

cvConstrainedLineRepresentation::vtkSetClampMacro ( RulerDistance  ,
double  ,
0  ,
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

Referenced by BuildRepresentation().

◆ LabelFormat

char* cvConstrainedLineRepresentation::LabelFormat
protected

◆ LabelSuffix

char* cvConstrainedLineRepresentation::LabelSuffix
protected

◆ NumberOfRulerTicks

int cvConstrainedLineRepresentation::NumberOfRulerTicks
protected

Referenced by BuildRepresentation(), and PrintSelf().

◆ RulerDistance

double cvConstrainedLineRepresentation::RulerDistance
protected

Referenced by BuildRepresentation(), and PrintSelf().

◆ RulerMode

vtkTypeBool cvConstrainedLineRepresentation::RulerMode
protected

Referenced by BuildRepresentation(), and PrintSelf().

◆ Scale

double cvConstrainedLineRepresentation::Scale
protected

◆ ShowLabel

vtkTypeBool cvConstrainedLineRepresentation::ShowLabel
protected

Referenced by BuildRepresentation(), and PrintSelf().


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