Blender V5.0
Freestyle::ChainPredicateIterator Class Reference

#include <ChainingIterators.h>

Inherits Freestyle::ChainingIterator.

Public Member Functions

 ChainPredicateIterator (bool iRestrictToSelection=true, bool iRestrictToUnvisited=true, ViewEdge *begin=nullptr, bool orientation=true)
 ChainPredicateIterator (UnaryPredicate1D &upred, BinaryPredicate1D &bpred, bool iRestrictToSelection=true, bool iRestrictToUnvisited=true, ViewEdge *begin=nullptr, bool orientation=true)
 ChainPredicateIterator (const ChainPredicateIterator &brother)
virtual ~ChainPredicateIterator ()
virtual string getExactTypeName () const
virtual int traverse (const AdjacencyIterator &it)
virtual int init ()
Public Member Functions inherited from Freestyle::ChainingIterator
 ChainingIterator (bool iRestrictToSelection=true, bool iRestrictToUnvisited=true, ViewEdge *begin=nullptr, bool orientation=true)
 ChainingIterator (const ChainingIterator &brother)
ViewVertexgetVertex ()
bool isIncrementing () const
virtual int increment ()
virtual int decrement ()
Public Member Functions inherited from Freestyle::ViewEdgeInternal::ViewEdgeIterator
 ViewEdgeIterator (ViewEdge *begin=nullptr, 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 ()

Protected Attributes

BinaryPredicate1D_binary_predicate
UnaryPredicate1D_unary_predicate
Protected Attributes inherited from Freestyle::ChainingIterator
bool _restrictToSelection
bool _restrictToUnvisited
bool _increment
Protected Attributes inherited from Freestyle::ViewEdgeInternal::ViewEdgeIterator
bool _orientation
ViewEdge_edge
ViewEdge_begin

Additional Inherited Members

Public Attributes inherited from Freestyle::ChainingIterator
ViewEdgeresult
void * py_c_it

Detailed Description

A "generic" user-controlled ViewEdge iterator. This iterator is in particular built from a unary predicate and a binary predicate. First, the unary predicate is evaluated for all potential next ViewEdges in order to only keep the ones respecting a certain constraint. Then, the binary predicate is evaluated on the current ViewEdge together with each ViewEdge of the previous selection. The first ViewEdge respecting both the unary predicate and the binary predicate is kept as the next one. If none of the potential next ViewEdge respects these 2 predicates, 0 is returned.

Definition at line 307 of file ChainingIterators.h.

Constructor & Destructor Documentation

◆ ChainPredicateIterator() [1/3]

Freestyle::ChainPredicateIterator::ChainPredicateIterator ( bool iRestrictToSelection = true,
bool iRestrictToUnvisited = true,
ViewEdge * begin = nullptr,
bool orientation = true )
inline

Builds a ChainPredicateIterator from a starting ViewEdge 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 ot not.
beginThe ViewEdge from where to start the iteration.
orientationIf true, we'll look for the next ViewEdge among the ViewEdges that surround the ending ViewVertex of begin. If false, we'll search over the ViewEdges surrounding the ending ViewVertex of begin.

Definition at line 327 of file ChainingIterators.h.

References _binary_predicate, _unary_predicate, begin(), and Freestyle::ChainingIterator::ChainingIterator().

Referenced by ChainPredicateIterator().

◆ ChainPredicateIterator() [2/3]

Freestyle::ChainPredicateIterator::ChainPredicateIterator ( UnaryPredicate1D & upred,
BinaryPredicate1D & bpred,
bool iRestrictToSelection = true,
bool iRestrictToUnvisited = true,
ViewEdge * begin = nullptr,
bool orientation = true )
inline

Builds a ChainPredicateIterator from a unary predicate, a binary predicate, a starting ViewEdge 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 ot not.
upredThe unary predicate that the next ViewEdge must satisfy.
bpredThe binary predicate that the next ViewEdge must satisfy together with the actual pointed ViewEdge.
beginThe ViewEdge from where to start the iteration.
orientationIf true, we'll look for the next ViewEdge among the ViewEdges that surround the ending ViewVertex of begin. If false, we'll search over the ViewEdges surrounding the ending ViewVertex of begin.

Definition at line 356 of file ChainingIterators.h.

References _binary_predicate, _unary_predicate, begin(), and Freestyle::ChainingIterator::ChainingIterator().

◆ ChainPredicateIterator() [3/3]

Freestyle::ChainPredicateIterator::ChainPredicateIterator ( const ChainPredicateIterator & brother)
inline

◆ ~ChainPredicateIterator()

virtual Freestyle::ChainPredicateIterator::~ChainPredicateIterator ( )
inlinevirtual

Destructor.

Definition at line 376 of file ChainingIterators.h.

References _binary_predicate, and _unary_predicate.

Member Function Documentation

◆ getExactTypeName()

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

Returns the string "ChainPredicateIterator"

Reimplemented from Freestyle::ChainingIterator.

Definition at line 383 of file ChainingIterators.h.

◆ init()

virtual int Freestyle::ChainPredicateIterator::init ( )
inlinevirtual

Initializes the iterator context.

Reimplemented from Freestyle::ChainingIterator.

Definition at line 394 of file ChainingIterators.h.

◆ traverse()

int Freestyle::ChainPredicateIterator::traverse ( const AdjacencyIterator & it)
virtual

This method iterates over the potential next ViewEdges and returns the one that will be followed next. When reaching the end of a chain, 0 is returned.

Reimplemented from Freestyle::ChainingIterator.

Definition at line 186 of file ChainingIterators.cpp.

References _binary_predicate, _unary_predicate, Freestyle::ViewEdgeInternal::ViewEdgeIterator::getCurrentEdge(), Freestyle::AdjacencyIterator::isEnd(), and Freestyle::ChainingIterator::result.

Member Data Documentation

◆ _binary_predicate

BinaryPredicate1D* Freestyle::ChainPredicateIterator::_binary_predicate
protected

◆ _unary_predicate

UnaryPredicate1D* Freestyle::ChainPredicateIterator::_unary_predicate
protected

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