ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ecvBoundingBoxEditorDlg.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 #include <ui_boundingBoxEditorDlg.h>
11 
12 // CV_DB_LIB
13 #include <ecvBBox.h>
14 
16 class ccBoundingBoxEditorDlg : public QDialog,
17  public Ui::BoundingBoxEditorDialog {
18  Q_OBJECT
19 
20 public:
22  explicit ccBoundingBoxEditorDlg(QWidget* parent = 0);
23 
25  const ccBBox& getBox() const { return m_currentBBox; }
26 
28 
32  void setBaseBBox(const ccBBox& box, bool isMinimal = true);
33 
35  void setBoxAxes(const CCVector3& X, const CCVector3& Y, const CCVector3& Z);
36 
39 
42 
44  void showInclusionWarning(bool state) { m_showInclusionWarning = state; }
45 
47  void forceKeepSquare(bool state);
48 
50  bool keepSquare() const;
51 
53  void set2DMode(bool state, unsigned char dim);
54 
56  void showBoxAxes(bool state);
57 
58 public slots:
59 
60  // overloaded from QDialog
61  virtual int exec();
62 
63 protected slots:
64 
65  void squareModeActivated(bool);
66  void resetToDefault();
67  void resetToLast();
68  void cancel();
69  void saveBoxAndAccept();
70 
71  void updateXWidth(double);
72  void updateYWidth(double);
73  void updateZWidth(double);
74 
76  void updateCurrentBBox(double dummy = 0.0);
78  void reflectChanges(int dummy = 0);
79 
81  void onAxisValueChanged(double);
82 
83  void fromClipboardClicked();
84  void toClipboardClicked();
85 
86 protected:
88  void checkBaseInclusion();
89 
92 
95 
98 
101 
104 };
#define slots
void * X
Definition: SmallVector.cpp:45
Bounding box structure.
Definition: ecvBBox.h:25
Dialog to define the extents of a 3D box.
void showInclusionWarning(bool state)
void showBoxAxes(bool state)
Whether to display or not the box axes.
void updateCurrentBBox(double dummy=0.0)
Updates current box based on the dialog state.
void forceKeepSquare(bool state)
Forces the 'keep square' mode.
const ccBBox & getBox() const
Returns bounding box.
ccBBox m_baseBBox
Base box (invalid if none)
void onAxisValueChanged(double)
Slot called anytime a component of the box axes is modified.
void getBoxAxes(CCVector3d &X, CCVector3d &Y, CCVector3d &Z)
Returns the box axes.
void checkBaseInclusion()
Checks if currentBox includes baseBox.
bool m_baseBoxIsMinimal
Whether base box is minimal or not.
void set2DMode(bool state, unsigned char dim)
Sets 2D mode (the line 'dim' will be hidden)
void reflectChanges(int dummy=0)
Reflects changes on bbox.
ccBBox m_initBBox
Box state at dialog start.
ccBBox m_currentBBox
Current box.
ccBoundingBoxEditorDlg(QWidget *parent=0)
Default constructor.
void setBaseBBox(const ccBBox &box, bool isMinimal=true)
Sets the (minimal) base box.
bool m_showInclusionWarning
Whether to show 'inclusion' warning or not.
bool keepSquare() const
Returns whether 'keep square' mode is enabled or not.
void setBoxAxes(const CCVector3 &X, const CCVector3 &Y, const CCVector3 &Z)
Sets the box axes.