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

Selection annotation manager. More...

#include <cvSelectionAnnotation.h>

Inheritance diagram for cvSelectionAnnotationManager:
Collaboration diagram for cvSelectionAnnotationManager:

Signals

void annotationsChanged ()
 Emitted when annotations change. More...
 
void annotationAdded (const QString &id)
 Emitted when annotation is added. More...
 
void annotationRemoved (const QString &id)
 Emitted when annotation is removed. More...
 
void annotationUpdated (const QString &id)
 Emitted when annotation is updated. More...
 

Public Member Functions

 cvSelectionAnnotationManager (QObject *parent=nullptr)
 
 ~cvSelectionAnnotationManager () override
 
void setVisualizer (PclUtils::PCLVis *viewer)
 Set the visualizer. More...
 
QString addAnnotation (const cvSelectionData &selection, const QString &text, bool autoPosition=true)
 Add annotation for a selection. More...
 
QString addAnnotationAt (const QString &text, const double position[3], const QString &id=QString())
 Add annotation at specific position. More...
 
bool removeAnnotation (const QString &id)
 Remove annotation. More...
 
bool updateAnnotationText (const QString &id, const QString &text)
 Update annotation text. More...
 
bool updateAnnotationPosition (const QString &id, const double position[3])
 Update annotation position. More...
 
bool setAnnotationVisible (const QString &id, bool visible)
 Set annotation visibility. More...
 
bool setAnnotationColor (const QString &id, const QColor &color)
 Set annotation color. More...
 
bool setAnnotationFontSize (const QString &id, int fontSize)
 Set annotation font size. More...
 
void applyLabelProperties (const cvSelectionLabelPropertiesDialog::LabelProperties &props, bool isCellLabel)
 Apply label properties to all annotations (for cell or point labels) More...
 
void setDefaultLabelProperties (const cvSelectionLabelPropertiesDialog::LabelProperties &props, bool isCellLabel)
 Set default label properties for new annotations. More...
 
cvAnnotation getAnnotation (const QString &id) const
 Get annotation. More...
 
QList< cvAnnotationallAnnotations () const
 Get all annotations. More...
 
QStringList annotationIds () const
 Get annotation IDs. More...
 
int count () const
 Get annotation count. More...
 
void clearAll ()
 Clear all annotations. More...
 
void showAll ()
 Show all annotations. More...
 
void hideAll ()
 Hide all annotations. More...
 
bool exportToFile (const QString &filename) const
 Export annotations to JSON file. More...
 
bool importFromFile (const QString &filename, bool merge=true)
 Import annotations from JSON file. More...
 

Detailed Description

Selection annotation manager.

Manages text annotations for selections:

  • Add/remove annotations
  • Show/hide annotations
  • Update annotation text and style
  • Export/import annotations
  • Auto-position at selection center

Based on ParaView's annotation functionality.

Definition at line 112 of file cvSelectionAnnotation.h.

Constructor & Destructor Documentation

◆ cvSelectionAnnotationManager()

cvSelectionAnnotationManager::cvSelectionAnnotationManager ( QObject *  parent = nullptr)
explicit

Definition at line 37 of file cvSelectionAnnotation.cpp.

References CVLog::PrintVerbose().

◆ ~cvSelectionAnnotationManager()

cvSelectionAnnotationManager::~cvSelectionAnnotationManager ( )
override

Definition at line 43 of file cvSelectionAnnotation.cpp.

References clearAll().

Member Function Documentation

◆ addAnnotation()

◆ addAnnotationAt()

◆ allAnnotations()

QList< cvAnnotation > cvSelectionAnnotationManager::allAnnotations ( ) const

Get all annotations.

Definition at line 332 of file cvSelectionAnnotation.cpp.

◆ annotationAdded

void cvSelectionAnnotationManager::annotationAdded ( const QString &  id)
signal

Emitted when annotation is added.

Referenced by addAnnotation(), and addAnnotationAt().

◆ annotationIds()

QStringList cvSelectionAnnotationManager::annotationIds ( ) const

Get annotation IDs.

Definition at line 337 of file cvSelectionAnnotation.cpp.

◆ annotationRemoved

void cvSelectionAnnotationManager::annotationRemoved ( const QString &  id)
signal

Emitted when annotation is removed.

Referenced by removeAnnotation().

◆ annotationsChanged

void cvSelectionAnnotationManager::annotationsChanged ( )
signal

◆ annotationUpdated

void cvSelectionAnnotationManager::annotationUpdated ( const QString &  id)
signal

◆ applyLabelProperties()

void cvSelectionAnnotationManager::applyLabelProperties ( const cvSelectionLabelPropertiesDialog::LabelProperties props,
bool  isCellLabel 
)

Apply label properties to all annotations (for cell or point labels)

Parameters
propsLabel properties from dialog
isCellLabelIf true, apply cell label properties; if false, apply point label properties

Definition at line 266 of file cvSelectionAnnotation.cpp.

