23 #include "../BPy_Convert.h"
24 #include "../BPy_Id.h"
25 #include "../Interface0D/BPy_CurvePoint.h"
26 #include "../Interface0D/BPy_SVertex.h"
39 "Class hierarchy: :class:`Interface1D` > :class:`Curve`\n"
41 "Base class for curves made of CurvePoints. :class:`SVertex` is the\n"
42 "type of the initial curve vertices. A :class:`Chain` is a\n"
43 "specialization of a Curve.\n"
45 ".. method:: __init__()\n"
46 " __init__(brother)\n"
49 " Builds a :class:`FrsCurve` using a default constructor,\n"
50 " copy constructor or from an :class:`Id`.\n"
52 " :arg brother: A Curve object.\n"
53 " :type brother: :class:`Curve`\n"
54 " :arg id: An Id object.\n"
55 " :type id: :class:`Id`");
59 static const char *kwlist_1[] = {
"brother",
nullptr};
60 static const char *kwlist_2[] = {
"id",
nullptr};
61 PyObject *obj =
nullptr;
63 if (PyArg_ParseTupleAndKeywords(args, kwds,
"|O!", (
char **)kwlist_1, &
FrsCurve_Type, &obj)) {
65 self->c =
new Curve();
71 else if ((
void)PyErr_Clear(),
72 PyArg_ParseTupleAndKeywords(args, kwds,
"O!", (
char **)kwlist_2, &
Id_Type, &obj)) {
76 PyErr_SetString(PyExc_TypeError,
"invalid argument(s)");
79 self->py_if1D.if1D =
self->c;
80 self->py_if1D.borrowed =
false;
85 ".. method:: push_vertex_back(vertex)\n"
87 " Adds a single vertex at the end of the Curve.\n"
89 " :arg vertex: A vertex object.\n"
90 " :type vertex: :class:`SVertex` or :class:`CurvePoint`");
94 static const char *kwlist[] = {
"vertex",
nullptr};
95 PyObject *obj =
nullptr;
97 if (!PyArg_ParseTupleAndKeywords(args, kwds,
"O", (
char **)kwlist, &obj)) {
105 self->c->push_vertex_back(((
BPy_SVertex *)obj)->sv);
108 PyErr_SetString(PyExc_TypeError,
"invalid argument");
115 ".. method:: push_vertex_front(vertex)\n"
117 " Adds a single vertex at the front of the Curve.\n"
119 " :arg vertex: A vertex object.\n"
120 " :type vertex: :class:`SVertex` or :class:`CurvePoint`");
124 static const char *kwlist[] = {
"vertex",
nullptr};
125 PyObject *obj =
nullptr;
127 if (!PyArg_ParseTupleAndKeywords(args, kwds,
"O", (
char **)kwlist, &obj)) {
135 self->c->push_vertex_front(((
BPy_SVertex *)obj)->sv);
138 PyErr_SetString(PyExc_TypeError,
"invalid argument");
147 METH_VARARGS | METH_KEYWORDS,
148 FrsCurve_push_vertex_back_doc},
149 {
"push_vertex_front",
151 METH_VARARGS | METH_KEYWORDS,
152 FrsCurve_push_vertex_front_doc},
153 {
nullptr,
nullptr, 0,
nullptr},
159 "True if the Curve doesn't have any Vertex yet.\n"
169 "The number of segments in the polyline constituting the Curve.\n"
175 return PyLong_FromLong(
self->c->nSegments());
183 FrsCurve_segments_size_doc,
185 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
191 PyVarObject_HEAD_INIT(
nullptr, 0)
"Curve",
209 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)