9 #include "../BPy_Convert.h"
10 #include "../Interface0D/BPy_ViewVertex.h"
23 AdjacencyIterator_doc,
24 "Class hierarchy: :class:`Iterator` > :class:`AdjacencyIterator`\n"
26 "Class for representing adjacency iterators used in the chaining\n"
27 "process. An AdjacencyIterator is created in the increment() and\n"
28 "decrement() methods of a :class:`ChainingIterator` and passed to the\n"
29 "traverse() method of the ChainingIterator.\n"
31 ".. method:: __init__()\n"
32 " __init__(brother)\n"
33 " __init__(vertex, restrict_to_selection=True, restrict_to_unvisited=True)\n"
35 " Builds an :class:`AdjacencyIterator` using the default constructor,\n"
36 " copy constructor or the overloaded constructor.\n"
38 " :arg brother: An AdjacencyIterator object.\n"
39 " :type brother: :class:`AdjacencyIterator`\n"
40 " :arg vertex: The vertex which is the next crossing.\n"
41 " :type vertex: :class:`ViewVertex`\n"
42 " :arg restrict_to_selection: Indicates whether to force the chaining\n"
43 " to stay within the set of selected ViewEdges or not.\n"
44 " :type restrict_to_selection: bool\n"
45 " :arg restrict_to_unvisited: Indicates whether a ViewEdge that has\n"
46 " already been chained must be ignored ot not.\n"
47 " :type restrict_to_unvisited: bool");
51 static const char *kwlist_1[] = {
"brother",
nullptr};
52 static const char *kwlist_2[] = {
53 "vertex",
"restrict_to_selection",
"restrict_to_unvisited",
nullptr};
54 PyObject *obj1 =
nullptr, *obj2 =
nullptr, *obj3 =
nullptr;
56 if (PyArg_ParseTupleAndKeywords(
60 self->at_start =
true;
67 else if ((
void)PyErr_Clear(),
68 (
void)(obj2 = obj3 =
nullptr),
69 PyArg_ParseTupleAndKeywords(args,
82 ((
BPy_ViewVertex *)obj1)->vv, restrictToSelection, restrictToUnvisited);
86 PyErr_SetString(PyExc_TypeError,
"invalid argument(s)");
89 self->py_it.it =
self->a_it;
96 self->at_start =
true;
97 return (PyObject *)
self;
102 if (
self->a_it->isEnd()) {
103 PyErr_SetNone(PyExc_StopIteration);
106 if (
self->at_start) {
107 self->at_start =
false;
110 self->a_it->increment();
111 if (
self->a_it->isEnd()) {
112 PyErr_SetNone(PyExc_StopIteration);
116 ViewEdge *ve =
self->a_it->operator->();
123 "The ViewEdge object currently pointed to by this iterator.\n"
125 ":type: :class:`ViewEdge`");
129 if (
self->a_it->isEnd()) {
130 PyErr_SetString(PyExc_RuntimeError,
"iteration has stopped");
133 ViewEdge *ve =
self->a_it->operator*();
141 "True if the current ViewEdge is coming towards the iteration vertex, and\n"
149 if (
self->a_it->isEnd()) {
150 PyErr_SetString(PyExc_RuntimeError,
"iteration has stopped");
160 AdjacencyIterator_is_incoming_doc,
165 AdjacencyIterator_object_doc,
167 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
173 PyVarObject_HEAD_INIT(
nullptr, 0)
"AdjacencyIterator",
191 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
192 AdjacencyIterator_doc,
static PyObject * AdjacencyIterator_iter(BPy_AdjacencyIterator *self)
static PyObject * AdjacencyIterator_is_incoming_get(BPy_AdjacencyIterator *self, void *UNUSED(closure))
static PyObject * AdjacencyIterator_iternext(BPy_AdjacencyIterator *self)
static PyObject * AdjacencyIterator_object_get(BPy_AdjacencyIterator *self, void *UNUSED(closure))
PyTypeObject AdjacencyIterator_Type
static int AdjacencyIterator_init(BPy_AdjacencyIterator *self, PyObject *args, PyObject *kwds)
PyDoc_STRVAR(AdjacencyIterator_doc, "Class hierarchy: :class:`Iterator` > :class:`AdjacencyIterator`\n" "\n" "Class for representing adjacency iterators used in the chaining\n" "process. An AdjacencyIterator is created in the increment() and\n" "decrement() methods of a :class:`ChainingIterator` and passed to the\n" "traverse() method of the ChainingIterator.\n" "\n" ".. method:: __init__()\n" " __init__(brother)\n" " __init__(vertex, restrict_to_selection=True, restrict_to_unvisited=True)\n" "\n" " Builds an :class:`AdjacencyIterator` using the default constructor,\n" " copy constructor or the overloaded constructor.\n" "\n" " :arg brother: An AdjacencyIterator object.\n" " :type brother: :class:`AdjacencyIterator`\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 PyGetSetDef BPy_AdjacencyIterator_getseters[]
PyObject * PyBool_from_bool(bool b)
bool bool_from_PyBool(PyObject *b)
PyObject * BPy_ViewEdge_from_ViewEdge(ViewEdge &ve)
PyTypeObject Iterator_Type
PyTypeObject ViewVertex_Type
SyclQueue void void size_t num_bytes void