 |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
Go to the documentation of this file.
12 #include <QtGui/QColor>
13 #include <QtCore/QDateTime>
14 #include <QtGui/QFont>
15 #include <QtCore/QList>
16 #include <QtCore/QMap>
17 #include <QtCore/QObject>
18 #include <QtCore/QString>
66 horizontalJustification(
"Left"),
67 verticalJustification(
"Bottom"),
69 followSelection(false),
77 const QString& uid = QString())
80 ? QString::number(QDateTime::currentMSecsSinceEpoch())
88 horizontalJustification(
"Left"),
89 verticalJustification(
"Bottom"),
91 followSelection(false),
92 timestamp(QDateTime::currentMSecsSinceEpoch()) {
133 bool autoPosition =
true);
142 QString addAnnotationAt(
const QString& text,
144 const QString&
id = QString());
151 bool removeAnnotation(
const QString&
id);
159 bool updateAnnotationText(
const QString&
id,
const QString& text);
167 bool updateAnnotationPosition(
const QString&
id,
const double position[3]);
175 bool setAnnotationVisible(
const QString&
id,
bool visible);
183 bool setAnnotationColor(
const QString&
id,
const QColor&
color);
191 bool setAnnotationFontSize(
const QString&
id,
int fontSize);
200 void applyLabelProperties(
210 void setDefaultLabelProperties(
224 QList<cvAnnotation> allAnnotations()
const;
229 QStringList annotationIds()
const;
234 int count()
const {
return m_annotations.size(); }
256 bool exportToFile(
const QString&
filename)
const;
264 bool importFromFile(
const QString&
filename,
bool merge =
true);
270 void annotationsChanged();
275 void annotationAdded(
const QString&
id);
280 void annotationRemoved(
const QString&
id);
285 void annotationUpdated(
const QString&
id);
289 void updateTextActor(
const QString&
id);
290 void removeTextActor(
const QString&
id);
292 vtkPolyData* polyData);
300 bool worldToDisplay(
const double worldPos[3],
double displayPos[2]);
303 QMap<QString, cvAnnotation> m_annotations;
304 QMap<QString, vtkSmartPointer<vtkTextActor>> m_textActors;
std::string filename
Definition: PointCloudIO.cpp:47
bool italic
Italic flag.
Definition: cvSelectionAnnotation.h:50
void hideAll()
Hide all annotations.
Definition: cvSelectionAnnotation.cpp:367
void applyLabelProperties(const cvSelectionLabelPropertiesDialog::LabelProperties &props, bool isCellLabel)
Apply label properties to all annotations (for cell or point labels)
Definition: cvSelectionAnnotation.cpp:266
int count() const
Get annotation count.
Definition: cvSelectionAnnotation.h:234
FieldAssociation fieldAssociation() const
Get field association.
Definition: cvSelectionData.h:193
GraphType data
Definition: graph_cut.cc:138
~cvSelectionAnnotationManager() override
Definition: cvSelectionAnnotation.cpp:43
int pointLabelFontSize
Definition: cvSelectionLabelPropertiesDialog.h:71
QColor pointLabelColor
Definition: cvSelectionLabelPropertiesDialog.h:72
static bool PrintVerbose(const char *format,...)
Prints out a verbose formatted message in console.
Definition: CVLog.cpp:103
math::float3 position
Definition: LineSetBuffers.cpp:44
vtkRenderer * getCurrentRenderer(int viewport=0)
Definition: PCLVis.cpp:2924
#define signals
Definition: PythonPlugin.cpp:26
QColor color
Text color.
Definition: cvSelectionAnnotation.h:46
void clearAll()
Clear all annotations.
Definition: cvSelectionAnnotation.cpp:342
static bool Print(const char *format,...)
Prints out a formatted message in console.
Definition: CVLog.cpp:113
bool cellLabelShadow
Definition: cvSelectionLabelPropertiesDialog.h:61
bool removeAnnotation(const QString &id)
Remove annotation.
Definition: cvSelectionAnnotation.cpp:166
QString cellLabelHorizontalJustification
Definition: cvSelectionLabelPropertiesDialog.h:63
bool cellLabelItalic
Definition: cvSelectionLabelPropertiesDialog.h:60
Definition: WidgetMap.h:20
Definition: CustomContextItem.cpp:18
bool visible
Visibility flag.
Definition: cvSelectionAnnotation.h:55
math::float4 color
Definition: LineSetBuffers.cpp:46
double opacity
Text opacity (0.0 to 1.0)
Definition: cvSelectionAnnotation.h:52
Label properties structure.
Definition: cvSelectionLabelPropertiesDialog.h:49
QString pointLabelHorizontalJustification
Definition: cvSelectionLabelPropertiesDialog.h:77
cvAnnotation(const QString &txt, const double pos[3], const QString &uid=QString())
Definition: cvSelectionAnnotation.h:75
qint64 timestamp
Creation timestamp.
Definition: cvSelectionAnnotation.h:57
void setDefaultLabelProperties(const cvSelectionLabelPropertiesDialog::LabelProperties &props, bool isCellLabel)
Set default label properties for new annotations.
Definition: cvSelectionAnnotation.cpp:305
double position[3]
3D position
Definition: cvSelectionAnnotation.h:45
bool importFromFile(const QString &filename, bool merge=true)
Import annotations from JSON file.
Definition: cvSelectionAnnotation.cpp:439
static bool Error(const char *format,...)
Display an error dialog with formatted message.
Definition: CVLog.cpp:143
cvAnnotation getAnnotation(const QString &id) const
Get annotation.
Definition: cvSelectionAnnotation.cpp:326
QString verticalJustification
"Top", "Center", "Bottom"
Definition: cvSelectionAnnotation.h:54
QString horizontalJustification
"Left", "Center", "Right"
Definition: cvSelectionAnnotation.h:53
QList< cvAnnotation > allAnnotations() const
Get all annotations.
Definition: cvSelectionAnnotation.cpp:332
bool followSelection
Auto-update position with selection.
Definition: cvSelectionAnnotation.h:56
bool shadow
Shadow flag.
Definition: cvSelectionAnnotation.h:51
bool pointLabelBold
Definition: cvSelectionLabelPropertiesDialog.h:73
int cellLabelFontSize
Definition: cvSelectionLabelPropertiesDialog.h:57
bool updateAnnotationPosition(const QString &id, const double position[3])
Update annotation position.
Definition: cvSelectionAnnotation.cpp:204
bool cellLabelBold
Definition: cvSelectionLabelPropertiesDialog.h:59
bool isEmpty() const
Check if selection is empty.
Definition: cvSelectionData.cpp:114
constexpr Rgb yellow(MAX, MAX, 0)
QString fontFamily
Font family (e.g., "Arial")
Definition: cvSelectionAnnotation.h:48
bool exportToFile(const QString &filename) const
Export annotations to JSON file.
Definition: cvSelectionAnnotation.cpp:377
void annotationRemoved(const QString &id)
Emitted when annotation is removed.
QStringList annotationIds() const
Get annotation IDs.
Definition: cvSelectionAnnotation.cpp:337
void showAll()
Show all annotations.
Definition: cvSelectionAnnotation.cpp:357
bool pointLabelItalic
Definition: cvSelectionLabelPropertiesDialog.h:74
bool pointLabelShadow
Definition: cvSelectionLabelPropertiesDialog.h:75
void setVisualizer(PclUtils::PCLVis *viewer)
Set the visualizer.
Definition: cvSelectionAnnotation.cpp:46
bool updateAnnotationText(const QString &id, const QString &text)
Update annotation text.
Definition: cvSelectionAnnotation.cpp:188
QString pointLabelVerticalJustification
Definition: cvSelectionLabelPropertiesDialog.h:79
QVector< qint64 > ids() const
Get selected IDs as a vector (copy)
Definition: cvSelectionData.cpp:124
bool setAnnotationColor(const QString &id, const QColor &color)
Set annotation color.
Definition: cvSelectionAnnotation.cpp:236
int fontSize
Font size in points.
Definition: cvSelectionAnnotation.h:47
@ POINTS
Selection applies to points.
Definition: cvSelectionData.h:143
QString pointLabelFontFamily
Definition: cvSelectionLabelPropertiesDialog.h:70
bool setAnnotationVisible(const QString &id, bool visible)
Set annotation visibility.
Definition: cvSelectionAnnotation.cpp:221
cvAnnotation()
Definition: cvSelectionAnnotation.h:59
double pointLabelOpacity
Definition: cvSelectionLabelPropertiesDialog.h:76
bool bold
Bold flag.
Definition: cvSelectionAnnotation.h:49
Encapsulates selection data without exposing VTK types.
Definition: cvSelectionData.h:136
static bool Warning(const char *format,...)
Prints out a formatted warning message in console.
Definition: CVLog.cpp:133
void annotationAdded(const QString &id)
Emitted when annotation is added.
#define QPCL_ENGINE_LIB_API
Definition: qPCL.h:15
Annotation for a selection.
Definition: cvSelectionAnnotation.h:42
QString cellLabelFontFamily
Definition: cvSelectionLabelPropertiesDialog.h:56
Selection annotation manager.
Definition: cvSelectionAnnotation.h:112
QString id
Unique ID.
Definition: cvSelectionAnnotation.h:44
QString cellLabelVerticalJustification
Definition: cvSelectionLabelPropertiesDialog.h:65
QString text
Annotation text.
Definition: cvSelectionAnnotation.h:43
cvSelectionAnnotationManager(QObject *parent=nullptr)
Definition: cvSelectionAnnotation.cpp:37
void annotationUpdated(const QString &id)
Emitted when annotation is updated.
bool setAnnotationFontSize(const QString &id, int fontSize)
Set annotation font size.
Definition: cvSelectionAnnotation.cpp:251
void annotationsChanged()
Emitted when annotations change.
QString addAnnotationAt(const QString &text, const double position[3], const QString &id=QString())
Add annotation at specific position.
Definition: cvSelectionAnnotation.cpp:126
double cellLabelOpacity
Definition: cvSelectionLabelPropertiesDialog.h:62
QColor cellLabelColor
Definition: cvSelectionLabelPropertiesDialog.h:58
QString addAnnotation(const cvSelectionData &selection, const QString &text, bool autoPosition=true)
Add annotation for a selection.
Definition: cvSelectionAnnotation.cpp:51