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

External for deserialize metadata

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free-Staging@20848 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 3dcda576
...@@ -163,7 +163,9 @@ int PoissonPlugin::poissonReconstruct(IdList _ids, int _depth) ...@@ -163,7 +163,9 @@ int PoissonPlugin::poissonReconstruct(IdList _ids, int _depth)
n_points += mesh->n_vertices(); n_points += mesh->n_vertices();
pt_data.reserve( n_points ); emit log(LOGINFO,QString("Adding %1 points from Object %2").arg(mesh->n_vertices()).arg(*idIter) );
pt_data.reserve( n_points * 6 );
TriMesh::VertexIter vit = mesh->vertices_begin(); TriMesh::VertexIter vit = mesh->vertices_begin();
for ( ; vit != mesh->vertices_end(); ++vit ) for ( ; vit != mesh->vertices_end(); ++vit )
{ {
...@@ -182,7 +184,9 @@ int PoissonPlugin::poissonReconstruct(IdList _ids, int _depth) ...@@ -182,7 +184,9 @@ int PoissonPlugin::poissonReconstruct(IdList _ids, int _depth)
n_points += mesh->n_vertices(); n_points += mesh->n_vertices();
pt_data.reserve( n_points ); emit log(LOGINFO,QString("Adding %1 points from Object %2").arg(mesh->n_vertices()).arg(*idIter) );
pt_data.reserve( n_points * 6 );
PolyMesh::VertexIter vit = mesh->vertices_begin(); PolyMesh::VertexIter vit = mesh->vertices_begin();
for ( ; vit != mesh->vertices_end(); ++vit ) for ( ; vit != mesh->vertices_end(); ++vit )
{ {
...@@ -209,7 +213,9 @@ int PoissonPlugin::poissonReconstruct(IdList _ids, int _depth) ...@@ -209,7 +213,9 @@ int PoissonPlugin::poissonReconstruct(IdList _ids, int _depth)
n_points += cloud->numSplats(); n_points += cloud->numSplats();
pt_data.reserve( n_points ); emit log(LOGINFO,QString("Adding %1 points from Object %2").arg(cloud->numSplats()).arg(*idIter) );
pt_data.reserve( n_points * 6 );
for (unsigned i = 0 ; i < cloud->numSplats(); ++i ) for (unsigned i = 0 ; i < cloud->numSplats(); ++i )
{ {
pt_data.push_back( cloud->positions( i )[0] ); pt_data.push_back( cloud->positions( i )[0] );
...@@ -231,6 +237,8 @@ int PoissonPlugin::poissonReconstruct(IdList _ids, int _depth) ...@@ -231,6 +237,8 @@ int PoissonPlugin::poissonReconstruct(IdList _ids, int _depth)
//create and reconstruct mesh //create and reconstruct mesh
if ( !pt_data.empty() ) { if ( !pt_data.empty() ) {
emit log(LOGINFO,"Creating Object");
// Add empty triangle mesh // Add empty triangle mesh
emit addEmptyObject ( DATA_TRIANGLE_MESH, meshId ); emit addEmptyObject ( DATA_TRIANGLE_MESH, meshId );
...@@ -248,6 +256,8 @@ int PoissonPlugin::poissonReconstruct(IdList _ids, int _depth) ...@@ -248,6 +256,8 @@ int PoissonPlugin::poissonReconstruct(IdList _ids, int _depth)
ACG::PoissonReconstructionT<TriMesh>::Parameter params; ACG::PoissonReconstructionT<TriMesh>::Parameter params;
params.Depth = _depth; params.Depth = _depth;
emit log(LOGINFO,"Starting reconstruction");
if ( pr.run( pt_data, *final_mesh, params ) ) { if ( pr.run( pt_data, *final_mesh, params ) ) {
emit log(LOGINFO,"Reconstruction succeeded"); emit log(LOGINFO,"Reconstruction succeeded");
emit updatedObject(meshId,UPDATE_ALL); emit updatedObject(meshId,UPDATE_ALL);
......
...@@ -43,13 +43,19 @@ run( std::vector< Real >& _pt_data, MeshT& _mesh, const Parameter& _parameter ) ...@@ -43,13 +43,19 @@ run( std::vector< Real >& _pt_data, MeshT& _mesh, const Parameter& _parameter )
#endif #endif
TreeOctNode::SetAllocator( MEMORY_ALLOCATOR_BLOCK_SIZE ); TreeOctNode::SetAllocator( MEMORY_ALLOCATOR_BLOCK_SIZE );
std::cerr << "Tree construction with depth " << m_parameter.Depth << std::endl;
tree.setBSplineData( m_parameter.Depth ); tree.setBSplineData( m_parameter.Depth );
double maxMemoryUsage; double maxMemoryUsage;
tree.maxMemoryUsage=0; tree.maxMemoryUsage=0;
XForm4x4< Real > xForm = XForm4x4< Real >::Identity(); XForm4x4< Real > xForm = XForm4x4< Real >::Identity();
int pointCount = tree.setTreeMemory( _pt_data , m_parameter.Depth , m_parameter.MinDepth , m_parameter.Depth , Real(m_parameter.SamplesPerNode), int pointCount = tree.setTreeMemory( _pt_data , m_parameter.Depth , m_parameter.MinDepth , m_parameter.Depth , Real(m_parameter.SamplesPerNode),
m_parameter.Scale , m_parameter.Confidence , m_parameter.PointWeight , m_parameter.AdaptiveExponent , xForm ); m_parameter.Scale , m_parameter.Confidence , m_parameter.PointWeight , m_parameter.AdaptiveExponent , xForm );
std::cerr << "Tree Clipping" << std::endl;
tree.ClipTree(); tree.ClipTree();
std::cerr << "Tree Finalize" << std::endl;
tree.finalize( m_parameter.IsoDivide ); tree.finalize( m_parameter.IsoDivide );
DumpOutput( "Input Points: %d\n" , pointCount ); DumpOutput( "Input Points: %d\n" , pointCount );
......
/*===========================================================================*\ /*===========================================================================*\
* * * *
* OpenFlipper * * OpenFlipper *
* Copyright (C) 2001-2014 by Computer Graphics Group, RWTH Aachen * * Copyright (C) 2001-2015 by Computer Graphics Group, RWTH Aachen *
* www.openflipper.org * * www.openflipper.org *
* * * *
*--------------------------------------------------------------------------- * *--------------------------------------------------------------------------- *
......
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