本文整理汇总了C++中Octree::setTreeMemory方法的典型用法代码示例。如果您正苦于以下问题:C++ Octree::setTreeMemory方法的具体用法?C++ Octree::setTreeMemory怎么用?C++ Octree::setTreeMemory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Octree
的用法示例。
在下文中一共展示了Octree::setTreeMemory方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ExecuteMemory
int ExecuteMemory( int argc , char* argv[], std::vector< std::vector< float > > & positions, std::vector< std::vector< float > > & normals,
std::vector< std::vector< float > > & vertices, std::vector< std::vector< int > > & faces )
{
argc = (int)argc;
argv = argv;
cmdLineParse( argc-1 , &argv[1] , sizeof(params)/sizeof(cmdLineReadable*) , params , 1 );
typedef PlyVertex< Real > Vertex;
bool OutputDensity = false;
OutputDensity = OutputDensity;
int i;
int paramNum = sizeof(params)/sizeof(cmdLineReadable*);
int commentNum=0;
char **comments;
comments = new char*[paramNum+7];
for( i=0 ; i<paramNum+7 ; i++ ) comments[i] = new char[1024];
if( Verbose.set ) echoStdout=1;
XForm4x4< Real > xForm , iXForm;
if( XForm.set )
{
FILE* fp = fopen( XForm.value , "r" );
if( !fp )
{
fprintf( stderr , "[WARNING] Could not read x-form from: %s\n" , XForm.value );
xForm = XForm4x4< Real >::Identity();
}
else
{
for( int i=0 ; i<4 ; i++ ) for( int j=0 ; j<4 ; j++ ) fscanf( fp , " %f " , &xForm( i , j ) );
fclose( fp );
}
}
else xForm = XForm4x4< Real >::Identity();
iXForm = xForm.inverse();
DumpOutput2( comments[commentNum++] , "Running Screened Poisson Reconstruction (Version 5.5)\n" , Degree );
char str[1024];
for( int i=0 ; i<paramNum ; i++ )
if( params[i]->set )
{
params[i]->writeValue( str );
if( strlen( str ) ) DumpOutput2( comments[commentNum++] , "\t--%s %s\n" , params[i]->name , str );
else DumpOutput2( comments[commentNum++] , "\t--%s\n" , params[i]->name );
}
double t;
double tt=Time();
Real isoValue = 0;
Octree< Degree , false > tree;
tree.threads = Threads.value;
//if( !In.set )
//{
// ShowUsage(argv[0]);
// return 0;
//}
if( !MaxSolveDepth.set ) MaxSolveDepth.value = Depth.value;
if( SolverDivide.value<MinDepth.value )
{
fprintf( stderr , "[WARNING] %s must be at least as large as %s: %d>=%d\n" , SolverDivide.name , MinDepth.name , SolverDivide.value , MinDepth.value );
SolverDivide.value = MinDepth.value;
}
if( IsoDivide.value<MinDepth.value )
{
fprintf( stderr , "[WARNING] %s must be at least as large as %s: %d>=%d\n" , IsoDivide.name , MinDepth.name , IsoDivide.value , IsoDivide.value );
IsoDivide.value = MinDepth.value;
}
OctNode< TreeNodeData< false > , Real >::SetAllocator( MEMORY_ALLOCATOR_BLOCK_SIZE );
t=Time();
int kernelDepth = KernelDepth.set ? KernelDepth.value : Depth.value-2;
tree.setBSplineData( Depth.value , BoundaryType.value );
if( kernelDepth>Depth.value )
{
fprintf( stderr,"[ERROR] %s can't be greater than %s: %d <= %d\n" , KernelDepth.name , Depth.name , KernelDepth.value , Depth.value );
return EXIT_FAILURE;
}
double maxMemoryUsage;
t=Time() , tree.maxMemoryUsage=0;
//int pointCount = tree.setTree( In.value , Depth.value , MinDepth.value , kernelDepth , Real(SamplesPerNode.value) , Scale.value , Confidence.set , PointWeight.value , AdaptiveExponent.value , xForm );
// Load data
MemoryPointStream< Real >* ps = new MemoryPointStream< Real >( &positions, &normals );
int pointCount = tree.setTreeMemory( ps , Depth.value , MinDepth.value , kernelDepth , Real(SamplesPerNode.value) , Scale.value , Confidence.set , PointWeight.value , AdaptiveExponent.value , xForm );
tree.ClipTree();
tree.finalize( IsoDivide.value );
DumpOutput2( comments[commentNum++] , "# Tree set in: %9.1f (s), %9.1f (MB)\n" , Time()-t , tree.maxMemoryUsage );
//.........这里部分代码省略.........