47 "Class gathering the elements of the ViewMap (i.e., :class:`ViewVertex`\n"
48 "and :class:`ViewEdge`) that are issued from the same input shape.\n"
50 ".. method:: __init__()\n"
51 " __init__(brother)\n"
54 " Builds a :class:`ViewShape` using the default constructor,\n"
55 " copy constructor, or from a :class:`SShape`.\n"
57 " :arg brother: A ViewShape object.\n"
58 " :type brother: :class:`ViewShape`\n"
59 " :arg sshape: An SShape object.\n"
60 " :type sshape: :class:`SShape`");
64 static const char *kwlist_1[] = {
"brother",
nullptr};
65 static const char *kwlist_2[] = {
"sshape",
nullptr};
66 PyObject *obj =
nullptr;
68 if (PyArg_ParseTupleAndKeywords(args, kwds,
"|O!", (
char **)kwlist_1, &
ViewShape_Type, &obj)) {
71 self->py_ss =
nullptr;
78 else if ((
void)PyErr_Clear(),
79 PyArg_ParseTupleAndKeywords(args, kwds,
"O!", (
char **)kwlist_2, &
SShape_Type, &obj))
86 PyErr_SetString(PyExc_TypeError,
"invalid argument(s)");
89 self->borrowed =
false;
90 Py_XINCREF(
self->py_ss);
98 Py_DECREF(
self->py_ss);
103 Py_TYPE(
self)->tp_free((PyObject *)
self);
108 return PyUnicode_FromFormat(
"ViewShape - address: %p",
self->vs);
113 ViewShape_add_edge_doc,
114 ".. method:: add_edge(edge)\n"
116 " Adds a ViewEdge to the list of ViewEdge objects.\n"
118 " :arg edge: A ViewEdge object.\n"
119 " :type edge: :class:`ViewEdge`\n");
123 static const char *kwlist[] = {
"edge",
nullptr};
124 PyObject *py_ve =
nullptr;
126 if (PyArg_ParseTupleAndKeywords(args, kwds,
"O!", (
char **)kwlist, &
ViewEdge_Type, &py_ve)) {
135 ViewShape_add_vertex_doc,
136 ".. method:: add_vertex(vertex)\n"
138 " Adds a ViewVertex to the list of the ViewVertex objects.\n"
140 " :arg vertex: A ViewVertex object.\n"
141 " :type vertex: :class:`ViewVertex`");
145 static const char *kwlist[] = {
"vertex",
nullptr};
146 PyObject *py_vv =
nullptr;
148 if (PyArg_ParseTupleAndKeywords(args, kwds,
"O!", (
char **)kwlist, &
ViewVertex_Type, &py_vv)) {
160 METH_VARARGS | METH_KEYWORDS,
161 ViewShape_add_edge_doc},
164 METH_VARARGS | METH_KEYWORDS,
165 ViewShape_add_vertex_doc},
166 {
nullptr,
nullptr, 0,
nullptr},
173 ViewShape_sshape_doc,
174 "The SShape on top of which this ViewShape is built.\n"
176 ":type: :class:`SShape`");
190 PyErr_SetString(PyExc_TypeError,
"value must be an SShape");
194 self->vs->setSShape(py_ss->
ss);
196 Py_DECREF(
self->py_ss);
200 Py_INCREF(
self->py_ss);
207 ViewShape_vertices_doc,
208 "The list of ViewVertex objects contained in this ViewShape.\n"
210 ":type: List of :class:`ViewVertex`");
216 PyObject *py_vertices = PyList_New(vertices.size());
219 for (it = vertices.begin(); it != vertices.end(); it++) {
230 if (!PyList_Check(value)) {
231 PyErr_SetString(PyExc_TypeError,
"value must be a list of ViewVertex objects");
235 v.reserve(PyList_GET_SIZE(value));
236 for (
uint i = 0; i < PyList_GET_SIZE(value); i++) {
237 item = PyList_GET_ITEM(value, i);
242 PyErr_SetString(PyExc_TypeError,
"value must be a list of ViewVertex objects");
246 self->vs->setVertices(
v);
253 "The list of ViewEdge objects contained in this ViewShape.\n"
255 ":type: List of :class:`ViewEdge`");
261 PyObject *py_edges = PyList_New(edges.size());
264 for (it = edges.begin(); it != edges.end(); it++) {
275 if (!PyList_Check(value)) {
276 PyErr_SetString(PyExc_TypeError,
"value must be a list of ViewEdge objects");
280 v.reserve(PyList_GET_SIZE(value));
281 for (
int i = 0; i < PyList_GET_SIZE(value); i++) {
282 item = PyList_GET_ITEM(value, i);
287 PyErr_SetString(PyExc_TypeError,
"argument must be list of ViewEdge objects");
291 self->vs->setEdges(
v);
298 "The name of the ViewShape.\n"
304 return PyUnicode_FromString(
self->vs->getName().c_str());
309 ViewShape_library_path_doc,
310 "The library path of the ViewShape.\n"
312 ":type: str, or None if the ViewShape is not part of a library");
316 return PyUnicode_FromString(
self->vs->getLibraryPath().c_str());
322 "The Id of this ViewShape.\n"
324 ":type: :class:`Id`");
336 ViewShape_sshape_doc,
341 ViewShape_vertices_doc,
352 ViewShape_library_path_doc,
354 {
"id", (getter)
ViewShape_id_get, (setter)
nullptr, ViewShape_id_doc,
nullptr},
355 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
361 PyVarObject_HEAD_INIT(
nullptr, 0)
380 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
PyObject * BPy_Id_from_Id(Id &id)
PyObject * BPy_SShape_from_SShape(SShape &ss)
PyObject * Any_BPy_ViewVertex_from_ViewVertex(ViewVertex &vv)
PyObject * BPy_ViewEdge_from_ViewEdge(ViewEdge &ve)
#define BPy_SShape_Check(v)
PyTypeObject ViewEdge_Type
#define BPy_ViewEdge_Check(v)
static PyObject * ViewShape_add_edge(BPy_ViewShape *self, PyObject *args, PyObject *kwds)
PyTypeObject ViewShape_Type
static PyObject * ViewShape_add_vertex(BPy_ViewShape *self, PyObject *args, PyObject *kwds)
static PyObject * ViewShape_repr(BPy_ViewShape *self)
static PyObject * ViewShape_sshape_get(BPy_ViewShape *self, void *)
static PyObject * ViewShape_edges_get(BPy_ViewShape *self, void *)
static int ViewShape_init(BPy_ViewShape *self, PyObject *args, PyObject *kwds)
static PyObject * ViewShape_id_get(BPy_ViewShape *self, void *)
static PyObject * ViewShape_library_path_get(BPy_ViewShape *self, void *)
static int ViewShape_vertices_set(BPy_ViewShape *self, PyObject *value, void *)
static void ViewShape_dealloc(BPy_ViewShape *self)
static PyMethodDef BPy_ViewShape_methods[]
int ViewShape_Init(PyObject *module)
static PyObject * ViewShape_vertices_get(BPy_ViewShape *self, void *)
static int ViewShape_edges_set(BPy_ViewShape *self, PyObject *value, void *)
static PyObject * ViewShape_name_get(BPy_ViewShape *self, void *)
PyDoc_STRVAR(ViewShape_doc, "Class gathering the elements of the ViewMap (i.e., :class:`ViewVertex`\n" "and :class:`ViewEdge`) that are issued from the same input shape.\n" "\n" ".. method:: __init__()\n" " __init__(brother)\n" " __init__(sshape)\n" "\n" " Builds a :class:`ViewShape` using the default constructor,\n" " copy constructor, or from a :class:`SShape`.\n" "\n" " :arg brother: A ViewShape object.\n" " :type brother: :class:`ViewShape`\n" " :arg sshape: An SShape object.\n" " :type sshape: :class:`SShape`")
static PyGetSetDef BPy_ViewShape_getseters[]
static int ViewShape_sshape_set(BPy_ViewShape *self, PyObject *value, void *)
PyTypeObject ViewVertex_Type
#define BPy_ViewVertex_Check(v)
ATTR_WARN_UNUSED_RESULT const BMVert * v
static struct PyModuleDef module
PyObject_HEAD Freestyle::SShape * ss