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.");
99 static const char *kwlist[] = {
nullptr};
101 if (!PyArg_ParseTupleAndKeywords(args, kwds,
"", (
char **)kwlist)) {
105 self->borrowed =
false;
111 if (
self->if1D && !
self->borrowed) {
114 Py_TYPE(
self)->tp_free((PyObject *)
self);
119 return PyUnicode_FromFormat(
120 "type: %s - address: %p",
self->if1D->getExactTypeName().c_str(),
self->if1D);
125 Interface1D_vertices_begin_doc,
126 ".. method:: vertices_begin()\n"
128 " Returns an iterator over the Interface1D vertices, pointing to the\n"
131 " :return: An Interface0DIterator pointing to the first vertex.\n"
132 " :rtype: :class:`Interface0DIterator`");
142 Interface1D_vertices_end_doc,
143 ".. method:: vertices_end()\n"
145 " Returns an iterator over the Interface1D vertices, pointing after\n"
146 " the last vertex.\n"
148 " :return: An Interface0DIterator pointing after the last vertex.\n"
149 " :rtype: :class:`Interface0DIterator`");
159 Interface1D_points_begin_doc,
160 ".. method:: points_begin(t=0.0)\n"
162 " Returns an iterator over the Interface1D points, pointing to the\n"
163 " first point. The difference with vertices_begin() is that here we can\n"
164 " iterate over points of the 1D element at a any given sampling.\n"
165 " Indeed, for each iteration, a virtual point is created.\n"
167 " :arg t: A sampling with which we want to iterate over points of\n"
168 " this 1D element.\n"
170 " :return: An Interface0DIterator pointing to the first point.\n"
171 " :rtype: :class:`Interface0DIterator`");
175 static const char *kwlist[] = {
"t",
nullptr};
178 if (!PyArg_ParseTupleAndKeywords(args, kwds,
"|f", (
char **)kwlist, &f)) {
187 Interface1D_points_end_doc,
188 ".. method:: points_end(t=0.0)\n"
190 " Returns an iterator over the Interface1D points, pointing after the\n"
191 " last point. The difference with vertices_end() is that here we can\n"
192 " iterate over points of the 1D element at a given sampling. Indeed,\n"
193 " for each iteration, a virtual point is created.\n"
195 " :arg t: A sampling with which we want to iterate over points of\n"
196 " this 1D element.\n"
198 " :return: An Interface0DIterator pointing after the last point.\n"
199 " :rtype: :class:`Interface0DIterator`");
203 static const char *kwlist[] = {
"t",
nullptr};
206 if (!PyArg_ParseTupleAndKeywords(args, kwds,
"|f", (
char **)kwlist, &f)) {
215# pragma clang diagnostic push
216# pragma clang diagnostic ignored "-Wcast-function-type"
218# pragma GCC diagnostic push
219# pragma GCC diagnostic ignored "-Wcast-function-type"
227 Interface1D_vertices_begin_doc},
231 Interface1D_vertices_end_doc},
234 METH_VARARGS | METH_KEYWORDS,
235 Interface1D_points_begin_doc},
238 METH_VARARGS | METH_KEYWORDS,
239 Interface1D_points_end_doc},
240 {
nullptr,
nullptr, 0,
nullptr},
245# pragma clang diagnostic pop
247# pragma GCC diagnostic pop
255 Interface1D_name_doc,
256 "The string of the name of the 1D element.\n"
262 return PyUnicode_FromString(Py_TYPE(
self)->tp_name);
268 "The Id of this Interface1D.\n"
270 ":type: :class:`Id`");
274 Id id(
self->if1D->getId());
275 if (PyErr_Occurred()) {
283 Interface1D_nature_doc,
284 "The nature of this Interface1D.\n"
286 ":type: :class:`Nature`");
291 if (PyErr_Occurred()) {
299 Interface1D_length_2d_doc,
300 "The 2D length of this Interface1D.\n"
307 if (PyErr_Occurred()) {
310 return PyFloat_FromDouble(
double(
length));
315 Interface1D_time_stamp_doc,
316 "The time stamp of the 1D element, mainly used for selection.\n"
322 return PyLong_FromLong(
self->if1D->getTimeStamp());
329 if ((timestamp = PyLong_AsLong(value)) == -1 && PyErr_Occurred()) {
330 PyErr_SetString(PyExc_TypeError,
"value must be a number");
333 self->if1D->setTimeStamp(timestamp);
344 Interface1D_length_2d_doc,
349 Interface1D_time_stamp_doc,
351 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
357 PyVarObject_HEAD_INIT(
nullptr, 0)
376 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)
PyDoc_STRVAR(Interface1D_doc, "Base class for any 1D element.\n" "\n" ".. method:: __init__()\n" "\n" " Default constructor.")
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)
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