Iterator iterating the nodes in a Quadtree inside a Mask. More...
#include <ntree.h>
Public Types | |
| using | iterator_category = std::forward_iterator_tag |
| using | value_type = std::pair< Position< D >, T > |
| using | pointer = value_type * |
| using | reference = value_type & |
| using | difference_type = long int |
Public Member Functions | |
| masked_iterator () | |
| Initialize an invalid iterator. | |
| masked_iterator (Ntree &q, const Mask< D > &mask, const Position< D > &anchor) | |
| Initialize an iterator to point to the first leaf node inside the mask within the tree below this Ntree. | |
| value_type & | operator* () |
| value_type * | operator-> () |
| masked_iterator & | operator++ () |
| Move the iterator to the next node inside the mask within the tree. | |
| masked_iterator | operator++ (int) |
| Postfix increment operator. | |
| bool | operator== (const masked_iterator &other) const |
| Iterators are equal if they point to the same node in the same ntree. | |
| bool | operator!= (const masked_iterator &other) const |
Protected Member Functions | |
| void | init_ () |
| Initialize. | |
| void | next_leaf_ () |
| Find the next leaf which is not outside the mask. | |
| void | first_leaf_ () |
| Find the first leaf which is not outside the mask. | |
| void | first_leaf_inside_ () |
| Set the allin_top_ to the current quadrant, and find the first leaf below the current quadrant. | |
| void | next_anchor_ () |
| Go to the next anchor image. | |
| bool | anchored_position_inside_mask (const Position< D > &position) |
Protected Attributes | |
| Ntree * | ntree_ |
| Ntree * | top_ |
| Ntree * | allin_top_ |
| size_t | node_ |
| const Mask< D > * | mask_ |
| Position< D > | anchor_ |
| Position< D > | anchored_position_ |
| std::vector< Position< D > > | anchors_ |
| size_t | current_anchor_ |
Iterator iterating the nodes in a Quadtree inside a Mask.
| using nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator::difference_type = long int |
| using nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator::iterator_category = std::forward_iterator_tag |
| using nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator::pointer = value_type* |
| using nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator::reference = value_type& |
| using nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator::value_type = std::pair< Position< D >, T > |
|
inline |
Initialize an invalid iterator.
| nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator::masked_iterator | ( | Ntree & | q, |
| const Mask< D > & | mask, | ||
| const Position< D > & | anchor | ||
| ) |
Initialize an iterator to point to the first leaf node inside the mask within the tree below this Ntree.
References nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator::anchor_, nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator::anchors_, nest::Ntree< D, T, max_capacity, max_depth >::extent_, nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator::init_(), nest::Box< D >::lower_left, nest::Ntree< D, T, max_capacity, max_depth >::lower_left_, nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator::mask_, nest::mod(), nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator::ntree_, nest::Ntree< D, T, max_capacity, max_depth >::periodic_, and nest::Box< D >::upper_right.
|
inlineprotected |
|
protected |
Find the first leaf which is not outside the mask.
If no leaf is found below the current quadrant, will continue to next_leaf_().
|
protected |
Set the allin_top_ to the current quadrant, and find the first leaf below the current quadrant.
|
protected |
Initialize.
Referenced by nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator::masked_iterator().
|
protected |
Go to the next anchor image.
|
protected |
Find the next leaf which is not outside the mask.
References nest::Ntree< D, T, max_capacity, max_depth >::N.
|
inline |
|
inline |
| Ntree< D, T, max_capacity, max_depth >::masked_iterator & nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator::operator++ | ( | ) |
Move the iterator to the next node inside the mask within the tree.
May cause the iterator to become invalid if there are no more nodes.
References nest::Ntree< D, T, max_capacity, max_depth >::nodes_.
|
inline |
Postfix increment operator.
|
inline |
|
inline |
Iterators are equal if they point to the same node in the same ntree.
References nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator::node_, and nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator::ntree_.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Referenced by nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator::operator!=(), nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator::operator*(), nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator::operator->(), and nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator::operator==().
|
protected |
Referenced by nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator::masked_iterator(), nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator::operator!=(), nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator::operator*(), nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator::operator->(), and nest::Ntree< D, T, max_capacity, max_depth >::masked_iterator::operator==().
|
protected |