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

Dialog for managing measurement tools (Distance, Contour, Protractor) More...

#include <ecvMeasurementTool.h>

Inheritance diagram for ecvMeasurementTool:
[legend]
Collaboration diagram for ecvMeasurementTool:
[legend]

Public Member Functions

 ecvMeasurementTool (QWidget *parent)
 Default constructor. More...
 
virtual ~ecvMeasurementTool ()
 Default destructor. More...
 
virtual bool linkWith (QWidget *win) override
 Links the overlay dialog with a MDI window. More...
 
virtual bool start () override
 Starts process. More...
 
virtual void stop (bool state) override
 Stops process/dialog. More...
 
void setMeasurementTool (ecvGenericMeasurementTools *tool)
 
ecvGenericMeasurementTools * getMeasurementTool () const
 
bool addAssociatedEntity (ccHObject *anObject)
 Adds an entity. More...
 
unsigned getNumberOfAssociatedEntity () const
 Returns the current number of associated entities. More...
 
ccHObject::Container getOutputs () const
 
void onItemPicked (const PickedItem &pi) override
 Inherited from ccPickingListener. More...
 
- Public Member Functions inherited from ccOverlayDialog
 ccOverlayDialog (QWidget *parent=nullptr, Qt::WindowFlags flags=Qt::FramelessWindowHint|Qt::Tool)
 Default constructor. More...
 
 ~ccOverlayDialog () override
 Destructor. More...
 
void reject () override
 
void addOverridenShortcut (Qt::Key key)
 
bool started () const
 Returns whether the tool is currently started or not. More...
 
- Public Member Functions inherited from ccPickingListener
virtual ~ccPickingListener ()=default
 

Protected Slots

void reset ()
 
void closeDialog ()
 
void updateMeasurementDisplay ()
 
void toggleWidget (bool state)
 
void exportMeasurement ()
 
void onInstanceChanged (int index)
 
void addInstance ()
 
void removeInstance ()
 
void onPointPickingRequested (int pointIndex)
 
void onPointPickingCancelled ()
 
void onColorButtonClicked ()
 
void onFontPropertiesChanged ()
 
- Protected Slots inherited from ccOverlayDialog
virtual void onLinkedWindowDeletion (QObject *object=nullptr)
 Slot called when the linked window is deleted (calls 'onClose') More...
 

Protected Member Functions

void updateResultDisplay ()
 Updates the measurement result display. More...
 
void updateUIFromTool ()
 Updates UI from current tool. More...
 
void updateToolFromUI ()
 Updates tool from UI. More...
 
void releaseAssociatedEntities ()
 Releases all associated entities. More...
 
ecvGenericMeasurementTools * createMeasurementTool (ecvGenericMeasurementTools::MeasurementType type)
 Creates a new measurement tool instance. More...
 
void updateInstancesComboBox ()
 Updates instances combo box. More...
 
void switchToToolUI (ecvGenericMeasurementTools *tool)
 Switches to the specified tool's UI. More...
 
void updateColorButtonAppearance (const QColor &color=QColor())
 
void applyColorToAllTools (const QColor &color=QColor())
 
void applyFontToTools ()
 
- Protected Member Functions inherited from ccOverlayDialog
bool eventFilter (QObject *obj, QEvent *e) override
 

Protected Attributes

ecvGenericMeasurementTools * m_tool
 Current measurement tool. More...
 
QList< ecvGenericMeasurementTools * > m_toolInstances
 List of all measurement tool instances. More...
 
ecvGenericMeasurementTools::MeasurementType m_measurementType
 
ccHObject m_entityContainer
 Associated entities container. More...
 
ccHObject::Container m_out_entities
 
bool m_updatingFromTool
 Flag to prevent recursive updates. More...
 
ccPickingHub * m_pickingHub
 Picking hub for point selection. More...
 
int m_pickPointMode
 Current point selection mode (0=none, 1=point1, 2=point2, 3=center) More...
 
QColor m_currentColor
 Current measurement color (default: green) More...
 
ecvFontPropertyWidget * m_fontPropertyWidget = nullptr
 Font property widget. More...
 
QWidget * m_linkedWidget = nullptr
 
- Protected Attributes inherited from ccOverlayDialog
QWidget * m_associatedWin
 Associated (MDI) window. More...
 
bool m_processing
 Running/processing state. More...
 
QList< int > m_overriddenKeys
 Overridden keys. More...
 

Additional Inherited Members

- Signals inherited from ccOverlayDialog
void processFinished (bool accepted)
 Signal emitted when process is finished. More...
 
void shortcutTriggered (int key)
 Signal emitted when an overridden key shortcut is pressed. More...
 
void shown ()
 Signal emitted when a 'show' event is detected. More...
 

Detailed Description

Dialog for managing measurement tools (Distance, Contour, Protractor)

Constructor & Destructor Documentation

◆ ecvMeasurementTool()

◆ ~ecvMeasurementTool()

ecvMeasurementTool::~ecvMeasurementTool ( )
virtual

Default destructor.

References m_pickingHub, m_toolInstances, and ccPickingHub::removeListener().

Member Function Documentation

◆ addAssociatedEntity()

bool ecvMeasurementTool::addAssociatedEntity ( ccHObject *  anObject)

◆ addInstance

◆ applyColorToAllTools()

void ecvMeasurementTool::applyColorToAllTools ( const QColor &  color = QColor())
protected

