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

Support for Poly meshes and ore warning fixes

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free-Staging@16327 383ad7c9-94d9-4d36-a494-682f7c89f535
parent cf72c9c7
......@@ -210,7 +210,7 @@ void SortedTreeNodes::setCornerTable( CornerTableData& cData , const TreeOctNode
if( rootNode )
printf( "(%d [%d %d %d) <-> (%d [%d %d %d])\n" , minDepth , off[0] , off[1] , off[2] , _d , _off[0] , _off[1] , _off[2] );
else
printf( "NULL <-> (%d [%d %d %d])\n" , minDepth , off[0] , off[1] , off[2] , _d , _off[0] , _off[1] , _off[2] );
std::cerr << "NULL <-> ( " << minDepth << " [ " << off[0] << " " << off[1] << " " << off[2] << " ]) " << _d << std::endl;
printf( "[%d %d]\n" , spans[d].first , spans[d].second );
exit( 0 );
}
......
......@@ -49,6 +49,7 @@
#include "OpenFlipper/BasePlugin/PluginFunctions.hh"
#include <OpenFlipper/common/GlobalOptions.hh>
#include <ObjectTypes/TriangleMesh/TriangleMesh.hh>
#include <ObjectTypes/PolyMesh/PolyMesh.hh>
#include "PoissonReconstructionT.hh"
......@@ -108,39 +109,69 @@ void PoissonPlugin::slotPoissonReconstruct(){
unsigned int n_points = 0;
std::vector< Real > pt_data;
for ( PluginFunctions::ObjectIterator o_it(PluginFunctions::TARGET_OBJECTS,DATA_TRIANGLE_MESH) ;o_it != PluginFunctions::objectsEnd(); ++o_it) {
for ( PluginFunctions::ObjectIterator o_it(PluginFunctions::TARGET_OBJECTS,(DATA_TRIANGLE_MESH | DATA_POLY_MESH)) ;o_it != PluginFunctions::objectsEnd(); ++o_it) {
TriMeshObject* object = PluginFunctions::triMeshObject(*o_it);
if ( object == 0 ) {
emit log(LOGWARN , "Unable to get object ( Only Triangle Meshes supported)");
continue;
}
// Get triangle mesh
TriMesh* mesh = PluginFunctions::triMesh(*o_it);
if ( o_it->dataType() == DATA_TRIANGLE_MESH) {
n_points += mesh->n_vertices();
TriMeshObject* object = PluginFunctions::triMeshObject(*o_it);
pt_data.reserve( n_points );
TriMesh::VertexIter vit = mesh->vertices_begin();
for ( ; vit != mesh->vertices_end(); ++vit )
{
pt_data.push_back( mesh->point( vit )[0] );
pt_data.push_back( mesh->point( vit )[1] );
pt_data.push_back( mesh->point( vit )[2] );
pt_data.push_back( mesh->normal( vit )[0] );
pt_data.push_back( mesh->normal( vit )[1] );
pt_data.push_back( mesh->normal( vit )[2] );
}
if ( object == 0 ) {
emit log(LOGWARN , "Unable to get object ( Only Triangle Meshes supported)");
continue;
}
// Get triangle mesh
TriMesh* mesh = PluginFunctions::triMesh(*o_it);
n_points += mesh->n_vertices();
pt_data.reserve( n_points );
TriMesh::VertexIter vit = mesh->vertices_begin();
for ( ; vit != mesh->vertices_end(); ++vit )
{
pt_data.push_back( mesh->point( vit )[0] );
pt_data.push_back( mesh->point( vit )[1] );
pt_data.push_back( mesh->point( vit )[2] );
pt_data.push_back( mesh->normal( vit )[0] );
pt_data.push_back( mesh->normal( vit )[1] );
pt_data.push_back( mesh->normal( vit )[2] );
}
}
if ( o_it->dataType() == DATA_POLY_MESH) {
PolyMeshObject* object = PluginFunctions::polyMeshObject(*o_it);
if ( object == 0 ) {
emit log(LOGWARN , "Unable to get object ( Only Triangle Meshes supported)");
continue;
}
// Get triangle mesh
PolyMesh* mesh = PluginFunctions::polyMesh(*o_it);
n_points += mesh->n_vertices();
pt_data.reserve( n_points );
PolyMesh::VertexIter vit = mesh->vertices_begin();
for ( ; vit != mesh->vertices_end(); ++vit )
{
pt_data.push_back( mesh->point( vit )[0] );
pt_data.push_back( mesh->point( vit )[1] );
pt_data.push_back( mesh->point( vit )[2] );
pt_data.push_back( mesh->normal( vit )[0] );
pt_data.push_back( mesh->normal( vit )[1] );
pt_data.push_back( mesh->normal( vit )[2] );
}
}
}
// Get triangle mesh
TriMesh* final_mesh = NULL;
ACG::PoissonReconstructionT<TriMesh> pr;
ACG::PoissonReconstructionT<TriMesh>::Parameter params;
......
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