23 #include "../BPy_Convert.h"
24 #include "../Interface1D/BPy_ViewEdge.h"
37 "Class hierarchy: :class:`Iterator` > :class:`ViewEdgeIterator`\n"
39 "Base class for iterators over ViewEdges of the :class:`ViewMap` Graph.\n"
40 "Basically the increment() operator of this class should be able to\n"
41 "take the decision of \"where\" (on which ViewEdge) to go when pointing\n"
42 "on a given ViewEdge.\n"
44 ".. method:: __init__(begin=None, orientation=True)\n"
45 " __init__(brother)\n"
47 " Builds a ViewEdgeIterator from a starting ViewEdge and its\n"
48 " orientation or the copy constructor.\n"
50 " :arg begin: The ViewEdge from where to start the iteration.\n"
51 " :type begin: :class:`ViewEdge` or None\n"
52 " :arg orientation: If true, we'll look for the next ViewEdge among\n"
53 " the ViewEdges that surround the ending ViewVertex of begin. If\n"
54 " false, we'll search over the ViewEdges surrounding the ending\n"
55 " ViewVertex of begin.\n"
56 " :type orientation: bool\n"
57 " :arg brother: A ViewEdgeIterator object.\n"
58 " :type brother: :class:`ViewEdgeIterator`");
65 *((PyObject **)
v) = obj;
71 static const char *kwlist_1[] = {
"brother",
nullptr};
72 static const char *kwlist_2[] = {
"begin",
"orientation",
nullptr};
73 PyObject *obj1 =
nullptr, *obj2 =
nullptr;
75 if (PyArg_ParseTupleAndKeywords(
79 else if ((
void)PyErr_Clear(),
80 (
void)(obj1 = obj2 =
nullptr),
81 PyArg_ParseTupleAndKeywords(
82 args, kwds,
"|O&O!", (
char **)kwlist_2,
check_begin, &obj1, &PyBool_Type, &obj2)) {
88 PyErr_SetString(PyExc_TypeError,
"invalid argument(s)");
91 self->py_it.it =
self->ve_it;
96 ".. method:: change_orientation()\n"
98 " Changes the current orientation.");
102 self->ve_it->changeOrientation();
107 {
"change_orientation",
110 ViewEdgeIterator_change_orientation_doc},
111 {
nullptr,
nullptr, 0,
nullptr},
117 "The ViewEdge object currently pointed by this iterator.\n"
119 ":type: :class:`ViewEdge`");
123 if (!
self->ve_it->isEnd()) {
124 PyErr_SetString(PyExc_RuntimeError,
"iteration has stopped");
127 ViewEdge *ve =
self->ve_it->operator*();
135 "The ViewEdge object currently pointed by this iterator.\n"
137 ":type: :class:`ViewEdge`");
142 ViewEdge *ve =
self->ve_it->getCurrentEdge();
154 PyErr_SetString(PyExc_TypeError,
"value must be a ViewEdge");
157 self->ve_it->setCurrentEdge(((
BPy_ViewEdge *)value)->ve);
162 "The orientation of the pointed ViewEdge in the iteration.\n"
163 "If true, the iterator looks for the next ViewEdge among those ViewEdges\n"
164 "that surround the ending ViewVertex of the \"begin\" ViewEdge. If false,\n"
165 "the iterator searches over the ViewEdges surrounding the ending ViewVertex\n"
166 "of the \"begin\" ViewEdge.\n"
180 if (!PyBool_Check(value)) {
181 PyErr_SetString(PyExc_TypeError,
"value must be a boolean");
189 "The first ViewEdge used for the iteration.\n"
191 ":type: :class:`ViewEdge`");
195 ViewEdge *ve =
self->ve_it->getBegin();
207 PyErr_SetString(PyExc_TypeError,
"value must be a ViewEdge");
218 ViewEdgeIterator_object_doc,
223 ViewEdgeIterator_current_edge_doc,
228 ViewEdgeIterator_orientation_doc,
233 ViewEdgeIterator_begin_doc,
235 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
241 PyVarObject_HEAD_INIT(
nullptr, 0)
"ViewEdgeIterator",
259 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
260 ViewEdgeIterator_doc,
PyObject * PyBool_from_bool(bool b)
bool bool_from_PyBool(PyObject *b)
PyObject * BPy_ViewEdge_from_ViewEdge(ViewEdge &ve)
PyTypeObject Iterator_Type
static PyObject * ViewEdgeIterator_orientation_get(BPy_ViewEdgeIterator *self, void *UNUSED(closure))
static int check_begin(PyObject *obj, void *v)
static int ViewEdgeIterator_current_edge_set(BPy_ViewEdgeIterator *self, PyObject *value, void *UNUSED(closure))
static PyObject * ViewEdgeIterator_begin_get(BPy_ViewEdgeIterator *self, void *UNUSED(closure))
static int ViewEdgeIterator_init(BPy_ViewEdgeIterator *self, PyObject *args, PyObject *kwds)
static int ViewEdgeIterator_begin_set(BPy_ViewEdgeIterator *self, PyObject *value, void *UNUSED(closure))
static PyMethodDef BPy_ViewEdgeIterator_methods[]
PyTypeObject ViewEdgeIterator_Type
static PyGetSetDef BPy_ViewEdgeIterator_getseters[]
static PyObject * ViewEdgeIterator_object_get(BPy_ViewEdgeIterator *self, void *UNUSED(closure))
static int ViewEdgeIterator_orientation_set(BPy_ViewEdgeIterator *self, PyObject *value, void *UNUSED(closure))
PyDoc_STRVAR(ViewEdgeIterator_doc, "Class hierarchy: :class:`Iterator` > :class:`ViewEdgeIterator`\n" "\n" "Base class for iterators over ViewEdges of the :class:`ViewMap` Graph.\n" "Basically the increment() operator of this class should be able to\n" "take the decision of \"where\" (on which ViewEdge) to go when pointing\n" "on a given ViewEdge.\n" "\n" ".. method:: __init__(begin=None, orientation=True)\n" " __init__(brother)\n" "\n" " Builds a ViewEdgeIterator from a starting ViewEdge and its\n" " orientation or the copy constructor.\n" "\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" " the ViewEdges that surround the ending ViewVertex of begin. If\n" " false, we'll search over the ViewEdges surrounding the ending\n" " ViewVertex of begin.\n" " :type orientation: bool\n" " :arg brother: A ViewEdgeIterator object.\n" " :type brother: :class:`ViewEdgeIterator`")
static PyObject * ViewEdgeIterator_current_edge_get(BPy_ViewEdgeIterator *self, void *UNUSED(closure))
static PyObject * ViewEdgeIterator_change_orientation(BPy_ViewEdgeIterator *self)
#define BPy_ViewEdge_Check(v)
ATTR_WARN_UNUSED_RESULT const BMVert * v