Octree< Content, GivenDimension >::iterator Class Reference

#include <Octree.hpp>

Collaboration diagram for Octree< Content, GivenDimension >::iterator:

Collaboration graph
[legend]

List of all members.

Public Types

typedef std::pair< __SubTree
*, int > 
LocalAddress

Public Member Functions

size_t depth ()
__SubTreecurrentFather ()
iteratoroperator++ (int)
const int & localNumber () const
int & localNumber ()
void addAddress (__SubTree *a)
 operator __Leaf * ()
 iterator ()
 iterator (const iterator &i)
 ~iterator ()

Private Attributes

__Leaf__leaf
std::stack< LocalAddress__address

Friends

class Octree< Content, Dimension >
class __SubTree


Detailed Description

template<typename Content, size_t GivenDimension>
class Octree< Content, GivenDimension >::iterator

Definition at line 255 of file Octree.hpp.


Member Typedef Documentation

template<typename Content, size_t GivenDimension>
typedef std::pair<__SubTree*, int> Octree< Content, GivenDimension >::iterator::LocalAddress

Definition at line 258 of file Octree.hpp.


Constructor & Destructor Documentation

template<typename Content, size_t GivenDimension>
Octree< Content, GivenDimension >::iterator::iterator (  )  [inline]

Definition at line 335 of file Octree.hpp.

00336       : __leaf(0)
00337     {
00338       ;
00339     }

template<typename Content, size_t GivenDimension>
Octree< Content, GivenDimension >::iterator::iterator ( const iterator i  )  [inline]

Definition at line 341 of file Octree.hpp.

00342       : __leaf(i.__leaf),
00343         __address(i.__address)
00344     {
00345       ;
00346     }

template<typename Content, size_t GivenDimension>
Octree< Content, GivenDimension >::iterator::~iterator (  )  [inline]

Definition at line 348 of file Octree.hpp.

00349     {
00350       ;
00351     }


Member Function Documentation

template<typename Content, size_t GivenDimension>
size_t Octree< Content, GivenDimension >::iterator::depth (  )  [inline]

Definition at line 270 of file Octree.hpp.

References Octree< Content, GivenDimension >::iterator::__address.

00271     {
00272       return __address.size();
00273     }

template<typename Content, size_t GivenDimension>
__SubTree* Octree< Content, GivenDimension >::iterator::currentFather (  )  [inline]

Definition at line 275 of file Octree.hpp.

References Octree< Content, GivenDimension >::iterator::__address.

Referenced by Octree< Content, GivenDimension >::iterator::operator++().

00276     {
00277       if (__address.size() > 0) {
00278         return __address.top().first;
00279       } else {
00280         return 0;
00281       }
00282     }

template<typename Content, size_t GivenDimension>
iterator& Octree< Content, GivenDimension >::iterator::operator++ ( int   )  [inline]

Definition at line 284 of file Octree.hpp.

References Octree< Content, GivenDimension >::iterator::__address, Octree< Content, GivenDimension >::iterator::__leaf, Octree< Content, GivenDimension >::iterator::addAddress(), Octree< Content, GivenDimension >::iterator::currentFather(), Octree< Content, GivenDimension >::__Node::leaf, Octree< Content, GivenDimension >::__SubTree::node(), and Octree< Content, GivenDimension >::__Node::type().

00285     {
00286       __SubTree* father = currentFather();
00287       __leaf = 0;
00288       if (father != 0) {
00289         __address.top().second++;
00290 
00291         if (__address.top().second < 8) {
00292           __Node* n = father->node(__address.top().second);
00293           if (n != 0) {
00294             if(n->type() == __Node::leaf) {
00295               __leaf = static_cast<__Leaf*>(n);
00296             } else {
00297               __SubTree* t = static_cast<__SubTree*>(n);
00298               this->addAddress(t);
00299               (*this)++;
00300             }
00301           } else {
00302             (*this)++;
00303           }
00304         } else {
00305           __address.pop();
00306           (*this)++;
00307         }
00308       }
00309       return *this;
00310     }

Here is the call graph for this function:

template<typename Content, size_t GivenDimension>
const int& Octree< Content, GivenDimension >::iterator::localNumber (  )  const [inline]

Definition at line 312 of file Octree.hpp.

References Octree< Content, GivenDimension >::iterator::__address.

00313     {
00314       return __address.top().second;
00315     }

template<typename Content, size_t GivenDimension>
int& Octree< Content, GivenDimension >::iterator::localNumber (  )  [inline]

Definition at line 317 of file Octree.hpp.

References Octree< Content, GivenDimension >::iterator::__address.

00318     {
00319       return __address.top().second;
00320     }

template<typename Content, size_t GivenDimension>
void Octree< Content, GivenDimension >::iterator::addAddress ( __SubTree a  )  [inline]

Definition at line 322 of file Octree.hpp.

References Octree< Content, GivenDimension >::iterator::__address.

Referenced by Octree< Content, GivenDimension >::__SubTree::begin(), and Octree< Content, GivenDimension >::iterator::operator++().

00323     {
00324       LocalAddress l;
00325       l.first = a;
00326       l.second = -1;
00327       __address.push(l);
00328     }

template<typename Content, size_t GivenDimension>
Octree< Content, GivenDimension >::iterator::operator __Leaf * (  )  [inline]

Definition at line 330 of file Octree.hpp.

References Octree< Content, GivenDimension >::iterator::__leaf.

00331     {
00332       return __leaf;
00333     }


Friends And Related Function Documentation

template<typename Content, size_t GivenDimension>
friend class Octree< Content, Dimension > [friend]

Definition at line 260 of file Octree.hpp.

template<typename Content, size_t GivenDimension>
friend class __SubTree [friend]

Definition at line 261 of file Octree.hpp.


Member Data Documentation

template<typename Content, size_t GivenDimension>
__Leaf* Octree< Content, GivenDimension >::iterator::__leaf [private]

template<typename Content, size_t GivenDimension>
std::stack<LocalAddress> Octree< Content, GivenDimension >::iterator::__address [private]


The documentation for this class was generated from the following file:

Generated on Wed Nov 19 00:10:44 2008 for FreeFEM3D (aka ff3d) by  doxygen 1.5.6