Blender
V3.3
|
#include "BPy_Operators.h"
#include "BPy_BinaryPredicate1D.h"
#include "BPy_Convert.h"
#include "BPy_StrokeShader.h"
#include "BPy_UnaryPredicate0D.h"
#include "BPy_UnaryPredicate1D.h"
#include "Iterator/BPy_ChainingIterator.h"
#include "Iterator/BPy_ViewEdgeIterator.h"
#include "UnaryFunction0D/BPy_UnaryFunction0DDouble.h"
#include "UnaryFunction1D/BPy_UnaryFunction1DVoid.h"
#include <sstream>
Go to the source code of this file.
Functions | |
int | Operators_Init (PyObject *module) |
PyDoc_STRVAR (Operators_doc, "Class defining the operators used in a style module. There are five\n" "types of operators: Selection, chaining, splitting, sorting and\n" "creation. All these operators are user controlled through functors,\n" "predicates and shaders that are taken as arguments.") | |
static void | Operators_dealloc (BPy_Operators *self) |
PyDoc_STRVAR (Operators_select_doc, ".. staticmethod:: select(pred)\n" "\n" " Selects the ViewEdges of the ViewMap verifying a specified\n" " condition.\n" "\n" " :arg pred: The predicate expressing this condition.\n" " :type pred: :class:`UnaryPredicate1D`") | |
static PyObject * | Operators_select (BPy_Operators *, PyObject *args, PyObject *kwds) |
PyDoc_STRVAR (Operators_chain_doc, ".. staticmethod:: chain(it, pred, modifier)\n" " chain(it, pred)\n" "\n" " Builds a set of chains from the current set of ViewEdges. Each\n" " ViewEdge of the current list starts a new chain. The chaining\n" " operator then iterates over the ViewEdges of the ViewMap using the\n" " user specified iterator. This operator only iterates using the\n" " increment operator and is therefore unidirectional.\n" "\n" " :arg it: The iterator on the ViewEdges of the ViewMap. It contains\n" " the chaining rule.\n" " :type it: :class:`ViewEdgeIterator`\n" " :arg pred: The predicate on the ViewEdge that expresses the\n" " stopping condition.\n" " :type pred: :class:`UnaryPredicate1D`\n" " :arg modifier: A function that takes a ViewEdge as argument and\n" " that is used to modify the processed ViewEdge state (the\n" " timestamp incrementation is a typical illustration of such a modifier).\n" " If this argument is not given, the time stamp is automatically managed.\n" " :type modifier: :class:`UnaryFunction1DVoid`\n") | |
static PyObject * | Operators_chain (BPy_Operators *, PyObject *args, PyObject *kwds) |
PyDoc_STRVAR (Operators_bidirectional_chain_doc, ".. staticmethod:: bidirectional_chain(it, pred)\n" " bidirectional_chain(it)\n" "\n" " Builds a set of chains from the current set of ViewEdges. Each\n" " ViewEdge of the current list potentially starts a new chain. The\n" " chaining operator then iterates over the ViewEdges of the ViewMap\n" " using the user specified iterator. This operator iterates both using\n" " the increment and decrement operators and is therefore bidirectional.\n" " This operator works with a ChainingIterator which contains the\n" " chaining rules. It is this last one which can be told to chain only\n" " edges that belong to the selection or not to process twice a ViewEdge\n" " during the chaining. Each time a ViewEdge is added to a chain, its\n" " chaining time stamp is incremented. This allows you to keep track of\n" " the number of chains to which a ViewEdge belongs to.\n" "\n" " :arg it: The ChainingIterator on the ViewEdges of the ViewMap. It\n" " contains the chaining rule.\n" " :type it: :class:`ChainingIterator`\n" " :arg pred: The predicate on the ViewEdge that expresses the stopping condition.\n" " This parameter is optional, you make not want to pass a stopping criterion\n" " when the stopping criterion is already contained in the iterator definition.\n" " :type pred: :class:`UnaryPredicate1D`\n") | |
static PyObject * | Operators_bidirectional_chain (BPy_Operators *, PyObject *args, PyObject *kwds) |
PyDoc_STRVAR (Operators_sequential_split_doc, ".. staticmethod:: sequential_split(starting_pred, stopping_pred, sampling=0.0)\n" " sequential_split(pred, sampling=0.0)\n" "\n" " Splits each chain of the current set of chains in a sequential way.\n" " The points of each chain are processed (with a specified sampling)\n" " sequentially. The first point of the initial chain is the\n" " first point of one of the resulting chains. The splitting ends when\n" " no more chain can start.\n" "\n" " .. tip::\n" "\n" " By specifying a starting and stopping predicate allows\n" " the chains to overlap rather than chains partitioning.\n" "\n" " :arg starting_pred: The predicate on a point that expresses the\n" " starting condition. Each time this condition is verified, a new chain begins\n" " :type starting_pred: :class:`UnaryPredicate0D`\n" " :arg stopping_pred: The predicate on a point that expresses the\n" " stopping condition. The chain ends as soon as this predicate is verified.\n" " :type stopping_pred: :class:`UnaryPredicate0D`\n" " :arg pred: The predicate on a point that expresses the splitting condition.\n" " Each time the condition is verified, the chain is split into two chains.\n" " The resulting set of chains is a partition of the initial chain\n" " :type pred: :class:`UnaryPredicate0D`\n" " :arg sampling: The resolution used to sample the chain for the\n" " predicates evaluation. (The chain is not actually resampled;\n" " a virtual point only progresses along the curve using this\n" " resolution.)\n" " :type sampling: float\n") | |
static PyObject * | Operators_sequential_split (BPy_Operators *, PyObject *args, PyObject *kwds) |
PyDoc_STRVAR (Operators_recursive_split_doc, ".. staticmethod:: recursive_split(func, pred_1d, sampling=0.0)\n" " recursive_split(func, pred_0d, pred_1d, sampling=0.0)\n" "\n" " Splits the current set of chains in a recursive way. We process the\n" " points of each chain (with a specified sampling) to find the point\n" " minimizing a specified function. The chain is split in two at this\n" " point and the two new chains are processed in the same way. The\n" " recursivity level is controlled through a predicate 1D that expresses\n" " a stopping condition on the chain that is about to be processed.\n" "\n" " The user can also specify a 0D predicate to make a first selection on the points\n" " that can potentially be split. A point that doesn't verify the 0D\n" " predicate won't be candidate in realizing the min.\n" "\n" " :arg func: The Unary Function evaluated at each point of the chain.\n" " The splitting point is the point minimizing this function.\n" " :type func: :class:`UnaryFunction0DDouble`\n" " :arg pred_0d: The Unary Predicate 0D used to select the candidate\n" " points where the split can occur. For example, it is very likely\n" " that would rather have your chain splitting around its middle\n" " point than around one of its extremities. A 0D predicate working\n" " on the curvilinear abscissa allows to add this kind of constraints.\n" " :type pred_0d: :class:`UnaryPredicate0D`\n" " :arg pred_1d: The Unary Predicate expressing the recursivity stopping\n" " condition. This predicate is evaluated for each curve before it\n" " actually gets split. If pred_1d(chain) is true, the curve won't be\n" " split anymore.\n" " :type pred_1d: :class:`UnaryPredicate1D`\n" " :arg sampling: The resolution used to sample the chain for the\n" " predicates evaluation. (The chain is not actually resampled; a\n" " virtual point only progresses along the curve using this\n" " resolution.)\n" " :type sampling: float\n") | |
static PyObject * | Operators_recursive_split (BPy_Operators *, PyObject *args, PyObject *kwds) |
PyDoc_STRVAR (Operators_sort_doc, ".. staticmethod:: sort(pred)\n" "\n" " Sorts the current set of chains (or viewedges) according to the\n" " comparison predicate given as argument.\n" "\n" " :arg pred: The binary predicate used for the comparison.\n" " :type pred: :class:`BinaryPredicate1D`") | |
static PyObject * | Operators_sort (BPy_Operators *, PyObject *args, PyObject *kwds) |
PyDoc_STRVAR (Operators_create_doc, ".. staticmethod:: create(pred, shaders)\n" "\n" " Creates and shades the strokes from the current set of chains. A\n" " predicate can be specified to make a selection pass on the chains.\n" "\n" " :arg pred: The predicate that a chain must verify in order to be\n" " transform as a stroke.\n" " :type pred: :class:`UnaryPredicate1D`\n" " :arg shaders: The list of shaders used to shade the strokes.\n" " :type shaders: list of :class:`StrokeShader` objects") | |
static PyObject * | Operators_create (BPy_Operators *, PyObject *args, PyObject *kwds) |
PyDoc_STRVAR (Operators_reset_doc, ".. staticmethod:: reset(delete_strokes=True)\n" "\n" " Resets the line stylization process to the initial state. The results of\n" " stroke creation are accumulated if **delete_strokes** is set to False.\n" "\n" " :arg delete_strokes: Delete the strokes that are currently stored.\n" " :type delete_strokes: bool\n") | |
static PyObject * | Operators_reset (BPy_Operators *, PyObject *args, PyObject *kwds) |
PyDoc_STRVAR (Operators_get_viewedge_from_index_doc, ".. staticmethod:: get_viewedge_from_index(i)\n" "\n" " Returns the ViewEdge at the index in the current set of ViewEdges.\n" "\n" " :arg i: index (0 <= i < Operators.get_view_edges_size()).\n" " :type i: int\n" " :return: The ViewEdge object.\n" " :rtype: :class:`ViewEdge`") | |
static PyObject * | Operators_get_viewedge_from_index (BPy_Operators *, PyObject *args, PyObject *kwds) |
PyDoc_STRVAR (Operators_get_chain_from_index_doc, ".. staticmethod:: get_chain_from_index(i)\n" "\n" " Returns the Chain at the index in the current set of Chains.\n" "\n" " :arg i: index (0 <= i < Operators.get_chains_size()).\n" " :type i: int\n" " :return: The Chain object.\n" " :rtype: :class:`Chain`") | |
static PyObject * | Operators_get_chain_from_index (BPy_Operators *, PyObject *args, PyObject *kwds) |
PyDoc_STRVAR (Operators_get_stroke_from_index_doc, ".. staticmethod:: get_stroke_from_index(i)\n" "\n" " Returns the Stroke at the index in the current set of Strokes.\n" "\n" " :arg i: index (0 <= i < Operators.get_strokes_size()).\n" " :type i: int\n" " :return: The Stroke object.\n" " :rtype: :class:`Stroke`") | |
static PyObject * | Operators_get_stroke_from_index (BPy_Operators *, PyObject *args, PyObject *kwds) |
PyDoc_STRVAR (Operators_get_view_edges_size_doc, ".. staticmethod:: get_view_edges_size()\n" "\n" " Returns the number of ViewEdges.\n" "\n" " :return: The number of ViewEdges.\n" " :rtype: int") | |
static PyObject * | Operators_get_view_edges_size (BPy_Operators *) |
PyDoc_STRVAR (Operators_get_chains_size_doc, ".. staticmethod:: get_chains_size()\n" "\n" " Returns the number of Chains.\n" "\n" " :return: The number of Chains.\n" " :rtype: int") | |
static PyObject * | Operators_get_chains_size (BPy_Operators *) |
PyDoc_STRVAR (Operators_get_strokes_size_doc, ".. staticmethod:: get_strokes_size()\n" "\n" " Returns the number of Strokes.\n" "\n" " :return: The number of Strokes.\n" " :rtype: int") | |
static PyObject * | Operators_get_strokes_size (BPy_Operators *) |
Variables | |
static PyMethodDef | BPy_Operators_methods [] |
PyTypeObject | Operators_Type |
|
static |
Definition at line 190 of file BPy_Operators.cpp.
References Freestyle::Operators::bidirectionalChain(), ChainingIterator_Type, and UnaryPredicate1D_Type.
|
static |
Definition at line 112 of file BPy_Operators.cpp.
References Freestyle::Operators::chain(), ChainingIterator_Type, UnaryFunction1DVoid_Type, and UnaryPredicate1D_Type.
|
static |
Definition at line 500 of file BPy_Operators.cpp.
References BPy_StrokeShader_Check, Freestyle::Operators::create(), blender::draw::image_engine::shaders, and UnaryPredicate1D_Type.
|
static |
Definition at line 53 of file BPy_Operators.cpp.
|
static |
Definition at line 610 of file BPy_Operators.cpp.
References BPy_Chain_from_Chain(), Freestyle::Operators::getChainFromIndex(), and Freestyle::Operators::getChainsSize().
|
static |
Definition at line 675 of file BPy_Operators.cpp.
References Freestyle::Operators::getChainsSize().
|
static |
Definition at line 637 of file BPy_Operators.cpp.
References BPy_Stroke_from_Stroke(), Freestyle::Operators::getStrokeFromIndex(), and Freestyle::Operators::getStrokesSize().
|
static |
Definition at line 688 of file BPy_Operators.cpp.
References Freestyle::Operators::getStrokesSize().
|
static |
Definition at line 662 of file BPy_Operators.cpp.
References Freestyle::Operators::getViewEdgesSize().
|
static |
Definition at line 583 of file BPy_Operators.cpp.
References BPy_ViewEdge_from_ViewEdge(), Freestyle::Operators::getViewEdgeFromIndex(), and Freestyle::Operators::getViewEdgesSize().
int Operators_Init | ( | PyObject * | module | ) |
Definition at line 30 of file BPy_Operators.cpp.
References module, and Operators_Type.
Referenced by Freestyle_Init().
|
static |
Definition at line 369 of file BPy_Operators.cpp.
References Freestyle::Operators::recursiveSplit(), UnaryFunction0DDouble_Type, UnaryPredicate0D_Type, and UnaryPredicate1D_Type.
|
static |
Definition at line 558 of file BPy_Operators.cpp.
References bool_from_PyBool(), and Freestyle::Operators::reset().
|
static |
Definition at line 67 of file BPy_Operators.cpp.
References Freestyle::Operators::select(), and UnaryPredicate1D_Type.
|
static |
Definition at line 270 of file BPy_Operators.cpp.
References Freestyle::Operators::sequentialSplit(), and UnaryPredicate0D_Type.
|
static |
Definition at line 465 of file BPy_Operators.cpp.
References BinaryPredicate1D_Type, and Freestyle::Operators::sort().
PyDoc_STRVAR | ( | Operators_bidirectional_chain_doc | , |
".. staticmethod:: bidirectional_chain(it, pred)\n" " bidirectional_chain(it)\n" "\n" " Builds a set of chains from the current set of ViewEdges. Each\n" " ViewEdge of the current list potentially starts a new chain. The\n" " chaining operator then iterates over the ViewEdges of the ViewMap\n" " using the user specified iterator. This operator iterates both using\n" " the increment and decrement operators and is therefore bidirectional.\n" " This operator works with a ChainingIterator which contains the\n" " chaining rules. It is this last one which can be told to chain only\n" " edges that belong to the selection or not to process twice a ViewEdge\n" " during the chaining. Each time a ViewEdge is added to a | chain, | ||
its\n" " chaining time stamp is incremented. This allows you to keep track of\n" " the number of chains to which a ViewEdge belongs to.\n" "\n" " :arg it:The ChainingIterator on the ViewEdges of the ViewMap. It\n" " contains the chaining rule.\n" " :type it::class:`ChainingIterator`\n" " :arg pred:The predicate on the ViewEdge that expresses the stopping condition.\n" " This parameter is | optional, | ||
you make not want to pass a stopping criterion\n" " when the stopping criterion is already contained in the iterator definition.\n" " :type pred::class:`UnaryPredicate1D`\n" | |||
) |
PyDoc_STRVAR | ( | Operators_chain_doc | , |
".. staticmethod:: chain(it, pred, modifier)\n" " chain(it, pred)\n" "\n" " Builds a set of chains from the current set of ViewEdges. Each\n" " ViewEdge of the current list starts a new chain. The chaining\n" " operator then iterates over the ViewEdges of the ViewMap using the\n" " user specified iterator. This operator only iterates using the\n" " increment operator and is therefore unidirectional.\n" "\n" " :arg it: The iterator on the ViewEdges of the ViewMap. It contains\n" " the chaining rule.\n" " :type it: :class:`ViewEdgeIterator`\n" " :arg pred: The predicate on the ViewEdge that expresses the\n" " stopping condition.\n" " :type pred: :class:`UnaryPredicate1D`\n" " :arg modifier: A function that takes a ViewEdge as argument and\n" " that is used to modify the processed ViewEdge state (the\n" " timestamp incrementation is a typical illustration of such a modifier).\n" " If this argument is not | given, | ||
the time stamp is automatically managed.\n" " :type modifier::class:`UnaryFunction1DVoid`\n" | |||
) |
PyDoc_STRVAR | ( | Operators_create_doc | , |
".. staticmethod:: create(pred, shaders)\n" "\n" " Creates and shades the strokes from the current set of chains. A\n" " predicate can be specified to make a selection pass on the chains.\n" "\n" " :arg pred: The predicate that a chain must verify in order to be\n" " transform as a stroke.\n" " :type pred: :class:`UnaryPredicate1D`\n" " :arg shaders: The list of shaders used to shade the strokes.\n" " :type shaders: list of :class:`StrokeShader` objects" | |||
) |
PyDoc_STRVAR | ( | Operators_doc | , |
"Class defining the operators used in a style module. There are five\n" "types of operators: | Selection, | ||
chaining | , | ||
splitting | , | ||
sorting and\n" "creation. All these operators are user controlled through | functors, | ||
\n" "predicates and shaders that are taken as arguments." | |||
) |
PyDoc_STRVAR | ( | Operators_get_chain_from_index_doc | , |
".. staticmethod:: get_chain_from_index(i)\n" "\n" " Returns the Chain at the index in the current set of Chains.\n" "\n" " :arg i: index (0 <= i < Operators.get_chains_size()).\n" " :type i: int\n" " :return: The Chain object.\n" " :rtype: :class:`Chain`" | |||
) |
PyDoc_STRVAR | ( | Operators_get_chains_size_doc | , |
".. staticmethod:: get_chains_size()\n" "\n" " Returns the number of Chains.\n" "\n" " :return: The number of Chains.\n" " :rtype: int" | |||
) |
PyDoc_STRVAR | ( | Operators_get_stroke_from_index_doc | , |
".. staticmethod:: get_stroke_from_index(i)\n" "\n" " Returns the Stroke at the index in the current set of Strokes.\n" "\n" " :arg i: index (0 <= i < Operators.get_strokes_size()).\n" " :type i: int\n" " :return: The Stroke object.\n" " :rtype: :class:`Stroke`" | |||
) |
PyDoc_STRVAR | ( | Operators_get_strokes_size_doc | , |
".. staticmethod:: get_strokes_size()\n" "\n" " Returns the number of Strokes.\n" "\n" " :return: The number of Strokes.\n" " :rtype: int" | |||
) |
PyDoc_STRVAR | ( | Operators_get_view_edges_size_doc | , |
".. staticmethod:: get_view_edges_size()\n" "\n" " Returns the number of ViewEdges.\n" "\n" " :return: The number of ViewEdges.\n" " :rtype: int" | |||
) |
PyDoc_STRVAR | ( | Operators_get_viewedge_from_index_doc | , |
".. staticmethod:: get_viewedge_from_index(i)\n" "\n" " Returns the ViewEdge at the index in the current set of ViewEdges.\n" "\n" " :arg i: index (0 <= i < Operators.get_view_edges_size()).\n" " :type i: int\n" " :return: The ViewEdge object.\n" " :rtype: :class:`ViewEdge`" | |||
) |
PyDoc_STRVAR | ( | Operators_recursive_split_doc | , |
".. staticmethod:: recursive_split(func, pred_1d, sampling=0.0)\n" " recursive_split(func, pred_0d, pred_1d, sampling=0.0)\n" "\n" " Splits the current set of chains in a recursive way. We process the\n" " points of each chain (with a specified sampling) to find the point\n" " minimizing a specified function. The chain is split in two at this\n" " point and the two new chains are processed in the same way. The\n" " recursivity level is controlled through a predicate 1D that expresses\n" " a stopping condition on the chain that is about to be processed.\n" "\n" " The user can also specify a 0D predicate to make a first selection on the points\n" " that can potentially be split. A point that doesn't verify the 0D\n" " predicate won't be candidate in realizing the min.\n" "\n" " :arg func: The Unary Function evaluated at each point of the chain.\n" " The splitting point is the point minimizing this function.\n" " :type func: :class:`UnaryFunction0DDouble`\n" " :arg pred_0d: The Unary Predicate 0D used to select the candidate\n" " points where the split can occur. For | example, | ||
it is very likely\n" " that would rather have your chain splitting around its middle\n" " point than around one of its extremities. A 0D predicate working\n" " on the curvilinear abscissa allows to add this kind of constraints.\n" " :type pred_0d::class:`UnaryPredicate0D`\n" " :arg pred_1d:The Unary Predicate expressing the recursivity stopping\n" " condition. This predicate is evaluated for each curve before it\n" " actually gets split. If pred_1d(chain) is | true, | ||
the curve won 't be\n" " split anymore.\n" " :type pred_1d::class:`UnaryPredicate1D`\n" " :arg sampling:The resolution used to sample the chain for the\n" " predicates evaluation.(The chain is not actually resampled;a\n" " virtual point only progresses along the curve using this\n" " resolution.)\n" " :type sampling:float\n" | |||
) |
PyDoc_STRVAR | ( | Operators_reset_doc | , |
".. staticmethod:: reset(delete_strokes=True)\n" "\n" " Resets the line stylization process to the initial state. The results of\n" " stroke creation are accumulated if **delete_strokes** is set to False.\n" "\n" " :arg delete_strokes: Delete the strokes that are currently stored.\n" " :type delete_strokes: bool\n" | |||
) |
PyDoc_STRVAR | ( | Operators_select_doc | , |
".. staticmethod:: select(pred)\n" "\n" " Selects the ViewEdges of the ViewMap verifying a specified\n" " condition.\n" "\n" " :arg pred: The predicate expressing this condition.\n" " :type pred: :class:`UnaryPredicate1D`" | |||
) |
PyDoc_STRVAR | ( | Operators_sequential_split_doc | , |
".. staticmethod:: sequential_split(starting_pred, stopping_pred, sampling=0.0)\n" " sequential_split(pred, sampling=0.0)\n" "\n" " Splits each chain of the current set of chains in a sequential way.\n" " The points of each chain are processed (with a specified sampling)\n" " sequentially. The first point of the initial chain is the\n" " first point of one of the resulting chains. The splitting ends when\n" " no more chain can start.\n" "\n" " .. tip::\n" "\n" " By specifying a starting and stopping predicate allows\n" " the chains to overlap rather than chains partitioning.\n" "\n" " :arg starting_pred: The predicate on a point that expresses the\n" " starting condition. Each time this condition is | verified, | ||
a new chain begins\n" " :type starting_pred::class:`UnaryPredicate0D`\n" " :arg stopping_pred:The predicate on a point that expresses the\n" " stopping condition. The chain ends as soon as this predicate is verified.\n" " :type stopping_pred::class:`UnaryPredicate0D`\n" " :arg pred:The predicate on a point that expresses the splitting condition.\n" " Each time the condition is | verified, | ||
the chain is split into two chains.\n" " The resulting set of chains is a partition of the initial chain\n" " :type pred::class:`UnaryPredicate0D`\n" " :arg sampling:The resolution used to sample the chain for the\n" " predicates evaluation.(The chain is not actually resampled;\n" " a virtual point only progresses along the curve using this\n" " resolution.)\n" " :type sampling:float\n" | |||
) |
PyDoc_STRVAR | ( | Operators_sort_doc | , |
".. staticmethod:: sort(pred)\n" "\n" " Sorts the current set of chains (or viewedges) according to the\n" " comparison predicate given as argument.\n" "\n" " :arg pred: The binary predicate used for the comparison.\n" " :type pred: :class:`BinaryPredicate1D`" | |||
) |
|
static |
Definition at line 694 of file BPy_Operators.cpp.
PyTypeObject Operators_Type |
Definition at line 756 of file BPy_Operators.cpp.
Referenced by Operators_Init().