diff --git a/src/meshlabplugins/filter_screened_poisson/Src/Allocator.h b/src/meshlabplugins/filter_screened_poisson/Src/Allocator.h index 3ba23d9d6..eb074095c 100755 --- a/src/meshlabplugins/filter_screened_poisson/Src/Allocator.h +++ b/src/meshlabplugins/filter_screened_poisson/Src/Allocator.h @@ -30,6 +30,7 @@ DAMAGE. #define ALLOCATOR_INCLUDED #include +#include class AllocatorState { @@ -148,7 +149,7 @@ public: if( elements>blockSize ) fprintf( stderr , "[ERROR] Allocator: elements bigger than block-size: %d>%d\n" , elements , blockSize ) , exit( 0 ); if( remains const C* GetPointer( const C& c ){ return &c; } template< class C > C* GetPointer( std::vector< C >& v ){ return &v[0]; } template< class C > const C* GetPointer( const std::vector< C >& v ){ return &v[0]; } -template< class C > C* GetPointer( C* c , int sz ) { return c; } -template< class C > const C* GetPointer( const C* c , int sz ) { return c; } +template< class C > C* GetPointer( C* c , int ) { return c; } +template< class C > const C* GetPointer( const C* c , int ) { return c; } #endif // ARRAY_DEBUG #endif // ARRAY_INCLUDED diff --git a/src/meshlabplugins/filter_screened_poisson/Src/MultiGridOctreeData.Evaluation.inl b/src/meshlabplugins/filter_screened_poisson/Src/MultiGridOctreeData.Evaluation.inl index a4f57e94f..1926977d1 100644 --- a/src/meshlabplugins/filter_screened_poisson/Src/MultiGridOctreeData.Evaluation.inl +++ b/src/meshlabplugins/filter_screened_poisson/Src/MultiGridOctreeData.Evaluation.inl @@ -57,7 +57,7 @@ void Octree< Real >::_Evaluator< FEMDegree , BType >::set( LocalDepth depth ) } //// The face stencil - for( int f=0 ; f::_Evaluator< FEMDegree , BType >::set( LocalDepth depth ) } //// The edge stencil - for( int e=0 ; e::_Evaluator< FEMDegree , BType >::set( LocalDepth depth ) } //// The corner stencil - for( int c=0 ; c::_Evaluator< FEMDegree , BType >::set( LocalDepth depth ) } //// The face stencil - for( int f=0 ; f::_Evaluator< FEMDegree , BType >::set( LocalDepth depth ) } //// The edge stencil - for( int e=0 ; e::_Evaluator< FEMDegree , BType >::set( LocalDepth depth ) } //// The corner stencil - for( int c=0 ; c::_getValue( const ConstPointSupportKey< FEMDegree >& neighborKe { static const int SupportSize = BSplineSupportSizes< FEMDegree >::SupportSize; static const int LeftSupportRadius = -BSplineSupportSizes< FEMDegree >::SupportStart; - static const int RightSupportRadius = BSplineSupportSizes< FEMDegree >::SupportEnd; + //static const int RightSupportRadius = BSplineSupportSizes< FEMDegree >::SupportEnd; static const int LeftPointSupportRadius = BSplineSupportSizes< FEMDegree >::SupportEnd; static const int RightPointSupportRadius = - BSplineSupportSizes< FEMDegree >::SupportStart; diff --git a/src/meshlabplugins/filter_screened_poisson/Src/MultiGridOctreeData.IsoSurface.inl b/src/meshlabplugins/filter_screened_poisson/Src/MultiGridOctreeData.IsoSurface.inl index 2be26dc51..fb8500208 100755 --- a/src/meshlabplugins/filter_screened_poisson/Src/MultiGridOctreeData.IsoSurface.inl +++ b/src/meshlabplugins/filter_screened_poisson/Src/MultiGridOctreeData.IsoSurface.inl @@ -26,6 +26,8 @@ ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF S DAMAGE. */ +#include "MultiGridOctreeData.h" + #include "Octree.h" #include "MyTime.h" #include "MemoryUsage.h" @@ -762,11 +764,11 @@ void Octree< Real >::_setIsoSurface( LocalDepth depth , int offset , const _Slic if( inBounds && !IsActiveNode( leaf->children ) ) { edges.clear(); - unsigned char mcIndex = ( bValues.mcIndices[ i - bValues.sliceData.nodeOffset ] ) | ( fValues.mcIndices[ i - fValues.sliceData.nodeOffset ]<<4 ); + //unsigned char mcIndex = ( bValues.mcIndices[ i - bValues.sliceData.nodeOffset ] ) | ( fValues.mcIndices[ i - fValues.sliceData.nodeOffset ]<<4 ); // [WARNING] Just because the node looks empty doesn't mean it doesn't get eges from finer neighbors { // Gather the edges from the faces (with the correct orientation) - for( int f=0 ; f::_setIsoSurface( LocalDepth depth , int offset , const _Slic long long start = edge[0] , current = edge[1]; while( current!=start ) { - int idx; - for( idx=0 ; idx<(int)edges.size() ; idx++ ) if( edges[idx][0]==current ) break; + unsigned int idx; + for( idx=0 ; idx::const_iterator iter; diff --git a/src/meshlabplugins/filter_screened_poisson/Src/MultiGridOctreeData.System.inl b/src/meshlabplugins/filter_screened_poisson/Src/MultiGridOctreeData.System.inl index be2140283..223358157 100644 --- a/src/meshlabplugins/filter_screened_poisson/Src/MultiGridOctreeData.System.inl +++ b/src/meshlabplugins/filter_screened_poisson/Src/MultiGridOctreeData.System.inl @@ -545,7 +545,7 @@ void Octree< Real >::_upSample( LocalDepth highDepth , DenseNodeData< C , FEMDeg static const int DownSampleSize = BSplineSupportSizes< FEMDegree >::DownSample0Size > BSplineSupportSizes< FEMDegree >::DownSample1Size ? BSplineSupportSizes< FEMDegree >::DownSample0Size : BSplineSupportSizes< FEMDegree >::DownSample1Size; Stencil< double , DownSampleSize > downSampleStencils[ Cube::CORNERS ]; int lowCenter = ( 1<>1; - for( int c=0 ; c::_updateCumulativeInterpolationConstraintsFromFiner( const I static const int LeftPointSupportRadius = BSplineSupportSizes< FEMDegree >::SupportEnd; static const int RightPointSupportRadius = -BSplineSupportSizes< FEMDegree >::SupportStart; static const int LeftSupportRadius = -BSplineSupportSizes< FEMDegree >::SupportStart; - static const int RightSupportRadius = BSplineSupportSizes< FEMDegree >::SupportEnd; + //static const int RightSupportRadius = BSplineSupportSizes< FEMDegree >::SupportEnd; // Note: We can't iterate over the finer point nodes as the point weights might be // scaled incorrectly, due to the adaptive exponent. So instead, we will iterate // over the coarser nodes and evaluate the finer solution at the associated points. LocalDepth lowDepth = highDepth-1; if( lowDepth<0 ) return; - size_t start = _sNodesBegin(lowDepth) , end = _sNodesEnd(lowDepth); + //size_t start = _sNodesBegin(lowDepth) , end = _sNodesEnd(lowDepth); std::vector< PointSupportKey< FEMDegree > > neighborKeys( std::max< int >( 1 , threads ) ); for( size_t i=0 ; i::_getSliceMatrixAndUpdateConstraints( const FEMSystemFunctor& } } #if !defined( _WIN32 ) && !defined( _WIN64 ) -#pragma message( "[WARNING] I'm not sure how expensive this system call is on non-Windows system. (You may want to comment this out.)" ) +//#pragma message( "[WARNING] I'm not sure how expensive this system call is on non-Windows system. (You may want to comment this out.)" ) #endif // !_WIN32 && !_WIN64 memoryUsage(); return 1; @@ -1638,7 +1638,7 @@ void Octree< Real >::_updateConstraintsFromCoarser( const FEMSystemFunctor& F , // Given the solution @( depth ) add to the met constraints @( depth-1 ) template< class Real > template< int FEMDegree , BoundaryType BType , class FEMSystemFunctor > -void Octree< Real >::_updateCumulativeIntegralConstraintsFromFiner( const FEMSystemFunctor& F , const BSplineData< FEMDegree , BType >& bsData , LocalDepth highDepth , const DenseNodeData< Real , FEMDegree >& fineSolution , DenseNodeData< Real , FEMDegree >& coarseConstraints ) const +void Octree< Real >::_updateCumulativeIntegralConstraintsFromFiner( const FEMSystemFunctor& F , const BSplineData< FEMDegree , BType >& , LocalDepth highDepth , const DenseNodeData< Real , FEMDegree >& fineSolution , DenseNodeData< Real , FEMDegree >& coarseConstraints ) const { typename BSplineIntegrationData< FEMDegree , BType , FEMDegree , BType >::FunctionIntegrator::template ChildIntegrator< DERIVATIVES( FEMDegree ) , DERIVATIVES( FEMDegree ) > childIntegrator; BSplineIntegrationData< FEMDegree , BType , FEMDegree , BType >::SetChildIntegrator( childIntegrator , highDepth-1 ); @@ -1651,8 +1651,8 @@ void Octree< Real >::_updateCumulativeIntegralConstraintsFromFiner( const FEMSys // Get the stencil describing the Laplacian relating coefficients @(depth) with coefficients @(depth-1) Stencil< double , OverlapSize > stencils[2][2][2]; SystemCoefficients< FEMDegree , BType , FEMDegree , BType >::SetCentralSystemStencils( F , childIntegrator , stencils ); - size_t start = _sNodesBegin( highDepth) , end = _sNodesEnd(highDepth) , range = end-start; - int lStart = _sNodesBegin(highDepth-1); + size_t start = _sNodesBegin( highDepth) , end = _sNodesEnd(highDepth) ; + //int lStart = _sNodesBegin(highDepth-1); // Iterate over the nodes @( depth ) std::vector< SupportKey > neighborKeys( std::max< int >( 1 , threads ) ); @@ -1926,7 +1926,7 @@ void Octree< Real >::_addFEMConstraints( const FEMConstraintFunctor& F , const C // Compute the contribution from all coarser depths for( LocalDepth d=1 ; d<=maxDepth ; d++ ) { - size_t start = _sNodesBegin( d ) , end = _sNodesEnd( d ); + //size_t start = _sNodesBegin( d ) , end = _sNodesEnd( d ); Stencil< _D , CFEMOverlapSize > stencils[2][2][2]; typename SystemCoefficients< CDegree , CBType , FEMDegree , FEMBType >::ChildIntegrator childIntegrator; BSplineIntegrationData< CDegree , CBType , FEMDegree , FEMBType >::SetChildIntegrator( childIntegrator , d-1 ); diff --git a/src/meshlabplugins/filter_screened_poisson/Src/MultiGridOctreeData.h b/src/meshlabplugins/filter_screened_poisson/Src/MultiGridOctreeData.h index b5aa80825..ab3e72cb1 100755 --- a/src/meshlabplugins/filter_screened_poisson/Src/MultiGridOctreeData.h +++ b/src/meshlabplugins/filter_screened_poisson/Src/MultiGridOctreeData.h @@ -692,7 +692,7 @@ public: const Point3D< Real >& normal = *n; if( normal[0]!=0 || normal[1]!=0 || normal[2]!=0 ) return true; } - if( node->children ) for( int c=0 ; cchildren + c ) ) return true; + if( node->children ) for( unsigned int c=0 ; cchildren + c ) ) return true; return false; } }; diff --git a/src/meshlabplugins/filter_screened_poisson/Src/MultiGridOctreeData.inl b/src/meshlabplugins/filter_screened_poisson/Src/MultiGridOctreeData.inl index 4aedb4ee7..0a93d14cb 100755 --- a/src/meshlabplugins/filter_screened_poisson/Src/MultiGridOctreeData.inl +++ b/src/meshlabplugins/filter_screened_poisson/Src/MultiGridOctreeData.inl @@ -187,18 +187,30 @@ template< class Real > struct _PointDataAccumulator_< Real , false > { #if POINT_DATA_RES - static inline void _AddToPointData_( PointData< Real , false >& pData , Point3D< Real > position , Real value , Point3D< Real > gradient , Point3D< Real > center , Real width , Real weight ){ pData.addPoint( SinglePointData< Real , false >( position , value , weight ) , center , width ); } + static inline void _AddToPointData_( PointData< Real , false >& pData , Point3D< Real > position , Real value , Point3D< Real > , Point3D< Real > center , Real width , Real weight ) + { + pData.addPoint( SinglePointData< Real , false >( position , value , weight ) , center , width ); + } #else // !POINT_DATA_RES - static inline void _AddToPointData_( PointData< Real , false >& pData , Point3D< Real > position , Real value , Point3D< Real > gradient , Real weight ){ pData.position += position , pData.value += value , pData.weight += weight; } + static inline void _AddToPointData_( PointData< Real , false >& pData , Point3D< Real > position , Real value , Point3D< Real > , Real weight ) + { + pData.position += position , pData.value += value , pData.weight += weight; + } #endif // POINT_DATA_RES }; template< class Real > struct _PointDataAccumulator_< Real , true > { #if POINT_DATA_RES - static inline void _AddToPointData_( PointData< Real , true >& pData , Point3D< Real > position , Real value , Point3D< Real > gradient , Point3D< Real > center , Real width , Real weight ){ pData.addPoint( SinglePointData< Real , true >( position , value , gradient , weight ) , center , width ); } + static inline void _AddToPointData_( PointData< Real , true >& pData , Point3D< Real > position , Real value , Point3D< Real > gradient , Point3D< Real > center , Real width , Real weight ) + { + pData.addPoint( SinglePointData< Real , true >( position , value , gradient , weight ) , center , width ); + } #else // !POINT_DATA_RES - static inline void _AddToPointData_( PointData< Real , true >& pData , Point3D< Real > position , Real value , Point3D< Real > gradient , Real weight ){ pData.position += position , pData.value += value , pData.gradient += gradient , pData.weight += weight; } + static inline void _AddToPointData_( PointData< Real , true >& pData , Point3D< Real > position , Real value , Point3D< Real > gradient , Real weight ) + { + pData.position += position , pData.value += value , pData.gradient += gradient , pData.weight += weight; + } #endif // POINT_DATA_RES }; @@ -294,7 +306,7 @@ typename Octree< Real >::template DensityEstimator< DensityDegree >* Octree< Rea #ifdef FAST_SET_UP std::vector< int > sampleMap( NodeCount() , -1 ); #pragma omp parallel for num_threads( threads ) - for( unsigned int i=0 ; i0 ) sampleMap[ samples[i].node->nodeData.nodeIndex ] = i; std::function< ProjectiveData< OrientedPoint3D< Real > , Real > ( TreeOctNode* ) > SetDensity = [&] ( TreeOctNode* node ) @@ -328,7 +340,7 @@ typename Octree< Real >::template DensityEstimator< DensityDegree >* Octree< Rea }; SetDensity( _spaceRoot ); #else // !FAST_SET_UP - for( unsigned int i=0 ; i , Real >& sample = samples[i].sample; diff --git a/src/meshlabplugins/filter_screened_poisson/poisson_utils.h b/src/meshlabplugins/filter_screened_poisson/poisson_utils.h index 6c8fccf0c..683f6cd74 100644 --- a/src/meshlabplugins/filter_screened_poisson/poisson_utils.h +++ b/src/meshlabplugins/filter_screened_poisson/poisson_utils.h @@ -458,7 +458,7 @@ int _Execute( double valueSum = 0 , weightSum = 0; typename Octree< Real >::template MultiThreadedEvaluator< Degree , BType > evaluator( &tree , solution , pp.ThreadsVal ); #pragma omp parallel for num_threads( pp.ThreadsVal ) reduction( + : valueSum , weightSum ) - for( unsigned int j=0 ; jsize() ; j++ ) { + for( int j=0 ; j<(int)samples->size() ; j++ ) { ProjectiveData< OrientedPoint3D< Real > , Real >& sample = (*samples)[j].sample; Real w = sample.weight; if( w>0 ) weightSum += w , valueSum += evaluator.value( sample.data.p / sample.weight , omp_get_thread_num() , (*samples)[j].node ) * w;