110 "Base class for any 1D element.\n"
112 ".. method:: __init__()\n"
114 " Default constructor.");
118 static const char *kwlist[] = {
nullptr};
120 if (!PyArg_ParseTupleAndKeywords(args, kwds,
"", (
char **)kwlist)) {
124 self->borrowed =
false;
130 if (
self->if1D && !
self->borrowed) {
133 Py_TYPE(
self)->tp_free((PyObject *)
self);
138 return PyUnicode_FromFormat(
139 "type: %s - address: %p",
self->if1D->getExactTypeName().c_str(),
self->if1D);
143 ".. method:: vertices_begin()\n"
145 " Returns an iterator over the Interface1D vertices, pointing to the\n"
148 " :return: An Interface0DIterator pointing to the first vertex.\n"
149 " :rtype: :class:`Interface0DIterator`");
158 ".. method:: vertices_end()\n"
160 " Returns an iterator over the Interface1D vertices, pointing after\n"
161 " the last vertex.\n"
163 " :return: An Interface0DIterator pointing after the last vertex.\n"
164 " :rtype: :class:`Interface0DIterator`");
173 ".. method:: points_begin(t=0.0)\n"
175 " Returns an iterator over the Interface1D points, pointing to the\n"
176 " first point. The difference with vertices_begin() is that here we can\n"
177 " iterate over points of the 1D element at a any given sampling.\n"
178 " Indeed, for each iteration, a virtual point is created.\n"
180 " :arg t: A sampling with which we want to iterate over points of\n"
181 " this 1D element.\n"
183 " :return: An Interface0DIterator pointing to the first point.\n"
184 " :rtype: :class:`Interface0DIterator`");
188 static const char *kwlist[] = {
"t",
nullptr};
191 if (!PyArg_ParseTupleAndKeywords(args, kwds,
"|f", (
char **)kwlist, &f)) {
199 ".. method:: points_end(t=0.0)\n"
201 " Returns an iterator over the Interface1D points, pointing after the\n"
202 " last point. The difference with vertices_end() is that here we can\n"
203 " iterate over points of the 1D element at a given sampling. Indeed,\n"
204 " for each iteration, a virtual point is created.\n"
206 " :arg t: A sampling with which we want to iterate over points of\n"
207 " this 1D element.\n"
209 " :return: An Interface0DIterator pointing after the last point.\n"
210 " :rtype: :class:`Interface0DIterator`");
214 static const char *kwlist[] = {
"t",
nullptr};
217 if (!PyArg_ParseTupleAndKeywords(args, kwds,
"|f", (
char **)kwlist, &f)) {
228 Interface1D_vertices_begin_doc},
232 Interface1D_vertices_end_doc},
235 METH_VARARGS | METH_KEYWORDS,
236 Interface1D_points_begin_doc},
239 METH_VARARGS | METH_KEYWORDS,
240 Interface1D_points_end_doc},
241 {
nullptr,
nullptr, 0,
nullptr},
247 "The string of the name of the 1D element.\n"
253 return PyUnicode_FromString(Py_TYPE(
self)->tp_name);
257 "The Id of this Interface1D.\n"
259 ":type: :class:`Id`");
264 if (PyErr_Occurred()) {
271 "The nature of this Interface1D.\n"
273 ":type: :class:`Nature`");
278 if (PyErr_Occurred()) {
285 "The 2D length of this Interface1D.\n"
292 if (PyErr_Occurred()) {
295 return PyFloat_FromDouble((
double)
length);
299 "The time stamp of the 1D element, mainly used for selection.\n"
305 return PyLong_FromLong(
self->if1D->getTimeStamp());
314 if ((timestamp = PyLong_AsLong(value)) == -1 && PyErr_Occurred()) {
315 PyErr_SetString(PyExc_TypeError,
"value must be a number");
318 self->if1D->setTimeStamp(timestamp);
329 Interface1D_length_2d_doc,
334 Interface1D_time_stamp_doc,
336 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
342 PyVarObject_HEAD_INIT(
nullptr, 0)
"Interface1D",
360 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(unsigned short 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 int Interface1D_time_stamp_set(BPy_Interface1D *self, PyObject *value, void *UNUSED(closure))
static PyObject * Interface1D_time_stamp_get(BPy_Interface1D *self, void *UNUSED(closure))
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.")
static PyObject * Interface1D_vertices_end(BPy_Interface1D *self)
PyTypeObject Interface1D_Type
static int Interface1D_init(BPy_Interface1D *self, PyObject *args, PyObject *kwds)
static PyObject * Interface1D_vertices_begin(BPy_Interface1D *self)
static PyObject * Interface1D_repr(BPy_Interface1D *self)
static PyObject * Interface1D_points_end(BPy_Interface1D *self, PyObject *args, PyObject *kwds)
int Interface1D_Init(PyObject *module)
static PyObject * Interface1D_id_get(BPy_Interface1D *self, void *UNUSED(closure))
static PyObject * Interface1D_length_2d_get(BPy_Interface1D *self, void *UNUSED(closure))
static PyGetSetDef BPy_Interface1D_getseters[]
static PyObject * Interface1D_name_get(BPy_Interface1D *self, void *UNUSED(closure))
static PyMethodDef BPy_Interface1D_methods[]
static PyObject * Interface1D_nature_get(BPy_Interface1D *self, void *UNUSED(closure))
#define BPy_MediumType_HUMID_MEDIUM
#define BPy_MediumType_OPAQUE_MEDIUM
#define BPy_MediumType_DRY_MEDIUM
PyTypeObject ViewEdge_Type
static struct PyModuleDef module
SIMD_FORCE_INLINE btScalar length(const btQuaternion &q)
Return the length of a quaternion.
unsigned short VertexNature