9 #include "../BPy_Convert.h"
10 #include "../Interface1D/BPy_ViewEdge.h"
23 "Class hierarchy: :class:`Iterator` > :class:`ViewEdgeIterator`\n"
25 "Base class for iterators over ViewEdges of the :class:`ViewMap` Graph.\n"
26 "Basically the increment() operator of this class should be able to\n"
27 "take the decision of \"where\" (on which ViewEdge) to go when pointing\n"
28 "on a given ViewEdge.\n"
30 ".. method:: __init__(begin=None, orientation=True)\n"
31 " __init__(brother)\n"
33 " Builds a ViewEdgeIterator from a starting ViewEdge and its\n"
34 " orientation or the copy constructor.\n"
36 " :arg begin: The ViewEdge from where to start the iteration.\n"
37 " :type begin: :class:`ViewEdge` or None\n"
38 " :arg orientation: If true, we'll look for the next ViewEdge among\n"
39 " the ViewEdges that surround the ending ViewVertex of begin. If\n"
40 " false, we'll search over the ViewEdges surrounding the ending\n"
41 " ViewVertex of begin.\n"
42 " :type orientation: bool\n"
43 " :arg brother: A ViewEdgeIterator object.\n"
44 " :type brother: :class:`ViewEdgeIterator`");
51 *((PyObject **)
v) = obj;
57 static const char *kwlist_1[] = {
"brother",
nullptr};
58 static const char *kwlist_2[] = {
"begin",
"orientation",
nullptr};
59 PyObject *obj1 =
nullptr, *obj2 =
nullptr;
61 if (PyArg_ParseTupleAndKeywords(
65 else if ((
void)PyErr_Clear(),
66 (
void)(obj1 = obj2 =
nullptr),
67 PyArg_ParseTupleAndKeywords(
68 args, kwds,
"|O&O!", (
char **)kwlist_2,
check_begin, &obj1, &PyBool_Type, &obj2)) {
74 PyErr_SetString(PyExc_TypeError,
"invalid argument(s)");
77 self->py_it.it =
self->ve_it;
82 ".. method:: change_orientation()\n"
84 " Changes the current orientation.");
88 self->ve_it->changeOrientation();
93 {
"change_orientation",
96 ViewEdgeIterator_change_orientation_doc},
97 {
nullptr,
nullptr, 0,
nullptr},
103 "The ViewEdge object currently pointed by this iterator.\n"
105 ":type: :class:`ViewEdge`");
109 if (!
self->ve_it->isEnd()) {
110 PyErr_SetString(PyExc_RuntimeError,
"iteration has stopped");
113 ViewEdge *ve =
self->ve_it->operator*();
121 "The ViewEdge object currently pointed by this iterator.\n"
123 ":type: :class:`ViewEdge`");
128 ViewEdge *ve =
self->ve_it->getCurrentEdge();
140 PyErr_SetString(PyExc_TypeError,
"value must be a ViewEdge");
143 self->ve_it->setCurrentEdge(((
BPy_ViewEdge *)value)->ve);
148 "The orientation of the pointed ViewEdge in the iteration.\n"
149 "If true, the iterator looks for the next ViewEdge among those ViewEdges\n"
150 "that surround the ending ViewVertex of the \"begin\" ViewEdge. If false,\n"
151 "the iterator searches over the ViewEdges surrounding the ending ViewVertex\n"
152 "of the \"begin\" ViewEdge.\n"
166 if (!PyBool_Check(value)) {
167 PyErr_SetString(PyExc_TypeError,
"value must be a boolean");
175 "The first ViewEdge used for the iteration.\n"
177 ":type: :class:`ViewEdge`");
181 ViewEdge *ve =
self->ve_it->getBegin();
193 PyErr_SetString(PyExc_TypeError,
"value must be a ViewEdge");
204 ViewEdgeIterator_object_doc,
209 ViewEdgeIterator_current_edge_doc,
214 ViewEdgeIterator_orientation_doc,
219 ViewEdgeIterator_begin_doc,
221 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
227 PyVarObject_HEAD_INIT(
nullptr, 0)
"ViewEdgeIterator",
245 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
246 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