72#define ADD_TYPE_CONST(id) \
73 PyLong_subtype_add_to_dict(Stroke_Type.tp_dict, &MediumType_Type, STRINGIFY(id), Stroke::id)
95 "Base class for any 1D element.\n"
97 ".. method:: __init__()\n"
99 " Default constructor.");
103 static const char *kwlist[] = {
nullptr};
105 if (!PyArg_ParseTupleAndKeywords(args, kwds,
"", (
char **)kwlist)) {
109 self->borrowed =
false;
115 if (
self->if1D && !
self->borrowed) {
118 Py_TYPE(
self)->tp_free((PyObject *)
self);
123 return PyUnicode_FromFormat(
124 "type: %s - address: %p",
self->if1D->getExactTypeName().c_str(),
self->if1D);
129 Interface1D_vertices_begin_doc,
130 ".. method:: vertices_begin()\n"
132 " Returns an iterator over the Interface1D vertices, pointing to the\n"
135 " :return: An Interface0DIterator pointing to the first vertex.\n"
136 " :rtype: :class:`Interface0DIterator`");
146 Interface1D_vertices_end_doc,
147 ".. method:: vertices_end()\n"
149 " Returns an iterator over the Interface1D vertices, pointing after\n"
150 " the last vertex.\n"
152 " :return: An Interface0DIterator pointing after the last vertex.\n"
153 " :rtype: :class:`Interface0DIterator`");
163 Interface1D_points_begin_doc,
164 ".. method:: points_begin(t=0.0)\n"
166 " Returns an iterator over the Interface1D points, pointing to the\n"
167 " first point. The difference with vertices_begin() is that here we can\n"
168 " iterate over points of the 1D element at a any given sampling.\n"
169 " Indeed, for each iteration, a virtual point is created.\n"
171 " :arg t: A sampling with which we want to iterate over points of\n"
172 " this 1D element.\n"
174 " :return: An Interface0DIterator pointing to the first point.\n"
175 " :rtype: :class:`Interface0DIterator`");
179 static const char *kwlist[] = {
"t",
nullptr};
182 if (!PyArg_ParseTupleAndKeywords(args, kwds,
"|f", (
char **)kwlist, &f)) {
191 Interface1D_points_end_doc,
192 ".. method:: points_end(t=0.0)\n"
194 " Returns an iterator over the Interface1D points, pointing after the\n"
195 " last point. The difference with vertices_end() is that here we can\n"
196 " iterate over points of the 1D element at a given sampling. Indeed,\n"
197 " for each iteration, a virtual point is created.\n"
199 " :arg t: A sampling with which we want to iterate over points of\n"
200 " this 1D element.\n"
202 " :return: An Interface0DIterator pointing after the last point.\n"
203 " :rtype: :class:`Interface0DIterator`");
207 static const char *kwlist[] = {
"t",
nullptr};
210 if (!PyArg_ParseTupleAndKeywords(args, kwds,
"|f", (
char **)kwlist, &f)) {
221 Interface1D_vertices_begin_doc},
225 Interface1D_vertices_end_doc},
228 METH_VARARGS | METH_KEYWORDS,
229 Interface1D_points_begin_doc},
232 METH_VARARGS | METH_KEYWORDS,
233 Interface1D_points_end_doc},
234 {
nullptr,
nullptr, 0,
nullptr},
241 Interface1D_name_doc,
242 "The string of the name of the 1D element.\n"
248 return PyUnicode_FromString(Py_TYPE(
self)->tp_name);
254 "The Id of this Interface1D.\n"
256 ":type: :class:`Id`");
260 Id id(
self->if1D->getId());
261 if (PyErr_Occurred()) {
269 Interface1D_nature_doc,
270 "The nature of this Interface1D.\n"
272 ":type: :class:`Nature`");
277 if (PyErr_Occurred()) {
285 Interface1D_length_2d_doc,
286 "The 2D length of this Interface1D.\n"
292 real length =
self->if1D->getLength2D();
293 if (PyErr_Occurred()) {
296 return PyFloat_FromDouble(
double(length));
301 Interface1D_time_stamp_doc,
302 "The time stamp of the 1D element, mainly used for selection.\n"
308 return PyLong_FromLong(
self->if1D->getTimeStamp());
315 if ((timestamp = PyLong_AsLong(value)) == -1 && PyErr_Occurred()) {
316 PyErr_SetString(PyExc_TypeError,
"value must be a number");
319 self->if1D->setTimeStamp(timestamp);
330 Interface1D_length_2d_doc,
335 Interface1D_time_stamp_doc,
337 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
343 PyVarObject_HEAD_INIT(
nullptr, 0)
362 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
static struct PyModuleDef module