Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2013-02-21 06:57:44 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2013-02-21 06:57:44 +0400
commit39f8c6e189c89f4097f5d979612cb71bd8773030 (patch)
treed9a4ace57a1dc75f9e968ac0c1cae92ef995c145 /source/blender/freestyle/intern/python/Iterator
parent92436c94d3adbbfc285bd7b3041db36e66dae5d5 (diff)
Freestyle Python API improvements - part 5.
Handling of keyword arguments in Python wrapper class constructors was revised. This revision is mainly focused on Interface0D, Interface1D, Iterator, and their subclasses, as well as a few additional view map component classes. Implementation notes: Because of the extensive use of constructor overloading in the underlying C++ classes, the corresponding Python wrappers try to parse arguments through multiple calls of PyArg_ParseTupleAndKeywords() if needed. The downside of this implementation is that most argument errors result in the same error message ("invalid argument(s)") without indicating what is wrong. For now this issue is left for future work. * Now the instantiation of ViewVertex is prohibited since the underlying C++ class is an abstract class. * Removed the .cast_to_interface0diterator() method from CurvePointIterator and StrokeVertexIterator. Instead the constructor of Interface0DIterator now accepts the instances of these two iterator classes to construct a nested Interface0DIterator instance that can be passed to Function0D functor objects. Specifically, an iterator 'it' is passed to a functor 'func' as follows: func(Interface0DIterator(it)) instead of: func(it.cast_to_interface0diterator()) * Boolean arguments of class constructors only accept values of boolean type. Input values of other types are considered as error. * Additional code clean-up was made.
Diffstat (limited to 'source/blender/freestyle/intern/python/Iterator')
-rw-r--r--source/blender/freestyle/intern/python/Iterator/BPy_AdjacencyIterator.cpp71
-rw-r--r--source/blender/freestyle/intern/python/Iterator/BPy_ChainPredicateIterator.cpp110
-rw-r--r--source/blender/freestyle/intern/python/Iterator/BPy_ChainSilhouetteIterator.cpp55
-rw-r--r--source/blender/freestyle/intern/python/Iterator/BPy_ChainingIterator.cpp59
-rw-r--r--source/blender/freestyle/intern/python/Iterator/BPy_CurvePointIterator.cpp77
-rw-r--r--source/blender/freestyle/intern/python/Iterator/BPy_Interface0DIterator.cpp48
-rw-r--r--source/blender/freestyle/intern/python/Iterator/BPy_SVertexIterator.cpp76
-rw-r--r--source/blender/freestyle/intern/python/Iterator/BPy_StrokeVertexIterator.cpp45
-rw-r--r--source/blender/freestyle/intern/python/Iterator/BPy_ViewEdgeIterator.cpp49
-rw-r--r--source/blender/freestyle/intern/python/Iterator/BPy_orientedViewEdgeIterator.cpp20
10 files changed, 299 insertions, 311 deletions
diff --git a/source/blender/freestyle/intern/python/Iterator/BPy_AdjacencyIterator.cpp b/source/blender/freestyle/intern/python/Iterator/BPy_AdjacencyIterator.cpp
index 8d7e5638d19..358bf78221f 100644
--- a/source/blender/freestyle/intern/python/Iterator/BPy_AdjacencyIterator.cpp
+++ b/source/blender/freestyle/intern/python/Iterator/BPy_AdjacencyIterator.cpp
@@ -19,52 +19,55 @@ PyDoc_STRVAR(AdjacencyIterator_doc,
"decrement() methods of a :class:`ChainingIterator` and passed to the\n"
"traverse() method of the ChainingIterator.\n"
"\n"
-".. method:: __init__(iVertex, iRestrictToSelection=True, iRestrictToUnvisited=True)\n"
+".. method:: __init__()\n"
"\n"
-" Builds a AdjacencyIterator object.\n"
+" Default constructor.\n"
"\n"
-" :arg iVertex: The vertex which is the next crossing.\n"
-" :type iVertex: :class:`ViewVertex`\n"
-" :arg iRestrictToSelection: Indicates whether to force the chaining\n"
-" to stay within the set of selected ViewEdges or not.\n"
-" :type iRestrictToSelection: bool\n"
-" :arg iRestrictToUnvisited: Indicates whether a ViewEdge that has\n"
-" already been chained must be ignored ot not.\n"
-" :type iRestrictToUnvisited: bool\n"
-"\n"
-".. method:: __init__(it)\n"
+".. method:: __init__(brother)\n"
"\n"
" Copy constructor.\n"
"\n"
-" :arg it: An AdjacencyIterator object.\n"
-" :type it: :class:`AdjacencyIterator`");
+" :arg brother: An AdjacencyIterator object.\n"
+" :type brother: :class:`AdjacencyIterator`\n"
+"\n"
+".. method:: __init__(vertex, restrict_to_selection=True, restrict_to_unvisited=True)\n"
+"\n"
+" Builds a AdjacencyIterator object.\n"
+"\n"
+" :arg vertex: The vertex which is the next crossing.\n"
+" :type vertex: :class:`ViewVertex`\n"
+" :arg restrict_to_selection: Indicates whether to force the chaining\n"
+" to stay within the set of selected ViewEdges or not.\n"
+" :type restrict_to_selection: bool\n"
+" :arg restrict_to_unvisited: Indicates whether a ViewEdge that has\n"
+" already been chained must be ignored ot not.\n"
+" :type restrict_to_unvisited: bool");
-static int AdjacencyIterator_init(BPy_AdjacencyIterator *self, PyObject *args)
+static int AdjacencyIterator_init(BPy_AdjacencyIterator *self, PyObject *args, PyObject *kwds)
{
- PyObject *obj1 = 0, *obj2 = 0 , *obj3 = 0;
-
- if (!PyArg_ParseTuple(args, "|OOO", &obj1, &obj2, &obj3))
- return -1;
-
- if (!obj1) {
- self->a_it = new AdjacencyIterator();
-
- } else if (BPy_AdjacencyIterator_Check(obj1) && !obj2) {
- self->a_it = new AdjacencyIterator(*(((BPy_AdjacencyIterator *)obj1)->a_it));
-
- } else if (BPy_ViewVertex_Check(obj1) && (!obj2 || PyBool_Check(obj2)) && (!obj3 || PyBool_Check(obj3))) {
- bool restrictToSelection = (obj2) ? bool_from_PyBool(obj2) : true;
- bool restrictToUnvisited = (obj3) ? bool_from_PyBool(obj3) : true;
-
+ static const char *kwlist_1[] = {"brother", NULL};
+ static const char *kwlist_2[] = {"vertex", "restrict_to_selection", "restrict_to_unvisited", NULL};
+ PyObject *obj1 = 0, *obj2 = 0, *obj3 = 0;
+
+ if (PyArg_ParseTupleAndKeywords(args, kwds, "|O!", (char **)kwlist_1, &AdjacencyIterator_Type, &obj1)) {
+ if (!obj1)
+ self->a_it = new AdjacencyIterator();
+ else
+ self->a_it = new AdjacencyIterator(*(((BPy_AdjacencyIterator *)obj1)->a_it));
+ }
+ else if (PyErr_Clear(), (obj2 = obj3 = 0),
+ PyArg_ParseTupleAndKeywords(args, kwds, "O!|O!O!", (char **)kwlist_2,
+ &ViewVertex_Type, &obj1, &PyBool_Type, &obj2, &PyBool_Type, &obj3))
+ {
+ bool restrictToSelection = (!obj2) ? true : bool_from_PyBool(obj2);
+ bool restrictToUnvisited = (!obj3) ? true : bool_from_PyBool(obj3);
self->a_it = new AdjacencyIterator(((BPy_ViewVertex *)obj1)->vv, restrictToSelection, restrictToUnvisited);
-
- } else {
+ }
+ else {
PyErr_SetString(PyExc_TypeError, "invalid argument(s)");
return -1;
}
-
self->py_it.it = self->a_it;
-
return 0;
}
diff --git a/source/blender/freestyle/intern/python/Iterator/BPy_ChainPredicateIterator.cpp b/source/blender/freestyle/intern/python/Iterator/BPy_ChainPredicateIterator.cpp
index 13495a4fd04..f449bf11a9e 100644
--- a/source/blender/freestyle/intern/python/Iterator/BPy_ChainPredicateIterator.cpp
+++ b/source/blender/freestyle/intern/python/Iterator/BPy_ChainPredicateIterator.cpp
@@ -26,17 +26,17 @@ PyDoc_STRVAR(ChainPredicateIterator_doc,
"predicate is kept as the next one. If none of the potential next\n"
"ViewEdge respects these two predicates, None is returned.\n"
"\n"
-".. method:: __init__(iRestrictToSelection=True, iRestrictToUnvisited=True, begin=None, orientation=True)\n"
+".. method:: __init__(restrict_to_selection=True, restrict_to_unvisited=True, begin=None, orientation=True)\n"
"\n"
" Builds a ChainPredicateIterator from a starting ViewEdge and its\n"
" orientation.\n"
"\n"
-" :arg iRestrictToSelection: Indicates whether to force the chaining\n"
+" :arg restrict_to_selection: Indicates whether to force the chaining\n"
" to stay within the set of selected ViewEdges or not.\n"
-" :type iRestrictToSelection: bool\n"
-" :arg iRestrictToUnvisited: Indicates whether a ViewEdge that has\n"
+" :type restrict_to_selection: bool\n"
+" :arg restrict_to_unvisited: Indicates whether a ViewEdge that has\n"
" already been chained must be ignored ot not.\n"
-" :type iRestrictToUnvisited: bool\n"
+" :type restrict_to_unvisited: bool\n"
" :arg begin: The ViewEdge from where to start the iteration.\n"
" :type begin: :class:`ViewEdge` or None\n"
" :arg orientation: If true, we'll look for the next ViewEdge among\n"
@@ -45,7 +45,7 @@ PyDoc_STRVAR(ChainPredicateIterator_doc,
" ViewVertex of begin. \n"
" :type orientation: bool\n"
"\n"
-".. method:: __init__(upred, bpred, iRestrictToSelection=True, iRestrictToUnvisited=True, begin=None, orientation=True)\n"
+".. method:: __init__(upred, bpred, restrict_to_selection=True, restrict_to_unvisited=True, begin=None, orientation=True)\n"
"\n"
" Builds a ChainPredicateIterator from a unary predicate, a binary\n"
" predicate, a starting ViewEdge and its orientation.\n"
@@ -55,12 +55,12 @@ PyDoc_STRVAR(ChainPredicateIterator_doc,
" :arg bpred: The binary predicate that the next ViewEdge must\n"
" satisfy together with the actual pointed ViewEdge.\n"
" :type bpred: :class:`BinaryPredicate1D`\n"
-" :arg iRestrictToSelection: Indicates whether to force the chaining\n"
+" :arg restrict_to_selection: Indicates whether to force the chaining\n"
" to stay within the set of selected ViewEdges or not.\n"
-" :type iRestrictToSelection: bool\n"
-" :arg iRestrictToUnvisited: Indicates whether a ViewEdge that has\n"
+" :type restrict_to_selection: bool\n"
+" :arg restrict_to_unvisited: Indicates whether a ViewEdge that has\n"
" already been chained must be ignored ot not.\n"
-" :type iRestrictToUnvisited: bool\n"
+" :type restrict_to_unvisited: bool\n"
" :arg begin: The ViewEdge from where to start the iteration.\n"
" :type begin: :class:`ViewEdge` or None\n"
" :arg orientation: If true, we'll look for the next ViewEdge among\n"
@@ -76,73 +76,61 @@ PyDoc_STRVAR(ChainPredicateIterator_doc,
" :arg brother: A ChainPredicateIterator object.\n"
" :type brother: :class:`ChainPredicateIterator`");
-static int ChainPredicateIterator_init(BPy_ChainPredicateIterator *self, PyObject *args)
+static int check_begin(PyObject *obj, void *v)
{
- PyObject *obj1 = 0, *obj2 = 0, *obj3 = 0, *obj4 = 0, *obj5 = 0, *obj6 = 0;
+ if (obj != 0 && obj != Py_None && !BPy_ViewEdge_Check(obj))
+ return 0;
+ *((PyObject **)v) = obj;
+ return 1;
+}
- if (!(PyArg_ParseTuple(args, "|OOOOOO", &obj1, &obj2, &obj3, &obj4, &obj5, &obj6)))
- return -1;
+static int ChainPredicateIterator_init(BPy_ChainPredicateIterator *self, PyObject *args, PyObject *kwds)
+{
+ static const char *kwlist_1[] = {"brother", NULL};
+ static const char *kwlist_2[] = {"upred", "bpred", "restrict_to_selection", "restrict_to_unvisited", "begin", "orientation", NULL};
+ static const char *kwlist_3[] = {"restrict_to_selection", "restrict_to_unvisited", "begin", "orientation", NULL};
+ PyObject *obj1 = 0, *obj2 = 0, *obj3 = 0, *obj4 = 0, *obj5 = 0, *obj6 = 0;
- if (obj1 && BPy_ChainPredicateIterator_Check(obj1)) {
+ if (PyArg_ParseTupleAndKeywords(args, kwds, "O!", (char **)kwlist_1, &ChainingIterator_Type, &obj1)) {
self->cp_it = new ChainPredicateIterator(*(((BPy_ChainPredicateIterator *)obj1)->cp_it));
- self->upred = NULL;
- self->bpred = NULL;
-
- } else if ( obj1 && BPy_UnaryPredicate1D_Check(obj1) &&
- obj2 && BPy_BinaryPredicate1D_Check(obj2)) {
-
- if (!((BPy_UnaryPredicate1D *)obj1)->up1D) {
- PyErr_SetString(PyExc_TypeError, "1st argument: invalid UnaryPredicate1D object");
- return -1;
- }
- if (!((BPy_BinaryPredicate1D *)obj2)->bp1D) {
- PyErr_SetString(PyExc_TypeError, "2nd argument: invalid BinaryPredicate1D object");
- return -1;
- }
+ }
+ else if (PyErr_Clear(), (obj3 = obj4 = obj5 = obj6 = 0),
+ PyArg_ParseTupleAndKeywords(args, kwds, "O!O!|O!O!O&O!", (char **)kwlist_2,
+ &UnaryPredicate1D_Type, &obj1, &BinaryPredicate1D_Type, &obj2,
+ &PyBool_Type, &obj3, &PyBool_Type, &obj4, check_begin, &obj5,
+ &PyBool_Type, &obj6))
+ {
UnaryPredicate1D *up1D = ((BPy_UnaryPredicate1D *)obj1)->up1D;
BinaryPredicate1D *bp1D = ((BPy_BinaryPredicate1D *)obj2)->bp1D;
- bool restrictToSelection = (obj3) ? bool_from_PyBool(obj3) : true;
- bool restrictToUnvisited = (obj4) ? bool_from_PyBool(obj4) : true;
- ViewEdge *begin;
- if (!obj5 || obj5 == Py_None)
- begin = NULL;
- else if (BPy_ViewEdge_Check(obj5))
- begin = ((BPy_ViewEdge *)obj5)->ve;
- else {
- PyErr_SetString(PyExc_TypeError, "5th argument must be either a ViewEdge object or None");
- return -1;
- }
- bool orientation = (obj6) ? bool_from_PyBool(obj6) : true;
-
- self->cp_it = new ChainPredicateIterator(*up1D, *bp1D, restrictToSelection, restrictToUnvisited, begin, orientation);
+ bool restrict_to_selection = (!obj3) ? true : bool_from_PyBool(obj3);
+ bool restrict_to_unvisited = (!obj4) ? true : bool_from_PyBool(obj4);
+ ViewEdge *begin = (!obj5 || obj5 == Py_None) ? NULL : ((BPy_ViewEdge *)obj5)->ve;
+ bool orientation = (!obj6) ? true : bool_from_PyBool(obj6);
+ self->cp_it = new ChainPredicateIterator(*up1D, *bp1D, restrict_to_selection, restrict_to_unvisited, begin, orientation);
self->upred = obj1;
self->bpred = obj2;
Py_INCREF(self->upred);
Py_INCREF(self->bpred);
-
- } else {
- bool restrictToSelection = (obj1) ? bool_from_PyBool(obj1) : true;
- bool restrictToUnvisited = (obj2) ? bool_from_PyBool(obj2) : true;
- ViewEdge *begin;
- if (!obj3 || obj3 == Py_None)
- begin = NULL;
- else if (BPy_ViewEdge_Check(obj3))
- begin = ((BPy_ViewEdge *)obj3)->ve;
- else {
- PyErr_SetString(PyExc_TypeError, "3rd argument must be either a ViewEdge object or None");
- return -1;
- }
- bool orientation = (obj4) ? bool_from_PyBool(obj4) : true;
-
- self->cp_it = new ChainPredicateIterator(restrictToSelection, restrictToUnvisited, begin, orientation);
+ }
+ else if (PyErr_Clear(), (obj1 = obj2 = obj3 = obj4 = 0),
+ PyArg_ParseTupleAndKeywords(args, kwds, "|O!O!O&O!", (char **)kwlist_3,
+ &PyBool_Type, &obj1, &PyBool_Type, &obj2, check_begin, &obj3,
+ &PyBool_Type, &obj4))
+ {
+ bool restrict_to_selection = (!obj1) ? true : bool_from_PyBool(obj1);
+ bool restrict_to_unvisited = (!obj2) ? true : bool_from_PyBool(obj2);
+ ViewEdge *begin = (!obj3 || obj3 == Py_None) ? NULL : ((BPy_ViewEdge *)obj3)->ve;
+ bool orientation = (!obj4) ? true : bool_from_PyBool(obj4);
+ self->cp_it = new ChainPredicateIterator(restrict_to_selection, restrict_to_unvisited, begin, orientation);
self->upred = NULL;
self->bpred = NULL;
+ } else {
+ PyErr_SetString(PyExc_TypeError, "invalid argument(s)");
+ return -1;
}
-
self->py_c_it.c_it = self->cp_it;
self->py_c_it.py_ve_it.ve_it = self->cp_it;
self->py_c_it.py_ve_it.py_it.it = self->cp_it;
-
return 0;
}
diff --git a/source/blender/freestyle/intern/python/Iterator/BPy_ChainSilhouetteIterator.cpp b/source/blender/freestyle/intern/python/Iterator/BPy_ChainSilhouetteIterator.cpp
index efc64913932..cfa0a6dcb8d 100644
--- a/source/blender/freestyle/intern/python/Iterator/BPy_ChainSilhouetteIterator.cpp
+++ b/source/blender/freestyle/intern/python/Iterator/BPy_ChainSilhouetteIterator.cpp
@@ -11,7 +11,7 @@ extern "C" {
//------------------------INSTANCE METHODS ----------------------------------
-// ChainSilhouetteIterator (bool iRestrictToSelection=true, ViewEdge *begin=NULL, bool orientation=true)
+// ChainSilhouetteIterator (bool restrict_to_selection=true, ViewEdge *begin=NULL, bool orientation=true)
// ChainSilhouetteIterator (const ChainSilhouetteIterator &brother)
PyDoc_STRVAR(ChainSilhouetteIterator_doc,
@@ -24,14 +24,14 @@ PyDoc_STRVAR(ChainSilhouetteIterator_doc,
"ViewEdge that are both Silhouette and Crease, there will be a\n"
"precedence of the silhouette over the crease criterion.\n"
"\n"
-".. method:: __init__(iRestrictToSelection=True, begin=None, orientation=True)\n"
+".. method:: __init__(restrict_to_selection=True, begin=None, orientation=True)\n"
"\n"
" Builds a ChainSilhouetteIterator from the first ViewEdge used for\n"
" iteration and its orientation.\n"
"\n"
-" :arg iRestrictToSelection: Indicates whether to force the chaining\n"
+" :arg restrict_to_selection: Indicates whether to force the chaining\n"
" to stay within the set of selected ViewEdges or not.\n"
-" :type iRestrictToSelection: bool\n"
+" :type restrict_to_selection: bool\n"
" :arg begin: The ViewEdge from where to start the iteration.\n"
" :type begin: :class:`ViewEdge` or None\n"
" :arg orientation: If true, we'll look for the next ViewEdge among\n"
@@ -47,36 +47,39 @@ PyDoc_STRVAR(ChainSilhouetteIterator_doc,
" :arg brother: A ChainSilhouetteIterator object.\n"
" :type brother: :class:`ChainSilhouetteIterator`");
-static int ChainSilhouetteIterator_init(BPy_ChainSilhouetteIterator *self, PyObject *args)
+static int check_begin(PyObject *obj, void *v)
{
- PyObject *obj1 = 0, *obj2 = 0, *obj3 = 0;
+ if (obj != 0 && obj != Py_None && !BPy_ViewEdge_Check(obj))
+ return 0;
+ *((PyObject **)v) = obj;
+ return 1;
+}
- if (!(PyArg_ParseTuple(args, "|OOO", &obj1, &obj2, &obj3)))
- return -1;
+static int ChainSilhouetteIterator_init(BPy_ChainSilhouetteIterator *self, PyObject *args, PyObject *kwds)
+{
+ static const char *kwlist_1[] = {"brother", NULL};
+ static const char *kwlist_2[] = {"restrict_to_selection", "begin", "orientation", NULL};
+ PyObject *obj1 = 0, *obj2 = 0, *obj3 = 0;
- if (obj1 && BPy_ChainSilhouetteIterator_Check(obj1)) {
+ if (PyArg_ParseTupleAndKeywords(args, kwds, "O!", (char **)kwlist_1, &ChainSilhouetteIterator_Type, &obj1)) {
self->cs_it = new ChainSilhouetteIterator(*(((BPy_ChainSilhouetteIterator *)obj1)->cs_it));
-
- } else {
- bool restrictToSelection = (obj1) ? bool_from_PyBool(obj1) : true;
- ViewEdge *begin;
- if (!obj2 || obj2 == Py_None)
- begin = NULL;
- else if (BPy_ViewEdge_Check(obj2))
- begin = ((BPy_ViewEdge *)obj2)->ve;
- else {
- PyErr_SetString(PyExc_TypeError, "2nd argument must be either a ViewEdge object or None");
- return -1;
- }
- bool orientation = (obj3) ? bool_from_PyBool(obj3) : true;
-
- self->cs_it = new ChainSilhouetteIterator(restrictToSelection, begin, orientation);
}
-
+ else if (PyErr_Clear(), (obj1 = obj2 = obj3 = 0),
+ PyArg_ParseTupleAndKeywords(args, kwds, "|O!O&O!", (char **)kwlist_2,
+ &PyBool_Type, &obj1, check_begin, &obj2, &PyBool_Type, &obj3))
+ {
+ bool restrict_to_selection = (!obj1) ? true : bool_from_PyBool(obj1);
+ ViewEdge *begin = (!obj2 || obj2 == Py_None) ? NULL : ((BPy_ViewEdge *)obj2)->ve;
+ bool orientation = (!obj3) ? true : bool_from_PyBool(obj3);
+ self->cs_it = new ChainSilhouetteIterator(restrict_to_selection, begin, orientation);
+ }
+ else {
+ PyErr_SetString(PyExc_TypeError, "invalid argument(s)");
+ return -1;
+ }
self->py_c_it.c_it = self->cs_it;
self->py_c_it.py_ve_it.ve_it = self->cs_it;
self->py_c_it.py_ve_it.py_it.it = self->cs_it;
-
return 0;
}
diff --git a/source/blender/freestyle/intern/python/Iterator/BPy_ChainingIterator.cpp b/source/blender/freestyle/intern/python/Iterator/BPy_ChainingIterator.cpp
index 5323fe1c146..1c727582b7b 100644
--- a/source/blender/freestyle/intern/python/Iterator/BPy_ChainingIterator.cpp
+++ b/source/blender/freestyle/intern/python/Iterator/BPy_ChainingIterator.cpp
@@ -25,17 +25,17 @@ PyDoc_STRVAR(ChainingIterator_doc,
"they will be included in the adjacency iterator (i.e, the adjacent\n"
"iterator will only stop on \"valid\" edges).\n"
"\n"
-".. method:: __init__(iRestrictToSelection=True, iRestrictToUnvisited=True, begin=None, orientation=True)\n"
+".. method:: __init__(restrict_to_selection=True, restrict_to_unvisited=True, begin=None, orientation=True)\n"
"\n"
" Builds a Chaining Iterator from the first ViewEdge used for\n"
" iteration and its orientation.\n"
"\n"
-" :arg iRestrictToSelection: Indicates whether to force the chaining\n"
+" :arg restrict_to_selection: Indicates whether to force the chaining\n"
" to stay within the set of selected ViewEdges or not.\n"
-" :type iRestrictToSelection: bool\n"
-" :arg iRestrictToUnvisited: Indicates whether a ViewEdge that has\n"
+" :type restrict_to_selection: bool\n"
+" :arg restrict_to_unvisited: Indicates whether a ViewEdge that has\n"
" already been chained must be ignored ot not.\n"
-" :type iRestrictToUnvisited: bool\n"
+" :type restrict_to_unvisited: bool\n"
" :arg begin: The ViewEdge from which to start the chain.\n"
" :type begin: :class:`ViewEdge` or None\n"
" :arg orientation: The direction to follow to explore the graph. If\n"
@@ -49,33 +49,38 @@ PyDoc_STRVAR(ChainingIterator_doc,
" :arg brother: \n"
" :type brother: ChainingIterator");
-static int ChainingIterator___init__(BPy_ChainingIterator *self, PyObject *args)
+static int check_begin(PyObject *obj, void *v)
{
- PyObject *obj1 = 0, *obj2 = 0, *obj3 = 0, *obj4 = 0;
+ if (obj != 0 && obj != Py_None && !BPy_ViewEdge_Check(obj))
+ return 0;
+ *((PyObject **)v) = obj;
+ return 1;
+}
- if (!PyArg_ParseTuple(args, "|OOOO", &obj1, &obj2, &obj3, &obj4))
- return -1;
+static int ChainingIterator___init__(BPy_ChainingIterator *self, PyObject *args, PyObject *kwds)
+{
+ static const char *kwlist_1[] = {"brother", NULL};
+ static const char *kwlist_2[] = {"restrict_to_selection", "restrict_to_unvisited", "begin", "orientation", NULL};
+ PyObject *obj1 = 0, *obj2 = 0, *obj3 = 0, *obj4 = 0;
- if (obj1 && BPy_ChainingIterator_Check(obj1)) {
+ if (PyArg_ParseTupleAndKeywords(args, kwds, "O!", (char **)kwlist_1, &ChainingIterator_Type, &obj1)) {
self->c_it = new ChainingIterator(*(((BPy_ChainingIterator *)obj1)->c_it));
-
- } else {
- bool restrictToSelection = (obj1) ? bool_from_PyBool(obj1) : true;
- bool restrictToUnvisited = (obj2) ? bool_from_PyBool(obj2) : true;
- ViewEdge *begin;
- if (!obj3 || obj3 == Py_None)
- begin = NULL;
- else if (BPy_ViewEdge_Check(obj3))
- begin = ((BPy_ViewEdge *)obj3)->ve;
- else {
- PyErr_SetString(PyExc_TypeError, "3rd argument must be either a ViewEdge object or None");
- return -1;
- }
- bool orientation = (obj4) ? bool_from_PyBool(obj4) : true;
-
- self->c_it = new ChainingIterator(restrictToSelection, restrictToUnvisited, begin, orientation);
}
-
+ else if (PyErr_Clear(), (obj1 = obj2 = obj3 = obj4 = 0),
+ PyArg_ParseTupleAndKeywords(args, kwds, "|O!O!O&O!", (char **)kwlist_2,
+ &PyBool_Type, &obj1, &PyBool_Type, &obj2, check_begin, &obj3,
+ &PyBool_Type, &obj4))
+ {
+ bool restrict_to_selection = (!obj1) ? true : bool_from_PyBool(obj1);
+ bool restrict_to_unvisited = (!obj2) ? true : bool_from_PyBool(obj2);
+ ViewEdge *begin = (!obj3 || obj3 == Py_None) ? NULL : ((BPy_ViewEdge *)obj3)->ve;
+ bool orientation = (!obj4) ? true : bool_from_PyBool(obj4);
+ self->c_it = new ChainingIterator(restrict_to_selection, restrict_to_unvisited, begin, orientation);
+ }
+ else {
+ PyErr_SetString(PyExc_TypeError, "invalid argument(s)");
+ return -1;
+ }
self->py_ve_it.ve_it = self->c_it;
self->py_ve_it.py_it.it = self->c_it;
diff --git a/source/blender/freestyle/intern/python/Iterator/BPy_CurvePointIterator.cpp b/source/blender/freestyle/intern/python/Iterator/BPy_CurvePointIterator.cpp
index 8761bc540bb..a4de82be090 100644
--- a/source/blender/freestyle/intern/python/Iterator/BPy_CurvePointIterator.cpp
+++ b/source/blender/freestyle/intern/python/Iterator/BPy_CurvePointIterator.cpp
@@ -16,7 +16,18 @@ PyDoc_STRVAR(CurvePointIterator_doc,
"\n"
"Class representing an iterator on a curve. Allows an iterating\n"
"outside initial vertices. A CurvePoint is instanciated and returned\n"
-"by getObject().\n"
+"through the .object attribute.\n"
+"\n"
+".. method:: __init__()\n"
+"\n"
+" Default constructor.\n"
+"\n"
+".. method:: __init__(brother)\n"
+"\n"
+" Copy constructor.\n"
+"\n"
+" :arg brother: A CurvePointIterator object.\n"
+" :type brother: :class:`CurvePointIterator`\n"
"\n"
".. method:: __init__(step=0.0)\n"
"\n"
@@ -26,59 +37,35 @@ PyDoc_STRVAR(CurvePointIterator_doc,
" If zero, no resampling is done (i.e., the iterator iterates over\n"
" initial vertices).\n"
" :type step: float\n"
-"\n"
-".. method:: __init__(brother)\n"
-"\n"
-" Copy constructor.\n"
-"\n"
-" :arg brother: A CurvePointIterator object.\n"
-" :type brother: :class:`CurvePointIterator`");
+);
-static int CurvePointIterator_init(BPy_CurvePointIterator *self, PyObject *args)
+static int CurvePointIterator_init(BPy_CurvePointIterator *self, PyObject *args, PyObject *kwds)
{
- PyObject *obj = 0;
-
- if (!PyArg_ParseTuple(args, "|O", &obj))
- return -1;
-
- if (!obj) {
- self->cp_it = new CurveInternal::CurvePointIterator();
-
- } else if (BPy_CurvePointIterator_Check(obj)) {
- self->cp_it = new CurveInternal::CurvePointIterator(*(((BPy_CurvePointIterator *)obj)->cp_it));
-
- } else if (PyFloat_Check(obj)) {
- self->cp_it = new CurveInternal::CurvePointIterator(PyFloat_AsDouble(obj));
-
- } else {
- PyErr_SetString(PyExc_TypeError, "invalid argument");
+ static const char *kwlist_1[] = {"brother", NULL};
+ static const char *kwlist_2[] = {"step", NULL};
+ PyObject *brother = 0;
+ float step;
+
+ if (PyArg_ParseTupleAndKeywords(args, kwds, "|O!", (char **)kwlist_1, &CurvePointIterator_Type, &brother)) {
+ if (!brother)
+ self->cp_it = new CurveInternal::CurvePointIterator();
+ else
+ self->cp_it = new CurveInternal::CurvePointIterator(*(((BPy_CurvePointIterator *)brother)->cp_it));
+ }
+ else if (PyErr_Clear(),
+ PyArg_ParseTupleAndKeywords(args, kwds, "f", (char **)kwlist_2, &step))
+ {
+ self->cp_it = new CurveInternal::CurvePointIterator(step);
+ }
+ else {
+ PyErr_SetString(PyExc_TypeError, "invalid argument(s)");
return -1;
}
-
self->py_it.it = self->cp_it;
-
return 0;
}
-PyDoc_STRVAR(CurvePointIterator_cast_to_interface0diterator_doc,
-".. method:: cast_to_interface0diterator()\n"
-"\n"
-" Returns an Interface0DIterator converted from this\n"
-" CurvePointIterator. Useful for any call to a function of the\n"
-" UnaryFunction0D type.\n"
-"\n"
-" :return: An Interface0DIterator object converted from the\n"
-" iterator.\n"
-" :rtype: :class:`Interface0DIterator`");
-
-static PyObject * CurvePointIterator_cast_to_interface0diterator(BPy_CurvePointIterator *self)
-{
- Interface0DIterator it(self->cp_it->castToInterface0DIterator());
- return BPy_Interface0DIterator_from_Interface0DIterator(it, 0);
-}
-
static PyMethodDef BPy_CurvePointIterator_methods[] = {
- {"cast_to_interface0diterator", (PyCFunction) CurvePointIterator_cast_to_interface0diterator, METH_NOARGS, CurvePointIterator_cast_to_interface0diterator_doc},
{NULL, NULL, 0, NULL}
};
diff --git a/source/blender/freestyle/intern/python/Iterator/BPy_Interface0DIterator.cpp b/source/blender/freestyle/intern/python/Iterator/BPy_Interface0DIterator.cpp
index fb9ec03648a..9c15eab1aad 100644
--- a/source/blender/freestyle/intern/python/Iterator/BPy_Interface0DIterator.cpp
+++ b/source/blender/freestyle/intern/python/Iterator/BPy_Interface0DIterator.cpp
@@ -16,24 +16,54 @@ PyDoc_STRVAR(Interface0DIterator_doc,
"Class defining an iterator over Interface0D elements. An instance of\n"
"this iterator is always obtained from a 1D element.\n"
"\n"
-".. method:: __init__(it)\n"
+".. method:: __init__(brother)\n"
"\n"
" Copy constructor.\n"
"\n"
-" :arg it: An Interface0DIterator object.\n"
-" :type it: :class:`Interface0DIterator`");
+" :arg brother: An Interface0DIterator object.\n"
+" :type brother: :class:`Interface0DIterator`\n"
+"\n"
+".. method:: __init__(it)\n"
+"\n"
+" Construct a nested Interface0DIterator that can be the argument of\n"
+" a Function0D.\n"
+"\n"
+" :arg it: An iterator object to be nested.\n"
+" :type it: :class:`SVertexIterator`, :class:`CurvePointIterator`, or\n"
+" :class:`StrokeVertexIterator`");
-static int Interface0DIterator_init(BPy_Interface0DIterator *self, PyObject *args)
+static int convert_nested_it(PyObject *obj, void *v)
{
- PyObject *obj = 0;
+ if (!obj || !BPy_Iterator_Check(obj))
+ return 0;
+ Interface0DIteratorNested *nested_it = dynamic_cast<Interface0DIteratorNested *>(((BPy_Iterator *)obj)->it);
+ if (!nested_it)
+ return 0;
+ *((Interface0DIteratorNested **)v) = nested_it;
+ return 1;
+}
- if (!PyArg_ParseTuple(args, "O!", &Interface0DIterator_Type, &obj))
- return -1;
+static int Interface0DIterator_init(BPy_Interface0DIterator *self, PyObject *args, PyObject *kwds)
+{
+ static const char *kwlist_1[] = {"it", NULL};
+ static const char *kwlist_2[] = {"brother", NULL};
+ Interface0DIteratorNested *nested_it;
+ PyObject *brother;
- self->if0D_it = new Interface0DIterator(*(((BPy_Interface0DIterator *)obj)->if0D_it));
+ if (PyArg_ParseTupleAndKeywords(args, kwds, "O&", (char **)kwlist_1, convert_nested_it, &nested_it)) {
+ self->if0D_it = new Interface0DIterator(nested_it->copy());
+ }
+ else if (PyErr_Clear(),
+ PyArg_ParseTupleAndKeywords(args, kwds, "O!", (char **)kwlist_2, &Interface0DIterator_Type, &brother))
+ {
+ self->if0D_it = new Interface0DIterator(*(((BPy_Interface0DIterator *)brother)->if0D_it));
+ }
+ else {
+ PyErr_SetString(PyExc_TypeError, "invalid argument(s)");
+ return -1;
+ }
self->py_it.it = self->if0D_it;
self->reversed = 0;
-
return 0;
}
diff --git a/source/blender/freestyle/intern/python/Iterator/BPy_SVertexIterator.cpp b/source/blender/freestyle/intern/python/Iterator/BPy_SVertexIterator.cpp
index 6243e487646..8946ef92eec 100644
--- a/source/blender/freestyle/intern/python/Iterator/BPy_SVertexIterator.cpp
+++ b/source/blender/freestyle/intern/python/Iterator/BPy_SVertexIterator.cpp
@@ -23,62 +23,62 @@ PyDoc_STRVAR(SVertexIterator_doc,
"\n"
" Default constructor.\n"
"\n"
-".. method:: __init__(it)\n"
+".. method:: __init__(brother)\n"
"\n"
" Copy constructor.\n"
"\n"
-" :arg it: An SVertexIterator object.\n"
-" :type it: :class:`SVertexIterator`\n"
+" :arg brother: An SVertexIterator object.\n"
+" :type brother: :class:`SVertexIterator`\n"
"\n"
-".. method:: __init__(v, begin, prev, next, t)\n"
+".. method:: __init__(vertex, begin, previous_edge, next_edge, t)\n"
"\n"
-" Builds an SVertexIterator that starts iteration from an SVertex\n"
+" Build an SVertexIterator that starts iteration from an SVertex\n"
" object v.\n"
"\n"
-" :arg v: The SVertex from which the iterator starts iteration.\n"
-" :type v: :class:`SVertex`\n"
-" :arg begin: The first vertex of a view edge.\n"
+" :arg vertex: The SVertex from which the iterator starts iteration.\n"
+" :type vertex: :class:`SVertex`\n"
+" :arg begin: The first SVertex of a ViewEdge.\n"
" :type begin: :class:`SVertex`\n"
-" :arg prev: The previous FEdge coming to v.\n"
-" :type prev: :class:`FEdge`\n"
-" :arg next: The next FEdge going out from v.\n"
-" :type next: :class:`FEdge`\n"
-" :arg t: The curvilinear abscissa at v.\n"
+" :arg previous_edge: The previous FEdge coming to vertex.\n"
+" :type previous_edge: :class:`FEdge`\n"
+" :arg next_edge: The next FEdge going out from vertex.\n"
+" :type next_edge: :class:`FEdge`\n"
+" :arg t: The curvilinear abscissa at vertex.\n"
" :type t: float");
-static int SVertexIterator_init(BPy_SVertexIterator *self, PyObject *args)
+static int SVertexIterator_init(BPy_SVertexIterator *self, PyObject *args, PyObject *kwds)
{
+ static const char *kwlist_1[] = {"brother", NULL};
+ static const char *kwlist_2[] = {"vertex", "begin", "previous_edge", "next_edge", "t", NULL};
PyObject *obj1 = 0, *obj2 = 0, *obj3 = 0, *obj4 = 0;
- float f = 0;
-
- if (!PyArg_ParseTuple(args, "|OOOOf", &obj1, &obj2, &obj3, &obj4, f))
- return -1;
-
- if (!obj1) {
- self->sv_it = new ViewEdgeInternal::SVertexIterator();
-
- } else if (BPy_SVertexIterator_Check(obj1)) {
- self->sv_it = new ViewEdgeInternal::SVertexIterator(*(((BPy_SVertexIterator *)obj1)->sv_it));
-
- } else if (obj1 && BPy_SVertex_Check(obj1) &&
- obj2 && BPy_SVertex_Check(obj2) &&
- obj3 && BPy_FEdge_Check(obj3) &&
- obj4 && BPy_FEdge_Check(obj4)) {
+ float t;
+ if (PyArg_ParseTupleAndKeywords(args, kwds, "|O!", (char **)kwlist_1, &SVertexIterator_Type, &obj1)) {
+ if (!obj1)
+ self->sv_it = new ViewEdgeInternal::SVertexIterator();
+ else
+ self->sv_it = new ViewEdgeInternal::SVertexIterator(*(((BPy_SVertexIterator *)obj1)->sv_it));
+ }
+ else if (PyErr_Clear(),
+ PyArg_ParseTupleAndKeywords(args, kwds, "O!O!O!O!f", (char **)kwlist_2,
+ &SVertex_Type, &obj1,
+ &SVertex_Type, &obj2,
+ &FEdge_Type, &obj3,
+ &FEdge_Type, &obj4,
+ &t))
+ {
self->sv_it = new ViewEdgeInternal::SVertexIterator(
- ((BPy_SVertex *)obj1)->sv,
- ((BPy_SVertex *)obj2)->sv,
- ((BPy_FEdge *)obj3)->fe,
- ((BPy_FEdge *)obj4)->fe,
- f);
-
- } else {
+ ((BPy_SVertex *)obj1)->sv,
+ ((BPy_SVertex *)obj2)->sv,
+ ((BPy_FEdge *)obj3)->fe,
+ ((BPy_FEdge *)obj4)->fe,
+ t);
+ }
+ else {
PyErr_SetString(PyExc_TypeError, "invalid argument(s)");
return -1;
}
-
self->py_it.it = self->sv_it;
-
return 0;
}
diff --git a/source/blender/freestyle/intern/python/Iterator/BPy_StrokeVertexIterator.cpp b/source/blender/freestyle/intern/python/Iterator/BPy_StrokeVertexIterator.cpp
index 57a9f867d53..4c92e1276ff 100644
--- a/source/blender/freestyle/intern/python/Iterator/BPy_StrokeVertexIterator.cpp
+++ b/source/blender/freestyle/intern/python/Iterator/BPy_StrokeVertexIterator.cpp
@@ -30,34 +30,26 @@ PyDoc_STRVAR(StrokeVertexIterator_doc,
"\n"
" Default constructor.\n"
"\n"
-".. method:: __init__(it)\n"
+".. method:: __init__(brother)\n"
"\n"
" Copy constructor.\n"
"\n"
-" :arg it: A StrokeVertexIterator object.\n"
-" :type it: :class:`StrokeVertexIterator`");
+" :arg brother: A StrokeVertexIterator object.\n"
+" :type brother: :class:`StrokeVertexIterator`");
-static int StrokeVertexIterator_init(BPy_StrokeVertexIterator *self, PyObject *args)
+static int StrokeVertexIterator_init(BPy_StrokeVertexIterator *self, PyObject *args, PyObject *kwds)
{
- PyObject *obj = 0;
+ static const char *kwlist[] = {"brother", NULL};
+ PyObject *brother = 0;
- if (!PyArg_ParseTuple(args, "|O", &obj))
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O!", (char **)kwlist, &StrokeVertexIterator_Type, &brother))
return -1;
-
- if (!obj) {
+ if (!brother)
self->sv_it = new StrokeInternal::StrokeVertexIterator();
-
- } else if (BPy_StrokeVertexIterator_Check(obj)) {
- self->sv_it = new StrokeInternal::StrokeVertexIterator(*(((BPy_StrokeVertexIterator *)obj)->sv_it));
-
- } else {
- PyErr_SetString(PyExc_TypeError, "invalid argument");
- return -1;
- }
-
+ else
+ self->sv_it = new StrokeInternal::StrokeVertexIterator(*(((BPy_StrokeVertexIterator *)brother)->sv_it));
self->py_it.it = self->sv_it;
self->reversed = 0;
-
return 0;
}
@@ -83,24 +75,7 @@ static PyObject * StrokeVertexIterator_iternext(BPy_StrokeVertexIterator *self)
return BPy_StrokeVertex_from_StrokeVertex(*sv);
}
-PyDoc_STRVAR(StrokeVertexIterator_cast_to_interface0diterator_doc,
-".. method:: cast_to_interface0diterator()\n"
-"\n"
-" Returns an Interface0DIterator converted from this\n"
-" StrokeVertexIterator. Useful for any call to a function of the\n"
-" UnaryFunction0D type.\n"
-"\n"
-" :return: An Interface0DIterator converted from the StrokeVertexIterator.\n"
-" :rtype: :class:`Interface0DIterator`");
-
-static PyObject * StrokeVertexIterator_cast_to_interface0diterator(BPy_StrokeVertexIterator *self)
-{
- Interface0DIterator it(self->sv_it->castToInterface0DIterator());
- return BPy_Interface0DIterator_from_Interface0DIterator(it, 0);
-}
-
static PyMethodDef BPy_StrokeVertexIterator_methods[] = {
- {"cast_to_interface0diterator", (PyCFunction) StrokeVertexIterator_cast_to_interface0diterator, METH_NOARGS, StrokeVertexIterator_cast_to_interface0diterator_doc},
{NULL, NULL, 0, NULL}
};
diff --git a/source/blender/freestyle/intern/python/Iterator/BPy_ViewEdgeIterator.cpp b/source/blender/freestyle/intern/python/Iterator/BPy_ViewEdgeIterator.cpp
index 066d223f6e9..e8678fde48c 100644
--- a/source/blender/freestyle/intern/python/Iterator/BPy_ViewEdgeIterator.cpp
+++ b/source/blender/freestyle/intern/python/Iterator/BPy_ViewEdgeIterator.cpp
@@ -33,40 +33,43 @@ PyDoc_STRVAR(ViewEdgeIterator_doc,
" ViewVertex of begin.\n"
" :type orientation: bool\n"
"\n"
-".. method:: __init__(it)\n"
+".. method:: __init__(brother)\n"
"\n"
" Copy constructor.\n"
"\n"
-" :arg it: A ViewEdgeIterator object.\n"
-" :type it: :class:`ViewEdgeIterator`");
+" :arg brother: A ViewEdgeIterator object.\n"
+" :type brother: :class:`ViewEdgeIterator`");
-static int ViewEdgeIterator_init(BPy_ViewEdgeIterator *self, PyObject *args)
+static int check_begin(PyObject *obj, void *v)
{
- PyObject *obj1 = 0, *obj2 = 0;
+ if (obj != 0 && obj != Py_None && !BPy_ViewEdge_Check(obj))
+ return 0;
+ *((PyObject **)v) = obj;
+ return 1;
+}
- if (!PyArg_ParseTuple(args, "O|O", &obj1, &obj2))
- return -1;
+static int ViewEdgeIterator_init(BPy_ViewEdgeIterator *self, PyObject *args, PyObject *kwds)
+{
+ static const char *kwlist_1[] = {"brother", NULL};
+ static const char *kwlist_2[] = {"begin", "orientation", NULL};
+ PyObject *obj1 = 0, *obj2 = 0;
- if (BPy_ViewEdgeIterator_Check(obj1)) {
+ if (PyArg_ParseTupleAndKeywords(args, kwds, "O!", (char **)kwlist_1, &ViewEdgeIterator_Type, &obj1)) {
self->ve_it = new ViewEdgeInternal::ViewEdgeIterator(*(((BPy_ViewEdgeIterator *)obj1)->ve_it));
-
- } else {
- ViewEdge *begin;
- if (obj1 == Py_None)
- begin = NULL;
- else if (BPy_ViewEdge_Check(obj1))
- begin = ((BPy_ViewEdge *)obj1)->ve;
- else {
- PyErr_SetString(PyExc_TypeError, "1st argument must be either a ViewEdge object or None");
- return -1;
- }
- bool orientation = (obj2) ? bool_from_PyBool(obj2) : true;
-
+ }
+ else if (PyErr_Clear(), (obj1 = obj2 = 0),
+ PyArg_ParseTupleAndKeywords(args, kwds, "|O&O!", (char **)kwlist_2,
+ check_begin, &obj1, &PyBool_Type, &obj2))
+ {
+ ViewEdge *begin = (!obj1 || obj1 == Py_None) ? NULL : ((BPy_ViewEdge *)obj1)->ve;
+ bool orientation = (!obj2) ? true : bool_from_PyBool(obj2);
self->ve_it = new ViewEdgeInternal::ViewEdgeIterator(begin, orientation);
}
-
+ else {
+ PyErr_SetString(PyExc_TypeError, "invalid argument(s)");
+ return -1;
+ }
self->py_it.it = self->ve_it;
-
return 0;
}
diff --git a/source/blender/freestyle/intern/python/Iterator/BPy_orientedViewEdgeIterator.cpp b/source/blender/freestyle/intern/python/Iterator/BPy_orientedViewEdgeIterator.cpp
index e3dbb089d49..086109e56d1 100644
--- a/source/blender/freestyle/intern/python/Iterator/BPy_orientedViewEdgeIterator.cpp
+++ b/source/blender/freestyle/intern/python/Iterator/BPy_orientedViewEdgeIterator.cpp
@@ -29,25 +29,19 @@ PyDoc_STRVAR(orientedViewEdgeIterator_doc,
" :arg iBrother: An orientedViewEdgeIterator object.\n"
" :type iBrother: :class:`orientedViewEdgeIterator`");
-static int orientedViewEdgeIterator_init(BPy_orientedViewEdgeIterator *self, PyObject *args)
+static int orientedViewEdgeIterator_init(BPy_orientedViewEdgeIterator *self, PyObject *args, PyObject *kwds)
{
- PyObject *obj = 0;
+ static const char *kwlist[] = {"brother", NULL};
+ PyObject *brother = 0;
- if (!PyArg_ParseTuple(args, "|O", &obj))
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O!", (char **)kwlist, &orientedViewEdgeIterator_Type, &brother))
return -1;
-
- if (!obj)
+ if (!brother)
self->ove_it = new ViewVertexInternal::orientedViewEdgeIterator();
- else if (BPy_orientedViewEdgeIterator_Check(obj))
- self->ove_it = new ViewVertexInternal::orientedViewEdgeIterator(*(((BPy_orientedViewEdgeIterator *)obj)->ove_it));
- else {
- PyErr_SetString(PyExc_TypeError, "invalid argument");
- return -1;
- }
-
+ else
+ self->ove_it = new ViewVertexInternal::orientedViewEdgeIterator(*(((BPy_orientedViewEdgeIterator *)brother)->ove_it));
self->py_it.it = self->ove_it;
self->reversed = 0;
-
return 0;
}