28 #include <QFileDialog>
30 #include <Eigen/Dense>
67 QApplication::processEvents();
73 QApplication::processEvents();
77 m_decomposition(decomposition),
78 m_pc(pc), m_parent(parent),
79 m_treeWidget(treeWidget),
80 m_renderWindow(window)
86 m_dialog =
new ReconstructViaMarchingCubesDialog;
89 if(decomposition ==
"PMC")
91 dialog->setWindowTitle(
"Planar Marching Cubes");
114 dialog->activateWindow();
133 QCheckBox* ransac_box =
m_dialog->checkBox_RANSAC;
136 ransac_box->setChecked(
false);
137 ransac_box->setCheckable(
false);
141 ransac_box->setCheckable(
true);
147 QComboBox* gs_box =
m_dialog->comboBox_gs;
149 QLabel* label =
m_dialog->label_below_gs;
150 QDoubleSpinBox* spinBox =
m_dialog->spinBox_below_gs;
155 label->setText(
"Voxel size");
156 spinBox->setMinimum(0);
157 spinBox->setMaximum(2000000);
158 spinBox->setSingleStep(1);
159 spinBox->setValue(10);
163 label->setText(
"Number of intersections");
164 spinBox->setMinimum(1);
165 spinBox->setMaximum(200000);
166 spinBox->setSingleStep(1);
167 spinBox->setValue(10);
173 QComboBox* pcm_box =
m_dialog->comboBox_pcm;
174 string pcm = pcm_box->currentText().toStdString();
175 QCheckBox* extrusion_box =
m_dialog->checkBox_Extrusion;
176 bool extrusion = extrusion_box->isChecked();
177 QCheckBox* ransac_box =
m_dialog->checkBox_RANSAC;
178 bool ransac = ransac_box->isChecked();
179 QSpinBox* kn_box =
m_dialog->spinBox_kn;
180 int kn = kn_box->value();
181 QSpinBox* kd_box =
m_dialog->spinBox_kd;
182 int kd = kd_box->value();
183 QSpinBox* ki_box =
m_dialog->spinBox_ki;
184 int ki = ki_box->value();
185 QCheckBox* reNormals_box =
m_dialog->checkBox_renormals;
186 bool reestimateNormals = reNormals_box->isChecked();
187 QComboBox* gridMode_box =
m_dialog->comboBox_gs;
188 bool useVoxelsize = (gridMode_box->currentIndex() == 0) ?
true :
false;
189 QDoubleSpinBox* gridSize_box =
m_dialog->spinBox_below_gs;
190 float resolution = (float)gridSize_box->value();
199 QTreeWidgetItem* entry_point =
m_parent;
211 std::cout << T << std::endl;
217 if(pcm ==
"STANN" || pcm ==
"FLANN" || pcm ==
"NABO" || pcm ==
"NANOFLANN")
222 if(!surface->pointBuffer()->hasNormals() || reestimateNormals)
224 surface->calculateSurfaceNormals();
231 auto grid = std::make_shared<PointsetGrid<Vec, FastBox<Vec>>>(
234 surface->getBoundingBox(),
238 grid->calcDistanceValues();
239 auto reconstruction = make_unique<FastReconstruction<Vec, FastBox<Vec>>>(grid);
240 reconstruction->getMesh(
mesh);
245 auto grid = std::make_shared<PointsetGrid<Vec, BilinearFastBox<Vec>>>(
248 surface->getBoundingBox(),
252 grid->calcDistanceValues();
253 auto reconstruction = make_unique<FastReconstruction<Vec, BilinearFastBox<Vec>>>(grid);
254 reconstruction->getMesh(
mesh);
258 auto grid = std::make_shared<PointsetGrid<Vec, TetraederBox<Vec>>>(
261 surface->getBoundingBox(),
265 grid->calcDistanceValues();
266 auto reconstruction = make_unique<FastReconstruction<Vec, TetraederBox<Vec>>>(grid);
267 reconstruction->getMesh(
mesh);
272 auto grid = std::make_shared<PointsetGrid<Vec, SharpBox<Vec>>>(
275 surface->getBoundingBox(),
279 grid->calcDistanceValues();
280 auto reconstruction = make_unique<FastReconstruction<Vec, SharpBox<Vec>>>(grid);
281 reconstruction->getMesh(
mesh);
305 vtkSmartPointer<vtkRenderer> renderer =
m_renderWindow->GetRenderers()->GetFirstRenderer();
306 bridge->addActors(renderer);
308 QString base(
"mesh");
312 base =
m_parent->text(0) +
" (mesh)";