28 #include <QFileDialog> 30 #include <Eigen/Dense> 67 QApplication::processEvents();
73 QApplication::processEvents();
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)";
QTreeWidget * m_treeWidget
void setProgressValue(int v)
void setClusterColors(const ClusterMap< Rgb8Color > &colors)
void setProgressTitle(string)
virtual ~LVRReconstructViaMarchingCubesDialog()
void deleteSmallPlanarCluster(BaseMesh< BaseVecT > &mesh, ClusterBiMap< FaceHandle > &clusters, size_t smallClusterThreshold)
Removes all clusters and their cotained faces from the given mesh which are smaller than the given sm...
static void updateProgressbar(int p)
std::shared_ptr< MeshBuffer > MeshBufferPtr
Algorithm which generates the same color for all vertices, which are in the same cluster.
DenseVertexMap< Normal< typename BaseVecT::CoordType > > calcVertexNormals(const BaseMesh< BaseVecT > &mesh, const FaceMap< Normal< typename BaseVecT::CoordType >> &normals, const PointsetSurface< BaseVecT > &surface)
Calculates a normal for each vertex in the mesh.
void toggleRANSACcheckBox(const QString &text)
PointBufferPtr getPointBuffer()
void progressTitleChanged(const QString &)
DenseFaceMap< Normal< typename BaseVecT::CoordType > > calcFaceNormals(const BaseMesh< BaseVecT > &mesh)
Calculates a normal for each face in the mesh.
QTreeWidgetItem * m_parent
Class for calculating materials for each cluster of a given mesh.
void setVertexNormals(const VertexMap< Normal< typename BaseVecT::CoordType >> &normals)
LVRModelItem * m_generatedModel
std::shared_ptr< PointBuffer > PointBufferPtr
Main class for conversion of LVR model instances to vtk actors. This class parses the internal model ...
A map of clusters, which also saves a back-reference from handle to cluster.
Transform< double > Transformd
4x4 double precision transformation matrix
DenseClusterMap< Rgb8Color > simpsons(const BaseMesh< BaseVecT > &mesh) const
Assign a pseudo-color to each cluster.
vtkRenderWindow * m_renderWindow
Used for extended marching cubes Reconstruction.
boost::shared_ptr< LVRModelBridge > ModelBridgePtr
void setMaterializerResult(const MaterializerResult< BaseVecT > &materializerResult)
QProgressDialog * m_progressDialog
MaterializerResult< BaseVecT > generateMaterials()
Generates materials.
void progressValueChanged(int)
Half-edge data structure implementing the BaseMesh interface.
static void setProgressCallback(ProgressCallbackPtr)
Registers a callback that is called with the new value when the percentage of the progress changed...
A point cloud manager class that uses the STANN nearest neighbor search library to handle the data...
static LVRReconstructViaMarchingCubesDialog * m_master
static void setProgressTitleCallback(ProgressTitleCallbackPtr)
Registers a callback that is called when a new progress instance is created.
std::shared_ptr< Model > ModelPtr
ClusterBiMap< FaceHandle > planarClusterGrowing(const BaseMesh< BaseVecT > &mesh, const FaceMap< Normal< typename BaseVecT::CoordType >> &normals, float minSinAngle)
Algorithm which generates plane clusters from the given mesh.
MeshBufferPtr apply(const BaseMesh< BaseVecT > &mesh)
Result struct for the materializer.
Transformd getTransformation(QTreeWidgetItem *from, QTreeWidgetItem *to)
LVRReconstructViaMarchingCubesDialog(string decomposition, LVRPointCloudItem *pc, QTreeWidgetItem *parent, QTreeWidget *treeWidget, vtkRenderWindow *renderer)
std::shared_ptr< PointsetSurface< BaseVecT > > PointsetSurfacePtr
void switchGridSizeDetermination(int index)
A map with constant lookup overhead using small-ish integer-keys.
static void updateProgressbarTitle(string t)
void connectSignalsAndSlots()
PointBufferPtr transform(PointBufferPtr pc_in, const Transformd &T)
ReconstructViaMarchingCubesDialog * m_dialog