9 #include "../BPy_Convert.h"
10 #include "../Interface0D/BPy_SVertex.h"
23 "Class hierarchy: :class:`Interface0D` > :class:`CurvePoint`\n"
25 "Class to represent a point of a curve. A CurvePoint can be any point\n"
26 "of a 1D curve (it doesn't have to be a vertex of the curve). Any\n"
27 ":class:`Interface1D` is built upon ViewEdges, themselves built upon\n"
28 "FEdges. Therefore, a curve is basically a polyline made of a list of\n"
29 ":class:`SVertex` objects. Thus, a CurvePoint is built by linearly\n"
30 "interpolating two :class:`SVertex` instances. CurvePoint can be used\n"
31 "as virtual points while querying 0D information along a curve at a\n"
34 ".. method:: __init__()\n"
35 " __init__(brother)\n"
36 " __init__(first_vertex, second_vertex, t2d)\n"
37 " __init__(first_point, second_point, t2d)\n"
39 " Builds a CurvePoint using the default constructor, copy constructor,\n"
40 " or one of the overloaded constructors. The over loaded constructors\n"
41 " can either take two :class:`SVertex` or two :class:`CurvePoint`\n"
42 " objects and an interpolation parameter\n"
44 " :arg brother: A CurvePoint object.\n"
45 " :type brother: :class:`CurvePoint`\n"
46 " :arg first_vertex: The first SVertex.\n"
47 " :type first_vertex: :class:`SVertex`\n"
48 " :arg second_vertex: The second SVertex.\n"
49 " :type second_vertex: :class:`SVertex`\n"
50 " :arg first_point: The first CurvePoint.\n"
51 " :type first_point: :class:`CurvePoint`\n"
52 " :arg second_point: The second CurvePoint.\n"
53 " :type second_point: :class:`CurvePoint`\n"
54 " :arg t2d: A 2D interpolation parameter used to linearly interpolate\n"
55 " first_vertex and second_vertex or first_point and second_point.\n"
56 " :type t2d: float\n");
60 static const char *kwlist_1[] = {
"brother",
nullptr};
61 static const char *kwlist_2[] = {
"first_vertex",
"second_vertex",
"t2d",
nullptr};
62 static const char *kwlist_3[] = {
"first_point",
"second_point",
"t2d",
nullptr};
63 PyObject *obj1 =
nullptr, *obj2 =
nullptr;
66 if (PyArg_ParseTupleAndKeywords(args, kwds,
"|O!", (
char **)kwlist_1, &
CurvePoint_Type, &obj1)) {
74 else if ((
void)PyErr_Clear(),
75 PyArg_ParseTupleAndKeywords(args,
86 else if ((
void)PyErr_Clear(),
87 PyArg_ParseTupleAndKeywords(args,
98 if (!cp1 || cp1->
A() ==
nullptr || cp1->
B() ==
nullptr) {
99 PyErr_SetString(PyExc_TypeError,
"argument 1 is an invalid CurvePoint object");
102 if (!cp2 || cp2->
A() ==
nullptr || cp2->
B() ==
nullptr) {
103 PyErr_SetString(PyExc_TypeError,
"argument 2 is an invalid CurvePoint object");
109 PyErr_SetString(PyExc_TypeError,
"invalid argument(s)");
112 self->py_if0D.if0D =
self->cp;
113 self->py_if0D.borrowed =
false;
122 "The first SVertex upon which the CurvePoint is built.\n"
124 ":type: :class:`SVertex`");
140 PyErr_SetString(PyExc_TypeError,
"value must be an SVertex");
148 "The second SVertex upon which the CurvePoint is built.\n"
150 ":type: :class:`SVertex`");
166 PyErr_SetString(PyExc_TypeError,
"value must be an SVertex");
174 "Gets the FEdge for the two SVertices that given CurvePoints consists out of.\n"
175 "A shortcut for CurvePoint.first_svertex.get_fedge(CurvePoint.second_svertex).\n"
177 ":type: :class:`FEdge`");
191 "The 2D interpolation parameter.\n"
197 return PyFloat_FromDouble(
self->cp->t2d());
203 if ((scalar = PyFloat_AsDouble(value)) == -1.0f && PyErr_Occurred()) {
204 PyErr_SetString(PyExc_TypeError,
"value must be a number");
207 self->cp->setT2d(scalar);
215 CurvePoint_first_svertex_doc,
220 CurvePoint_second_svertex_doc,
224 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
229 PyVarObject_HEAD_INIT(
nullptr, 0)
"CurvePoint",
247 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
PyObject * BPy_SVertex_from_SVertex(SVertex &sv)
PyObject * Any_BPy_Interface1D_from_Interface1D(Interface1D &if1D)
static PyObject * CurvePoint_second_svertex_get(BPy_CurvePoint *self, void *UNUSED(closure))
static int CurvePoint_init(BPy_CurvePoint *self, PyObject *args, PyObject *kwds)
PyTypeObject CurvePoint_Type
static int CurvePoint_first_svertex_set(BPy_CurvePoint *self, PyObject *value, void *UNUSED(closure))
PyDoc_STRVAR(CurvePoint_doc, "Class hierarchy: :class:`Interface0D` > :class:`CurvePoint`\n" "\n" "Class to represent a point of a curve. A CurvePoint can be any point\n" "of a 1D curve (it doesn't have to be a vertex of the curve). Any\n" ":class:`Interface1D` is built upon ViewEdges, themselves built upon\n" "FEdges. Therefore, a curve is basically a polyline made of a list of\n" ":class:`SVertex` objects. Thus, a CurvePoint is built by linearly\n" "interpolating two :class:`SVertex` instances. CurvePoint can be used\n" "as virtual points while querying 0D information along a curve at a\n" "given resolution.\n" "\n" ".. method:: __init__()\n" " __init__(brother)\n" " __init__(first_vertex, second_vertex, t2d)\n" " __init__(first_point, second_point, t2d)\n" "\n" " Builds a CurvePoint using the default constructor, copy constructor,\n" " or one of the overloaded constructors. The over loaded constructors\n" " can either take two :class:`SVertex` or two :class:`CurvePoint`\n" " objects and an interpolation parameter\n" "\n" " :arg brother: A CurvePoint object.\n" " :type brother: :class:`CurvePoint`\n" " :arg first_vertex: The first SVertex.\n" " :type first_vertex: :class:`SVertex`\n" " :arg second_vertex: The second SVertex.\n" " :type second_vertex: :class:`SVertex`\n" " :arg first_point: The first CurvePoint.\n" " :type first_point: :class:`CurvePoint`\n" " :arg second_point: The second CurvePoint.\n" " :type second_point: :class:`CurvePoint`\n" " :arg t2d: A 2D interpolation parameter used to linearly interpolate\n" " first_vertex and second_vertex or first_point and second_point.\n" " :type t2d: float\n")
static int CurvePoint_t2d_set(BPy_CurvePoint *self, PyObject *value, void *UNUSED(closure))
static PyObject * CurvePoint_first_svertex_get(BPy_CurvePoint *self, void *UNUSED(closure))
static PyGetSetDef BPy_CurvePoint_getseters[]
static int CurvePoint_second_svertex_set(BPy_CurvePoint *self, PyObject *value, void *UNUSED(closure))
static PyObject * CurvePoint_fedge_get(BPy_CurvePoint *self, void *UNUSED(closure))
static PyObject * CurvePoint_t2d_get(BPy_CurvePoint *self, void *UNUSED(closure))
PyTypeObject Interface0D_Type
PyTypeObject SVertex_Type
#define BPy_SVertex_Check(v)