Blender  V3.3
Public Member Functions | Public Attributes | Protected Attributes | List of all members
Freestyle::ChainingIterator Class Reference

#include <ChainingIterators.h>

Inheritance diagram for Freestyle::ChainingIterator:
Freestyle::ViewEdgeInternal::ViewEdgeIterator Freestyle::Iterator Freestyle::ChainPredicateIterator Freestyle::ChainSilhouetteIterator

Public Member Functions

 ChainingIterator (bool iRestrictToSelection=true, bool iRestrictToUnvisited=true, ViewEdge *begin=NULL, bool orientation=true)
 
 ChainingIterator (const ChainingIterator &brother)
 
virtual string getExactTypeName () const
 
virtual int init ()
 
virtual int traverse (const AdjacencyIterator &it)
 
ViewVertexgetVertex ()
 
bool isIncrementing () const
 
virtual int increment ()
 
virtual int decrement ()
 
- Public Member Functions inherited from Freestyle::ViewEdgeInternal::ViewEdgeIterator
 ViewEdgeIterator (ViewEdge *begin=NULL, bool orientation=true)
 
 ViewEdgeIterator (const ViewEdgeIterator &it)
 
virtual ~ViewEdgeIterator ()
 
ViewEdgegetCurrentEdge ()
 
void setCurrentEdge (ViewEdge *edge)
 
ViewEdgegetBegin ()
 
void setBegin (ViewEdge *begin)
 
bool getOrientation () const
 
void setOrientation (bool orientation)
 
void changeOrientation ()
 
virtual ViewEdgeoperator* ()
 
virtual ViewEdgeoperator-> ()
 
virtual ViewEdgeIteratoroperator++ ()
 
virtual ViewEdgeIterator operator++ (int)
 
virtual ViewEdgeIteratoroperator-- ()
 
virtual ViewEdgeIterator operator-- (int)
 
virtual bool isBegin () const
 
virtual bool isEnd () const
 
virtual bool operator== (ViewEdgeIterator &it) const
 
virtual bool operator!= (ViewEdgeIterator &it) const
 
- Public Member Functions inherited from Freestyle::Iterator
virtual ~Iterator ()
 

Public Attributes

ViewEdgeresult
 
voidpy_c_it
 

Protected Attributes

bool _restrictToSelection
 
bool _restrictToUnvisited
 
bool _increment
 
- Protected Attributes inherited from Freestyle::ViewEdgeInternal::ViewEdgeIterator
bool _orientation
 
ViewEdge_edge
 
ViewEdge_begin
 

Detailed Description

Base class for chaining iterators. This class is designed to be overloaded in order to describe chaining rules. It makes the works of chaining rules description easier. The two main methods that need to overloaded are traverse() and init(). traverse() tells which ViewEdge to follow, among the adjacent ones. If you specify restriction rules (such as "Chain only ViewEdges of the selection"), they will be included in the adjacency iterator. (i.e, the adjacent iterator will only stop on "valid" edges).

Definition at line 138 of file ChainingIterators.h.

Constructor & Destructor Documentation

◆ ChainingIterator() [1/2]

Freestyle::ChainingIterator::ChainingIterator ( bool  iRestrictToSelection = true,
bool  iRestrictToUnvisited = true,
ViewEdge begin = NULL,
bool  orientation = true 
)
inline

Builds a Chaining Iterator from the first ViewEdge used for iteration and its orientation.

Parameters
iRestrictToSelectionIndicates whether to force the chaining to stay within the set of selected ViewEdges or not.
iRestrictToUnvisitedIndicates whether a ViewEdge that has already been chained must be ignored or not.
beginThe ViewEdge from which to start the chain.
orientationThe direction to follow to explore the graph. If true, the direction indicated by the first ViewEdge is used.

Definition at line 160 of file ChainingIterators.h.

References _increment, _restrictToSelection, _restrictToUnvisited, NULL, and py_c_it.

◆ ChainingIterator() [2/2]

Freestyle::ChainingIterator::ChainingIterator ( const ChainingIterator brother)
inline

Copy constructor

Definition at line 173 of file ChainingIterators.h.

References _increment, _restrictToSelection, _restrictToUnvisited, and py_c_it.

Member Function Documentation

◆ decrement()

int Freestyle::ChainingIterator::decrement ( )
virtual

◆ getExactTypeName()

virtual string Freestyle::ChainingIterator::getExactTypeName ( ) const
inlinevirtual

Returns the string "ChainingIterator"

Reimplemented from Freestyle::ViewEdgeInternal::ViewEdgeIterator.

Reimplemented in Freestyle::ChainPredicateIterator, and Freestyle::ChainSilhouetteIterator.

Definition at line 182 of file ChainingIterators.h.

◆ getVertex()

ViewVertex* Freestyle::ChainingIterator::getVertex ( )
inline

Returns true if the orientation of the current ViewEdge corresponds to its natural orientation Returns the vertex which is the next crossing

Definition at line 208 of file ChainingIterators.h.

References Freestyle::ViewEdgeInternal::ViewEdgeIterator::_edge, _increment, Freestyle::ViewEdgeInternal::ViewEdgeIterator::_orientation, Freestyle::ViewEdge::A(), and Freestyle::ViewEdge::B().

Referenced by decrement(), increment(), and Freestyle::ChainSilhouetteIterator::traverse().

◆ increment()

int Freestyle::ChainingIterator::increment ( )
virtual

◆ init()

int Freestyle::ChainingIterator::init ( )
virtual

Initializes the iterator context. This method is called each time a new chain is started. It can be used to reset some history information that you might want to keep.

Reimplemented in Freestyle::ChainPredicateIterator, and Freestyle::ChainSilhouetteIterator.

Definition at line 50 of file ChainingIterators.cpp.

References Director_BPy_ChainingIterator_init().

Referenced by Freestyle::Operators::bidirectionalChain().

◆ isIncrementing()

bool Freestyle::ChainingIterator::isIncrementing ( ) const
inline

Returns true if the current iteration is an incrementation

Definition at line 229 of file ChainingIterators.h.

References _increment.

◆ traverse()

int Freestyle::ChainingIterator::traverse ( const AdjacencyIterator it)
virtual

This method iterates over the potential next ViewEdges and returns the one that will be followed next. returns the next ViewEdge to follow or 0 when the end of the chain is reached.

Parameters
itThe iterator over the ViewEdges adjacent to the end vertex of the current ViewEdge. The Adjacency iterator reflects the restriction rules by only iterating over the valid ViewEdges.

Reimplemented in Freestyle::ChainPredicateIterator, and Freestyle::ChainSilhouetteIterator.

Definition at line 55 of file ChainingIterators.cpp.

References Director_BPy_ChainingIterator_traverse().

Referenced by decrement(), and increment().

Member Data Documentation

◆ _increment

bool Freestyle::ChainingIterator::_increment
protected

◆ _restrictToSelection

bool Freestyle::ChainingIterator::_restrictToSelection
protected

Definition at line 140 of file ChainingIterators.h.

Referenced by ChainingIterator(), decrement(), and increment().

◆ _restrictToUnvisited

bool Freestyle::ChainingIterator::_restrictToUnvisited
protected

Definition at line 141 of file ChainingIterators.h.

Referenced by ChainingIterator(), decrement(), and increment().

◆ py_c_it

void* Freestyle::ChainingIterator::py_c_it

◆ result

ViewEdge* Freestyle::ChainingIterator::result

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