References annotationsChanged(), cvSelectionLabelPropertiesDialog::LabelProperties::cellLabelBold, cvSelectionLabelPropertiesDialog::LabelProperties::cellLabelColor, cvSelectionLabelPropertiesDialog::LabelProperties::cellLabelFontFamily, cvSelectionLabelPropertiesDialog::LabelProperties::cellLabelFontSize, cvSelectionLabelPropertiesDialog::LabelProperties::cellLabelHorizontalJustification, cvSelectionLabelPropertiesDialog::LabelProperties::cellLabelItalic, cvSelectionLabelPropertiesDialog::LabelProperties::cellLabelOpacity, cvSelectionLabelPropertiesDialog::LabelProperties::cellLabelShadow, cvSelectionLabelPropertiesDialog::LabelProperties::cellLabelVerticalJustification, cvSelectionLabelPropertiesDialog::LabelProperties::pointLabelBold, cvSelectionLabelPropertiesDialog::LabelProperties::pointLabelColor, cvSelectionLabelPropertiesDialog::LabelProperties::pointLabelFontFamily, cvSelectionLabelPropertiesDialog::LabelProperties::pointLabelFontSize, cvSelectionLabelPropertiesDialog::LabelProperties::pointLabelHorizontalJustification, cvSelectionLabelPropertiesDialog::LabelProperties::pointLabelItalic, cvSelectionLabelPropertiesDialog::LabelProperties::pointLabelOpacity, cvSelectionLabelPropertiesDialog::LabelProperties::pointLabelShadow, and cvSelectionLabelPropertiesDialog::LabelProperties::pointLabelVerticalJustification.

◆ clearAll()

void cvSelectionAnnotationManager::clearAll ( )

Clear all annotations.

Definition at line 342 of file cvSelectionAnnotation.cpp.

References annotationsChanged(), and CVLog::Print().

Referenced by importFromFile(), and ~cvSelectionAnnotationManager().

◆ count()

int cvSelectionAnnotationManager::count ( ) const
inline

Get annotation count.

Definition at line 234 of file cvSelectionAnnotation.h.

◆ exportToFile()

bool cvSelectionAnnotationManager::exportToFile ( const QString &  filename) const

Export annotations to JSON file.

Parameters
filenameOutput filename
Returns
True on success

Definition at line 377 of file cvSelectionAnnotation.cpp.

References CVLog::Error(), filename, and CVLog::Print().

◆ getAnnotation()

cvAnnotation cvSelectionAnnotationManager::getAnnotation ( const QString &  id) const

Get annotation.

Parameters
idAnnotation ID
Returns
Annotation data

Definition at line 326 of file cvSelectionAnnotation.cpp.

◆ hideAll()

void cvSelectionAnnotationManager::hideAll ( )

Hide all annotations.

Definition at line 367 of file cvSelectionAnnotation.cpp.

References annotationsChanged().

◆ importFromFile()

bool cvSelectionAnnotationManager::importFromFile ( const QString &  filename,
bool  merge = true 
)

◆ removeAnnotation()

bool cvSelectionAnnotationManager::removeAnnotation ( const QString &  id)

Remove annotation.

Parameters
idAnnotation ID
Returns
True if removed

Definition at line 166 of file cvSelectionAnnotation.cpp.

References annotationRemoved(), annotationsChanged(), CVLog::Print(), and CVLog::Warning().

◆ setAnnotationColor()

bool cvSelectionAnnotationManager::setAnnotationColor ( const QString &  id,
const QColor &  color 
)

Set annotation color.

Parameters
idAnnotation ID
colorText color
Returns
True if updated

Definition at line 236 of file cvSelectionAnnotation.cpp.

References annotationUpdated(), and color.

◆ setAnnotationFontSize()

bool cvSelectionAnnotationManager::setAnnotationFontSize ( const QString &  id,
int  fontSize 
)

Set annotation font size.

Parameters
idAnnotation ID
fontSizeFont size in points
Returns
True if updated

Definition at line 251 of file cvSelectionAnnotation.cpp.

References annotationUpdated().

◆ setAnnotationVisible()

bool cvSelectionAnnotationManager::setAnnotationVisible ( const QString &  id,
bool  visible 
)

Set annotation visibility.

Parameters
idAnnotation ID
visibleVisibility flag
Returns
True if updated

Definition at line 221 of file cvSelectionAnnotation.cpp.

References annotationUpdated().

◆ setDefaultLabelProperties()

void cvSelectionAnnotationManager::setDefaultLabelProperties ( const cvSelectionLabelPropertiesDialog::LabelProperties props,
bool  isCellLabel 
)

Set default label properties for new annotations.

Parameters
propsLabel properties from dialog
isCellLabelIf true, use cell label properties; if false, use point label properties

Definition at line 305 of file cvSelectionAnnotation.cpp.

References cvSelectionLabelPropertiesDialog::LabelProperties::cellLabelColor, cvSelectionLabelPropertiesDialog::LabelProperties::cellLabelFontFamily, cvSelectionLabelPropertiesDialog::LabelProperties::cellLabelFontSize, and CVLog::PrintVerbose().

Referenced by cvSelectionPropertiesWidget::setSelectionManager().

◆ setVisualizer()

void cvSelectionAnnotationManager::setVisualizer ( PclUtils::PCLVis viewer)

Set the visualizer.

Definition at line 46 of file cvSelectionAnnotation.cpp.

Referenced by cvViewSelectionManager::setVisualizer().

◆ showAll()

void cvSelectionAnnotationManager::showAll ( )

Show all annotations.

Definition at line 357 of file cvSelectionAnnotation.cpp.

References annotationsChanged().

◆ updateAnnotationPosition()

bool cvSelectionAnnotationManager::updateAnnotationPosition ( const QString &  id,
const double  position[3] 
)

Update annotation position.

Parameters
idAnnotation ID
positionNew position
Returns
True if updated

Definition at line 204 of file cvSelectionAnnotation.cpp.

References annotationUpdated(), and position.

◆ updateAnnotationText()

bool cvSelectionAnnotationManager::updateAnnotationText ( const QString &  id,
const QString &  text 
)

Update annotation text.

Parameters
idAnnotation ID
textNew text
Returns
True if updated

Definition at line 188 of file cvSelectionAnnotation.cpp.

References annotationsChanged(), and annotationUpdated().


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