28 template<
typename node,
bool isconst = false>
33 typedef typename util::conditional<isconst, const node&, node&>::type reference;
34 typedef typename util::conditional<isconst, const node*, node*>::type pointer;
36 typedef typename node::point point;
39 reference operator*()
const {
return *curNode; }
40 pointer operator->()
const {
return curNode; }
50 m_stack.push(root_node);
59 while ( ! m_stack.empty() )
61 curNode = m_stack.top();
64 if ( curNode->isLeaf() )
70 m_stack.push(curNode->left );
71 m_stack.push(curNode->right);
81 bool good()
const {
return curNode != 0; }
87 m_stack.push(root_node);
90 int level()
const {
return curNode->level; }
92 point lowerCorner()
const
94 point result = curNode->box->first;
95 const int lvl = curNode->level;
98 for (
index_t i = 0; i!= result.size(); ++i )
104 point upperCorner()
const
106 point result = curNode->box->second;
107 const int lvl = curNode->level;
109 for (
index_t i = 0; i!=result.size(); ++i )
117 bool isAligned()
const
121 for (
index_t i = 0; i!=curNode->box->first.size(); ++i )
123 if (curNode->box->second[i] % h != 0 ||
124 curNode->box->first[i] % h != 0 )
139 std::stack<node*> m_stack;
Iterates over the leaves of an gsHDomain (tree).
Definition: gsHDomainLeafIter.h:29
#define index_t
Definition: gsConfig.h:32
void startFrom(node *const root_node)
The iteration is done in the sub-tree hanging from node root_node.
Definition: gsHDomainLeafIter.h:84
index_t m_index_level
The level of the box representation.
Definition: gsHDomainLeafIter.h:136
Provides declaration of the tree node.
bool good() const
Returns true iff we are still pointing at a valid leaf.
Definition: gsHDomainLeafIter.h:81