@@ -247,7 +247,7 @@ Real Octree< Real >::GetIsoValue( ConstPointer( Real ) solution , const std::vec
247247 for ( int d=maxDepth ; d>=_minDepth ; d-- )
248248 {
249249 std::vector< typename TreeOctNode::ConstNeighborKey3 > neighborKeys ( std::max< int >( 1 , threads ) );
250- for ( int i=0 ; i<neighborKeys.size () ; i++ ) neighborKeys[i].set ( d );
250+ for ( size_t i=0 ; i<neighborKeys.size () ; i++ ) neighborKeys[i].set ( d );
251251#pragma omp parallel for num_threads( threads ) reduction( + : isoValue , weightSum )
252252 for ( int i=_sNodes.nodeCount [d] ; i<_sNodes.nodeCount [d+1 ] ; i++ )
253253 {
@@ -279,8 +279,7 @@ Real Octree< Real >::GetIsoValue( ConstPointer( Real ) solution , const std::vec
279279 if ( w!=0 ) isoValue += value * w , weightSum += w;
280280 }
281281 }
282- if ( _boundaryType==-1 ) return isoValue/weightSum - Real (0.5 );
283- else return isoValue/weightSum;
282+ return isoValue / weightSum;
284283}
285284
286285template < class Real >
@@ -296,7 +295,7 @@ void Octree< Real >::SetSliceIsoCorners( ConstPointer( Real ) solution , ConstPo
296295{
297296 typename Octree< Real >::template SliceValues< Vertex >& sValues = slabValues[depth].sliceValues ( slice );
298297 std::vector< typename TreeOctNode::ConstNeighborKey3 > neighborKeys ( std::max< int >( 1 , threads ) );
299- for ( int i=0 ; i<neighborKeys.size () ; i++ ) neighborKeys[i].set ( depth );
298+ for ( size_t i=0 ; i<neighborKeys.size () ; i++ ) neighborKeys[i].set ( depth );
300299#pragma omp parallel for num_threads( threads )
301300 for ( int i=_sNodes.nodeCount [depth]+_sNodes.sliceOffsets [depth][slice-z] ; i<_sNodes.nodeCount [depth]+_sNodes.sliceOffsets [depth][slice-z+1 ] ; i++ )
302301 {
@@ -364,7 +363,7 @@ void Octree< Real >::SetSliceIsoVertices( ConstPointer( Real ) kernelDensityWeig
364363{
365364 typename Octree< Real >::template SliceValues< Vertex >& sValues = slabValues[depth].sliceValues ( slice );
366365 std::vector< typename TreeOctNode::ConstNeighborKey3 > neighborKeys ( std::max< int >( 1 , threads ) );
367- for ( int i=0 ; i<neighborKeys.size () ; i++ ) neighborKeys[i].set ( depth );
366+ for ( size_t i=0 ; i<neighborKeys.size () ; i++ ) neighborKeys[i].set ( depth );
368367#pragma omp parallel for num_threads( threads )
369368 for ( int i=_sNodes.nodeCount [depth]+_sNodes.sliceOffsets [depth][slice-z] ; i<_sNodes.nodeCount [depth]+_sNodes.sliceOffsets [depth][slice-z+1 ] ; i++ )
370369 {
@@ -456,7 +455,7 @@ void Octree< Real >::SetXSliceIsoVertices( ConstPointer( Real ) kernelDensityWei
456455 typename Octree< Real >::template XSliceValues< Vertex >& xValues = slabValues[depth].xSliceValues ( slab );
457456
458457 std::vector< typename TreeOctNode::ConstNeighborKey3 > neighborKeys ( std::max< int >( 1 , threads ) );
459- for ( int i=0 ; i<neighborKeys.size () ; i++ ) neighborKeys[i].set ( depth );
458+ for ( size_t i=0 ; i<neighborKeys.size () ; i++ ) neighborKeys[i].set ( depth );
460459#pragma omp parallel for num_threads( threads )
461460 for ( int i=_sNodes.nodeCount [depth]+_sNodes.sliceOffsets [depth][slab] ; i<_sNodes.nodeCount [depth]+_sNodes.sliceOffsets [depth][slab+1 ] ; i++ )
462461 {
@@ -661,7 +660,7 @@ void Octree< Real >::SetSliceIsoEdges( int depth , int slice , int z , std::vect
661660{
662661 typename Octree< Real >::template SliceValues< Vertex >& sValues = slabValues[depth].sliceValues ( slice );
663662 std::vector< typename TreeOctNode::ConstNeighborKey3 > neighborKeys ( std::max< int >( 1 , threads ) );
664- for ( int i=0 ; i<neighborKeys.size () ; i++ ) neighborKeys[i].set ( depth );
663+ for ( size_t i=0 ; i<neighborKeys.size () ; i++ ) neighborKeys[i].set ( depth );
665664#pragma omp parallel for num_threads( threads )
666665 for ( int i=_sNodes.nodeCount [depth]+_sNodes.sliceOffsets [depth][slice-z] ; i<_sNodes.nodeCount [depth]+_sNodes.sliceOffsets [depth][slice-z+1 ] ; i++ )
667666 {
@@ -721,7 +720,7 @@ void Octree< Real >::SetXSliceIsoEdges( int depth , int slab , std::vector< Slab
721720 typename Octree< Real >::template XSliceValues< Vertex >& xValues = slabValues[depth].xSliceValues ( slab );
722721
723722 std::vector< typename TreeOctNode::ConstNeighborKey3 > neighborKeys ( std::max< int >( 1 , threads ) );
724- for ( int i=0 ; i<neighborKeys.size () ; i++ ) neighborKeys[i].set ( depth );
723+ for ( size_t i=0 ; i<neighborKeys.size () ; i++ ) neighborKeys[i].set ( depth );
725724#pragma omp parallel for num_threads( threads )
726725 for ( int i=_sNodes.nodeCount [depth]+_sNodes.sliceOffsets [depth][slab] ; i<_sNodes.nodeCount [depth]+_sNodes.sliceOffsets [depth][slab+1 ] ; i++ )
727726 {
@@ -797,7 +796,7 @@ void Octree< Real >::SetIsoSurface( int depth , int offset , const SliceValues<
797796 std::vector< std::pair< int , Vertex > > polygon;
798797 std::vector< typename TreeOctNode::ConstNeighborKey3 > neighborKeys ( std::max< int >( 1 , threads ) );
799798 std::vector< std::vector< IsoEdge > > edgess ( std::max< int >( 1 , threads ) );
800- for ( int i=0 ; i<neighborKeys.size () ; i++ ) neighborKeys[i].set ( depth );
799+ for ( size_t i=0 ; i<neighborKeys.size () ; i++ ) neighborKeys[i].set ( depth );
801800#pragma omp parallel for num_threads( threads )
802801 for ( int i=_sNodes.nodeCount [depth]+_sNodes.sliceOffsets [depth][offset] ; i<_sNodes.nodeCount [depth]+_sNodes.sliceOffsets [depth][offset+1 ] ; i++ )
803802 {
@@ -834,7 +833,7 @@ void Octree< Real >::SetIsoSurface( int depth , int offset , const SliceValues<
834833 if ( iter!=sValues .faceEdgeMap .end () )
835834 {
836835 const std::vector< IsoEdge >& _edges = iter->second ;
837- for ( int j=0 ; j<_edges.size () ; j++ ) edges.push_back ( IsoEdge ( _edges[j][flip] , _edges[j][1 -flip] ) );
836+ for ( size_t j=0 ; j<_edges.size () ; j++ ) edges.push_back ( IsoEdge ( _edges[j][flip] , _edges[j][1 -flip] ) );
838837 }
839838 else fprintf ( stderr , " [ERROR] Invalid faces: %d %d %d\n " , i , d , o ) , exit ( 0 );
840839 }
@@ -854,7 +853,7 @@ void Octree< Real >::SetIsoSurface( int depth , int offset , const SliceValues<
854853 if ( iter!=xValues.faceEdgeMap .end () )
855854 {
856855 const std::vector< IsoEdge >& _edges = iter->second ;
857- for ( int j=0 ; j<_edges.size () ; j++ ) edges.push_back ( IsoEdge ( _edges[j][flip] , _edges[j][1 -flip] ) );
856+ for ( size_t j=0 ; j<_edges.size () ; j++ ) edges.push_back ( IsoEdge ( _edges[j][flip] , _edges[j][1 -flip] ) );
858857 }
859858 else fprintf ( stderr , " [ERROR] Invalid faces: %d %d %d\n " , i , d , o ) , exit ( 0 );
860859 }
@@ -871,7 +870,7 @@ void Octree< Real >::SetIsoSurface( int depth , int offset , const SliceValues<
871870 while ( current!=start )
872871 {
873872 int idx;
874- for ( idx=0 ; idx<edges.size () ; idx++ ) if ( edges[idx][0 ]==current ) break ;
873+ for ( idx=0 ; idx<( int ) edges.size () ; idx++ ) if ( edges[idx][0 ]==current ) break ;
875874 if ( idx==edges.size () )
876875 {
877876 typename hash_map< long long , long long >::const_iterator iter;
@@ -890,10 +889,10 @@ void Octree< Real >::SetIsoSurface( int depth , int offset , const SliceValues<
890889 loops.back ().push_back ( start );
891890 }
892891 // Add the loops to the mesh
893- for ( int j=0 ; j<loops.size () ; j++ )
892+ for ( size_t j=0 ; j<loops.size () ; j++ )
894893 {
895894 std::vector< std::pair< int , Vertex > > polygon ( loops[j].size () );
896- for ( int k=0 ; k<loops[j].size () ; k++ )
895+ for ( size_t k=0 ; k<loops[j].size () ; k++ )
897896 {
898897 long long key = loops[j][k];
899898 typename hash_map< long long , std::pair< int , Vertex > >::const_iterator iter;
0 commit comments