29 #ifndef BINARY_NODE_INCLUDED
30 #define BINARY_NODE_INCLUDED
32 #define MSVC_2010_FIX 1
42 static inline int CenterCount(
int depth ) {
return 1<<depth; }
43 static inline int CornerCount(
int depth ) {
return (1<<depth)+1; }
46 static inline int Index(
int depth ,
int offSet ) {
return (1<<depth)+offSet-1; }
47 static inline int CenterIndex(
int depth ,
int offSet ) {
return (1<<depth)+offSet-1; }
48 static inline int CornerIndex(
int depth ,
int offSet ) {
return (1<<depth)+offSet+depth; }
50 static inline int CornerIndex(
int maxDepth ,
int depth ,
int offSet ,
int forwardCorner ){
return (offSet+forwardCorner)<<(maxDepth-depth); }
55 width=
Real (1.0/(1<<depth) );
56 center=
Real((0.5+offset)*width);
69 #else // !MSVC_2010_FIX
71 #endif // MSVC_2010_FIX
79 #endif // MSVC_2010_FIX
80 offset = ( idx+1 ) - (1<<depth);
88 #endif // BINARY_NODE_INCLUDED
static Real Width(int depth)
static int CenterIndex(int depth, int offSet)
static int CumulativeCornerCount(int maxDepth)
static int CenterCount(int depth)
static int CornerIndex(int depth, int offSet)
static int CumulativeCenterCount(int maxDepth)
static Real CornerIndexPosition(int index, int maxDepth)
static int CornerIndex(int maxDepth, int depth, int offSet, int forwardCorner)
static int Index(int depth, int offSet)
static void DepthAndOffset(int idx, int &depth, int &offset)
static void CenterAndWidth(int idx, Real ¢er, Real &width)
static int CornerCount(int depth)
static void CenterAndWidth(int depth, int offset, Real ¢er, Real &width)