9 #include "../BPy_Convert.h"
10 #include "../BPy_Id.h"
11 #include "../Interface0D/BPy_CurvePoint.h"
12 #include "../Interface0D/BPy_SVertex.h"
25 "Class hierarchy: :class:`Interface1D` > :class:`Curve`\n"
27 "Base class for curves made of CurvePoints. :class:`SVertex` is the\n"
28 "type of the initial curve vertices. A :class:`Chain` is a\n"
29 "specialization of a Curve.\n"
31 ".. method:: __init__()\n"
32 " __init__(brother)\n"
35 " Builds a :class:`FrsCurve` using a default constructor,\n"
36 " copy constructor or from an :class:`Id`.\n"
38 " :arg brother: A Curve object.\n"
39 " :type brother: :class:`Curve`\n"
40 " :arg id: An Id object.\n"
41 " :type id: :class:`Id`");
45 static const char *kwlist_1[] = {
"brother",
nullptr};
46 static const char *kwlist_2[] = {
"id",
nullptr};
47 PyObject *obj =
nullptr;
49 if (PyArg_ParseTupleAndKeywords(args, kwds,
"|O!", (
char **)kwlist_1, &
FrsCurve_Type, &obj)) {
51 self->c =
new Curve();
57 else if ((
void)PyErr_Clear(),
58 PyArg_ParseTupleAndKeywords(args, kwds,
"O!", (
char **)kwlist_2, &
Id_Type, &obj)) {
62 PyErr_SetString(PyExc_TypeError,
"invalid argument(s)");
65 self->py_if1D.if1D =
self->c;
66 self->py_if1D.borrowed =
false;
71 ".. method:: push_vertex_back(vertex)\n"
73 " Adds a single vertex at the end of the Curve.\n"
75 " :arg vertex: A vertex object.\n"
76 " :type vertex: :class:`SVertex` or :class:`CurvePoint`");
80 static const char *kwlist[] = {
"vertex",
nullptr};
81 PyObject *obj =
nullptr;
83 if (!PyArg_ParseTupleAndKeywords(args, kwds,
"O", (
char **)kwlist, &obj)) {
91 self->c->push_vertex_back(((
BPy_SVertex *)obj)->sv);
94 PyErr_SetString(PyExc_TypeError,
"invalid argument");
101 ".. method:: push_vertex_front(vertex)\n"
103 " Adds a single vertex at the front of the Curve.\n"
105 " :arg vertex: A vertex object.\n"
106 " :type vertex: :class:`SVertex` or :class:`CurvePoint`");
110 static const char *kwlist[] = {
"vertex",
nullptr};
111 PyObject *obj =
nullptr;
113 if (!PyArg_ParseTupleAndKeywords(args, kwds,
"O", (
char **)kwlist, &obj)) {
121 self->c->push_vertex_front(((
BPy_SVertex *)obj)->sv);
124 PyErr_SetString(PyExc_TypeError,
"invalid argument");
133 METH_VARARGS | METH_KEYWORDS,
134 FrsCurve_push_vertex_back_doc},
135 {
"push_vertex_front",
137 METH_VARARGS | METH_KEYWORDS,
138 FrsCurve_push_vertex_front_doc},
139 {
nullptr,
nullptr, 0,
nullptr},
145 "True if the Curve doesn't have any Vertex yet.\n"
155 "The number of segments in the polyline constituting the Curve.\n"
161 return PyLong_FromLong(
self->c->nSegments());
169 FrsCurve_segments_size_doc,
171 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
177 PyVarObject_HEAD_INIT(
nullptr, 0)
"Curve",
195 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
PyObject * PyBool_from_bool(bool b)
#define BPy_CurvePoint_Check(v)
static PyObject * FrsCurve_segments_size_get(BPy_FrsCurve *self, void *UNUSED(closure))
static PyObject * FrsCurve_push_vertex_front(BPy_FrsCurve *self, PyObject *args, PyObject *kwds)
static int FrsCurve_init(BPy_FrsCurve *self, PyObject *args, PyObject *kwds)
static PyObject * FrsCurve_is_empty_get(BPy_FrsCurve *self, void *UNUSED(closure))
PyTypeObject FrsCurve_Type
static PyGetSetDef BPy_FrsCurve_getseters[]
static PyObject * FrsCurve_push_vertex_back(BPy_FrsCurve *self, PyObject *args, PyObject *kwds)
static PyMethodDef BPy_FrsCurve_methods[]
PyDoc_STRVAR(FrsCurve_doc, "Class hierarchy: :class:`Interface1D` > :class:`Curve`\n" "\n" "Base class for curves made of CurvePoints. :class:`SVertex` is the\n" "type of the initial curve vertices. A :class:`Chain` is a\n" "specialization of a Curve.\n" "\n" ".. method:: __init__()\n" " __init__(brother)\n" " __init__(id)\n" "\n" " Builds a :class:`FrsCurve` using a default constructor,\n" " copy constructor or from an :class:`Id`.\n" "\n" " :arg brother: A Curve object.\n" " :type brother: :class:`Curve`\n" " :arg id: An Id object.\n" " :type id: :class:`Id`")
PyTypeObject Interface1D_Type
#define BPy_SVertex_Check(v)