Commit 7ff3e6d0 authored by Jan Möbius's avatar Jan Möbius
Browse files

Give mesh a reasonable name, remove created mesh, if something went wrong

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free-Staging@16314 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 521201a4
......@@ -104,11 +104,6 @@ void PoissonPlugin::initializePlugin(){
void PoissonPlugin::slotPoissonReconstruct(){
std::cerr << "Reconstruct" << std::endl;
// Add empty triangle mesh
int meshId = -1;
emit addEmptyObject ( DATA_TRIANGLE_MESH, meshId );
unsigned int n_points = 0;
std::vector< Real > pt_data;
......@@ -144,7 +139,7 @@ void PoissonPlugin::slotPoissonReconstruct(){
// Get triangle mesh
TriMesh* final_mesh = NULL;
PluginFunctions::getMesh(meshId,final_mesh);
ACG::PoissonReconstructionT<TriMesh> pr;
......@@ -153,12 +148,22 @@ void PoissonPlugin::slotPoissonReconstruct(){
if ( !pt_data.empty() ) {
// Add empty triangle mesh
int meshId = -1;
emit addEmptyObject ( DATA_TRIANGLE_MESH, meshId );
TriMeshObject* finalObject = PluginFunctions::triMeshObject(meshId);
PluginFunctions::getMesh(meshId,final_mesh);
if ( pr.run( pt_data, *final_mesh, params ) ) {
emit log(LOGINFO,"Reconstruction succeeded");
emit updatedObject(meshId,UPDATE_ALL);
finalObject->setName("Poisson Reconstruction.obj");
//finalObject->target(true);
} else {
emit log(LOGERR,"Reconstruction failed");
// TODO: Remove mesh
emit deleteObject( meshId );
}
}
......
......@@ -73,6 +73,7 @@ signals:
// Load/Save Interface
void addEmptyObject (DataType _type, int& _id);
void deleteObject( int _id );
// ToolboxInterface
//void addToolbox( QString _name , QWidget* _widget, QIcon* _icon );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment