Blender
V3.3
|
#include <Operators.h>
Public Types | |
typedef vector< Interface1D * > | I1DContainer |
typedef vector< Stroke * > | StrokesContainer |
Class defining the operators used in a style module. There are 4 classes of operators: Selection, Chaining, Splitting and Creating. All these operators are user controlled in the scripting language through Functors, Predicates and Shaders that are taken as arguments.
Definition at line 35 of file Operators.h.
typedef vector<Interface1D *> Freestyle::Operators::I1DContainer |
Definition at line 38 of file Operators.h.
typedef vector<Stroke *> Freestyle::Operators::StrokesContainer |
Definition at line 39 of file Operators.h.
|
static |
The only difference with the above bidirectional chaining algorithm is that we don't need to pass a stopping criterion. This might be desirable when the stopping criterion is already contained in the iterator definition. Builds a set of chains from the current set of ViewEdges. Each ViewEdge of the current list potentially starts a new chain. The chaining operator then iterates over the ViewEdges of the ViewMap using the user specified iterator. This operator iterates both using the increment and decrement operators and is therefore bidirectional. This operator works with a ChainingIterator which contains the chaining rules. It is this last one which can be told to chain only edges that belong to the selection or not to process twice a ViewEdge during the chaining. Each time a ViewEdge is added to a chain, its chaining time stamp is incremented. This allows you to keep track of the number of chains to which a ViewEdge belongs to.
it | The ChainingIterator on the ViewEdges of the ViewMap. It contains the chaining rule. |
Definition at line 418 of file Operators.cpp.
References Freestyle::ChainingIterator::decrement(), error(), Freestyle::ViewEdgeInternal::ViewEdgeIterator::getOrientation(), id, Freestyle::ChainingIterator::increment(), Freestyle::ChainingIterator::init(), Freestyle::TimeStamp::instance(), Freestyle::ViewEdgeInternal::ViewEdgeIterator::isEnd(), Freestyle::Chain::push_viewedge_back(), Freestyle::Chain::push_viewedge_front(), Freestyle::UnaryPredicate1D::result, Freestyle::ViewEdgeInternal::ViewEdgeIterator::setBegin(), Freestyle::ViewEdgeInternal::ViewEdgeIterator::setCurrentEdge(), and Freestyle::ViewEdgeInternal::ViewEdgeIterator::setOrientation().
|
static |
Builds a set of chains from the current set of ViewEdges. Each ViewEdge of the current list potentially starts a new chain. The chaining operator then iterates over the ViewEdges of the ViewMap using the user specified iterator. This operator iterates both using the increment and decrement operators and is therefore bidirectional. This operator works with a ChainingIterator which contains the chaining rules. It is this last one which can be told to chain only edges that belong to the selection or not to process twice a ViewEdge during the chaining. Each time a ViewEdge is added to a chain, its chaining time stamp is incremented. This allows you to keep track of the number of chains to which a ViewEdge belongs to.
it | The ChainingIterator on the ViewEdges of the ViewMap. It contains the chaining rule. |
pred | The predicate on the ViewEdge that expresses the stopping condition. |
Definition at line 315 of file Operators.cpp.
References Freestyle::ChainingIterator::decrement(), error(), Freestyle::ViewEdgeInternal::ViewEdgeIterator::getOrientation(), id, Freestyle::ChainingIterator::increment(), Freestyle::ChainingIterator::init(), Freestyle::TimeStamp::instance(), Freestyle::ViewEdgeInternal::ViewEdgeIterator::isEnd(), Freestyle::Chain::push_viewedge_back(), Freestyle::Chain::push_viewedge_front(), Freestyle::UnaryPredicate1D::result, Freestyle::ViewEdgeInternal::ViewEdgeIterator::setBegin(), Freestyle::ViewEdgeInternal::ViewEdgeIterator::setCurrentEdge(), and Freestyle::ViewEdgeInternal::ViewEdgeIterator::setOrientation().
Referenced by Operators_bidirectional_chain().
|
static |
Builds a set of chains from the current set of ViewEdges. Each ViewEdge of the current list starts a new chain. The chaining operator then iterates over the ViewEdges of the ViewMap using the user specified iterator. This operator only iterates using the increment operator and is therefore unidirectional. This chaining operator is different from the previous one because it doesn't take any modifier as argument. Indeed, the time stamp (insuring that a ViewEdge is processed one time) is automatically managed in this case.
it | The iterator on the ViewEdges of the ViewMap. It contains the chaining rule. |
pred | The predicate on the ViewEdge that expresses the stopping condition. |
Definition at line 134 of file Operators.cpp.
References error(), Freestyle::ViewEdgeInternal::ViewEdgeIterator::getOrientation(), id, Freestyle::TimeStamp::instance(), Freestyle::ViewEdgeInternal::ViewEdgeIterator::isEnd(), Freestyle::Chain::push_viewedge_back(), Freestyle::UnaryPredicate1D::result, Freestyle::ViewEdgeInternal::ViewEdgeIterator::setBegin(), and Freestyle::ViewEdgeInternal::ViewEdgeIterator::setCurrentEdge().
|
static |
Builds a set of chains from the current set of ViewEdges. Each ViewEdge of the current list starts a new chain. The chaining operator then iterates over the ViewEdges of the ViewMap using the user specified iterator. This operator only iterates using the increment operator and is therefore unidirectional.
it | The iterator on the ViewEdges of the ViewMap. It contains the chaining rule. |
pred | The predicate on the ViewEdge that expresses the stopping condition. |
modifier | A function that takes a ViewEdge as argument and that is used to modify the processed ViewEdge state (the timestamp incrementation is a typical illustration of such a modifier) |
Definition at line 68 of file Operators.cpp.
References error(), Freestyle::ViewEdgeInternal::ViewEdgeIterator::getOrientation(), id, Freestyle::ViewEdgeInternal::ViewEdgeIterator::isEnd(), Freestyle::Chain::push_viewedge_back(), Freestyle::UnaryPredicate1D::result, Freestyle::ViewEdgeInternal::ViewEdgeIterator::setBegin(), and Freestyle::ViewEdgeInternal::ViewEdgeIterator::setCurrentEdge().
Referenced by Operators_chain().
|
static |
Creates and shades the strokes from the current set of chains. A predicate can be specified to make a selection pass on the chains.
pred | The predicate that a chain must verify in order to be transform as a stroke |
shaders | The list of shaders used to shade the strokes |
Definition at line 1259 of file Operators.cpp.
References Freestyle::applyShading(), Freestyle::createStroke(), error(), Freestyle::UnaryPredicate1D::result, and blender::draw::image_engine::shaders.
Referenced by Operators_create().
|
inlinestatic |
Definition at line 225 of file Operators.h.
Referenced by Operators_get_chain_from_index().
|
inlinestatic |
Definition at line 240 of file Operators.h.
Referenced by Operators_get_chain_from_index(), and Operators_get_chains_size().
|
inlinestatic |
Definition at line 230 of file Operators.h.
Referenced by Operators_get_stroke_from_index().
|
inlinestatic |
Definition at line 255 of file Operators.h.
|
inlinestatic |
Definition at line 245 of file Operators.h.
Referenced by Operators_get_stroke_from_index(), and Operators_get_strokes_size().
|
inlinestatic |
Definition at line 220 of file Operators.h.
Referenced by Operators_get_viewedge_from_index().
|
inlinestatic |
Definition at line 235 of file Operators.h.
Referenced by Operators_get_view_edges_size(), and Operators_get_viewedge_from_index().
|
static |
Splits the current set of chains in a recursive way. We process the points of each chain (with a specified sampling) to find the point minimizing a specified function. The chain is split in two at this point and the two new chains are processed in the same way. The user can specify a 0D predicate to make a first selection on the points that can potentially be split. A point that doesn't verify the 0D predicate won't be candidate in realizing the min. The recursivity level is controlled through a predicate 1D that expresses a stopping condition on the chain that is about to be processed.
func | The Unary Function evaluated at each point of the chain. The splitting point is the point minimizing this function |
pred0d | The Unary Predicate 0D used to select the candidate points where the split can occur. For example, it is very likely that would rather have your chain splitting around its middle point than around one of its extremities. A 0D predicate working on the curvilinear abscissa allows to add this kind of constraints. |
pred | The Unary Predicate ex pressing the recursivity stopping condition. This predicate is evaluated for each curve before it actually gets split. If pred(chain) is true, the curve won't be split anymore. |
sampling | The resolution used to sample the chain for the predicates evaluation. (The chain is not actually resampled, a virtual point only progresses along the curve using this resolution) |
Definition at line 973 of file Operators.cpp.
References Freestyle::__recursiveSplit(), Freestyle::M_EPSILON, and Freestyle::UnaryPredicate1D::result.
|
static |
Splits the current set of chains in a recursive way. We process the points of each chain (with a specified sampling) to find the point minimizing a specified function. The chain is split in two at this point and the two new chains are processed in the same way. The recursivity level is controlled through a predicate 1D that expresses a stopping condition on the chain that is about to be processed.
func | The Unary Function evaluated at each point of the chain. The splitting point is the point minimizing this function |
pred | The Unary Predicate ex pressing the recursivity stopping condition. This predicate is evaluated for each curve before it actually gets split. If pred(chain) is true, the curve won't be split anymore. |
sampling | The resolution used to sample the chain for the predicates evaluation. (The chain is not actually resampled, a virtual point only progresses along the curve using this resolution) |
Definition at line 790 of file Operators.cpp.
References Freestyle::__recursiveSplit(), Freestyle::M_EPSILON, and Freestyle::UnaryPredicate1D::result.
Referenced by Operators_recursive_split().
Definition at line 1303 of file Operators.cpp.
References Freestyle::ViewMap::getInstance(), Freestyle::M_EPSILON, and Freestyle::ViewMap::ViewEdges().
Referenced by Operators_reset().
|
static |
Selects the ViewEdges of the ViewMap verifying a specified condition.
pred | The predicate expressing this condition |
Definition at line 26 of file Operators.cpp.
References Freestyle::UnaryPredicate1D::result.
Referenced by Operators_select().
|
static |
Splits each chain of the current set of chains in a sequential way. The points of each chain are processed (with a specified sampling) sequentially and each time a user specified condition is verified, the chain is split into two chains. The resulting set of chains is a partition of the initial chain
pred | The predicate on a point that expresses the splitting condition |
sampling | The resolution used to sample the chain for the predicate evaluation. (The chain is not actually resampled, a virtual point only progresses along the curve using this resolution) |
Definition at line 498 of file Operators.cpp.
References error(), Freestyle::Id::getSecond(), Freestyle::M_EPSILON, Freestyle::Curve::nSegments(), point, Freestyle::Curve::push_vertex_back(), Freestyle::UnaryPredicate0D::result, and Freestyle::Id::setSecond().
|
static |
Splits each chain of the current set of chains in a sequential way. The points of each chain are processed (with a specified sampling) sequentially. Each time a user specified starting condition is verified, a new chain begins and ends as soon as a user-defined stopping predicate is verified. This allows chains overlapping rather than chains partitioning. The first point of the initial chain is the first point of one of the resulting chains. The splitting ends when no more chain can start.
startingPred | The predicate on a point that expresses the starting condition |
stoppingPred | The predicate on a point that expresses the stopping condition |
sampling | The resolution used to sample the chain for the predicates evaluation. (The chain is not actually resampled, a virtual point only progresses along the curve using this resolution) |
Definition at line 580 of file Operators.cpp.
References ELEM, error(), Freestyle::Id::getSecond(), Freestyle::M_EPSILON, Freestyle::Curve::nSegments(), point, Freestyle::Curve::push_vertex_back(), Freestyle::UnaryPredicate0D::result, and Freestyle::Id::setSecond().
Referenced by Operators_sequential_split().
|
static |
Sorts the current set of chains (or viewedges) according to the comparison predicate given as argument.
pred | The binary predicate used for the comparison |
Definition at line 1054 of file Operators.cpp.
Referenced by Operators_sort().