Inkscape
Vector Graphics Editor
|
Iterator for editable nodes. More...
#include <node.h>
Public Types | |
using | self = NodeIterator |
Public Member Functions | |
NodeIterator () | |
self & | operator++ () |
self & | operator-- () |
bool | operator== (self const &other) const |
N & | operator* () const |
operator bool () const | |
N * | get_pointer () const |
Get a pointer to the underlying node. Equivalent to &*i . | |
N * | ptr () const |
self | next () const |
self | prev () const |
self & | advance () |
self & | retreat () |
Private Member Functions | |
NodeIterator (ListNode const *n) | |
Private Attributes | |
ListNode * | _node |
Friends | |
class | NodeList |
Iterator for editable nodes.
Use this class for all operations that require some knowledge about the node's neighbors. It is a bidirectional iterator.
Because paths can be cyclic, node iterators have two different ways to increment and decrement them. When using ++/–, the end iterator will eventually be returned. When using advance()/retreat(), the end iterator will only be returned when the path is open. If it's closed, calling advance() will cycle indefinitely. This is particularly useful for cases where the adjacency of nodes is more important than their sequence order.
When i is a node iterator, then:
++i
moves the iterator to the next node in sequence order;–i
moves the iterator to the previous node in sequence order;i.next()
returns the next node with wrap-around;i.prev()
returns the previous node with wrap-around;i.advance()
moves the iterator to the next node with wrap-around;i.retreat()
moves the iterator to the previous node with wrap-around.next() and prev() do not change their iterator. They can return the end iterator if the path is open.
Unlike most other iterators, you can check whether you've reached the end of the list without having access to the iterator's container. Simply use if (i) { ...
using Inkscape::UI::NodeIterator< N >::self = NodeIterator |
|
inline |
|
inlineprivate |
NodeIterator< N > & Inkscape::UI::NodeIterator< N >::advance | ( | ) |
Definition at line 489 of file node.h.
Referenced by Inkscape::UI::NodeIterator< N >::next().
|
inline |
Get a pointer to the underlying node. Equivalent to &*i
.
Definition at line 307 of file node.h.
References Inkscape::UI::NodeIterator< N >::_node, and N.
|
inline |
Definition at line 311 of file node.h.
References Inkscape::UI::NodeIterator< N >::advance().
Referenced by Inkscape::UI::PathManipulator::_chooseHandle(), Inkscape::UI::PathManipulator::_deleteSegments(), Inkscape::UI::PathManipulator::_deleteStretch(), Inkscape::UI::CurveDragPoint::_getTip(), Inkscape::UI::Node::_linearGrow(), Inkscape::UI::Node::_next(), Inkscape::UI::PathManipulator::_nodeClicked(), Inkscape::UI::PathManipulator::_selectionChanged(), Inkscape::UI::PathManipulator::_updateDragPoint(), Inkscape::UI::CurveDragPoint::clicked(), Inkscape::UI::PathManipulator::deleteNodes(), Inkscape::UI::CurveDragPoint::doubleclicked(), Inkscape::UI::CurveDragPoint::dragged(), Inkscape::UI::PathManipulator::duplicateNodes(), Inkscape::UI::CurveDragPoint::grabbed(), Inkscape::UI::PathManipulator::insertNodeAtExtremum(), Inkscape::UI::PathManipulator::insertNodes(), Inkscape::UI::PathManipulator::setSegmentType(), Inkscape::UI::PathManipulator::subdivideSegment(), Inkscape::UI::PathManipulator::weldNodes(), and Inkscape::UI::PathManipulator::weldSegments().
|
inline |
|
inline |
Definition at line 304 of file node.h.
References Inkscape::UI::NodeIterator< N >::_node, and N.
|
inline |
Definition at line 295 of file node.h.
References Inkscape::UI::NodeIterator< N >::_node, and Inkscape::UI::ListNode::ln_next.
|
inline |
Definition at line 299 of file node.h.
References Inkscape::UI::NodeIterator< N >::_node, and Inkscape::UI::ListNode::ln_prev.
|
inline |
Definition at line 303 of file node.h.
References Inkscape::UI::NodeIterator< N >::_node.
|
inline |
Definition at line 316 of file node.h.
References Inkscape::UI::NodeIterator< N >::retreat().
Referenced by Inkscape::UI::PathManipulator::_chooseHandle(), Inkscape::UI::PathManipulator::_deleteSegments(), Inkscape::UI::PathManipulator::_deleteStretch(), Inkscape::UI::Node::_linearGrow(), Inkscape::UI::Node::_prev(), Inkscape::UI::PathManipulator::_selectionChanged(), and Inkscape::UI::PathManipulator::weldSegments().
|
inline |
Definition at line 309 of file node.h.
References Inkscape::UI::NodeIterator< N >::_node, and N.
Referenced by Inkscape::UI::PathManipulator::_chooseHandle(), Inkscape::UI::PathManipulator::_createGeometryFromControlPoints(), Inkscape::UI::Node::_linearGrow(), Inkscape::UI::Node::_prev(), Inkscape::UI::CurveDragPoint::clicked(), Inkscape::UI::PathManipulator::insertNode(), Inkscape::UI::PathManipulator::insertNodeAtExtremum(), and Inkscape::UI::MultiPathManipulator::shiftSelection().
NodeIterator< N > & Inkscape::UI::NodeIterator< N >::retreat | ( | ) |
Definition at line 495 of file node.h.
Referenced by Inkscape::UI::NodeIterator< N >::prev().
|
private |
Definition at line 328 of file node.h.
Referenced by Inkscape::UI::NodeList::before(), Inkscape::UI::NodeList::before(), Inkscape::UI::NodeList::erase(), Inkscape::UI::NodeList::get(), Inkscape::UI::NodeIterator< N >::get_pointer(), Inkscape::UI::NodeList::insert(), Inkscape::UI::NodeIterator< N >::operator*(), Inkscape::UI::NodeIterator< N >::operator++(), Inkscape::UI::NodeIterator< N >::operator--(), Inkscape::UI::NodeIterator< N >::operator==(), Inkscape::UI::NodeIterator< N >::ptr(), and Inkscape::UI::NodeList::splice().