Applies color to all tool instances (or current tool if "Apply all" is unchecked)

Parameters
colorOptional color to apply. If not provided, uses m_currentColor

References color, m_measurementType, m_tool, m_toolInstances, and ecvGenericMeasurementTools::setColor().

Referenced by onColorButtonClicked().

◆ applyFontToTools()

◆ closeDialog

void ecvMeasurementTool::closeDialog ( )
protectedslot

References stop().

Referenced by ecvMeasurementTool().

◆ createMeasurementTool()

◆ exportMeasurement

◆ getMeasurementTool()

ecvGenericMeasurementTools* ecvMeasurementTool::getMeasurementTool ( ) const
inline

References m_tool.

◆ getNumberOfAssociatedEntity()

unsigned ecvMeasurementTool::getNumberOfAssociatedEntity ( ) const

Returns the current number of associated entities.

References ccHObject::getChildrenNumber(), and m_entityContainer.

◆ getOutputs()

ccHObject::Container ecvMeasurementTool::getOutputs ( ) const
inline

References m_out_entities.

◆ linkWith()

bool ecvMeasurementTool::linkWith ( QWidget *  win)
overridevirtual

Links the overlay dialog with a MDI window.

Warning: link can't be modified while dialog is displayed/process is running!

Returns
success

Reimplemented from ccOverlayDialog.

References ccOverlayDialog::linkWith(), m_linkedWidget, and m_toolInstances.

◆ onColorButtonClicked

void ecvMeasurementTool::onColorButtonClicked ( )
protectedslot

◆ onFontPropertiesChanged

void ecvMeasurementTool::onFontPropertiesChanged ( )
protectedslot

◆ onInstanceChanged

void ecvMeasurementTool::onInstanceChanged ( int  index)
protectedslot

◆ onItemPicked()

◆ onPointPickingCancelled

void ecvMeasurementTool::onPointPickingCancelled ( )
protectedslot

◆ onPointPickingRequested

void ecvMeasurementTool::onPointPickingRequested ( int  pointIndex)
protectedslot

◆ releaseAssociatedEntities()

void ecvMeasurementTool::releaseAssociatedEntities ( )
protected

Releases all associated entities.

References m_entityContainer, m_out_entities, and ccHObject::removeAllChildren().

Referenced by stop().

◆ removeInstance

◆ reset

void ecvMeasurementTool::reset ( )
protectedslot

◆ setMeasurementTool()

◆ start()

◆ stop()

void ecvMeasurementTool::stop ( bool  accepted)
overridevirtual

Stops process/dialog.

Automatically emits the 'processFinished' signal (with input state as argument).

Parameters
acceptedprocess/dialog result

Reimplemented from ccOverlayDialog.

References m_pickingHub, m_pickPointMode, m_tool, m_toolInstances, releaseAssociatedEntities(), ccPickingHub::removeListener(), and ccOverlayDialog::stop().

Referenced by closeDialog().

◆ switchToToolUI()

◆ toggleWidget

void ecvMeasurementTool::toggleWidget ( bool  state)
protectedslot

◆ updateColorButtonAppearance()

void ecvMeasurementTool::updateColorButtonAppearance ( const QColor &  color = QColor())
protected

Updates color button appearance based on current color

Parameters
colorOptional color to display. If not provided, uses m_currentColor

References color, and m_currentColor.

Referenced by ecvMeasurementTool(), and updateUIFromTool().

◆ updateInstancesComboBox()

void ecvMeasurementTool::updateInstancesComboBox ( )
protected

◆ updateMeasurementDisplay

void ecvMeasurementTool::updateMeasurementDisplay ( )
protectedslot

◆ updateResultDisplay()

void ecvMeasurementTool::updateResultDisplay ( )
protected

Updates the measurement result display.

◆ updateToolFromUI()

void ecvMeasurementTool::updateToolFromUI ( )
protected

Updates tool from UI.

◆ updateUIFromTool()

Member Data Documentation

◆ m_currentColor

QColor ecvMeasurementTool::m_currentColor
protected

Current measurement color (default: green)

Referenced by updateColorButtonAppearance().

◆ m_entityContainer

ccHObject ecvMeasurementTool::m_entityContainer
protected

◆ m_fontPropertyWidget

ecvFontPropertyWidget* ecvMeasurementTool::m_fontPropertyWidget = nullptr
protected

Font property widget.

Referenced by applyFontToTools(), ecvMeasurementTool(), and updateUIFromTool().

◆ m_linkedWidget

QWidget* ecvMeasurementTool::m_linkedWidget = nullptr
protected

VTK widget reference from linkWith (for creating shortcuts in new instances)

Referenced by addInstance(), and linkWith().

◆ m_measurementType

◆ m_out_entities

ccHObject::Container ecvMeasurementTool::m_out_entities
protected

◆ m_pickingHub

ccPickingHub* ecvMeasurementTool::m_pickingHub
protected

◆ m_pickPointMode

int ecvMeasurementTool::m_pickPointMode
protected

Current point selection mode (0=none, 1=point1, 2=point2, 3=center)

Referenced by onItemPicked(), onPointPickingCancelled(), onPointPickingRequested(), and stop().

◆ m_tool

◆ m_toolInstances

◆ m_updatingFromTool

bool ecvMeasurementTool::m_updatingFromTool
protected

Flag to prevent recursive updates.

Referenced by updateUIFromTool().


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