Commit 2b6ef96d authored by Matthias Möller's avatar Matthias Möller
Browse files

fixes some cpp check warnings

refs #1403

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free-Staging@16367 383ad7c9-94d9-4d36-a494-682f7c89f535
parent a16779e6
......@@ -90,9 +90,9 @@ template< class C > ConstArray< C > GetPointer( const std::vector< C >& v ){ ret
#define DeletePointer( ... ) { if( __VA_ARGS__ ) delete[] __VA_ARGS__ , __VA_ARGS__ = NULL; }
template< class C > C* NewPointer( size_t size , const char* name=NULL ){ return new C[size]; }
template< class C > C* AllocPointer( size_t size , const char* name=NULL ){ return (C*) malloc( sizeof(C) * size ); }
template< class C > C* AlignedAllocPointer( size_t size , size_t alignment , const char* name=NULL ){ return (C*)aligned_malloc( sizeof(C) * size , alignment ); }
template< class C > C* ReAllocPointer( C* c , size_t size , const char* name=NULL ){ return (C*) realloc( c , sizeof(C) * size ); }
template< class C > C* AllocPointer( size_t size , const char* name=NULL ){ return static_cast<C*> (malloc( sizeof(C) * size )); }
template< class C > C* AlignedAllocPointer( size_t size , size_t alignment , const char* name=NULL ){ return static_cast<C*>(aligned_malloc( sizeof(C) * size , alignment )); }
template< class C > C* ReAllocPointer( C* c , size_t size , const char* name=NULL ){ return static_cast<C*> (realloc( c , sizeof(C) * size )); }
template< class C > C* NullPointer( void ){ return NULL; }
......
......@@ -33,106 +33,106 @@ DAMAGE.
#include "PPolynomial.h"
#include "Array.h"
template< unsigned int Degree >
template< int Degree >
struct BSplineElementCoefficients
{
int coeffs[Degree+1];
BSplineElementCoefficients( void ) { memset( coeffs , 0 , sizeof( int ) * ( Degree+1 ) ); }
int& operator[]( int idx ){ return coeffs[idx]; }
const int& operator[]( int idx ) const { return coeffs[idx]; }
int coeffs[Degree+1];
BSplineElementCoefficients( void ) { memset( coeffs , 0 , sizeof( int ) * ( Degree+1 ) ); }
int& operator[]( unsigned int idx ){ if (idx <= Degree) return coeffs[idx]; return coeffs[0];}
const int& operator[]( unsigned int idx ) const {if (idx <= Degree) return coeffs[idx]; return coeffs[0];}
};
template< int Degree >
struct BSplineElements : public std::vector< BSplineElementCoefficients< Degree > >
{
static const int _off = (Degree+1)/2;
void _addLeft ( int offset , int boundary );
void _addRight( int offset , int boundary );
static const int _off = (Degree+1)/2;
void _addLeft ( int offset , int boundary );
void _addRight( int offset , int boundary );
public:
enum
{
NONE = 0,
DIRICHLET = -1,
NEUMANN = 1
};
// Coefficients are ordered as "/" "-" "\"
int denominator;
BSplineElements( void ) { denominator = 1; }
BSplineElements( int res , int offset , int boundary=NONE , int inset=0 );
void upSample( BSplineElements& high ) const;
void differentiate( BSplineElements< Degree-1 >& d ) const;
void print( FILE* fp=stdout ) const
{
enum
{
NONE = 0,
DIRICHLET = -1,
NEUMANN = 1
};
// Coefficients are ordered as "/" "-" "\"
int denominator;
BSplineElements( void ) { denominator = 1; }
BSplineElements( int res , int offset , int boundary=NONE , int inset=0 );
void upSample( BSplineElements& high ) const;
void differentiate( BSplineElements< Degree-1 >& d ) const;
void print( FILE* fp=stdout ) const
{
for( int i=0 ; i< this->size() ; i++ )
{
printf( "%d]" , i );
for( int j=0 ; j<=Degree ; j++ ) printf( " %d" , (*this)[i][j] );
printf( " (%d)\n" , denominator );
}
}
{
printf( "%d]" , i );
for( int j=0 ; j<=Degree ; j++ ) printf( " %d" , (*this)[i][j] );
printf( " (%d)\n" , denominator );
}
}
};
template< int Degree , class Real >
class BSplineData
{
bool useDotRatios;
int boundaryType;
bool useDotRatios;
int boundaryType;
public:
struct BSplineComponents
{
Polynomial< Degree > polys[Degree+1];
Polynomial< Degree >& operator[] ( int idx ) { return polys[idx]; }
const Polynomial< Degree >& operator[] ( int idx ) const { return polys[idx]; }
void printnl( void ) const { for( int d=0 ; d<=Degree ; d++ ) polys[d].printnl(); }
BSplineComponents scale( double s ) const { BSplineComponents b ; for( int d=0 ; d<=Degree ; d++ ) b[d] = polys[d].scale(s) ; return b; }
BSplineComponents shift( double s ) const { BSplineComponents b ; for( int d=0 ; d<=Degree ; d++ ) b[d] = polys[d].shift(s) ; return b; }
};
const static int VV_DOT_FLAG = 1;
const static int DV_DOT_FLAG = 2;
const static int DD_DOT_FLAG = 4;
const static int VALUE_FLAG = 1;
const static int D_VALUE_FLAG = 2;
int depth , functionCount , sampleCount;
Pointer( Real ) vvDotTable;
Pointer( Real ) dvDotTable;
Pointer( Real ) ddDotTable;
Pointer( Real ) valueTables;
Pointer( Real ) dValueTables;
PPolynomial< Degree > baseFunction , leftBaseFunction , rightBaseFunction , leftRightBaseFunction;
PPolynomial< Degree-1 > dBaseFunction , dLeftBaseFunction , dRightBaseFunction , dLeftRightBaseFunction;
BSplineComponents baseBSpline , leftBSpline , rightBSpline , leftRightBSpline;
Pointer( PPolynomial< Degree > ) baseFunctions;
Pointer( BSplineComponents ) baseBSplines;
BSplineData(void);
~BSplineData(void);
virtual void setDotTables( int flags , bool inset=false );
virtual void clearDotTables( int flags );
virtual void setValueTables( int flags , double smooth=0 );
virtual void setValueTables( int flags , double valueSmooth , double normalSmooth );
virtual void clearValueTables( void );
void setSampleSpan( int idx , int& start , int& end , double smooth=0 ) const;
/********************************************************
* Sets the translates and scales of the basis function
* up to the prescribed depth
* <maxDepth> the maximum depth
* <useDotRatios> specifies if dot-products of derivatives
* should be pre-divided by function integrals
* <reflectBoundary> spcifies if function space should be
* forced to be reflectively symmetric across the boundary
********************************************************/
void set( int maxDepth , bool useDotRatios=true , int boundaryType=BSplineElements< Degree >::NONE );
inline int Index( int i1 , int i2 ) const;
static inline int SymmetricIndex( int i1 , int i2 );
static inline int SymmetricIndex( int i1 , int i2 , int& index );
struct BSplineComponents
{
Polynomial< Degree > polys[Degree+1];
Polynomial< Degree >& operator[] ( unsigned int idx ) { return polys[idx]; }
const Polynomial< Degree >& operator[] ( unsigned int idx ) const { return polys[idx]; }
void printnl( void ) const { for( int d=0 ; d<=Degree ; d++ ) polys[d].printnl(); }
BSplineComponents scale( double s ) const { BSplineComponents b ; for( unsigned int d=0 ; d<=Degree ; d++ ) b[d] = polys[d].scale(s) ; return b; }
BSplineComponents shift( double s ) const { BSplineComponents b ; for( unsigned int d=0 ; d<=Degree ; d++ ) b[d] = polys[d].shift(s) ; return b; }
};
const static int VV_DOT_FLAG = 1;
const static int DV_DOT_FLAG = 2;
const static int DD_DOT_FLAG = 4;
const static int VALUE_FLAG = 1;
const static int D_VALUE_FLAG = 2;
int depth , functionCount , sampleCount;
Pointer( Real ) vvDotTable;
Pointer( Real ) dvDotTable;
Pointer( Real ) ddDotTable;
Pointer( Real ) valueTables;
Pointer( Real ) dValueTables;
PPolynomial< Degree > baseFunction , leftBaseFunction , rightBaseFunction , leftRightBaseFunction;
PPolynomial< Degree-1 > dBaseFunction , dLeftBaseFunction , dRightBaseFunction , dLeftRightBaseFunction;
BSplineComponents baseBSpline , leftBSpline , rightBSpline , leftRightBSpline;
Pointer( PPolynomial< Degree > ) baseFunctions;
Pointer( BSplineComponents ) baseBSplines;
BSplineData(void);
~BSplineData(void);
virtual void setDotTables( int flags , bool inset=false );
virtual void clearDotTables( int flags );
virtual void setValueTables( int flags , double smooth=0 );
virtual void setValueTables( int flags , double valueSmooth , double normalSmooth );
virtual void clearValueTables( void );
void setSampleSpan( int idx , int& start , int& end , double smooth=0 ) const;
/********************************************************
* Sets the translates and scales of the basis function
* up to the prescribed depth
* <maxDepth> the maximum depth
* <useDotRatios> specifies if dot-products of derivatives
* should be pre-divided by function integrals
* <reflectBoundary> spcifies if function space should be
* forced to be reflectively symmetric across the boundary
********************************************************/
void set( int maxDepth , bool useDotRatios=true , int boundaryType=BSplineElements< Degree >::NONE );
inline int Index( int i1 , int i2 ) const;
static inline int SymmetricIndex( int i1 , int i2 );
static inline int SymmetricIndex( int i1 , int i2 , int& index );
};
template< int Degree1 , int Degree2 > void SetBSplineElementIntegrals( double integrals[Degree1+1][Degree2+1] );
......
......@@ -164,6 +164,9 @@ CoredFileMeshData::CoredFileMeshData( void )
oocPointFile = new BufferedReadWriteFile();
polygonFile = new BufferedReadWriteFile();
memset(pointFileName,0,sizeof(char)*1024);
memset(polygonFileName,0,sizeof(char)*1024);
}
CoredFileMeshData::~CoredFileMeshData( void )
{
......
......@@ -29,8 +29,10 @@ DAMAGE.
#ifndef GEOMETRY_INCLUDED
#define GEOMETRY_INCLUDED
#include <math.h>
#include <cmath>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include "Hash.h"
template<class Real>
......@@ -308,11 +310,11 @@ public:
{
Point3D< float > start , end;
float value;
Vertex( void ) { ; }
Vertex( Point3D< float > s , Point3D< float > e , float v ) { start = s , end = e , value = v; }
Vertex( Point3D< float > s , Point3D< float > e , Point3D< float > p )
Vertex( void ):value(0.f) { ; }
Vertex( Point3D< float > s , Point3D< float > e , float v ):start(s),end(e),value(v) { }
Vertex( Point3D< float > s , Point3D< float > e , Point3D< float > p ):
start(s),end(e)
{
start = s , end = e;
// < p , e-s > = < s + v*(e-s) , e-s >
// < p , e-s > - < s , e-s > = v || e-s || ^2
// v = < p-s , e-s > / || e-s ||^2
......
......@@ -4,6 +4,12 @@
#include <hash_map>
using stdext::hash_map;
#else // !WIN32
#if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)>= 40300 //gcc >= 4.3
#include <tr1/unordered_map>
#define hash_map std::tr1::unordered_map
#else //GCC_VERSION < 40300
#include <ext/hash_map>
using namespace __gnu_cxx;
......@@ -24,6 +30,7 @@ namespace __gnu_cxx
size_t operator()(const unsigned long long __x) const { return __x; }
};
}
#endif // gcc >= 4.3
#endif // WIN32
#endif // HASH_INCLUDED
......@@ -34,46 +34,46 @@ DAMAGE.
#include <Windows.h>
class MemoryInfo{
public:
size_t TotalPhysicalMemory;
size_t FreePhysicalMemory;
size_t TotalSwapSpace;
size_t FreeSwapSpace;
size_t TotalVirtualAddressSpace;
size_t FreeVirtualAddressSpace;
size_t PageSize;
void set(void){
MEMORYSTATUSEX Mem;
SYSTEM_INFO Info;
ZeroMemory( &Mem, sizeof(Mem));
ZeroMemory( &Info, sizeof(Info));
Mem.dwLength = sizeof(Mem);
::GlobalMemoryStatusEx( &Mem );
::GetSystemInfo( &Info );
TotalPhysicalMemory = (size_t)Mem.ullTotalPhys;
FreePhysicalMemory = (size_t)Mem.ullAvailPhys;
TotalSwapSpace = (size_t)Mem.ullTotalPageFile;
FreeSwapSpace = (size_t)Mem.ullAvailPageFile;
TotalVirtualAddressSpace = (size_t)Mem.ullTotalVirtual;
FreeVirtualAddressSpace = (size_t)Mem.ullAvailVirtual;
PageSize = (size_t)Info.dwPageSize;
}
size_t usage(void) const {return TotalVirtualAddressSpace-FreeVirtualAddressSpace;}
static size_t Usage(void){
MEMORY_BASIC_INFORMATION mbi;
size_t dwMemUsed = 0;
PVOID pvAddress = 0;
memset(&mbi, 0, sizeof(MEMORY_BASIC_INFORMATION));
while(VirtualQuery(pvAddress, &mbi, sizeof(MEMORY_BASIC_INFORMATION)) == sizeof(MEMORY_BASIC_INFORMATION)){
if(mbi.State == MEM_COMMIT && mbi.Type == MEM_PRIVATE){dwMemUsed += mbi.RegionSize;}
pvAddress = ((BYTE*)mbi.BaseAddress) + mbi.RegionSize;
}
return dwMemUsed;
}
size_t TotalPhysicalMemory;
size_t FreePhysicalMemory;
size_t TotalSwapSpace;
size_t FreeSwapSpace;
size_t TotalVirtualAddressSpace;
size_t FreeVirtualAddressSpace;
size_t PageSize;
void set(void){
MEMORYSTATUSEX Mem;
SYSTEM_INFO Info;
ZeroMemory( &Mem, sizeof(Mem));
ZeroMemory( &Info, sizeof(Info));
Mem.dwLength = sizeof(Mem);
::GlobalMemoryStatusEx( &Mem );
::GetSystemInfo( &Info );
TotalPhysicalMemory = (size_t)Mem.ullTotalPhys;
FreePhysicalMemory = (size_t)Mem.ullAvailPhys;
TotalSwapSpace = (size_t)Mem.ullTotalPageFile;
FreeSwapSpace = (size_t)Mem.ullAvailPageFile;
TotalVirtualAddressSpace = (size_t)Mem.ullTotalVirtual;
FreeVirtualAddressSpace = (size_t)Mem.ullAvailVirtual;
PageSize = (size_t)Info.dwPageSize;
}
size_t usage(void) const {return TotalVirtualAddressSpace-FreeVirtualAddressSpace;}
static size_t Usage(void){
MEMORY_BASIC_INFORMATION mbi;
size_t dwMemUsed = 0;
PVOID pvAddress = 0;
memset(&mbi, 0, sizeof(MEMORY_BASIC_INFORMATION));
while(VirtualQuery(pvAddress, &mbi, sizeof(MEMORY_BASIC_INFORMATION)) == sizeof(MEMORY_BASIC_INFORMATION)){
if(mbi.State == MEM_COMMIT && mbi.Type == MEM_PRIVATE){dwMemUsed += mbi.RegionSize;}
pvAddress = ((BYTE*)mbi.BaseAddress) + mbi.RegionSize;
}
return dwMemUsed;
}
};
#else // !WIN32
......@@ -88,23 +88,23 @@ class MemoryInfo
public:
static size_t Usage(void)
{
FILE* f = fopen("/proc/self/stat","rb");
int d;
long ld;
unsigned long lu;
unsigned long long llu;
char tmp[256];
char* s = &tmp[0];
char c;
int pid;
unsigned long vm;
int n = fscanf(f, "%d %s %c %d %d %d %d %d %lu %lu %lu %lu %lu %lu %lu %ld %ld %ld %ld %d %ld %llu %lu %ld %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %d %d %lu %lu"
,&pid ,s ,&c ,&d ,&d ,&d ,&d ,&d ,&lu ,&lu ,&lu ,&lu ,&lu ,&lu ,&lu ,&ld ,&ld ,&ld ,&ld ,&d ,&ld ,&llu ,&vm ,&ld ,&lu ,&lu ,&lu ,&lu ,&lu ,&lu ,&lu ,&lu ,&lu ,&lu ,&lu ,&lu ,&lu ,&d ,&d ,&lu ,&lu );
fclose(f);
FILE* f = fopen("/proc/self/stat","rb");
int d;
long ld;
unsigned long lu;
unsigned long long llu;
char tmp[256];
char* s = &tmp[0];
char c;
int pid;
unsigned long vm;
fscanf(f, "%d %255s %c %d %d %d %d %d %lu %lu %lu %lu %lu %lu %lu %ld %ld %ld %ld %d %ld %llu %lu %ld %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %d %d %lu %lu"
,&pid ,s ,&c ,&d ,&d ,&d ,&d ,&d ,&lu ,&lu ,&lu ,&lu ,&lu ,&lu ,&lu ,&ld ,&ld ,&ld ,&ld ,&d ,&ld ,&llu ,&vm ,&ld ,&lu ,&lu ,&lu ,&lu ,&lu ,&lu ,&lu ,&lu ,&lu ,&lu ,&lu ,&lu ,&lu ,&d ,&d ,&lu ,&lu );
fclose(f);
/*
pid %d
comm %s
......@@ -148,8 +148,8 @@ processor %d
rt_priority %lu (since kernel 2.5.19)
policy %lu (since kernel 2.5.19)
*/
return vm;
}
return vm;
}
};
#else // __APPLE__: has no "/proc" pseudo-file system
......@@ -182,7 +182,7 @@ class MemoryInfo
public:
static size_t Usage(void)
{
unsigned long rss, vs, psize;
unsigned long rss, vs;
task_t task = MACH_PORT_NULL;
if (task_for_pid(current_task(), getpid(), &task) != KERN_SUCCESS)
......
......@@ -245,7 +245,7 @@ class Octree
Point3D< Real > position;
Real coarserValue;
Real weight;
PointData( Point3D< Real > p=Point3D< Real >() , Real w=0 ) { position = p , weight = w , coarserValue = Real(0); }
PointData( Point3D< Real > p=Point3D< Real >() , Real w=0 ):position(p),coarserValue(Real(0)),weight(w){}
};
std::vector< PointData > _points;
......
......@@ -29,7 +29,7 @@ DAMAGE.
#ifndef DOXY_IGNORE_THIS
#include "Octree.h"
#include "time.h"
#include "Time.h"
#include "MemoryUsage.h"
#include "PointStream.h"
#include "MAT.h"
......@@ -140,7 +140,7 @@ void SortedTreeNodes::setCornerTable( CornerTableData& cData , const TreeOctNode
TreeOctNode* node = treeNodes[i];
if( d<maxDepth && node->children ) continue;
const TreeOctNode::ConstNeighbors3& neighbors = neighborKey.getNeighbors( node , minDepth );
for( unsigned int c=0 ; c<Cube::CORNERS ; c++ ) // Iterate over the cell's corners
for( unsigned int c=0 ; c<Cube::CORNERS ; c++ ) // Iterate over the cell's corners
{
bool cornerOwner = true;
int x , y , z;
......@@ -211,7 +211,7 @@ void SortedTreeNodes::setCornerTable( CornerTableData& cData , const TreeOctNode
int& idx = cData[ treeNodes[i] ][c];
if( idx<0 )
{
fprintf( stderr , "[ERROR] Found unindexed corner nodes[%d][%d] = %d (%d,%d)\n" , treeNodes[i]->nodeData.nodeIndex , c , idx , minDepth , maxDepth );
fprintf( stderr , "[ERROR] Found unindexed corner nodes[%d][%u] = %d (%d,%d)\n" , treeNodes[i]->nodeData.nodeIndex , c , idx , minDepth , maxDepth );
int _d , _off[3];
treeNodes[i]->depthAndOffset( _d , _off );
if( rootNode )
......@@ -254,7 +254,7 @@ int SortedTreeNodes::getMaxCornerCount( int depth , int maxDepth , int threads )
if( d<maxDepth && node->children ) continue;
const TreeOctNode::ConstNeighbors3& neighbors = neighborKey.getNeighbors( node , depth );
for( unsigned int c=0 ; c<Cube::CORNERS ; c++ ) // Iterate over the cell's corners
for( unsigned int c=0 ; c<Cube::CORNERS ; c++ ) // Iterate over the cell's corners
{
bool cornerOwner = true;
int x , y , z;
......@@ -521,7 +521,11 @@ Octree<Degree>::Octree(void)
radius = 0;
width = 0;
postDerivativeSmooth = 0;
_minDepth = 0;
_constrainValues = false;
_boundaryType = 0;
_scale = Real(0);
normals = NULL;
}
template< int Degree >
......@@ -626,11 +630,11 @@ Real Octree< Degree >::SplatOrientedPoint( const Point3D<Real>& position , const
temp=&temp->children[cIndex];
myWidth/=2;
if(cIndex&1) myCenter[0] += myWidth/2;
else myCenter[0] -= myWidth/2;
else myCenter[0] -= myWidth/2;
if(cIndex&2) myCenter[1] += myWidth/2;
else myCenter[1] -= myWidth/2;
else myCenter[1] -= myWidth/2;
if(cIndex&4) myCenter[2] += myWidth/2;
else myCenter[2] -= myWidth/2;
else myCenter[2] -= myWidth/2;
}
Real weight , depth;
GetSampleDepthAndWeight( temp , position , neighborKey3 , samplesPerNode , depth , weight );
......@@ -764,11 +768,11 @@ Real Octree< Degree >::SplatOrientedPoint( const Point3D<Real>& position , const
temp=&temp->children[cIndex];
myWidth/=2;
if(cIndex&1) myCenter[0] += myWidth/2;
else myCenter[0] -= myWidth/2;
else myCenter[0] -= myWidth/2;
if(cIndex&2) myCenter[1] += myWidth/2;
else myCenter[1] -= myWidth/2;
else myCenter[1] -= myWidth/2;
if(cIndex&4) myCenter[2] += myWidth/2;
else myCenter[2] -= myWidth/2;
else myCenter[2] -= myWidth/2;
}
Real weight , depth;
GetSampleDepthAndWeight( temp , position , neighborKey , samplesPerNode , depth , weight );
......@@ -796,11 +800,11 @@ Real Octree< Degree >::SplatOrientedPoint( const Point3D<Real>& position , const
temp=&temp->children[cIndex];
myWidth/=2;
if(cIndex&1) myCenter[0] += myWidth/2;
else myCenter[0] -= myWidth/2;
else myCenter[0] -= myWidth/2;
if(cIndex&2) myCenter[1] += myWidth/2;
else myCenter[1] -= myWidth/2;
else myCenter[1] -= myWidth/2;
if(cIndex&4) myCenter[2] += myWidth/2;
else myCenter[2] -= myWidth/2;
else myCenter[2] -= myWidth/2;
}
width = 1.0 / ( 1<<temp->depth() );
n = normal * weight / Real( pow( width , 3 ) ) * Real( dx );
......@@ -1030,11 +1034,11 @@ int Octree<Degree>::setTree( char* fileName , int maxDepth , int minDepth ,
temp = &temp->children[cIndex];
myWidth /= 2;
if(cIndex&1) myCenter[0] += myWidth/2;
else myCenter[0] -= myWidth/2;
else myCenter[0] -= myWidth/2;
if(cIndex&2) myCenter[1] += myWidth/2;
else myCenter[1] -= myWidth/2;
else myCenter[1] -= myWidth/2;
if(cIndex&4) myCenter[2] += myWidth/2;
else myCenter[2] -= myWidth/2;
else myCenter[2] -= myWidth/2;
d++;
}
pointWeight = GetSampleWeight( temp , p , neighborKey );
......@@ -1047,11 +1051,11 @@ int Octree<Degree>::setTree( char* fileName , int maxDepth , int minDepth ,
temp=&temp->children[cIndex];
myWidth/=2;
if(cIndex&1) myCenter[0] += myWidth/2;
else myCenter[0] -= myWidth/2;
else myCenter[0] -= myWidth/2;
if(cIndex&2) myCenter[1] += myWidth/2;
else myCenter[1] -= myWidth/2;
else myCenter[1] -= myWidth/2;
if(cIndex&4) myCenter[2] += myWidth/2;
else myCenter[2] -= myWidth/2;
else myCenter[2] -= myWidth/2;
d++;
}
SplatOrientedPoint( temp , p , n , neighborKey );
......@@ -1083,11 +1087,11 @@ int Octree<Degree>::setTree( char* fileName , int maxDepth , int minDepth ,
temp = &temp->children[cIndex];
myWidth /= 2;
if( cIndex&1 ) myCenter[0] += myWidth/2;
else myCenter[0] -= myWidth/2;
else myCenter[0] -= myWidth/2;
if( cIndex&2 ) myCenter[1] += myWidth/2;
else myCenter[1] -= myWidth/2;
else myCenter[1] -= myWidth/2;
if( cIndex&4 ) myCenter[2] += myWidth/2;
else myCenter[2] -= myWidth/2;
else myCenter[2] -= myWidth/2;
d++;
}