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
lvr2::LVRRemoveArtifactsDialog::m_parent
LVRModelItem * m_parent
Definition: LVROptimizationRemoveArtifactsDialog.hpp:64
BaseVector.hpp
lvr2::LVRRemoveArtifactsDialog::m_dialog
RemoveArtifactsDialog * m_dialog
Definition: LVROptimizationRemoveArtifactsDialog.hpp:61
lvr2::BaseVector< float >
lvr2::removeDanglingCluster
void removeDanglingCluster(BaseMesh< BaseVecT > &mesh, size_t sizeThreshold)
lvr2::LVRMeshItem
Definition: LVRMeshItem.hpp:45
lvr2::Model
Definition: Model.hpp:51
HalfEdgeMesh.hpp
lvr2::SimpleFinalizer
Definition: FinalizeAlgorithms.hpp:68
lvr2::LVRRemoveArtifactsDialog::LVRRemoveArtifactsDialog
LVRRemoveArtifactsDialog(LVRMeshItem *mesh, LVRModelItem *parent, QTreeWidget *treeWidget, vtkRenderWindow *renderer)
Definition: LVROptimizationRemoveArtifactsDialog.cpp:40
lvr2::ModelBridgePtr
boost::shared_ptr< LVRModelBridge > ModelBridgePtr
Definition: LVRModelBridge.hpp:120
LVROptimizationRemoveArtifactsDialog.hpp
lvr2::LVRRemoveArtifactsDialog::connectSignalsAndSlots
void connectSignalsAndSlots()
Definition: LVROptimizationRemoveArtifactsDialog.cpp:60
lvr2::LVRMeshItem::getMeshBuffer
MeshBufferPtr getMeshBuffer()
Definition: LVRMeshItem.cpp:134
lvr2::LVRRemoveArtifactsDialog::m_treeWidget
QTreeWidget * m_treeWidget
Definition: LVROptimizationRemoveArtifactsDialog.hpp:65
Model.hpp
lvr2::LVRRemoveArtifactsDialog::m_optimizedModel
LVRModelItem * m_optimizedModel
Definition: LVROptimizationRemoveArtifactsDialog.hpp:63
lvr2::LVRModelBridge
Main class for conversion of LVR model instances to vtk actors. This class parses the internal model ...
Definition: LVRModelBridge.hpp:61
lvr2::LVRModelItem
Definition: LVRModelItem.hpp:47
lvr2
Definition: BaseBufferManipulators.hpp:39
lvr2::ModelPtr
std::shared_ptr< Model > ModelPtr
Definition: Model.hpp:80
ClusterAlgorithms.hpp
lvr2::LVRRemoveArtifactsDialog::m_renderWindow
vtkRenderWindow * m_renderWindow
Definition: LVROptimizationRemoveArtifactsDialog.hpp:66
lvr2::LVRModelItem::getName
QString getName()
Definition: LVRModelItem.cpp:109
lvr2::LVRRemoveArtifactsDialog::m_mesh
LVRMeshItem * m_mesh
Definition: LVROptimizationRemoveArtifactsDialog.hpp:62
mesh
HalfEdgeMesh< Vec > mesh
Definition: src/tools/lvr2_gs_reconstruction/Main.cpp:26
lvr2::LVRRemoveArtifactsDialog::removeArtifacts
void removeArtifacts()
Definition: LVROptimizationRemoveArtifactsDialog.cpp:65
lvr2::SimpleFinalizer::apply
MeshBufferPtr apply(const BaseMesh< BaseVecT > &mesh)
lvr2::LVRRemoveArtifactsDialog::~LVRRemoveArtifactsDialog
virtual ~LVRRemoveArtifactsDialog()
Definition: LVROptimizationRemoveArtifactsDialog.cpp:55
lvr2::HalfEdgeMesh
Half-edge data structure implementing the BaseMesh interface.
Definition: HalfEdgeMesh.hpp:70


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 Wed Mar 2 2022 00:37:24