

Public Types | |
| enum | Type { subtree, leaf } |
Public Member Functions | |
| __Node * | node (const size_t i) |
| const __Node::Type | type () const |
| Octree< Content, Dimension > ::iterator & | fuzzySearch (const TinyVector< Dimension, real_t > &X, const TinyVector< Dimension, real_t > ¢er, const real_t size, typename Octree< Content, Dimension >::iterator &cell) |
| void | addLeaf (const TinyVector< Dimension, real_t > ¢er, const real_t s, __Leaf *l) |
| iterator | begin () |
| __SubTree () | |
| __SubTree (const __SubTree &s) | |
| ~__SubTree () | |
Private Attributes | |
| TinyVector< StaticPow < 2, Dimension >::value, __Node * > | __nodes |
Definition at line 123 of file Octree.hpp.
enum Octree::__Node::Type [inherited] |
| Octree< Content, GivenDimension >::__SubTree::__SubTree | ( | ) | [inline] |
Definition at line 229 of file Octree.hpp.
Referenced by Octree< Content, GivenDimension >::__SubTree::addLeaf().
00230 : __nodes(0) 00231 { 00232 ; 00233 }
| Octree< Content, GivenDimension >::__SubTree::__SubTree | ( | const __SubTree & | s | ) | [inline] |
| Octree< Content, GivenDimension >::__SubTree::~__SubTree | ( | ) | [inline] |
| __Node* Octree< Content, GivenDimension >::__SubTree::node | ( | const size_t | i | ) | [inline] |
Definition at line 131 of file Octree.hpp.
References Octree< Content, GivenDimension >::__SubTree::__nodes.
Referenced by Octree< Content, GivenDimension >::iterator::operator++().
00132 { 00133 return __nodes[i]; 00134 }
| const __Node::Type Octree< Content, GivenDimension >::__SubTree::type | ( | ) | const [inline, virtual] |
Implements Octree< Content, GivenDimension >::__Node.
Definition at line 136 of file Octree.hpp.
References Octree< Content, GivenDimension >::__Node::subtree.
00137 { 00138 return __Node::subtree; 00139 }
| Octree<Content, Dimension>::iterator& Octree< Content, GivenDimension >::__SubTree::fuzzySearch | ( | const TinyVector< Dimension, real_t > & | X, | |
| const TinyVector< Dimension, real_t > & | center, | |||
| const real_t | size, | |||
| typename Octree< Content, Dimension >::iterator & | cell | |||
| ) | [inline] |
if no cell is found there, it is bad ... But there is at least one cell in this subtree which contains a leaf. To ensure the returned iterator is not to far, the local number is reset so that the complet tree is candidate.
Definition at line 142 of file Octree.hpp.
References Octree< Content, GivenDimension >::__SubTree::__nodes, Octree< Content, GivenDimension >::Dimension, and Octree< Content, GivenDimension >::__Node::subtree.
00146 { 00147 int num=0; 00148 TinyVector<Dimension,int> I; 00149 00150 for (size_t i=0; i<Dimension; ++i) { 00151 I[i] = (X[i]>center[i]); 00152 num += (I[i] << (Dimension-1-i)); 00153 } 00154 00155 cell.addAddress(this); 00156 cell.localNumber() = num; 00157 00158 if (__nodes[num]==0) { 00166 cell.localNumber() = -1; 00167 cell++; 00168 } else { 00169 double newS = 0.5*size; 00170 00171 TinyVector<Dimension> newCenter = center; 00172 for (size_t i=0; i<Dimension; ++i) { 00173 newCenter[i] += (I[i]*2-1)*newS; 00174 } 00175 00176 if ((*__nodes[num]).type() == __Node::subtree) { 00177 (static_cast<__SubTree&>(*__nodes[num])).fuzzySearch(X,newCenter,newS,cell); 00178 } else { 00179 cell.__leaf = static_cast<__Leaf*>(__nodes[num]); 00180 } 00181 } 00182 00183 return cell; 00184 }
| void Octree< Content, GivenDimension >::__SubTree::addLeaf | ( | const TinyVector< Dimension, real_t > & | center, | |
| const real_t | s, | |||
| __Leaf * | l | |||
| ) | [inline] |
Definition at line 186 of file Octree.hpp.
References Octree< Content, GivenDimension >::__SubTree::__nodes, Octree< Content, GivenDimension >::__SubTree::__SubTree(), Octree< Content, GivenDimension >::__SubTree::addLeaf(), Octree< Content, GivenDimension >::Dimension, and Octree< Content, GivenDimension >::__Node::subtree.
Referenced by Octree< Content, GivenDimension >::__SubTree::addLeaf().
00189 { 00190 int num=0; 00191 TinyVector<Dimension,int> I; 00192 00193 for (size_t i=0; i<Dimension; ++i) { 00194 I[i] = ((*l).position()[i]>center[i]); 00195 00196 num += (I[i] << (Dimension-1-i)); 00197 } 00198 00199 if (__nodes[num]==0) { 00200 __nodes[num] = l; 00201 } else { 00202 double newS = 0.5*s; 00203 00204 TinyVector<Dimension> newCenter = center; 00205 for (size_t i=0; i<Dimension; ++i) { 00206 newCenter[i] += (I[i]*2-1)*newS; 00207 } 00208 00209 if ((*__nodes[num]).type() == __Node::subtree) { 00210 (static_cast<__SubTree&>(*__nodes[num])).addLeaf(newCenter,newS,l); 00211 } else { 00212 __Leaf* oldleaf=static_cast<__Leaf*>(__nodes[num]); 00213 __SubTree* s =new __SubTree(); 00214 __nodes[num]=s; 00215 s->addLeaf(newCenter, newS, l); 00216 s->addLeaf(newCenter, newS, oldleaf); 00217 } 00218 } 00219 }

| iterator Octree< Content, GivenDimension >::__SubTree::begin | ( | ) | [inline] |
Definition at line 221 of file Octree.hpp.
References Octree< Content, GivenDimension >::iterator::addAddress().

TinyVector<StaticPow<2,Dimension>::value, __Node*> Octree< Content, GivenDimension >::__SubTree::__nodes [private] |
Definition at line 128 of file Octree.hpp.
Referenced by Octree< Content, GivenDimension >::__SubTree::addLeaf(), Octree< Content, GivenDimension >::__SubTree::fuzzySearch(), and Octree< Content, GivenDimension >::__SubTree::node().
1.5.6