ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ecvAnnotationsTool.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 // LOCAL
11 #include <ecvOverlayDialog.h>
12 #include <ui_annotationsDlg.h>
13 
14 // CV_DB_LIB
15 #include <ecvBBox.h>
16 #include <ecvDisplayTools.h>
17 
18 // SYSTEM
19 #include <vector>
20 
22 class ecvProgressDialog;
23 class ccHObject;
24 class ccBBox;
26 
28 class ecvAnnotationsTool : public ccOverlayDialog, public Ui::AnnotationsDlg {
29  Q_OBJECT
30 
31 public:
33  explicit ecvAnnotationsTool(QWidget* parent);
35  virtual ~ecvAnnotationsTool() override;
36 
37  // inherited from ccOverlayDialog
38  virtual bool start() override;
39  virtual void stop(bool state) override;
40  virtual bool linkWith(QWidget* win) override;
41 
42  bool setAnnotationsTool(ecvGenericAnnotationTool* annotationTool);
43 
45 
47  bool addAssociatedEntity(ccHObject* anObject);
48 
50 
52  unsigned getNumberOfAssociatedEntity() const;
53 
54 public slots:
55  void toggleInteractors(bool state);
56  void toggleEditMode(bool state);
57 
58 protected slots:
60  void onShortcutTriggered(int);
61 
62  void importClassesFromFile();
63  void toggleBox(bool);
64  void toggleOrigin(bool dummy);
65 
66  void onNewMode();
67  void onUnionMode();
68  void onTrimMode();
69  void onIntersectMode();
70  void onLabelSelected();
71  void onLabelChanged(int index);
72  void onItemPicked(bool isPicked);
73 
74  void saveAnnotations();
75  void reset();
76  void closeDialog();
77  void exportAnnotationToSF();
78  void updateLabelsCombox(const std::vector<std::string>& labels);
79 
80  inline void shiftXMinus() { shiftBox(0, true); }
81  inline void shiftXPlus() { shiftBox(0, false); }
82  inline void shiftYMinus() { shiftBox(1, true); }
83  inline void shiftYPlus() { shiftBox(1, false); }
84  inline void shiftZMinus() { shiftBox(2, true); }
85  inline void shiftZPlus() { shiftBox(2, false); }
86 
87  void setFrontView();
88  void setBottomView();
89  void setTopView();
90  void setBackView();
91  void setLeftView();
92  void setRightView();
93 
94 protected:
96  void shiftBox(unsigned char dim, bool minus);
97 
99  void setView(CC_VIEW_ORIENTATION orientation);
100 
103 
105 
108 
111 
114 
116 };
CC_VIEW_ORIENTATION
View orientation.
Definition: CVConst.h:102
#define slots
Bounding box structure.
Definition: ecvBBox.h:25
A 3D cloud interface with associated features (color, normals, octree, etc.)
Hierarchical CLOUDVIEWER Object.
Definition: ecvHObject.h:25
Generic overlay dialog interface.
Dialog for managing a clipping box.
ecvGenericAnnotationTool * m_annotationTool
Annotation tool.
bool addAssociatedEntity(ccHObject *anObject)
Adds an entity.
void toggleOrigin(bool dummy)
virtual void stop(bool state) override
Stops process/dialog.
virtual bool linkWith(QWidget *win) override
Links the overlay dialog with a MDI window.
ecvAnnotationsTool(QWidget *parent)
Default constructor.
void toggleInteractors(bool state)
void onLabelChanged(int index)
bool m_disabledCombEvent
for solving dummy event trigger
virtual bool start() override
Starts process.
void updateLabelsCombox(const std::vector< std::string > &labels)
virtual ~ecvAnnotationsTool() override
Default destructor.
void onShortcutTriggered(int)
To capture overridden shortcuts (pause button, etc.)
ccHObject m_entityContainer
Associated entities container.
void shiftBox(unsigned char dim, bool minus)
Shift box.
void setView(CC_VIEW_ORIENTATION orientation)
Sets predefined view.
void onItemPicked(bool isPicked)
unsigned getNumberOfAssociatedEntity() const
Returns the current number of associated entities.
void toggleEditMode(bool state)
ccBBox m_box
bounding box
bool setAnnotationsTool(ecvGenericAnnotationTool *annotationTool)
Generic Annotation Tool interface.
Graphical progress indicator (thread-safe)