275 template <
class NodeData,
class Real>
285 else{
return temp->nextLeaf();}
288 template <
class NodeData,
class Real>
293 else return nextBranch(
current);
296 template <
class NodeData,
class Real>
301 else return nextBranch(
current );
304 template <
class NodeData,
class Real>
308 centerAndWidth(
center,width);
309 for(
int dim=0;dim<DIMENSION;dim++){
311 if(dim<DIMENSION-1){
printf(
"x");}
316 template <
class NodeData,
class Real>
319 template <
class NodeData,
class Real>
320 template<
class NodeAdjacencyFunction>
323 if(
children){__processNodeNodes(node,
F);}
326 template <
class NodeData,
class Real>
327 template<
class NodeAdjacencyFunction>
333 __processNodeFaces(node,
F,c1,c2,c3,c4);
337 template <
class NodeData,
class Real>
338 template<
class NodeAdjacencyFunction>
344 __processNodeEdges(node,
F,c1,c2);
348 template <
class NodeData,
class Real>
349 template<
class NodeAdjacencyFunction>
353 while(
temp->children){
355 F->Function(
temp,node);
359 template <
class NodeData,
class Real>
360 template<
class NodeAdjacencyFunction>
380 template <
class NodeData,
class Real>
381 template<
class NodeAdjacencyFunction>
382 void OctNode<NodeData,Real>::__processNodeEdges(
OctNode* node,NodeAdjacencyFunction* F,
int cIndex1,
int cIndex2){
383 F->Function(&
children[cIndex1],node);
384 F->Function(&
children[cIndex2],node);
389 template <
class NodeData,
class Real>
390 template<
class NodeAdjacencyFunction>
391 void OctNode<NodeData,Real>::__processNodeFaces(
OctNode* node,NodeAdjacencyFunction* F,
int cIndex1,
int cIndex2,
int cIndex3,
int cIndex4){
392 F->Function(&
children[cIndex1],node);
393 F->Function(&
children[cIndex2],node);
394 F->Function(&
children[cIndex3],node);
395 F->Function(&
children[cIndex4],node);
402 template<
class NodeData,
class Real>
403 template<
class NodeAdjacencyFunction>
405 int c1[3],c2[3],
w1,
w2;
414 template<
class NodeData,
class Real>
415 template<
class NodeAdjacencyFunction>
422 if(!
node2->children){
return;}
426 template<
class NodeData,
class Real>
427 template<
class TerminatingNodeAdjacencyFunction>
429 int c1[3],c2[3],
w1,
w2;
438 template<
class NodeData,
class Real>
439 template<
class TerminatingNodeAdjacencyFunction>
447 if(!
node2->children){
return;}
451 template<
class NodeData,
class Real>
452 template<
class Po
intAdjacencyFunction>
461 template<
class NodeData,
class Real>
462 template<
class Po
intAdjacencyFunction>
469 if( !
node2->children )
return;
473 template<
class NodeData,
class Real>
474 template<
class NodeAdjacencyFunction>
480 int c1[3],c2[3],
w1,
w2;
486 ProcessFixedDepthNodeAdjacentNodes(c1[0]-c2[0],c1[1]-c2[1],c1[2]-c2[2],
node1,(
width1*
w1)>>1,
node2,(
width2*
w2)>>1,
w2,
depth,
F,
processCurrent);
489 template<
class NodeData,
class Real>
490 template<
class NodeAdjacencyFunction>
501 if(!
node2->children){
return;}
506 template<
class NodeData,
class Real>
507 template<
class NodeAdjacencyFunction>
513 int c1[3],c2[3],
w1,
w2;
518 ProcessMaxDepthNodeAdjacentNodes(c1[0]-c2[0],c1[1]-c2[1],c1[2]-c2[2],
node1,(
width1*
w1)>>1,
node2,(
width2*
w2)>>1,
w2,
depth,
F,
processCurrent);
521 template<
class NodeData,
class Real>
522 template<
class NodeAdjacencyFunction>
535 template <
class NodeData,
class Real>
536 template<
class NodeAdjacencyFunction>
553 if(o& 2){F->Function(&node2->
children[1],node1);
if(node2->
children[1].
children){__ProcessNodeAdjacentNodes(dx2,dy1,dz1,node1,radius1,&node2->
children[1],radius,cWidth,F);}}
554 if(o& 4){F->Function(&node2->
children[2],node1);
if(node2->
children[2].
children){__ProcessNodeAdjacentNodes(dx1,dy2,dz1,node1,radius1,&node2->
children[2],radius,cWidth,F);}}
555 if(o& 8){F->Function(&node2->
children[3],node1);
if(node2->
children[3].
children){__ProcessNodeAdjacentNodes(dx2,dy2,dz1,node1,radius1,&node2->
children[3],radius,cWidth,F);}}
556 if(o& 16){F->Function(&node2->
children[4],node1);
if(node2->
children[4].
children){__ProcessNodeAdjacentNodes(dx1,dy1,dz2,node1,radius1,&node2->
children[4],radius,cWidth,F);}}
557 if(o& 32){F->Function(&node2->
children[5],node1);
if(node2->
children[5].
children){__ProcessNodeAdjacentNodes(dx2,dy1,dz2,node1,radius1,&node2->
children[5],radius,cWidth,F);}}
558 if(o& 64){F->Function(&node2->
children[6],node1);
if(node2->
children[6].
children){__ProcessNodeAdjacentNodes(dx1,dy2,dz2,node1,radius1,&node2->
children[6],radius,cWidth,F);}}
559 if(o&128){F->Function(&node2->
children[7],node1);
if(node2->
children[7].
children){__ProcessNodeAdjacentNodes(dx2,dy2,dz2,node1,radius1,&node2->
children[7],radius,cWidth,F);}}
563 template <
class NodeData,
class Real>
564 template<
class TerminatingNodeAdjacencyFunction>
565 void OctNode<NodeData,Real>::__ProcessTerminatingNodeAdjacentNodes(
int dx,
int dy,
int dz,
567 OctNode* node2,
int radius2,
int cWidth2,
568 TerminatingNodeAdjacencyFunction* F)
570 int cWidth=cWidth2>>1;
571 int radius=radius2>>1;
572 int o=ChildOverlap(dx,dy,dz,radius1+radius,cWidth);
580 if(o& 1){
if(F->Function(&node2->children[0],node1) && node2->children[0].children){__ProcessTerminatingNodeAdjacentNodes(dx1,dy1,dz1,node1,radius1,&node2->children[0],radius,cWidth,F);}}
581 if(o& 2){
if(F->Function(&node2->children[1],node1) && node2->children[1].children){__ProcessTerminatingNodeAdjacentNodes(dx2,dy1,dz1,node1,radius1,&node2->children[1],radius,cWidth,F);}}
582 if(o& 4){
if(F->Function(&node2->children[2],node1) && node2->children[2].children){__ProcessTerminatingNodeAdjacentNodes(dx1,dy2,dz1,node1,radius1,&node2->children[2],radius,cWidth,F);}}
583 if(o& 8){
if(F->Function(&node2->children[3],node1) && node2->children[3].children){__ProcessTerminatingNodeAdjacentNodes(dx2,dy2,dz1,node1,radius1,&node2->children[3],radius,cWidth,F);}}
584 if(o& 16){
if(F->Function(&node2->children[4],node1) && node2->children[4].children){__ProcessTerminatingNodeAdjacentNodes(dx1,dy1,dz2,node1,radius1,&node2->children[4],radius,cWidth,F);}}
585 if(o& 32){
if(F->Function(&node2->children[5],node1) && node2->children[5].children){__ProcessTerminatingNodeAdjacentNodes(dx2,dy1,dz2,node1,radius1,&node2->children[5],radius,cWidth,F);}}
586 if(o& 64){
if(F->Function(&node2->children[6],node1) && node2->children[6].children){__ProcessTerminatingNodeAdjacentNodes(dx1,dy2,dz2,node1,radius1,&node2->children[6],radius,cWidth,F);}}
587 if(o&128){
if(F->Function(&node2->children[7],node1) && node2->children[7].children){__ProcessTerminatingNodeAdjacentNodes(dx2,dy2,dz2,node1,radius1,&node2->children[7],radius,cWidth,F);}}
591 template <
class NodeData,
class Real>
592 template<
class Po
intAdjacencyFunction>
593 void OctNode<NodeData,Real>::__ProcessPointAdjacentNodes(
int dx,
int dy,
int dz,
594 OctNode* node2,
int radius2,
int cWidth2,
595 PointAdjacencyFunction* F)
597 int cWidth=cWidth2>>1;
598 int radius=radius2>>1;
599 int o=ChildOverlap(dx,dy,dz,radius,cWidth);
608 if(o& 1){F->Function(&node2->children[0]);
if(node2->children[0].children){__ProcessPointAdjacentNodes(dx1,dy1,dz1,&node2->children[0],radius,cWidth,F);}}
609 if(o& 2){F->Function(&node2->children[1]);
if(node2->children[1].children){__ProcessPointAdjacentNodes(dx2,dy1,dz1,&node2->children[1],radius,cWidth,F);}}
610 if(o& 4){F->Function(&node2->children[2]);
if(node2->children[2].children){__ProcessPointAdjacentNodes(dx1,dy2,dz1,&node2->children[2],radius,cWidth,F);}}
611 if(o& 8){F->Function(&node2->children[3]);
if(node2->children[3].children){__ProcessPointAdjacentNodes(dx2,dy2,dz1,&node2->children[3],radius,cWidth,F);}}
612 if(o& 16){F->Function(&node2->children[4]);
if(node2->children[4].children){__ProcessPointAdjacentNodes(dx1,dy1,dz2,&node2->children[4],radius,cWidth,F);}}
613 if(o& 32){F->Function(&node2->children[5]);
if(node2->children[5].children){__ProcessPointAdjacentNodes(dx2,dy1,dz2,&node2->children[5],radius,cWidth,F);}}
614 if(o& 64){F->Function(&node2->children[6]);
if(node2->children[6].children){__ProcessPointAdjacentNodes(dx1,dy2,dz2,&node2->children[6],radius,cWidth,F);}}
615 if(o&128){F->Function(&node2->children[7]);
if(node2->children[7].children){__ProcessPointAdjacentNodes(dx2,dy2,dz2,&node2->children[7],radius,cWidth,F);}}
619 template <
class NodeData,
class Real>
620 template<
class NodeAdjacencyFunction>
621 void OctNode<NodeData,Real>::__ProcessFixedDepthNodeAdjacentNodes(
int dx,
int dy,
int dz,
623 OctNode* node2,
int radius2,
int cWidth2,
624 int depth,NodeAdjacencyFunction* F)
626 int cWidth=cWidth2>>1;
627 int radius=radius2>>1;
628 int o=ChildOverlap(dx,dy,dz,radius1+radius,cWidth);
636 if(node2->depth()==
depth){
637 if(o& 1){F->Function(&node2->children[0],node1);}
638 if(o& 2){F->Function(&node2->children[1],node1);}
639 if(o& 4){F->Function(&node2->children[2],node1);}
640 if(o& 8){F->Function(&node2->children[3],node1);}
641 if(o& 16){F->Function(&node2->children[4],node1);}
642 if(o& 32){F->Function(&node2->children[5],node1);}
643 if(o& 64){F->Function(&node2->children[6],node1);}
644 if(o&128){F->Function(&node2->children[7],node1);}
647 if(o& 1){
if(node2->children[0].children){__ProcessFixedDepthNodeAdjacentNodes(dx1,dy1,dz1,node1,radius1,&node2->children[0],radius,cWidth,
depth,F);}}
648 if(o& 2){
if(node2->children[1].children){__ProcessFixedDepthNodeAdjacentNodes(dx2,dy1,dz1,node1,radius1,&node2->children[1],radius,cWidth,
depth,F);}}
649 if(o& 4){
if(node2->children[2].children){__ProcessFixedDepthNodeAdjacentNodes(dx1,dy2,dz1,node1,radius1,&node2->children[2],radius,cWidth,
depth,F);}}
650 if(o& 8){
if(node2->children[3].children){__ProcessFixedDepthNodeAdjacentNodes(dx2,dy2,dz1,node1,radius1,&node2->children[3],radius,cWidth,
depth,F);}}
651 if(o& 16){
if(node2->children[4].children){__ProcessFixedDepthNodeAdjacentNodes(dx1,dy1,dz2,node1,radius1,&node2->children[4],radius,cWidth,
depth,F);}}
652 if(o& 32){
if(node2->children[5].children){__ProcessFixedDepthNodeAdjacentNodes(dx2,dy1,dz2,node1,radius1,&node2->children[5],radius,cWidth,
depth,F);}}
653 if(o& 64){
if(node2->children[6].children){__ProcessFixedDepthNodeAdjacentNodes(dx1,dy2,dz2,node1,radius1,&node2->children[6],radius,cWidth,
depth,F);}}
654 if(o&128){
if(node2->children[7].children){__ProcessFixedDepthNodeAdjacentNodes(dx2,dy2,dz2,node1,radius1,&node2->children[7],radius,cWidth,
depth,F);}}
659 template <
class NodeData,
class Real>
660 template<
class NodeAdjacencyFunction>
661 void OctNode<NodeData,Real>::__ProcessMaxDepthNodeAdjacentNodes(
int dx,
int dy,
int dz,
663 OctNode* node2,
int radius2,
int cWidth2,
664 int depth,NodeAdjacencyFunction* F)
666 int cWidth=cWidth2>>1;
667 int radius=radius2>>1;
668 int o=ChildOverlap(dx,dy,dz,radius1+radius,cWidth);
676 if(node2->depth()<=
depth){
677 if(o& 1){F->Function(&node2->children[0],node1);}
678 if(o& 2){F->Function(&node2->children[1],node1);}
679 if(o& 4){F->Function(&node2->children[2],node1);}
680 if(o& 8){F->Function(&node2->children[3],node1);}
681 if(o& 16){F->Function(&node2->children[4],node1);}
682 if(o& 32){F->Function(&node2->children[5],node1);}
683 if(o& 64){F->Function(&node2->children[6],node1);}
684 if(o&128){F->Function(&node2->children[7],node1);}
686 if(node2->depth()<
depth){
687 if(o& 1){
if(node2->children[0].children){__ProcessMaxDepthNodeAdjacentNodes(dx1,dy1,dz1,node1,radius1,&node2->children[0],radius,cWidth,
depth,F);}}
688 if(o& 2){
if(node2->children[1].children){__ProcessMaxDepthNodeAdjacentNodes(dx2,dy1,dz1,node1,radius1,&node2->children[1],radius,cWidth,
depth,F);}}
689 if(o& 4){
if(node2->children[2].children){__ProcessMaxDepthNodeAdjacentNodes(dx1,dy2,dz1,node1,radius1,&node2->children[2],radius,cWidth,
depth,F);}}
690 if(o& 8){
if(node2->children[3].children){__ProcessMaxDepthNodeAdjacentNodes(dx2,dy2,dz1,node1,radius1,&node2->children[3],radius,cWidth,
depth,F);}}
691 if(o& 16){
if(node2->children[4].children){__ProcessMaxDepthNodeAdjacentNodes(dx1,dy1,dz2,node1,radius1,&node2->children[4],radius,cWidth,
depth,F);}}
692 if(o& 32){
if(node2->children[5].children){__ProcessMaxDepthNodeAdjacentNodes(dx2,dy1,dz2,node1,radius1,&node2->children[5],radius,cWidth,
depth,F);}}
693 if(o& 64){
if(node2->children[6].children){__ProcessMaxDepthNodeAdjacentNodes(dx1,dy2,dz2,node1,radius1,&node2->children[6],radius,cWidth,
depth,F);}}
694 if(o&128){
if(node2->children[7].children){__ProcessMaxDepthNodeAdjacentNodes(dx2,dy2,dz2,node1,radius1,&node2->children[7],radius,cWidth,
depth,F);}}
699 template <
class NodeData,
class Real>
700 inline int OctNode<NodeData,Real>::ChildOverlap(
int dx,
int dy,
int dz,
int d,
int cRadius2)
707 if(dx<w2 && dx>-w1){test =1;}
708 if(dx<w1 && dx>-w2){test|=2;}
711 if(dz<w2 && dz>-w1){test1 =test;}
712 if(dz<w1 && dz>-w2){test1|=test<<4;}
714 if(!test1){
return 0;}
715 if(dy<w2 && dy>-w1){overlap =test1;}
716 if(dy<w1 && dy>-w2){overlap|=test1<<2;}
720 template <
class NodeData,
class Real>
729 while(
temp->children){
743 template <
class NodeData,
class Real>
758 template <
class NodeData,
class Real>
760 int o1,
o2,i1,i2,j1,j2;
764 if(
o1!=
o2){
return 0;}
770 case 0:
dir[0]=1;
dir[1]=2;
break;
771 case 1:
dir[0]=0;
dir[1]=2;
break;
772 case 2:
dir[0]=0;
dir[1]=1;
break;
793 template<
class NodeData,
class Real>
802 template <
class NodeData,
class Real>
803 template<
class NodeData2>
810 for(i=0;i<DIMENSION;i++){this->offset[i] = node.offset[i];}
818 template <
class NodeData,
class Real>
823 template<
class NodeData ,
class Real >
828 if( n1->d!=n2->d )
return int(n1->d)-
int(n2->d);
829 else if( n1->off[0]!=n2->off[0] )
return int(n1->off[0]) -
int(n2->off[0]);
830 else if( n1->off[1]!=n2->off[1] )
return int(n1->off[1]) -
int(n2->off[1]);
831 else if( n1->off[2]!=n2->off[2] )
return int(n1->off[2]) -
int(n2->off[2]);
838 long long _p[3] = {p[0],p[1],p[2]};
839 for(
int i=0 ; i<31 ; i++ ) key |= ( (
_p[0] & (1ull<<i) )<<(2*i) ) | ( (
_p[1] & (1ull<<i) )<<(2*i+1) ) | ( (
_p[2] & (1ull<<i) )<<(2*i+2) );
843 template <
class NodeData,
class Real>
849 n1->depthAndOffset(
d1 ,
off1 ) , n2->depthAndOffset(
d2 ,
off2 );
850 if (
d1>
d2 )
return 1;
851 else if(
d1<
d2 )
return -1;
853 if (
k1>
k2 )
return 1;
854 else if(
k1<
k2 )
return -1;
858 template <
class NodeData,
class Real>
863 if(n1->d!=n2->d){
return int(n1->d)-
int(n2->d);}
864 while( n1->parent!=n2->parent )
869 if(n1->off[0]!=n2->off[0]){
return int(n1->off[0])-
int(n2->off[0]);}
870 if(n1->off[1]!=n2->off[1]){
return int(n1->off[1])-
int(n2->off[1]);}
871 return int(n1->off[2])-
int(n2->off[2]);
875 template <
class NodeData,
class Real>
880 template <
class NodeData,
class Real>
885 template <
class NodeData,
class Real>
898 template <
class NodeData,
class Real>
904 template <
class NodeData,
class Real>
906 template <
class NodeData,
class Real>
908 template <
class NodeData,
class Real>
916 if(!temp){
return NULL;}
918 if(forceChildren){temp->initChildren();}
921 return &temp->children[pIndex];
925 template <
class NodeData,
class Real>
926 const OctNode<NodeData,Real>* OctNode<NodeData,Real>::__faceNeighbor(
int dir,
int off)
const {
933 if(!temp || !temp->children){
return temp;}
934 else{
return &temp->children[pIndex];}
938 template <
class NodeData,
class Real>
943 case 0: idx[0]=1; idx[1]=2;
break;
944 case 1: idx[0]=0; idx[1]=2;
break;
945 case 2: idx[0]=0; idx[1]=1;
break;
950 template <
class NodeData,
class Real>
955 case 0: idx[0]=1; idx[1]=2;
break;
956 case 1: idx[0]=0; idx[1]=2;
break;
957 case 2: idx[0]=0; idx[1]=1;
break;
959 return __edgeNeighbor(
o,i,idx);
962 template <
class NodeData,
class Real>
969 aIndex=(~((i[0] ^ x[idx[0]]) | ((i[1] ^ x[idx[1]])<<1))) & 3;
970 pIndex^=(7 ^ (1<<
o));
974 else{
return &temp->children[pIndex];}
978 if(!temp || !temp->children){
return NULL;}
979 else{
return &temp->children[pIndex];}
986 if(!temp || !temp->children){
return temp;}
987 else{
return &temp->children[pIndex];}
992 template <
class NodeData,
class Real>
993 OctNode<NodeData,Real>* OctNode<NodeData,Real>::__edgeNeighbor(
int o,
const int i[2],
const int idx[2],
int forceChildren){
996 int aIndex,x[DIMENSION];
999 aIndex=(~((i[0] ^ x[idx[0]]) | ((i[1] ^ x[idx[1]])<<1))) & 3;
1000 pIndex^=(7 ^ (1<<o));
1003 if(!temp || !temp->children){
return NULL;}
1004 else{
return &temp->children[pIndex];}
1006 else if(aIndex==2) {
1008 if(!temp || !temp->children){
return NULL;}
1009 else{
return &temp->children[pIndex];}
1011 else if(aIndex==0) {
1014 else if(aIndex==3) {
1015 OctNode* temp=
parent->__edgeNeighbor(o,i,idx,forceChildren);
1016 if(!temp){
return NULL;}
1017 if(!temp->children){
1018 if(forceChildren){temp->initChildren();}
1021 return &temp->children[pIndex];
1026 template <
class NodeData,
class Real>
1040 else{
return &
temp->children[pIndex];}
1045 else{
return &
temp->children[pIndex];}
1050 else{
return &
temp->children[pIndex];}
1055 else{
return &
temp->children[pIndex];}
1060 else{
return &
temp->children[pIndex];}
1065 else{
return &
temp->children[pIndex];}
1070 else{
return &
temp->children[pIndex];}
1075 template <
class NodeData,
class Real>
1089 if(!
temp->children){
1093 return &
temp->children[pIndex];
1098 else{
return &
temp->children[pIndex];}
1103 else{
return &
temp->children[pIndex];}
1108 else{
return &
temp->children[pIndex];}
1113 else{
return &
temp->children[pIndex];}
1118 else{
return &
temp->children[pIndex];}
1123 else{
return &
temp->children[pIndex];}
1131 template<
class NodeData,
class Real>
1134 template<
class NodeData,
class Real>
1136 for(
int i=0;i<3;i++){
for(
int j=0;j<3;j++){
for(
int k=0;k<3;k++){neighbors[i][j][k]=
NULL;}}}
1139 template<
class NodeData,
class Real>
1142 template<
class NodeData,
class Real>
1149 template<
class NodeData,
class Real>
1158 template<
class NodeData ,
class Real >
1161 if( !neighbors[
d].neighbors[1][1][1] || !neighbors[
d].neighbors[1][1][1]->
isInside( p ) )
1165 if( !
d ) neighbors[
d].neighbors[1][1][1] =
root;
1170 int i , j , k , x1 ,
y1 , z1 , x2 ,
y2 , z2;
1173 temp.neighbors[1][1][1]->centerAndWidth(
c , w );
1178 if( !
temp.neighbors[1][1][1]->children )
temp.neighbors[1][1][1]->initChildren();
1179 for( i=0 ; i<2 ; i++ )
for( j=0 ; j<2 ; j++ )
for( k=0 ; k<2 ; k++ )
1185 if(
temp.neighbors[i][1][1] )
1187 if( !
temp.neighbors[i][1][1]->children )
temp.neighbors[i][1][1]->initChildren();
1188 for( j=0 ; j<2 ; j++ )
for( k=0 ; k<2 ; k++ ) neighbors[
d].neighbors[i][
y2+j][z2+k] = &
temp.neighbors[i][1][1]->children[
Cube::CornerIndex(x2,j,k)];
1191 if(
temp.neighbors[1][j][1] )
1193 if( !
temp.neighbors[1][j][1]->children )
temp.neighbors[1][j][1]->initChildren();
1194 for( i=0 ; i<2 ; i++ )
for( k=0 ; k<2 ; k++ ) neighbors[
d].neighbors[x2+i][j][z2+k] = &
temp.neighbors[1][j][1]->children[
Cube::CornerIndex(i,
y2,k)];
1197 if(
temp.neighbors[1][1][k] )
1199 if( !
temp.neighbors[1][1][k]->children )
temp.neighbors[1][1][k]->initChildren();
1200 for( i=0 ; i<2 ; i++ )
for( j=0 ; j<2 ; j++ ) neighbors[
d].neighbors[x2+i][
y2+j][k] = &
temp.neighbors[1][1][k]->children[
Cube::CornerIndex(i,j,z2)];
1224 i=x1<<1 , j=y1<<1 , k=z1<<1;
1232 return neighbors[
d];
1235 template<
class NodeData ,
class Real >
1238 if( !neighbors[
d].neighbors[1][1][1] || !neighbors[
d].neighbors[1][1][1]->
isInside( p ) )
1242 if( !
d ) neighbors[
d].neighbors[1][1][1] =
root;
1245 Neighbors3& temp = getNeighbors(
root , p ,
d-1 );
1247 int i , j , k , x1 , y1 , z1 , x2 , y2 , z2;
1250 temp.neighbors[1][1][1]->centerAndWidth( c , w );
1255 if( !temp.neighbors[1][1][1] || !temp.neighbors[1][1][1]->children )
1259 for( i=0 ; i<2 ; i++ )
for( j=0 ; j<2 ; j++ )
for( k=0 ; k<2 ; k++ )
1260 neighbors[
d].neighbors[x2+i][y2+j][z2+k] = &temp.neighbors[1][1][1]->children[
Cube::CornerIndex(i,j,k)];
1265 if( temp.neighbors[i][1][1] )
1266 for( j=0 ; j<2 ; j++ )
for( k=0 ; k<2 ; k++ ) neighbors[
d].neighbors[i][y2+j][z2+k] = &temp.neighbors[i][1][1]->children[
Cube::CornerIndex(x2,j,k)];
1268 if( temp.neighbors[1][j][1] )
1269 for( i=0 ; i<2 ; i++ )
for( k=0 ; k<2 ; k++ ) neighbors[
d].neighbors[x2+i][j][z2+k] = &temp.neighbors[1][j][1]->children[
Cube::CornerIndex(i,y2,k)];
1271 if( temp.neighbors[1][1][k] )
1272 for( i=0 ; i<2 ; i++ )
for( j=0 ; j<2 ; j++ ) neighbors[
d].neighbors[x2+i][y2+j][k] = &temp.neighbors[1][1][k]->children[
Cube::CornerIndex(i,j,z2)];
1276 if( temp.neighbors[i][j][1] )
1277 for( k=0 ; k<2 ; k++ ) neighbors[
d].neighbors[i][j][z2+k] = &temp.neighbors[i][j][1]->children[
Cube::CornerIndex(x2,y2,k)];
1279 if( temp.neighbors[i][1][k] )
1280 for( j=0 ; j<2 ; j++ ) neighbors[
d].neighbors[i][y2+j][k] = &temp.neighbors[i][1][k]->children[
Cube::CornerIndex(x2,j,z2)];
1282 if( temp.neighbors[1][j][k] )
1283 for( i=0 ; i<2 ; i++ ) neighbors[
d].neighbors[x2+i][j][k] = &temp.neighbors[1][j][k]->children[
Cube::CornerIndex(i,y2,z2)];
1286 i=x1<<1 , j=y1<<1 , k=z1<<1;
1287 if( temp.neighbors[i][j][k] )
1288 neighbors[
d].neighbors[i][j][k] = &temp.neighbors[i][j][k]->children[
Cube::CornerIndex(x2,y2,z2)];
1291 return neighbors[
d];
1294 template<
class NodeData ,
class Real >
1297 int d = node->depth();
1298 if( node==neighbors[
d].neighbors[1][1][1] )
1301 for(
int i=0 ; i<3 ; i++ )
for(
int j=0 ; j<3 ; j++ )
for(
int k=0 ; k<3 ; k++ )
if( !neighbors[
d].neighbors[i][j][k] ) reset =
true;
1302 if( reset ) neighbors[
d].neighbors[1][1][1] = NULL;
1304 if( node!=neighbors[
d].neighbors[1][1][1] )
1306 neighbors[
d].clear();
1308 if( !node->parent ) neighbors[
d].neighbors[1][1][1] = node;
1311 int i,j,k,x1,y1,z1,x2,y2,z2;
1312 int idx=int(node-node->parent->children);
1318 neighbors[
d].neighbors[x2+i][y2+j][z2+k]=&node->parent->children[
Cube::CornerIndex(i,j,k)];
1322 Neighbors3& temp=setNeighbors(node->parent);
1326 if(temp.neighbors[i][1][1]){
1327 if(!temp.neighbors[i][1][1]->children){temp.neighbors[i][1][1]->initChildren();}
1328 for(j=0;j<2;j++){
for(k=0;k<2;k++){neighbors[
d].neighbors[i][y2+j][z2+k]=&temp.neighbors[i][1][1]->children[
Cube::CornerIndex(x2,j,k)];}}
1331 if(temp.neighbors[1][j][1]){
1332 if(!temp.neighbors[1][j][1]->children){temp.neighbors[1][j][1]->initChildren();}
1333 for(i=0;i<2;i++){
for(k=0;k<2;k++){neighbors[
d].neighbors[x2+i][j][z2+k]=&temp.neighbors[1][j][1]->children[
Cube::CornerIndex(i,y2,k)];}}
1336 if(temp.neighbors[1][1][k]){
1337 if(!temp.neighbors[1][1][k]->children){temp.neighbors[1][1][k]->initChildren();}
1338 for(i=0;i<2;i++){
for(j=0;j<2;j++){neighbors[
d].neighbors[x2+i][y2+j][k]=&temp.neighbors[1][1][k]->children[
Cube::CornerIndex(i,j,z2)];}}
1343 if(temp.neighbors[i][j][1]){
1344 if(!temp.neighbors[i][j][1]->children){temp.neighbors[i][j][1]->initChildren();}
1345 for(k=0;k<2;k++){neighbors[
d].neighbors[i][j][z2+k]=&temp.neighbors[i][j][1]->children[
Cube::CornerIndex(x2,y2,k)];}
1348 if(temp.neighbors[i][1][k]){
1349 if(!temp.neighbors[i][1][k]->children){temp.neighbors[i][1][k]->initChildren();}
1350 for(j=0;j<2;j++){neighbors[
d].neighbors[i][y2+j][k]=&temp.neighbors[i][1][k]->children[
Cube::CornerIndex(x2,j,z2)];}
1353 if(temp.neighbors[1][j][k]){
1354 if(!temp.neighbors[1][j][k]->children){temp.neighbors[1][j][k]->initChildren();}
1355 for(i=0;i<2;i++){neighbors[
d].neighbors[x2+i][j][k]=&temp.neighbors[1][j][k]->children[
Cube::CornerIndex(i,y2,z2)];}
1359 i=x1<<1; j=y1<<1; k=z1<<1;
1360 if(temp.neighbors[i][j][k]){
1361 if(!temp.neighbors[i][j][k]->children){temp.neighbors[i][j][k]->initChildren();}
1362 neighbors[
d].neighbors[i][j][k]=&temp.neighbors[i][j][k]->children[
Cube::CornerIndex(x2,y2,z2)];
1366 return neighbors[
d];
1371 template<
class NodeData ,
class Real >
1374 int d = node->depth();
1375 if( node==neighbors[
d].neighbors[1][1][1] )
1378 for(
int i=0 ; i<3 ; i++ )
for(
int j=0 ; j<3 ; j++ )
for(
int k=0 ; k<3 ; k++ )
if( flags[i][j][k] && !neighbors[
d].neighbors[i][j][k] ) reset =
true;
1379 if( reset ) neighbors[
d].neighbors[1][1][1] = NULL;
1381 if( node!=neighbors[
d].neighbors[1][1][1] )
1383 neighbors[
d].clear();
1385 if( !node->parent ) neighbors[
d].neighbors[1][1][1] = node;
1388 int x1,y1,z1,x2,y2,z2;
1389 int idx=int(node-node->parent->children);
1392 for(
int i=0 ; i<2 ; i++ )
1393 for(
int j=0 ; j<2 ; j++ )
1394 for(
int k=0 ; k<2 ; k++ )
1395 neighbors[
d].neighbors[x2+i][y2+j][z2+k]=&node->parent->children[
Cube::CornerIndex(i,j,k)];
1397 Neighbors3& temp=setNeighbors( node->parent , flags );
1402 if( temp.neighbors[i][1][1] )
1404 if( flags[i][1][1] && !temp.neighbors[i][1][1]->children ) temp.neighbors[i][1][1]->initChildren();
1405 if( temp.neighbors[i][1][1]->children )
for(
int j=0 ; j<2 ; j++ )
for(
int k=0 ; k<2 ; k++ ) neighbors[
d].neighbors[i][y2+j][z2+k] = &temp.neighbors[i][1][1]->children[
Cube::CornerIndex(x2,j,k)];
1410 if( temp.neighbors[1][j][1] )
1412 if( flags[1][j][1] && !temp.neighbors[1][j][1]->children ) temp.neighbors[1][j][1]->initChildren();
1413 if( temp.neighbors[1][j][1]->children )
for(
int i=0 ; i<2 ; i++ )
for(
int k=0 ; k<2 ; k++ ) neighbors[
d].neighbors[x2+i][j][z2+k] = &temp.neighbors[1][j][1]->children[
Cube::CornerIndex(i,y2,k)];
1418 if( temp.neighbors[1][1][k] )
1420 if( flags[1][1][k] && !temp.neighbors[1][1][k]->children ) temp.neighbors[1][1][k]->initChildren();
1421 if( temp.neighbors[1][1][k]->children )
for(
int i=0 ; i<2 ; i++ )
for(
int j=0 ; j<2 ; j++ ) neighbors[
d].neighbors[x2+i][y2+j][k] = &temp.neighbors[1][1][k]->children[
Cube::CornerIndex(i,j,z2)];
1427 int i=x1<<1 , j=y1<<1;
1428 if( temp.neighbors[i][j][1] )
1430 if( flags[i][j][1] && !temp.neighbors[i][j][1]->children ) temp.neighbors[i][j][1]->initChildren();
1431 if( temp.neighbors[i][j][1]->children )
for(
int k=0 ; k<2 ; k++ ) neighbors[
d].neighbors[i][j][z2+k] = &temp.neighbors[i][j][1]->children[
Cube::CornerIndex(x2,y2,k)];
1435 int i=x1<<1 , k=z1<<1;
1436 if( temp.neighbors[i][1][k] )
1438 if( flags[i][1][k] && !temp.neighbors[i][1][k]->children ) temp.neighbors[i][1][k]->initChildren();
1439 if( temp.neighbors[i][1][k]->children )
for(
int j=0 ; j<2 ; j++ ) neighbors[
d].neighbors[i][y2+j][k] = &temp.neighbors[i][1][k]->children[
Cube::CornerIndex(x2,j,z2)];
1443 int j=y1<<1 , k=z1<<1;
1444 if( temp.neighbors[1][j][k] )
1446 if( flags[1][j][k] && !temp.neighbors[1][j][k]->children ) temp.neighbors[1][j][k]->initChildren();
1447 if( temp.neighbors[1][j][k]->children )
for(
int i=0 ; i<2 ; i++ ) neighbors[
d].neighbors[x2+i][j][k] = &temp.neighbors[1][j][k]->children[
Cube::CornerIndex(i,y2,z2)];
1453 int i=x1<<1 , j=y1<<1 , k=z1<<1;
1454 if( temp.neighbors[i][j][k] )
1456 if( flags[i][j][k] && !temp.neighbors[i][j][k]->children ) temp.neighbors[i][j][k]->initChildren();
1457 if( temp.neighbors[i][j][k]->children ) neighbors[
d].neighbors[i][j][k] = &temp.neighbors[i][j][k]->children[
Cube::CornerIndex(x2,y2,z2)];
1462 return neighbors[
d];
1465 template<
class NodeData,
class Real>
1467 int d=node->depth();
1468 if(node!=neighbors[
d].neighbors[1][1][1]){
1469 neighbors[
d].clear();
1471 if(!node->parent){neighbors[
d].neighbors[1][1][1]=node;}
1473 int i,j,k,x1,y1,z1,x2,y2,z2;
1474 int idx=int(node-node->parent->children);
1480 neighbors[
d].neighbors[x2+i][y2+j][z2+k]=&node->parent->children[
Cube::CornerIndex(i,j,k)];
1484 Neighbors3& temp=getNeighbors(node->parent);
1488 if(temp.neighbors[i][1][1] && temp.neighbors[i][1][1]->children){
1489 for(j=0;j<2;j++){
for(k=0;k<2;k++){neighbors[
d].neighbors[i][y2+j][z2+k]=&temp.neighbors[i][1][1]->children[
Cube::CornerIndex(x2,j,k)];}}
1492 if(temp.neighbors[1][j][1] && temp.neighbors[1][j][1]->children){
1493 for(i=0;i<2;i++){
for(k=0;k<2;k++){neighbors[
d].neighbors[x2+i][j][z2+k]=&temp.neighbors[1][j][1]->children[
Cube::CornerIndex(i,y2,k)];}}
1496 if(temp.neighbors[1][1][k] && temp.neighbors[1][1][k]->children){
1497 for(i=0;i<2;i++){
for(j=0;j<2;j++){neighbors[
d].neighbors[x2+i][y2+j][k]=&temp.neighbors[1][1][k]->children[
Cube::CornerIndex(i,j,z2)];}}
1502 if(temp.neighbors[i][j][1] && temp.neighbors[i][j][1]->children){
1503 for(k=0;k<2;k++){neighbors[
d].neighbors[i][j][z2+k]=&temp.neighbors[i][j][1]->children[
Cube::CornerIndex(x2,y2,k)];}
1506 if(temp.neighbors[i][1][k] && temp.neighbors[i][1][k]->children){
1507 for(j=0;j<2;j++){neighbors[
d].neighbors[i][y2+j][k]=&temp.neighbors[i][1][k]->children[
Cube::CornerIndex(x2,j,z2)];}
1510 if(temp.neighbors[1][j][k] && temp.neighbors[1][j][k]->children){
1511 for(i=0;i<2;i++){neighbors[
d].neighbors[x2+i][j][k]=&temp.neighbors[1][j][k]->children[
Cube::CornerIndex(i,y2,z2)];}
1515 i=x1<<1; j=y1<<1; k=z1<<1;
1516 if(temp.neighbors[i][j][k] && temp.neighbors[i][j][k]->children){
1517 neighbors[
d].neighbors[i][j][k]=&temp.neighbors[i][j][k]->children[
Cube::CornerIndex(x2,y2,z2)];
1521 return neighbors[node->depth()];
1527 template<
class NodeData,
class Real>
1530 template<
class NodeData,
class Real>
1532 for(
int i=0;i<3;i++){
for(
int j=0;j<3;j++){
for(
int k=0;k<3;k++){neighbors[i][j][k]=
NULL;}}}
1535 template<
class NodeData,
class Real>
1538 template<
class NodeData,
class Real>
1544 template<
class NodeData,
class Real>
1552 template<
class NodeData,
class Real>
1554 int d=node->depth();
1555 if(node!=neighbors[
d].neighbors[1][1][1]){
1556 neighbors[
d].clear();
1558 if(!node->parent){neighbors[
d].neighbors[1][1][1]=node;}
1560 int i,j,k,x1,
y1,z1,x2,
y2,z2;
1561 int idx=
int(node-node->parent->children);
1571 ConstNeighbors3& temp=getNeighbors(node->parent);
1575 if(temp.neighbors[i][1][1] && temp.neighbors[i][1][1]->children){
1576 for(j=0;j<2;j++){
for(k=0;k<2;k++){neighbors[
d].neighbors[i][y2+j][z2+k]=&temp.neighbors[i][1][1]->children[
Cube::CornerIndex(x2,j,k)];}}
1579 if(temp.neighbors[1][j][1] && temp.neighbors[1][j][1]->children){
1580 for(i=0;i<2;i++){
for(k=0;k<2;k++){neighbors[
d].neighbors[x2+i][j][z2+k]=&temp.neighbors[1][j][1]->children[
Cube::CornerIndex(i,y2,k)];}}
1583 if(temp.neighbors[1][1][k] && temp.neighbors[1][1][k]->children){
1584 for(i=0;i<2;i++){
for(j=0;j<2;j++){neighbors[
d].neighbors[x2+i][y2+j][k]=&temp.neighbors[1][1][k]->children[
Cube::CornerIndex(i,j,z2)];}}
1589 if(temp.neighbors[i][j][1] && temp.neighbors[i][j][1]->children){
1590 for(k=0;k<2;k++){neighbors[
d].neighbors[i][j][z2+k]=&temp.neighbors[i][j][1]->children[
Cube::CornerIndex(x2,y2,k)];}
1593 if(temp.neighbors[i][1][k] && temp.neighbors[i][1][k]->children){
1594 for(j=0;j<2;j++){neighbors[
d].neighbors[i][y2+j][k]=&temp.neighbors[i][1][k]->children[
Cube::CornerIndex(x2,j,z2)];}
1597 if(temp.neighbors[1][j][k] && temp.neighbors[1][j][k]->children){
1598 for(i=0;i<2;i++){neighbors[
d].neighbors[x2+i][j][k]=&temp.neighbors[1][j][k]->children[
Cube::CornerIndex(i,y2,z2)];}
1602 i=x1<<1; j=y1<<1; k=z1<<1;
1603 if(temp.neighbors[i][j][k] && temp.neighbors[i][j][k]->children){
1604 neighbors[
d].neighbors[i][j][k]=&temp.neighbors[i][j][k]->children[
Cube::CornerIndex(x2,y2,z2)];
1608 return neighbors[node->depth()];
1611 template<
class NodeData,
class Real>
1614 int d=node->depth();
1619 if( node!=neighbors[
d].neighbors[1][1][1] )
1621 neighbors[
d].clear();
1623 if(
d==minDepth ) neighbors[
d].neighbors[1][1][1]=node;
1626 int i,j,k,x1,y1,z1,x2,y2,z2;
1627 int idx = int(node-node->parent->children);
1631 ConstNeighbors3& temp=getNeighbors( node->parent , minDepth );
1634 for( i=0 ; i<2 ; i++ )
for( j=0 ; j<2 ; j++ )
for( k=0 ; k<2 ; k++ )
1635 neighbors[
d].neighbors[x2+i][y2+j][z2+k] = &node->parent->children[
Cube::CornerIndex(i,j,k) ];
1639 if( temp.neighbors[i][1][1] && temp.neighbors[i][1][1]->children )
1640 for( j=0 ; j<2 ; j++ )
for( k=0 ; k<2 ; k++ ) neighbors[
d].neighbors[i][y2+j][z2+k] = &temp.neighbors[i][1][1]->children[
Cube::CornerIndex(x2,j,k)];
1643 if( temp.neighbors[1][j][1] && temp.neighbors[1][j][1]->children )
1644 for( i=0 ; i<2 ; i++ )
for( k=0 ; k<2 ; k++ ) neighbors[
d].neighbors[x2+i][j][z2+k] = &temp.neighbors[1][j][1]->children[
Cube::CornerIndex(i,y2,k)];
1647 if( temp.neighbors[1][1][k] && temp.neighbors[1][1][k]->children )
1648 for( i=0 ; i<2 ; i++ )
for( j=0 ; j<2 ; j++ ) neighbors[
d].neighbors[x2+i][y2+j][k] = &temp.neighbors[1][1][k]->children[
Cube::CornerIndex(i,j,z2)];
1652 if( temp.neighbors[i][j][1] && temp.neighbors[i][j][1]->children )
1653 for( k=0 ; k<2 ; k++ ) neighbors[
d].neighbors[i][j][z2+k] = &temp.neighbors[i][j][1]->children[
Cube::CornerIndex(x2,y2,k)];
1656 if( temp.neighbors[i][1][k] && temp.neighbors[i][1][k]->children )
1657 for( j=0 ; j<2 ; j++ ) neighbors[
d].neighbors[i][y2+j][k] = &temp.neighbors[i][1][k]->children[
Cube::CornerIndex(x2,j,z2)];
1660 if( temp.neighbors[1][j][k] && temp.neighbors[1][j][k]->children )
1661 for( i=0 ; i<2 ; i++ ) neighbors[
d].neighbors[x2+i][j][k] = &temp.neighbors[1][j][k]->children[
Cube::CornerIndex(i,y2,z2)];
1664 i=x1<<1 , j=y1<<1 , k=z1<<1;
1665 if( temp.neighbors[i][j][k] && temp.neighbors[i][j][k]->children )
1666 neighbors[
d].neighbors[i][j][k] = &temp.neighbors[i][j][k]->children[
Cube::CornerIndex(x2,y2,z2)];
1669 return neighbors[node->depth()];
1676 template<
class NodeData ,
class Real >
1679 for(
int i=0 ; i<5 ; i++ )
for(
int j=0 ; j<5 ; j++ )
for(
int k=0 ; k<5 ; k++ ) neighbors[i][j][k] =
NULL;
1682 template<
class NodeData ,
class Real >
1685 for(
int i=0 ; i<5 ; i++ )
for(
int j=0 ; j<5 ; j++ )
for(
int k=0 ; k<5 ; k++ ) neighbors[i][j][k] =
NULL;
1688 template<
class NodeData ,
class Real >
1695 template<
class NodeData ,
class Real >
1702 template<
class NodeData ,
class Real >
1709 template<
class NodeData ,
class Real >
1716 template<
class NodeData ,
class Real >
1726 template<
class NodeData ,
class Real >
1736 template<
class NodeData ,
class Real >
1740 if( node!=neighbors[
d].neighbors[2][2][2] )
1742 neighbors[
d].clear();
1744 if( !node->
parent ) neighbors[
d].neighbors[2][2][2]=node;
1747 getNeighbors( node->
parent );
1749 int x1 ,
y1 , z1 , x2 ,
y2 , z2;
1763 for( i=0 ; i<2 ; i++ )
for( j=0 ; j<2 ; j++ )
for( k=0 ; k<2 ; k++ )
1767 if(
temp.neighbors[
cx1][2][2] &&
temp.neighbors[
cx1][2][2]->children )
1768 for( i=0 ; i<2 ; i++ )
for( j=0 ; j<2 ; j++ )
for( k=0 ; k<2 ; k++ )
1770 if(
temp.neighbors[2][
cy1][2] &&
temp.neighbors[2][
cy1][2]->children )
1771 for( i=0 ; i<2 ; i++ )
for( j=0 ; j<2 ; j++ )
for( k=0 ; k<2 ; k++ )
1773 if(
temp.neighbors[2][2][
cz1] &&
temp.neighbors[2][2][
cz1]->children )
1774 for( i=0 ; i<2 ; i++ )
for( j=0 ; j<2 ; j++ )
for( k=0 ; k<2 ; k++ )
1776 if(
temp.neighbors[
cx2][2][2] &&
temp.neighbors[
cx2][2][2]->children )
1777 for( j=0 ; j<2 ; j++ )
for( k=0 ; k<2 ; k++ )
1779 if(
temp.neighbors[2][
cy2][2] &&
temp.neighbors[2][
cy2][2]->children )
1780 for( i=0 ; i<2 ; i++ )
for( k=0 ; k<2 ; k++ )
1782 if(
temp.neighbors[2][2][
cz2] &&
temp.neighbors[2][2][
cz2]->children )
1783 for( i=0 ; i<2 ; i++ )
for( j=0 ; j<2 ; j++ )
1788 for( i=0 ; i<2 ; i++ )
for( j=0 ; j<2 ; j++ )
for( k=0 ; k<2 ; k++ )
1791 for( i=0 ; i<2 ; i++ )
for( j=0 ; j<2 ; j++ )
for( k=0 ; k<2 ; k++ )
1794 for( i=0 ; i<2 ; i++ )
for( j=0 ; j<2 ; j++ )
for( k=0 ; k<2 ; k++ )
1797 for( i=0 ; i<2 ; i++ )
for( k=0 ; k<2 ; k++ )
1800 for( i=0 ; i<2 ; i++ )
for( j=0 ; j<2 ; j++ )
1803 for( j=0 ; j<2 ; j++ )
for( k=0 ; k<2 ; k++ )
1806 for( i=0 ; i<2 ; i++ )
for( j=0 ; j<2 ; j++ )
1809 for( j=0 ; j<2 ; j++ )
for( k=0 ; k<2 ; k++ )
1812 for( i=0 ; i<2 ; i++ )
for( k=0 ; k<2 ; k++ )
1815 for( k=0 ; k<2 ; k++ )
1818 for( j=0 ; j<2 ; j++ )
1821 for( i=0 ; i<2 ; i++ )
1826 for( i=0 ; i<2 ; i++ )
for( j=0 ; j<2 ; j++ )
for( k=0 ; k<2 ; k++ )
1829 for( i=0 ; i<2 ; i++ )
for( j=0 ; j<2 ; j++ )
1832 for( i=0 ; i<2 ; i++ )
for( k=0 ; k<2 ; k++ )
1835 for( j=0 ; j<2 ; j++ )
for( k=0 ; k<2 ; k++ )
1838 for( i=0 ; i<2 ; i++ )
1841 for( j=0 ; j<2 ; j++ )
1844 for( k=0 ; k<2 ; k++ )
1850 return neighbors[
d];
1853 template<
class NodeData ,
class Real >
1857 if( node!=neighbors[
d].neighbors[2][2][2] )
1859 neighbors[
d].clear();
1861 if( !node->
parent ) neighbors[
d].neighbors[2][2][2]=node;
1866 int x1 ,
y1 , z1 , x2 ,
y2 , z2 ,
ii ,
jj ,
kk;
1885 if(
temp.neighbors[x2][
y2][z2] )
1887 if( !
temp.neighbors[x2][
y2][z2]->children )
temp.neighbors[x2][
y2][z2]->initChildren();
1895 return neighbors[
d];
1898 template<
class NodeData ,
class Real >
1902 if( node!=neighbors[
d].neighbors[2][2][2] )
1904 neighbors[
d].clear();
1906 if(!node->
parent) neighbors[
d].neighbors[2][2][2]=node;
1909 getNeighbors( node->
parent );
1915 for(
int i=0;i<5;i++)
1920 for(
int j=0;j<5;j++)
1925 for(
int k=0;k<5;k++)
1930 if(
temp.neighbors[x2][
y2][z2] &&
temp.neighbors[x2][
y2][z2]->children)
1937 return neighbors[
d];
1940 template <
class NodeData,
class Real>
1949 template <
class NodeData,
class Real>
1956 template <
class NodeData,
class Real>
1965 template <
class NodeData,
class Real>
1980 template<
class NodeData,
class Real>
1986 template<
class NodeData,
class Real>