LVROptimizationRemoveArtifactsDialog.cpp
Go to the documentation of this file.
1 
28 #include <QFileDialog>
29 
31 
35 #include "lvr2/io/Model.hpp"
36 
37 namespace lvr2
38 {
39 
40 LVRRemoveArtifactsDialog::LVRRemoveArtifactsDialog(LVRMeshItem* mesh, LVRModelItem* parent, QTreeWidget* treeWidget, vtkRenderWindow* window) :
41  m_mesh(mesh), m_parent(parent), m_treeWidget(treeWidget), m_renderWindow(window)
42 {
43  // Setup DialogUI and events
44  QDialog* dialog = new QDialog(m_treeWidget);
45  m_dialog = new RemoveArtifactsDialog;
46  m_dialog->setupUi(dialog);
47 
49 
50  dialog->show();
51  dialog->raise();
52  dialog->activateWindow();
53 }
54 
56 {
57  // TODO Auto-generated destructor stub
58 }
59 
61 {
62  QObject::connect(m_dialog->buttonBox, SIGNAL(accepted()), this, SLOT(removeArtifacts()));
63 }
64 
66 {
67  using Vec = BaseVector<float>;
68 
69  QSpinBox* removeDanglingArtifacts_box = m_dialog->spinBox_rda;
70  int removeDanglingArtifacts = removeDanglingArtifacts_box->value();
71 
73  removeDanglingCluster(mesh, removeDanglingArtifacts);
74 
75  // create normals and/or colors?
77 
78  ModelPtr model(new Model(fin.apply(mesh)));
79  ModelBridgePtr bridge(new LVRModelBridge(model));
80  vtkSmartPointer<vtkRenderer> renderer = m_renderWindow->GetRenderers()->GetFirstRenderer();
81  bridge->addActors(renderer);
82 
83  QString base = m_parent->getName() + " (artifacts removed)";
84  m_optimizedModel = new LVRModelItem(bridge, base);
85 
86  m_treeWidget->addTopLevelItem(m_optimizedModel);
87  m_optimizedModel->setExpanded(true);
88 }
89 
90 } // namespace lvr2
HalfEdgeMesh< Vec > mesh
void removeDanglingCluster(BaseMesh< BaseVecT > &mesh, size_t sizeThreshold)
LVRRemoveArtifactsDialog(LVRMeshItem *mesh, LVRModelItem *parent, QTreeWidget *treeWidget, vtkRenderWindow *renderer)
MeshBufferPtr apply(const BaseMesh< BaseVecT > &mesh)
Main class for conversion of LVR model instances to vtk actors. This class parses the internal model ...
boost::shared_ptr< LVRModelBridge > ModelBridgePtr
Half-edge data structure implementing the BaseMesh interface.
std::shared_ptr< Model > ModelPtr
Definition: Model.hpp:80
MeshBufferPtr getMeshBuffer()


lvr2
Author(s): Thomas Wiemann , Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Mon Feb 28 2022 22:46:08