![]() |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
Selection annotation manager. More...
#include <cvSelectionAnnotation.h>


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< cvAnnotation > | allAnnotations () 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... | |
Selection annotation manager.
Manages text annotations for selections:
Based on ParaView's annotation functionality.
Definition at line 112 of file cvSelectionAnnotation.h.
|
explicit |
Definition at line 37 of file cvSelectionAnnotation.cpp.
References CVLog::PrintVerbose().
|
override |
Definition at line 43 of file cvSelectionAnnotation.cpp.
References clearAll().
| QString cvSelectionAnnotationManager::addAnnotation | ( | const cvSelectionData & | selection, |
| const QString & | text, | ||
| bool | autoPosition = true |
||
| ) |
Add annotation for a selection.
| selection | Selection data |
| text | Annotation text |
| autoPosition | If true, position at selection center |
Definition at line 51 of file cvSelectionAnnotation.cpp.
References annotationAdded(), annotationsChanged(), cvAnnotation::bold, 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, cvAnnotation::color, cvAnnotation::followSelection, cvAnnotation::fontFamily, cvAnnotation::fontSize, cvAnnotation::horizontalJustification, cvAnnotation::id, cvSelectionData::isEmpty(), cvAnnotation::italic, cvAnnotation::opacity, cvAnnotation::position, CVLog::Print(), CVLog::PrintVerbose(), cvAnnotation::shadow, cvAnnotation::text, cvAnnotation::verticalJustification, and CVLog::Warning().
| QString cvSelectionAnnotationManager::addAnnotationAt | ( | const QString & | text, |
| const double | position[3], | ||
| const QString & | id = QString() |
||
| ) |
Add annotation at specific position.
| text | Annotation text |
| position | 3D position |
| id | Optional custom ID |
Definition at line 126 of file cvSelectionAnnotation.cpp.
References annotationAdded(), annotationsChanged(), cvAnnotation::bold, 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, cvAnnotation::color, cvAnnotation::fontFamily, cvAnnotation::fontSize, cvAnnotation::horizontalJustification, cvAnnotation::italic, cvAnnotation::opacity, position, CVLog::Print(), cvAnnotation::shadow, and cvAnnotation::verticalJustification.
| QList< cvAnnotation > cvSelectionAnnotationManager::allAnnotations | ( | ) | const |
Get all annotations.
Definition at line 332 of file cvSelectionAnnotation.cpp.
|
signal |
Emitted when annotation is added.
Referenced by addAnnotation(), and addAnnotationAt().
| QStringList cvSelectionAnnotationManager::annotationIds | ( | ) | const |
Get annotation IDs.
Definition at line 337 of file cvSelectionAnnotation.cpp.
|
signal |
Emitted when annotation is removed.
Referenced by removeAnnotation().
|
signal |
Emitted when annotations change.
Referenced by addAnnotation(), addAnnotationAt(), applyLabelProperties(), clearAll(), hideAll(), importFromFile(), removeAnnotation(), showAll(), and updateAnnotationText().
|
signal |
Emitted when annotation is updated.
Referenced by setAnnotationColor(), setAnnotationFontSize(), setAnnotationVisible(), updateAnnotationPosition(), and updateAnnotationText().
| void cvSelectionAnnotationManager::applyLabelProperties | ( | const cvSelectionLabelPropertiesDialog::LabelProperties & | props, |
| bool | isCellLabel | ||
| ) |
Apply label properties to all annotations (for cell or point labels)
| props | Label properties from dialog |
| isCellLabel | If 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.
| void cvSelectionAnnotationManager::clearAll | ( | ) |
Clear all annotations.
Definition at line 342 of file cvSelectionAnnotation.cpp.
References annotationsChanged(), and CVLog::Print().
Referenced by importFromFile(), and ~cvSelectionAnnotationManager().
|
inline |
Get annotation count.
Definition at line 234 of file cvSelectionAnnotation.h.
| bool cvSelectionAnnotationManager::exportToFile | ( | const QString & | filename | ) | const |
Export annotations to JSON file.
| filename | Output filename |
Definition at line 377 of file cvSelectionAnnotation.cpp.
References CVLog::Error(), filename, and CVLog::Print().
| cvAnnotation cvSelectionAnnotationManager::getAnnotation | ( | const QString & | id | ) | const |
Get annotation.
| id | Annotation ID |
Definition at line 326 of file cvSelectionAnnotation.cpp.
| void cvSelectionAnnotationManager::hideAll | ( | ) |
Hide all annotations.
Definition at line 367 of file cvSelectionAnnotation.cpp.
References annotationsChanged().
| bool cvSelectionAnnotationManager::importFromFile | ( | const QString & | filename, |
| bool | merge = true |
||
| ) |
Import annotations from JSON file.
| filename | Input filename |
| merge | If true, merge; if false, replace |
Definition at line 439 of file cvSelectionAnnotation.cpp.
References annotationsChanged(), cvAnnotation::bold, clearAll(), cvAnnotation::color, data, CVLog::Error(), filename, cvAnnotation::followSelection, cvAnnotation::fontFamily, cvAnnotation::fontSize, cvAnnotation::horizontalJustification, cvAnnotation::italic, cvAnnotation::opacity, position, CVLog::Print(), cvAnnotation::shadow, cvAnnotation::timestamp, cvAnnotation::verticalJustification, and cvAnnotation::visible.
| bool cvSelectionAnnotationManager::removeAnnotation | ( | const QString & | id | ) |
Remove annotation.
| id | Annotation ID |
Definition at line 166 of file cvSelectionAnnotation.cpp.
References annotationRemoved(), annotationsChanged(), CVLog::Print(), and CVLog::Warning().
| bool cvSelectionAnnotationManager::setAnnotationColor | ( | const QString & | id, |
| const QColor & | color | ||
| ) |
Set annotation color.
| id | Annotation ID |
| color | Text color |
Definition at line 236 of file cvSelectionAnnotation.cpp.
References annotationUpdated(), and color.
| bool cvSelectionAnnotationManager::setAnnotationFontSize | ( | const QString & | id, |
| int | fontSize | ||
| ) |
Set annotation font size.
| id | Annotation ID |
| fontSize | Font size in points |
Definition at line 251 of file cvSelectionAnnotation.cpp.
References annotationUpdated().
| bool cvSelectionAnnotationManager::setAnnotationVisible | ( | const QString & | id, |
| bool | visible | ||
| ) |
Set annotation visibility.
| id | Annotation ID |
| visible | Visibility flag |
Definition at line 221 of file cvSelectionAnnotation.cpp.
References annotationUpdated().
| void cvSelectionAnnotationManager::setDefaultLabelProperties | ( | const cvSelectionLabelPropertiesDialog::LabelProperties & | props, |
| bool | isCellLabel | ||
| ) |
Set default label properties for new annotations.
| props | Label properties from dialog |
| isCellLabel | If 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().
| void cvSelectionAnnotationManager::setVisualizer | ( | PclUtils::PCLVis * | viewer | ) |
Set the visualizer.
Definition at line 46 of file cvSelectionAnnotation.cpp.
Referenced by cvViewSelectionManager::setVisualizer().
| void cvSelectionAnnotationManager::showAll | ( | ) |
Show all annotations.
Definition at line 357 of file cvSelectionAnnotation.cpp.
References annotationsChanged().
| bool cvSelectionAnnotationManager::updateAnnotationPosition | ( | const QString & | id, |
| const double | position[3] | ||
| ) |
Update annotation position.
| id | Annotation ID |
| position | New position |
Definition at line 204 of file cvSelectionAnnotation.cpp.
References annotationUpdated(), and position.
| bool cvSelectionAnnotationManager::updateAnnotationText | ( | const QString & | id, |
| const QString & | text | ||
| ) |
Update annotation text.
| id | Annotation ID |
| text | New text |
Definition at line 188 of file cvSelectionAnnotation.cpp.
References annotationsChanged(), and annotationUpdated().