mirror of
https://github.com/CloudCompare/PoissonRecon.git
synced 2026-08-29 16:40:28 +08:00
no message
This commit is contained in:
@@ -318,6 +318,7 @@ int _Execute( int argc , char* argv[] )
|
||||
for( int i=0 ; i<geometrySamples.size() ; i++ ) nodes[i] = geometrySamples[i].node;
|
||||
tree.template thicken< Degree >( nodes , (int)geometrySamples.size() );
|
||||
profiler.dumpOutput2( comments , "# Thickened tree:" );
|
||||
delete[] nodes;
|
||||
}
|
||||
|
||||
// Finalize the topology of the tree
|
||||
@@ -529,6 +530,8 @@ int _Execute( int argc , char* argv[] )
|
||||
}
|
||||
}
|
||||
|
||||
for( int i=0 ; i<comments.size() ; i++ ) if( comments[i] ) delete[] comments[i];
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -566,7 +569,11 @@ int main( int argc , char* argv[] )
|
||||
#ifdef FAST_COMPILE
|
||||
static const int Degree = DEFAULT_FEM_DEGREE;
|
||||
static const BoundaryType BType = BOUNDARY_FREE;
|
||||
#if 1
|
||||
fprintf( stderr , "[WARNING] Compiled for degree-%d, boundary-%s, %s-precision _only_\n" , Degree , BoundaryNames[ BType ] , sizeof(Real)==4 ? "single" : "double" );
|
||||
#else
|
||||
fprintf( stderr , "[WARNING] Compiled for degree-%d, boundary-%s, %s-precision _only_\n" , Degree , BoundaryNames[ BType ] , sizeof(DefaultFloatType)==4 ? "single" : "double" );
|
||||
#endif
|
||||
if( BaseDepth.value>FullDepth.value )
|
||||
{
|
||||
if( BaseDepth.set ) fprintf( stderr , "[WARNING] Base depth must be smaller than full depth: %d <= %d\n" , BaseDepth.value , FullDepth.value );
|
||||
|
||||
@@ -1872,7 +1872,7 @@ DenseNodeData< Real , UIntPack< FEMSigs ... > > FEMTree< Dim , Real >::supportWe
|
||||
for( int d=0 ; d<=_maxDepth ; d++ )
|
||||
{
|
||||
for( size_t i=0 ; i<neighborKeys.size() ; i++ ) neighborKeys[i].set( _localToGlobal( d ) );
|
||||
( ( BaseSystem& )F ).init( d );
|
||||
F.init( d );
|
||||
F.template setStencil< false >( stencil );
|
||||
#pragma omp parallel for
|
||||
for( int i=_sNodesBegin(d) ; i<_sNodesEnd(d) ; i++ ) if( _isValidFEM1Node( _sNodes.treeNodes[i] ) )
|
||||
|
||||
+2
-2
@@ -42,7 +42,7 @@ DAMAGE.
|
||||
#ifndef FEM_TREE_INCLUDED
|
||||
#define FEM_TREE_INCLUDED
|
||||
|
||||
#define VERSION "10.02"
|
||||
#define VERSION "10.03"
|
||||
#define MEMORY_ALLOCATOR_BLOCK_SIZE 1<<12
|
||||
|
||||
#define NEW_CODE
|
||||
@@ -865,7 +865,7 @@ public:
|
||||
{
|
||||
typedef Constraint< UIntPack< TDegrees ... > , UIntPack< TDegrees ... > , 1 > Base;
|
||||
SystemConstraint( System< UIntPack< TDegrees ... > >& sys ) : _sys( sys ){;}
|
||||
void init( void ){ _sys.init( Base::highDepth() ) ; _sys.init(); }
|
||||
void init( void ){ _sys.init( Base::highDepth() ) ; _sys.init(); }
|
||||
Point< double , 1 > ccIntegrate( const int off1[] , const int off2[] ) const{ return Point< double , 1 >( _sys.ccIntegrate( off1 , off2 ) ); }
|
||||
Point< double , 1 > pcIntegrate( const int off1[] , const int off2[] ) const{ return Point< double , 1 >( _sys.pcIntegrate( off1 , off2 ) ); }
|
||||
Point< double , 1 > cpIntegrate( const int off1[] , const int off2[] ) const{ return Point< double , 1 >( _sys.pcIntegrate( off2 , off1 ) ); }
|
||||
|
||||
+1
-1
@@ -539,7 +539,7 @@ public:
|
||||
bool write( const void* data , size_t size )
|
||||
{
|
||||
if( !size ) return true;
|
||||
char* _data = (char*) data;
|
||||
const char* _data = (char*) data;
|
||||
size_t sz = _bufferSize - _bufferIndex;
|
||||
while( sz<=size )
|
||||
{
|
||||
|
||||
@@ -194,6 +194,7 @@ inline void ImageReader::GetInfo( const char* fileName , unsigned int& width , u
|
||||
else if( !strcasecmp( ext , "png" ) ) PNGReader::GetInfo( fileName , width , height , channels );
|
||||
else if( !strcasecmp( ext , "iGrid" ) ) TiledImageReader::GetInfo( fileName , width , height , channels );
|
||||
#endif // WIN32
|
||||
delete[] ext;
|
||||
}
|
||||
inline ImageWriter* ImageWriter::Get( const char* fileName , unsigned int width , unsigned int height , unsigned int channels , ImageWriterParams params )
|
||||
{
|
||||
|
||||
@@ -459,7 +459,7 @@ void _Execute( void )
|
||||
c += outBlock[ii] - average;
|
||||
_outRows[ii] = RGBPixel( c[0] , c[1] , c[2] );
|
||||
}
|
||||
FreePointer( outBlock );
|
||||
DeletePointer( outBlock );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -475,6 +475,9 @@ void _Execute( void )
|
||||
delete out;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef FAST_COMPILE
|
||||
#else // !FAST_COMPILE
|
||||
template< typename Real >
|
||||
void _Execute( void )
|
||||
{
|
||||
@@ -487,6 +490,8 @@ void _Execute( void )
|
||||
default: fprintf( stderr , "[ERROR] Only B-Splines of degree 1 - 2 are supported" ) ; exit( 0 );
|
||||
}
|
||||
}
|
||||
#endif // FAST_COMPILE
|
||||
|
||||
int main( int argc , char* argv[] )
|
||||
{
|
||||
Timer timer;
|
||||
|
||||
@@ -67,6 +67,7 @@ PNGReader::~PNGReader( void )
|
||||
{
|
||||
if( _scratchRow ) delete[] _scratchRow;
|
||||
_scratchRow = NULL;
|
||||
png_destroy_read_struct( &_png_ptr , &_info_ptr , &_end_info );
|
||||
}
|
||||
|
||||
inline bool PNGReader::GetInfo( const char* fileName , unsigned int& width , unsigned int& height , unsigned int& channels )
|
||||
|
||||
@@ -421,6 +421,27 @@ int PlyWritePolygons( const char* fileName,
|
||||
}
|
||||
|
||||
delete[] ply_face.vertices;
|
||||
if( ply->nelems )
|
||||
{
|
||||
for( int i=0 ; i<ply->nelems ; i++ )
|
||||
{
|
||||
free( ply->elems[i]->name );
|
||||
if( ply->elems[i]->store_prop ) free( ply->elems[i]->store_prop );
|
||||
for( int j=0 ; j<ply->elems[i]->nprops ; j++ )
|
||||
{
|
||||
free( ply->elems[i]->props[j]->name );
|
||||
free( ply->elems[i]->props[j] );
|
||||
}
|
||||
free( ply->elems[i]->props );
|
||||
free( ply->elems[i] );
|
||||
}
|
||||
free( ply->elems );
|
||||
}
|
||||
if( ply->num_comments )
|
||||
{
|
||||
for( int i=0 ; i<ply->num_comments ; i++ ) free( ply->comments[i] );
|
||||
free( ply->comments );
|
||||
}
|
||||
ply_close(ply);
|
||||
return 1;
|
||||
}
|
||||
@@ -498,7 +519,7 @@ int PlyReadPolygons( const char* fileName,
|
||||
ply_get_element (ply, (void *) &ply_face);
|
||||
polygons[j].resize(ply_face.nr_vertices);
|
||||
for(k=0;k<ply_face.nr_vertices;k++) polygons[j][k]=ply_face.vertices[k];
|
||||
delete[] ply_face.vertices;
|
||||
free( ply_face.vertices );
|
||||
} // for, read faces
|
||||
} // if face
|
||||
else{ply_get_other_element (ply, elem_name, num_elems);}
|
||||
@@ -661,6 +682,27 @@ int PlyWritePolygons( const char* fileName , CoredMeshData< Vertex >* mesh , int
|
||||
delete[] ply_face.vertices;
|
||||
} // for, write faces
|
||||
|
||||
if( ply->nelems )
|
||||
{
|
||||
for( int i=0 ; i<ply->nelems ; i++ )
|
||||
{
|
||||
free( ply->elems[i]->name );
|
||||
if( ply->elems[i]->store_prop ) free( ply->elems[i]->store_prop );
|
||||
for( int j=0 ; j<ply->elems[i]->nprops ; j++ )
|
||||
{
|
||||
free( ply->elems[i]->props[j]->name );
|
||||
free( ply->elems[i]->props[j] );
|
||||
}
|
||||
free( ply->elems[i]->props );
|
||||
free( ply->elems[i] );
|
||||
}
|
||||
free( ply->elems );
|
||||
}
|
||||
if( ply->num_comments )
|
||||
{
|
||||
for( int i=0 ; i<ply->num_comments ; i++ ) free( ply->comments[i] );
|
||||
free( ply->comments );
|
||||
}
|
||||
ply_close( ply );
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -182,6 +182,16 @@ void PLYInputPointStream< Real , Dim >::reset( void )
|
||||
template< class Real , int Dim >
|
||||
void PLYInputPointStream< Real , Dim >::_free( void )
|
||||
{
|
||||
if( _ply->comments )
|
||||
{
|
||||
for( int i=0 ; i<_ply->num_comments ; i++ ) free( _ply->comments[i] );
|
||||
free( _ply->comments );
|
||||
}
|
||||
if( _ply->obj_info )
|
||||
{
|
||||
for( int i=0 ; i<_ply->num_obj_info ; i++ ) free( _ply->obj_info[i] );
|
||||
free( _ply->obj_info );
|
||||
}
|
||||
if( _ply ) ply_close( _ply ) , _ply = NULL;
|
||||
if( _elist )
|
||||
{
|
||||
@@ -391,6 +401,32 @@ void PLYInputPointStreamWithData< Real , Dim , Data >::reset( void )
|
||||
template< class Real , int Dim , class Data >
|
||||
void PLYInputPointStreamWithData< Real , Dim , Data >::_free( void )
|
||||
{
|
||||
if( _ply->comments )
|
||||
{
|
||||
for( int i=0 ; i<_ply->num_comments ; i++ ) free( _ply->comments[i] );
|
||||
free( _ply->comments );
|
||||
}
|
||||
if( _ply->obj_info )
|
||||
{
|
||||
for( int i=0 ; i<_ply->num_obj_info ; i++ ) free( _ply->obj_info[i] );
|
||||
free( _ply->obj_info );
|
||||
}
|
||||
if( _ply->elems )
|
||||
{
|
||||
for( int i=0 ; i<_ply->nelems ; i++ )
|
||||
{
|
||||
free( _ply->elems[i]->name );
|
||||
if( _ply->elems[i]->store_prop ) free( _ply->elems[i]->store_prop );
|
||||
for( int j=0 ; j<_ply->elems[i]->nprops ; j++ )
|
||||
{
|
||||
free( _ply->elems[i]->props[j]->name );
|
||||
free( _ply->elems[i]->props[j] );
|
||||
}
|
||||
free( _ply->elems[i]->props );
|
||||
free( _ply->elems[i] );
|
||||
}
|
||||
free( _ply->elems );
|
||||
}
|
||||
if( _ply ) ply_close( _ply ) , _ply = NULL;
|
||||
if( _elist )
|
||||
{
|
||||
|
||||
@@ -291,7 +291,7 @@ struct SystemDual< Dim , double >
|
||||
};
|
||||
|
||||
template< typename Vertex , typename Real , unsigned int ... FEMSigs , typename ... SampleData >
|
||||
void ExtractMesh( UIntPack< FEMSigs ... > , std::tuple< SampleData ... > , FEMTree< sizeof ... ( FEMSigs ) , Real >& tree , const DenseNodeData< Real , UIntPack< FEMSigs ... > >& solution , Real isoValue , const std::vector< typename FEMTree< sizeof ... ( FEMSigs ) , Real >::PointSample >* samples , std::vector< MultiPointStreamData< Real , PointStreamNormal< Real , DIMENSION > , MultiPointStreamData< Real , SampleData ... > > >* sampleData , const typename FEMTree< sizeof ... ( FEMSigs ) , Real >::template DensityEstimator< WEIGHT_DEGREE >* density , std::function< void ( Vertex& , Point< Real , DIMENSION > , Real , MultiPointStreamData< Real , PointStreamNormal< Real , DIMENSION > , MultiPointStreamData< Real , SampleData ... > > ) > SetVertex , std::vector< char* > comments , XForm< Real , sizeof...(FEMSigs)+1 > iXForm )
|
||||
void ExtractMesh( UIntPack< FEMSigs ... > , std::tuple< SampleData ... > , FEMTree< sizeof ... ( FEMSigs ) , Real >& tree , const DenseNodeData< Real , UIntPack< FEMSigs ... > >& solution , Real isoValue , const std::vector< typename FEMTree< sizeof ... ( FEMSigs ) , Real >::PointSample >* samples , std::vector< MultiPointStreamData< Real , PointStreamNormal< Real , DIMENSION > , MultiPointStreamData< Real , SampleData ... > > >* sampleData , const typename FEMTree< sizeof ... ( FEMSigs ) , Real >::template DensityEstimator< WEIGHT_DEGREE >* density , std::function< void ( Vertex& , Point< Real , DIMENSION > , Real , MultiPointStreamData< Real , PointStreamNormal< Real , DIMENSION > , MultiPointStreamData< Real , SampleData ... > > ) > SetVertex , std::vector< char* >& comments , XForm< Real , sizeof...(FEMSigs)+1 > iXForm )
|
||||
{
|
||||
static const int Dim = sizeof ... ( FEMSigs );
|
||||
typedef UIntPack< FEMSigs ... > Sigs;
|
||||
@@ -632,6 +632,8 @@ int Execute( int argc , char* argv[] , UIntPack< FEMSigs ... > )
|
||||
if( density ) delete density , density = NULL;
|
||||
messageWriter( comments , "# Total Solve: %9.1f (s), %9.1f (MB)\n" , Time()-startTime , FEMTree< Dim , Real >::MaxMemoryUsage() );
|
||||
|
||||
for( int i=0 ; i<comments.size() ; i++ ) if( comments[i] ) delete[] comments[i];
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -214,6 +214,9 @@ public:
|
||||
ConstNeighborKey( void );
|
||||
ConstNeighborKey( const ConstNeighborKey& key );
|
||||
~ConstNeighborKey( void );
|
||||
#if 1
|
||||
ConstNeighborKey& operator = ( const ConstNeighborKey& key );
|
||||
#endif
|
||||
|
||||
int depth( void ) const { return _depth; }
|
||||
void set( int depth );
|
||||
|
||||
@@ -624,6 +624,15 @@ RegularTreeNode< Dim , NodeData , DepthAndOffsetType >::ConstNeighborKey< UIntPa
|
||||
if( neighbors ) delete[] neighbors;
|
||||
neighbors=NULL;
|
||||
}
|
||||
#if 1
|
||||
template< unsigned int Dim , class NodeData , class DepthAndOffsetType >
|
||||
template< unsigned int ... LeftRadii , unsigned int ... RightRadii >
|
||||
RegularTreeNode< Dim , NodeData , DepthAndOffsetType >::ConstNeighborKey< UIntPack< LeftRadii ... > , UIntPack< RightRadii ... > >& RegularTreeNode< Dim , NodeData , DepthAndOffsetType >::ConstNeighborKey< UIntPack< LeftRadii ... > , UIntPack< RightRadii ... > >::operator = ( const ConstNeighborKey& key )
|
||||
{
|
||||
set( key._depth );
|
||||
for( int d=0 ; d<=_depth ; d++ ) memcpy( &neighbors[d] , &key.neighbors[d] , sizeof( ConstNeighbors< UIntPack< ( LeftRadii + RightRadii + 1 ) ... > > ) );
|
||||
}
|
||||
#endif
|
||||
template< unsigned int Dim , class NodeData , class DepthAndOffsetType >
|
||||
template< unsigned int ... LeftRadii , unsigned int ... RightRadii >
|
||||
void RegularTreeNode< Dim , NodeData , DepthAndOffsetType >::ConstNeighborKey< UIntPack< LeftRadii ... > , UIntPack< RightRadii ... > >::set( int d )
|
||||
|
||||
+3
-1
@@ -312,7 +312,7 @@ struct SystemDual< Dim , double , TotalPointSampleData >
|
||||
};
|
||||
|
||||
template< typename Vertex , typename Real , unsigned int ... FEMSigs , typename ... SampleData >
|
||||
void ExtractMesh( UIntPack< FEMSigs ... > , std::tuple< SampleData ... > , FEMTree< sizeof ... ( FEMSigs ) , Real >& tree , const DenseNodeData< Real , UIntPack< FEMSigs ... > >& solution , Real isoValue , const std::vector< typename FEMTree< sizeof ... ( FEMSigs ) , Real >::PointSample >* samples , std::vector< MultiPointStreamData< Real , PointStreamNormal< Real , DIMENSION > , MultiPointStreamData< Real , SampleData ... > > >* sampleData , const typename FEMTree< sizeof ... ( FEMSigs ) , Real >::template DensityEstimator< WEIGHT_DEGREE >* density , std::function< void ( Vertex& , Point< Real , DIMENSION > , Real , MultiPointStreamData< Real , PointStreamNormal< Real , DIMENSION > , MultiPointStreamData< Real , SampleData ... > > ) > SetVertex , std::vector< char* > comments , XForm< Real , sizeof...(FEMSigs)+1 > iXForm )
|
||||
void ExtractMesh( UIntPack< FEMSigs ... > , std::tuple< SampleData ... > , FEMTree< sizeof ... ( FEMSigs ) , Real >& tree , const DenseNodeData< Real , UIntPack< FEMSigs ... > >& solution , Real isoValue , const std::vector< typename FEMTree< sizeof ... ( FEMSigs ) , Real >::PointSample >* samples , std::vector< MultiPointStreamData< Real , PointStreamNormal< Real , DIMENSION > , MultiPointStreamData< Real , SampleData ... > > >* sampleData , const typename FEMTree< sizeof ... ( FEMSigs ) , Real >::template DensityEstimator< WEIGHT_DEGREE >* density , std::function< void ( Vertex& , Point< Real , DIMENSION > , Real , MultiPointStreamData< Real , PointStreamNormal< Real , DIMENSION > , MultiPointStreamData< Real , SampleData ... > > ) > SetVertex , std::vector< char* >& comments , XForm< Real , sizeof...(FEMSigs)+1 > iXForm )
|
||||
{
|
||||
static const int Dim = sizeof ... ( FEMSigs );
|
||||
typedef UIntPack< FEMSigs ... > Sigs;
|
||||
@@ -633,6 +633,8 @@ int Execute( int argc , char* argv[] , UIntPack< FEMSigs ... > )
|
||||
if( density ) delete density , density = NULL;
|
||||
messageWriter( comments , "# Total Solve: %9.1f (s), %9.1f (MB)\n" , Time()-startTime , FEMTree< Dim , Real >::MaxMemoryUsage() );
|
||||
|
||||
for( int i=0 ; i<comments.size() ; i++ ) if( comments[i] ) delete[] comments[i];
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -366,6 +366,9 @@ int Execute( void )
|
||||
sprintf( comments[commentNum++] , "#Trimmed In: %9.1f (s)" , Time()-t );
|
||||
if( Out.set ) PlyWritePolygons< Vertex >( Out.value , vertices , gtPolygons , Vertex::PlyWriteProperties() , Vertex::PlyWriteNum , ft , &comments[0] , (int)comments.size() );
|
||||
|
||||
for( int i=0 ; i<comments.size() ; i++ ) delete[] comments[i];
|
||||
delete[] _comments;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
int main( int argc , char* argv[] )
|
||||
|
||||
Reference in New Issue
Block a user