29 #include <QMessageBox>
34 m_entityContainer(
"entities"),
39 connect(importClassSetsButton, &QToolButton::clicked,
this,
41 connect(saveButton, &QToolButton::clicked,
this,
43 connect(resetButton, &QToolButton::clicked,
this,
45 connect(closeButton, &QToolButton::clicked,
this,
47 connect(exportCloudWithAnnotations, &QToolButton::clicked,
this,
50 connect(editToolButton, &QToolButton::toggled,
this,
53 connect(pauseToolButton, &QToolButton::toggled,
this,
55 connect(showBoxToolButton, &QToolButton::toggled,
this,
57 connect(showOriginToolButton, &QToolButton::toggled,
this,
60 connect(minusXShiftToolButton, &QToolButton::clicked,
this,
62 connect(plusXShiftToolButton, &QToolButton::clicked,
this,
64 connect(minusYShiftToolButton, &QToolButton::clicked,
this,
66 connect(plusYShiftToolButton, &QToolButton::clicked,
this,
68 connect(minusZShiftToolButton, &QToolButton::clicked,
this,
70 connect(plusZShiftToolButton, &QToolButton::clicked,
this,
73 viewButtonsFrame->setEnabled(
true);
74 connect(viewUpToolButton, &QToolButton::clicked,
this,
76 connect(viewDownToolButton, &QToolButton::clicked,
this,
78 connect(viewFrontToolButton, &QToolButton::clicked,
this,
80 connect(viewBackToolButton, &QToolButton::clicked,
this,
82 connect(viewLeftToolButton, &QToolButton::clicked,
this,
84 connect(viewRightToolButton, &QToolButton::clicked,
this,
87 connect(newModeButton, &QToolButton::clicked,
this,
89 connect(unionModeButton, &QToolButton::clicked,
this,
91 connect(trimModeButton, &QToolButton::clicked,
this,
93 connect(intersectModeButton, &QToolButton::clicked,
this,
95 connect(labelSelectedButton, &QToolButton::clicked,
this,
97 connect(labelsComboBox,
98 static_cast<void (QComboBox::*)(
int)
>(
99 &QComboBox::currentIndexChanged),
128 if (annotationTool) {
140 showBoxToolButton->toggle();
144 pauseToolButton->toggle();
148 labelSelectedButton->click();
152 resetButton->click();
160 intersectModeButton->click();
164 unionModeButton->click();
168 newModeButton->click();
171 trimModeButton->click();
208 int curIndex = labelsComboBox->currentIndex();
219 backColor = QColor(col.
r, col.
g, col.
b);
222 QPalette pal = labelsComboBox->palette();
223 pal.setColor(QPalette::Base, backColor);
224 labelsComboBox->setPalette(pal);
226 QString text = labelsComboBox->currentText();
227 labelsComboBox->clearFocus();
231 editToolButton->toggle();
261 QString filters =
"*.classes";
262 QString selectedFilter = filters;
263 QString selectedFilename = QFileDialog::getOpenFileName(
264 this, tr(
"import class sets"), currentPath, filters,
267 if (selectedFilename.isEmpty()) {
273 currentPath = QFileInfo(selectedFilename).absolutePath();
281 std::vector<std::string> labels;
290 "[ecvAnnotationsTool::toggleBox] Annotations tool has not been "
306 "[ecvAnnotationsTool::toggleBox] Annotations tool has not been "
311 if (showOriginToolButton->isChecked()) {
331 QString(
"[ecvAnnotationsTool::addAssociatedEntity] No "
332 "associated annotation Tool!"));
338 classSetsGroupBox->setEnabled(
true);
377 std::vector<std::string> labels;
380 if (pauseToolButton->isChecked()) {
381 pauseToolButton->setChecked(
false);
384 if (showOriginToolButton->isChecked()) {
385 showOriginToolButton->setChecked(
false);
391 exportCloudWithAnnotations->setEnabled(
false);
394 exportCloudWithAnnotations->setEnabled(
true);
406 if (!pauseToolButton->isChecked()) {
407 pauseToolButton->setChecked(
true);
410 if (!showOriginToolButton->isChecked()) {
411 showOriginToolButton->setChecked(
true);
423 const std::vector<std::string>& labels) {
424 if (labels.empty())
return;
428 labelsComboBox->clear();
429 for (
size_t i = 0; i < labels.size(); ++i) {
431 labelsComboBox->addItem(
name);
436 QColor backColor(col.
r, col.
g, col.
b);
437 labelsComboBox->setItemData(
static_cast<int>(i), backColor,
441 QPalette pal = labelsComboBox->palette();
442 pal.setColor(QPalette::Base, QColor(
Qt::white));
443 labelsComboBox->setPalette(pal);
463 if (QMessageBox::question(
this, tr(
"Quit"),
464 tr(
"Are you sure you want to quit Annotation?"),
466 QMessageBox::Cancel) == QMessageBox::Ok) {
473 std::vector<int> annotations;
476 "[ecvAnnotationsTool::exportAnnotationToSF] Export "
477 "Annotation To SF failed!");
480 std::vector<std::vector<int>> annosVector;
481 annosVector.push_back(annotations);
482 std::vector<std::vector<ScalarType>> scalarsVector;
483 ccEntityAction::ConvertToScalarType<int>(annosVector, scalarsVector);
489 "[ecvAnnotationsTool::exportAnnotationToSF] Import sf "
494 "[ecvAnnotationsTool::exportAnnotationToSF] "
495 "Export annotations to sf successfully, please change the "
496 "colors mode to scalar filed!");
CC_VIEW_ORIENTATION
View orientation.
static bool Warning(const char *format,...)
Prints out a formatted warning message in console.
static bool Print(const char *format,...)
Prints out a formatted message in console.
static bool Error(const char *format,...)
Display an error dialog with formatted message.
virtual void setVisible(bool state)
Sets entity visibility.
virtual void showSF(bool state)
Sets active scalarfield visibility.
static ccPointCloud * ToPointCloud(ccHObject *obj, bool *isLockedVertices=nullptr)
Converts current object to 'equivalent' ccPointCloud.
Hierarchical CLOUDVIEWER Object.
void removeAllChildren()
Removes all children.
virtual ccBBox getDisplayBB_recursive(bool relative)
Returns the bounding-box of this entity and it's children WHEN DISPLAYED.
ccHObject * getFirstChild() const
Shortcut: returns first child.
unsigned getChildrenNumber() const
Returns the number of children.
virtual bool addChild(ccHObject *child, int dependencyFlags=DP_PARENT_OF_OTHER, int insertIndex=-1)
Adds a child.
virtual ccBBox getBB_recursive(bool withGLFeatures=false, bool onlyEnabledChildren=true)
Returns the bounding-box of this entity and it's children.
std::vector< ccHObject * > Container
Standard instances container (for children, etc.)
virtual void setEnabled(bool state)
Sets the "enabled" property.
bool isKindOf(CV_CLASS_ENUM type) const
Generic overlay dialog interface.
void shortcutTriggered(int key)
Signal emitted when an overridden key shortcut is pressed.
virtual void stop(bool accepted)
Stops process/dialog.
virtual bool start()
Starts process.
bool m_processing
Running/processing state.
virtual bool linkWith(QWidget *win)
Links the overlay dialog with a MDI window.
void addOverridenShortcut(Qt::Key key)
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
void clear()
Resets the bounding box.
bool isValid() const
Returns whether bounding box is valid or not.
static const QString CurrentPath()
static const QString LoadFile()
static QVariant getValue(const QString §ion, const QString &key, const QVariant &defaultValue=QVariant())
static void setValue(const QString §ion, const QString &key, const QVariant &value)
bool importToSF(const ccHObject::Container &selectedEntities, const std::vector< std::vector< ScalarType >> &scalarsVector, const std::string &name)
constexpr Rgb white(MAX, MAX, MAX)
QString defaultDocPath()
Shortcut for getting the documents location path.