68#define ADD_TYPE_CONST(id) \
69 PyLong_subtype_add_to_dict(Stroke_Type.tp_dict, &MediumType_Type, STRINGIFY(id), Stroke::id)
91 "Base class for any 1D element.\n"
93 ".. method:: __init__()\n"
95 " Default constructor.\n");
98 static const char *kwlist[] = {
nullptr};
100 if (!PyArg_ParseTupleAndKeywords(args, kwds,
"", (
char **)kwlist)) {
104 self->borrowed =
false;
110 if (
self->if1D && !
self->borrowed) {
113 Py_TYPE(
self)->tp_free((PyObject *)
self);
118 return PyUnicode_FromFormat(
119 "type: %s - address: %p",
self->if1D->getExactTypeName().c_str(),
self->if1D);
124 Interface1D_vertices_begin_doc,
125 ".. method:: vertices_begin()\n"
127 " Returns an iterator over the Interface1D vertices, pointing to the\n"
130 " :return: An Interface0DIterator pointing to the first vertex.\n"
131 " :rtype: :class:`Interface0DIterator`\n");
140 Interface1D_vertices_end_doc,
141 ".. method:: vertices_end()\n"
143 " Returns an iterator over the Interface1D vertices, pointing after\n"
144 " the last vertex.\n"
146 " :return: An Interface0DIterator pointing after the last vertex.\n"
147 " :rtype: :class:`Interface0DIterator`\n");
156 Interface1D_points_begin_doc,
157 ".. method:: points_begin(t=0.0)\n"
159 " Returns an iterator over the Interface1D points, pointing to the\n"
160 " first point. The difference with vertices_begin() is that here we can\n"
161 " iterate over points of the 1D element at a any given sampling.\n"
162 " Indeed, for each iteration, a virtual point is created.\n"
164 " :arg t: A sampling with which we want to iterate over points of\n"
165 " this 1D element.\n"
167 " :return: An Interface0DIterator pointing to the first point.\n"
168 " :rtype: :class:`Interface0DIterator`\n");
171 static const char *kwlist[] = {
"t",
nullptr};
174 if (!PyArg_ParseTupleAndKeywords(args, kwds,
"|f", (
char **)kwlist, &f)) {
183 Interface1D_points_end_doc,
184 ".. method:: points_end(t=0.0)\n"
186 " Returns an iterator over the Interface1D points, pointing after the\n"
187 " last point. The difference with vertices_end() is that here we can\n"
188 " iterate over points of the 1D element at a given sampling. Indeed,\n"
189 " for each iteration, a virtual point is created.\n"
191 " :arg t: A sampling with which we want to iterate over points of\n"
192 " this 1D element.\n"
194 " :return: An Interface0DIterator pointing after the last point.\n"
195 " :rtype: :class:`Interface0DIterator`\n");
198 static const char *kwlist[] = {
"t",
nullptr};
201 if (!PyArg_ParseTupleAndKeywords(args, kwds,
"|f", (
char **)kwlist, &f)) {
210# pragma clang diagnostic push
211# pragma clang diagnostic ignored "-Wcast-function-type"
213# pragma GCC diagnostic push
214# pragma GCC diagnostic ignored "-Wcast-function-type"
222 Interface1D_vertices_begin_doc},
226 Interface1D_vertices_end_doc},
229 METH_VARARGS | METH_KEYWORDS,
230 Interface1D_points_begin_doc},
233 METH_VARARGS | METH_KEYWORDS,
234 Interface1D_points_end_doc},
235 {
nullptr,
nullptr, 0,
nullptr},
240# pragma clang diagnostic pop
242# pragma GCC diagnostic pop
250 Interface1D_name_doc,
251 "The string of the name of the 1D element.\n"
256 return PyUnicode_FromString(Py_TYPE(
self)->tp_name);
262 "The Id of this Interface1D.\n"
264 ":type: :class:`Id`\n");
267 Id id(
self->if1D->getId());
268 if (PyErr_Occurred()) {
276 Interface1D_nature_doc,
277 "The nature of this Interface1D.\n"
279 ":type: :class:`Nature`\n");
283 if (PyErr_Occurred()) {
291 Interface1D_length_2d_doc,
292 "The 2D length of this Interface1D.\n"
298 if (PyErr_Occurred()) {
301 return PyFloat_FromDouble(
double(
length));
306 Interface1D_time_stamp_doc,
307 "The time stamp of the 1D element, mainly used for selection.\n"
312 return PyLong_FromLong(
self->if1D->getTimeStamp());
319 if ((timestamp = PyLong_AsLong(value)) == -1 && PyErr_Occurred()) {
320 PyErr_SetString(PyExc_TypeError,
"value must be a number");
323 self->if1D->setTimeStamp(timestamp);
334 Interface1D_length_2d_doc,
339 Interface1D_time_stamp_doc,
341 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
347 PyVarObject_HEAD_INIT(
nullptr, 0)
366 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
PyObject * BPy_Interface0DIterator_from_Interface0DIterator(Interface0DIterator &if0D_it, bool reversed)
PyObject * BPy_Id_from_Id(Id &id)
PyObject * BPy_Nature_from_Nature(ushort n)
PyTypeObject FEdgeSharp_Type
void FEdgeSharp_mathutils_register_callback()
void FEdgeSmooth_mathutils_register_callback()
PyTypeObject FEdgeSmooth_Type
PyTypeObject FrsCurve_Type
static void Interface1D_dealloc(BPy_Interface1D *self)
static PyObject * Interface1D_time_stamp_get(BPy_Interface1D *self, void *)
static PyObject * Interface1D_length_2d_get(BPy_Interface1D *self, void *)
static PyObject * Interface1D_id_get(BPy_Interface1D *self, void *)
static PyObject * Interface1D_vertices_begin(BPy_Interface1D *self)
static PyObject * Interface1D_points_end(BPy_Interface1D *self, PyObject *args, PyObject *kwds)
static PyObject * Interface1D_repr(BPy_Interface1D *self)
#define ADD_TYPE_CONST(id)
PyTypeObject Interface1D_Type
static int Interface1D_time_stamp_set(BPy_Interface1D *self, PyObject *value, void *)
static PyObject * Interface1D_name_get(BPy_Interface1D *self, void *)
static int Interface1D_init(BPy_Interface1D *self, PyObject *args, PyObject *kwds)
int Interface1D_Init(PyObject *module)
static PyObject * Interface1D_points_begin(BPy_Interface1D *self, PyObject *args, PyObject *kwds)
PyDoc_STRVAR(Interface1D_doc, "Base class for any 1D element.\n" "\n" ".. method:: __init__()\n" "\n" " Default constructor.\n")
static PyObject * Interface1D_nature_get(BPy_Interface1D *self, void *)
static PyGetSetDef BPy_Interface1D_getseters[]
static PyMethodDef BPy_Interface1D_methods[]
static PyObject * Interface1D_vertices_end(BPy_Interface1D *self)
PyTypeObject ViewEdge_Type
float length(VecOp< float, D >) RET
static struct PyModuleDef module