47 "Class to define a feature shape. It is the gathering of feature\n"
48 "elements from an identified input shape.\n"
50 ".. method:: __init__()\n"
51 " __init__(brother)\n"
53 " Creates a :class:`SShape` class using either a default constructor or copy constructor.\n"
55 " :arg brother: An SShape object.\n"
56 " :type brother: :class:`SShape`");
60 static const char *kwlist[] = {
"brother",
nullptr};
61 PyObject *brother =
nullptr;
63 if (!PyArg_ParseTupleAndKeywords(args, kwds,
"|O!", (
char **)kwlist, &
SShape_Type, &brother)) {
72 self->borrowed =
false;
81 Py_TYPE(
self)->tp_free((PyObject *)
self);
86 return PyUnicode_FromFormat(
"SShape - address: %p",
self->ss);
90 ".. method:: add_edge(edge)\n"
92 " Adds an FEdge to the list of FEdges.\n"
94 " :arg edge: An FEdge object.\n"
95 " :type edge: :class:`FEdge`\n";
99 static const char *kwlist[] = {
"edge",
nullptr};
100 PyObject *py_fe =
nullptr;
102 if (!PyArg_ParseTupleAndKeywords(args, kwds,
"O!", (
char **)kwlist, &
FEdge_Type, &py_fe)) {
111 SShape_add_vertex_doc,
112 ".. method:: add_vertex(vertex)\n"
114 " Adds an SVertex to the list of SVertex of this Shape. The SShape\n"
115 " attribute of the SVertex is also set to this SShape.\n"
117 " :arg vertex: An SVertex object.\n"
118 " :type vertex: :class:`SVertex`");
122 static const char *kwlist[] = {
"edge",
nullptr};
123 PyObject *py_sv =
nullptr;
125 if (!PyArg_ParseTupleAndKeywords(args, kwds,
"O!", (
char **)kwlist, &
SVertex_Type, &py_sv)) {
134 SShape_compute_bbox_doc,
135 ".. method:: compute_bbox()\n"
137 " Compute the bbox of the SShape.");
141 self->ss->ComputeBBox();
153 METH_VARARGS | METH_KEYWORDS,
154 SShape_add_vertex_doc},
156 {
nullptr,
nullptr, 0,
nullptr},
164 "The Id of this SShape.\n"
166 ":type: :class:`Id`");
177 PyErr_SetString(PyExc_TypeError,
"value must be an Id");
187 "The name of the SShape.\n"
193 return PyUnicode_FromString(
self->ss->getName().c_str());
198 if (!PyUnicode_Check(value)) {
199 PyErr_SetString(PyExc_TypeError,
"value must be a string");
202 const char *name = PyUnicode_AsUTF8(value);
203 self->ss->setName(name);
210 "The bounding box of the SShape.\n"
212 ":type: :class:`BBox`");
223 PyErr_SetString(PyExc_TypeError,
"value must be a BBox");
233 "The list of vertices constituting this SShape.\n"
235 ":type: List of :class:`SVertex`");
242 PyObject *py_vertices = PyList_New(vertices.size());
245 for (it = vertices.begin(); it != vertices.end(); it++) {
255 "The list of edges constituting this SShape.\n"
257 ":type: List of :class:`FEdge`");
264 PyObject *py_edges = PyList_New(edges.size());
267 for (it = edges.begin(); it != edges.end(); it++) {
278 {
"edges", (getter)
SShape_edges_get, (setter)
nullptr, SShape_edges_doc,
nullptr},
280 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
286 PyVarObject_HEAD_INIT(
nullptr, 0)
305 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)
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`")
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)
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
static struct PyModuleDef module