diff --git a/Src/PoissonRecon.cpp b/Src/PoissonRecon.cpp index 5659b083..4baa0652 100644 --- a/Src/PoissonRecon.cpp +++ b/Src/PoissonRecon.cpp @@ -70,7 +70,7 @@ cmdLineParameter< char* > Grid( "grid" ) , Tree( "tree" ) , Envelope( "envelope" ) , - EnvelopeGrid( "envelopeGrid" ), + EnvelopeGrid( "envelopeGrid" ) , Transform( "xForm" ); cmdLineReadable @@ -174,6 +174,7 @@ void ShowUsage(char* ex) printf( "\t[--%s ]\n" , Grid.name ); printf( "\t[--%s \n" , EnvelopeGrid.name ); printf( "\t[--%s ]\n" , Tree.name ); + printf( "\t[--%s ]\n" , Transform.name , DEFAULT_DIMENSION , DEFAULT_DIMENSION ); #ifndef FAST_COMPILE printf( "\t[--%s =%d]\n" , Degree.name , Degree.value ); printf( "\t[--%s =%d]\n" , BType.name , BType.value ); @@ -267,30 +268,26 @@ template< class Real , unsigned int Dim > XForm< Real , Dim+1 > GetBoundingBoxXForm( Point< Real , Dim > min , Point< Real , Dim > max , Real scaleFactor ) { Point< Real , Dim > center = ( max + min ) / 2; - Real scale = max[0] - min[0]; - for( int d=1 ; d( scale , max[d]-min[d] ); - scale *= scaleFactor; - for( int i=0 ; i( max_range , max[d]-min[d] ); + max_range *= scaleFactor; + for( int i=0 ; i tXForm = XForm< Real , Dim+1 >::Identity() , sXForm = XForm< Real , Dim+1 >::Identity(); - for( int i=0 ; i XForm< Real , Dim+1 > GetBoundingBoxXForm( Point< Real , Dim > min , Point< Real , Dim > max , Real width , Real scaleFactor , int& depth ) { - // Get the target resolution (along the largest dimension) - Real resolution = ( max[0]-min[0] ) / width; - for( int d=1 ; d( resolution , ( max[d]-min[d] ) / width ); - resolution *= scaleFactor; - depth = 0; - while( (1< center = ( max + min ) / 2; - Real scale = (1<( max_range , max[d]-min[d] ); + max_range *= scaleFactor; + Real fine_voxels = ceil(max_range / width); + for ( depth=0 ; (1 << depth) < fine_voxels; ++depth); + for( int i=0 ; i tXForm = XForm< Real , Dim+1 >::Identity() , sXForm = XForm< Real , Dim+1 >::Identity(); - for( int i=0 ; i , const AuxDataFactory &auxDataFactory ) if( Width.value>0 ) modelToUnitCube = GetPointXForm< Real , Dim , typename AuxDataFactory::VertexType >( _pointStream , Width.value , (Real)( Scale.value>0 ? Scale.value : 1. ) , Depth.value ) * modelToUnitCube; else modelToUnitCube = Scale.value>0 ? GetPointXForm< Real , Dim , typename AuxDataFactory::VertexType >( _pointStream , (Real)Scale.value ) * modelToUnitCube : modelToUnitCube; + if( !KernelDepth.set ) KernelDepth.value = Depth.value-2; + if( KernelDepth.value>Depth.value ) + { + WARN( "Kernel depth should not exceed depth: " , KernelDepth.name , " <= " , KernelDepth.value ); + KernelDepth.value = Depth.value; + } + if( !EnvelopeDepth.set ) EnvelopeDepth.value = BaseDepth.value; + if( EnvelopeDepth.value>Depth.value ) + { + WARN( EnvelopeDepth.name , " can't be greater than " , Depth.name , ": " , EnvelopeDepth.value , " <= " , Depth.value ); + EnvelopeDepth.value = Depth.value; + } + if( EnvelopeDepth.value= " , BaseDepth.value ); + EnvelopeDepth.value = BaseDepth.value; + } if( !SolveDepth.set ) SolveDepth.value = Depth.value; if( SolveDepth.value>Depth.value ) { @@ -1078,24 +1092,6 @@ int main( int argc , char* argv[] ) if( BaseDepth.set ) WARN( "Base depth must be smaller than full depth: " , BaseDepth.value , " <= " , FullDepth.value ); BaseDepth.value = FullDepth.value; } - if( !KernelDepth.set ) KernelDepth.value = Depth.value-2; - if( KernelDepth.value>Depth.value ) - { - WARN( "Kernel depth should not exceed depth: " , KernelDepth.name , " <= " , KernelDepth.value ); - KernelDepth.value = Depth.value; - } - - if( !EnvelopeDepth.set ) EnvelopeDepth.value = BaseDepth.value; - if( EnvelopeDepth.value>Depth.value ) - { - WARN( EnvelopeDepth.name , " can't be greater than " , Depth.name , ": " , EnvelopeDepth.value , " <= " , Depth.value ); - EnvelopeDepth.value = Depth.value; - } - if( EnvelopeDepth.value= " , BaseDepth.value ); - EnvelopeDepth.value = BaseDepth.value; - } #ifdef USE_DOUBLE typedef double Real; diff --git a/Src/VertexFactory.inl b/Src/VertexFactory.inl index f8e990f1..43b4331c 100644 --- a/Src/VertexFactory.inl +++ b/Src/VertexFactory.inl @@ -47,12 +47,18 @@ namespace VertexFactory { switch( plyType ) { - case PLY_INT: return TypeOnDisk::INT; - case PLY_UINT: return TypeOnDisk::UINT; - case PLY_CHAR: return TypeOnDisk::CHAR; - case PLY_UCHAR: return TypeOnDisk::UCHAR; - case PLY_FLOAT: return TypeOnDisk::FLOAT; - case PLY_DOUBLE: return TypeOnDisk::DOUBLE; + case PLY_INT: return TypeOnDisk::INT; + case PLY_UINT: return TypeOnDisk::UINT; + case PLY_CHAR: return TypeOnDisk::CHAR; + case PLY_UCHAR: return TypeOnDisk::UCHAR; + case PLY_FLOAT: return TypeOnDisk::FLOAT; + case PLY_DOUBLE: return TypeOnDisk::DOUBLE; + case PLY_INT_8: return TypeOnDisk::CHAR; + case PLY_UINT_8: return TypeOnDisk::UCHAR; + case PLY_INT_32: return TypeOnDisk::INT; + case PLY_UINT_32: return TypeOnDisk::UINT; + case PLY_FLOAT_32: return TypeOnDisk::FLOAT; + case PLY_FLOAT_64: return TypeOnDisk::DOUBLE; default: ERROR_OUT( "Unrecognized type: " , plyType ); } return TypeOnDisk::UNKNOWN;