28 #include <QFileDialog>
47 m_decomposition(decomposition),
48 m_pc(pc), m_parent(parent),
49 m_treeWidget(treeWidget),
50 m_renderWindow(window)
54 m_dialog =
new ReconstructViaExtendedMarchingCubesDialog;
58 dialog->setWindowTitle(
"Extended Marching Cubes");
64 dialog->activateWindow();
81 QCheckBox* ransac_box =
m_dialog->checkBox_RANSAC;
84 ransac_box->setChecked(
false);
85 ransac_box->setCheckable(
false);
89 ransac_box->setCheckable(
true);
95 QComboBox* gs_box =
m_dialog->comboBox_gs;
97 QLabel* label =
m_dialog->label_below_gs;
98 QDoubleSpinBox* spinBox =
m_dialog->spinBox_below_gs;
103 label->setText(
"Voxel size");
104 spinBox->setMinimum(0);
105 spinBox->setMaximum(2000000);
106 spinBox->setSingleStep(1);
107 spinBox->setValue(10);
111 label->setText(
"Number of intersections");
112 spinBox->setMinimum(1);
113 spinBox->setMaximum(200000);
114 spinBox->setSingleStep(1);
115 spinBox->setValue(10);
123 QComboBox* pcm_box =
m_dialog->comboBox_pcm;
124 string pcm = pcm_box->currentText().toStdString();
125 QCheckBox* extrusion_box =
m_dialog->checkBox_Extrusion;
126 bool extrusion = extrusion_box->isChecked();
127 QCheckBox* ransac_box =
m_dialog->checkBox_RANSAC;
128 bool ransac = ransac_box->isChecked();
129 QSpinBox* kn_box =
m_dialog->spinBox_kn;
130 int kn = kn_box->value();
131 QSpinBox* kd_box =
m_dialog->spinBox_kd;
132 int kd = kd_box->value();
133 QSpinBox* ki_box =
m_dialog->spinBox_ki;
134 int ki = ki_box->value();
135 QCheckBox* reNormals_box =
m_dialog->checkBox_renormals;
136 bool reestimateNormals = reNormals_box->isChecked();
137 QComboBox* gridMode_box =
m_dialog->comboBox_gs;
138 bool useVoxelsize = (gridMode_box->currentIndex() == 0) ?
true :
false;
139 QDoubleSpinBox* gridSize_box =
m_dialog->spinBox_below_gs;
140 float resolution = (float)gridSize_box->value();
142 float sf =
m_dialog->doubleSpinBox_sf->value();
143 float sc =
m_dialog->doubleSpinBox_sc->value();
150 if(pcm ==
"STANN" || pcm ==
"FLANN" || pcm ==
"NABO" || pcm ==
"NANOFLANN")
155 if(!surface->pointBuffer()->hasNormals() || reestimateNormals)
157 surface->calculateSurfaceNormals();
164 auto grid = std::make_shared<PointsetGrid<Vec, SharpBox<Vec>>>(
167 surface->getBoundingBox(),
172 grid->calcDistanceValues();
173 auto reconstruction = make_unique<FastReconstruction<Vec, SharpBox<Vec>>>(grid);
177 reconstruction->getMesh(
mesh);
200 vtkSmartPointer<vtkRenderer> renderer =
m_renderWindow->GetRenderers()->GetFirstRenderer();
201 bridge->addActors(renderer);