ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ecvComputeOctreeDlg.cpp
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 #include "ecvComputeOctreeDlg.h"
9 
10 // Local
12 
13 // CV_DB_LIB
14 #include <ecvOctree.h>
15 
17  double minCellSize,
18  QWidget* parent /*=0*/)
19  : QDialog(parent), Ui::ComputeOctreeDialog(), m_bbEditorDlg(0) {
20  setupUi(this);
21 
22  headerLabel->setText(QString("Max subdivision level: %1")
24 
25  // minimum cell size
26  if (minCellSize > 0.0) {
27  cellSizeDoubleSpinBox->setMinimum(minCellSize);
28  cellSizeDoubleSpinBox->setMaximum(1.0e9);
29  } else {
31  "[ccComputeOctreeDlg] Invalid minimum cell size specified!");
32  cellSizeRadioButton->setEnabled(false);
33  }
34 
35  // custom bbox editor
36  if (baseBBox.isValid()) {
38  m_bbEditorDlg->setBaseBBox(baseBBox, true);
40  connect(customBBToolButton, &QAbstractButton::clicked, m_bbEditorDlg,
42  } else {
44  "[ccComputeOctreeDlg] Invalid base bounding-box specified!");
45  customBBRadioButton->setEnabled(false);
46  }
47 }
48 
50  // defaultRadioButton
51  if (cellSizeRadioButton->isChecked())
52  return MIN_CELL_SIZE;
53  else if (customBBRadioButton->isChecked())
54  return CUSTOM_BBOX;
55 
56  assert(defaultRadioButton->isChecked());
57  return DEFAULT;
58 }
59 
61  return cellSizeDoubleSpinBox->value();
62 }
63 
65  return (m_bbEditorDlg ? m_bbEditorDlg->getBox() : ccBBox());
66 }
static bool Warning(const char *format,...)
Prints out a formatted warning message in console.
Definition: CVLog.cpp:133
Bounding box structure.
Definition: ecvBBox.h:25
Dialog to define the extents of a 3D box.
void forceKeepSquare(bool state)
Forces the 'keep square' mode.
const ccBBox & getBox() const
Returns bounding box.
void setBaseBBox(const ccBBox &box, bool isMinimal=true)
Sets the (minimal) base box.
ComputationMode getMode() const
Returns octree computation mode.
double getMinCellSize() const
Returns cell size at max level.
ccBBox getCustomBBox() const
Returns custom bbox.
ccComputeOctreeDlg(const ccBBox &baseBBox, double minCellSize, QWidget *parent=0)
Default constructor.
ccBoundingBoxEditorDlg * m_bbEditorDlg
Associated dialog.
ComputationMode
Computation mode.
bool isValid() const
Returns whether bounding box is valid or not.
Definition: BoundingBox.h:203
static const int MAX_OCTREE_LEVEL
Max octree subdivision level.
Definition: DgmOctree.h:67