19#include "../generic/py_capi_utils.hh"
45 "Class to define a feature shape. It is the gathering of feature\n"
46 "elements from an identified input shape.\n"
48 ".. method:: __init__()\n"
49 " __init__(brother)\n"
51 " Creates a :class:`SShape` class using either a default constructor or copy constructor.\n"
53 " :arg brother: An SShape object.\n"
54 " :type brother: :class:`SShape`\n");
57 static const char *kwlist[] = {
"brother",
nullptr};
58 PyObject *brother =
nullptr;
60 if (!PyArg_ParseTupleAndKeywords(args, kwds,
"|O!", (
char **)kwlist, &
SShape_Type, &brother)) {
69 self->borrowed =
false;
78 Py_TYPE(
self)->tp_free((PyObject *)
self);
83 return PyUnicode_FromFormat(
"SShape - address: %p",
self->ss);
87 ".. method:: add_edge(edge)\n"
89 " Adds an FEdge to the list of FEdges.\n"
91 " :arg edge: An FEdge object.\n"
92 " :type edge: :class:`FEdge`\n";
96 static const char *kwlist[] = {
"edge",
nullptr};
97 PyObject *py_fe =
nullptr;
99 if (!PyArg_ParseTupleAndKeywords(args, kwds,
"O!", (
char **)kwlist, &
FEdge_Type, &py_fe)) {
108 SShape_add_vertex_doc,
109 ".. method:: add_vertex(vertex)\n"
111 " Adds an SVertex to the list of SVertex of this Shape. The SShape\n"
112 " attribute of the SVertex is also set to this SShape.\n"
114 " :arg vertex: An SVertex object.\n"
115 " :type vertex: :class:`SVertex`\n");
118 static const char *kwlist[] = {
"edge",
nullptr};
119 PyObject *py_sv =
nullptr;
121 if (!PyArg_ParseTupleAndKeywords(args, kwds,
"O!", (
char **)kwlist, &
SVertex_Type, &py_sv)) {
130 SShape_compute_bbox_doc,
131 ".. method:: compute_bbox()\n"
133 " Compute the bbox of the SShape.\n");
136 self->ss->ComputeBBox();
146# pragma clang diagnostic push
147# pragma clang diagnostic ignored "-Wcast-function-type"
149# pragma GCC diagnostic push
150# pragma GCC diagnostic ignored "-Wcast-function-type"
158 METH_VARARGS | METH_KEYWORDS,
159 SShape_add_vertex_doc},
161 {
nullptr,
nullptr, 0,
nullptr},
166# pragma clang diagnostic pop
168# pragma GCC diagnostic pop
177 "The Id of this SShape.\n"
179 ":type: :class:`Id`\n");
189 PyErr_SetString(PyExc_TypeError,
"value must be an Id");
199 "The name of the SShape.\n"
209 if (!PyUnicode_Check(value)) {
210 PyErr_SetString(PyExc_TypeError,
"value must be a string");
213 const char *
name = PyUnicode_AsUTF8(value);
221 "The bounding box of the SShape.\n"
223 ":type: :class:`BBox`\n");
233 PyErr_SetString(PyExc_TypeError,
"value must be a BBox");
243 "The list of vertices constituting this SShape.\n"
245 ":type: List of :class:`SVertex`\n");
251 PyObject *py_vertices = PyList_New(vertices.size());
254 for (it = vertices.begin(); it != vertices.end(); it++) {
264 "The list of edges constituting this SShape.\n"
266 ":type: List of :class:`FEdge`\n");
272 PyObject *py_edges = PyList_New(edges.size());
275 for (it = edges.begin(); it != edges.end(); it++) {
286 {
"edges", (getter)
SShape_edges_get, (setter)
nullptr, SShape_edges_doc,
nullptr},
288 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
294 PyVarObject_HEAD_INIT(
nullptr, 0)
313 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
#define BPy_BBox_Check(v)
PyObject * BPy_Id_from_Id(Id &id)
PyObject * Any_BPy_FEdge_from_FEdge(FEdge &fe)
PyObject * BPy_SVertex_from_SVertex(SVertex &sv)
PyObject * BPy_BBox_from_BBox(const BBox< Vec3r > &bb)
static char SShape_add_edge_doc[]
static PyObject * SShape_add_edge(BPy_SShape *self, PyObject *args, PyObject *kwds)
static void SShape_dealloc(BPy_SShape *self)
static int SShape_init(BPy_SShape *self, PyObject *args, PyObject *kwds)
static PyGetSetDef BPy_SShape_getseters[]
static PyObject * SShape_compute_bbox(BPy_SShape *self)
PyDoc_STRVAR(SShape_doc, "Class to define a feature shape. It is the gathering of feature\n" "elements from an identified input shape.\n" "\n" ".. method:: __init__()\n" " __init__(brother)\n" "\n" " Creates a :class:`SShape` class using either a default constructor or copy constructor.\n" "\n" " :arg brother: An SShape object.\n" " :type brother: :class:`SShape`\n")
static int SShape_bbox_set(BPy_SShape *self, PyObject *value, void *)
int SShape_Init(PyObject *module)
static PyMethodDef BPy_SShape_methods[]
static PyObject * SShape_edges_get(BPy_SShape *self, void *)
static PyObject * SShape_bbox_get(BPy_SShape *self, void *)
static PyObject * SShape_repr(BPy_SShape *self)
static PyObject * SShape_vertices_get(BPy_SShape *self, void *)
static PyObject * SShape_id_get(BPy_SShape *self, void *)
static PyObject * SShape_add_vertex(BPy_SShape *self, PyObject *args, PyObject *kwds)
static int SShape_name_set(BPy_SShape *self, PyObject *value, void *)
static int SShape_id_set(BPy_SShape *self, PyObject *value, void *)
static PyObject * SShape_name_get(BPy_SShape *self, void *)
PyTypeObject SVertex_Type
PyObject * PyC_UnicodeFromStdStr(const std::string &str)
static struct PyModuleDef module