23 #include "../BPy_Convert.h"
24 #include "../Interface0D/BPy_SVertex.h"
37 "Class hierarchy: :class:`Interface0D` > :class:`CurvePoint`\n"
39 "Class to represent a point of a curve. A CurvePoint can be any point\n"
40 "of a 1D curve (it doesn't have to be a vertex of the curve). Any\n"
41 ":class:`Interface1D` is built upon ViewEdges, themselves built upon\n"
42 "FEdges. Therefore, a curve is basically a polyline made of a list of\n"
43 ":class:`SVertex` objects. Thus, a CurvePoint is built by linearly\n"
44 "interpolating two :class:`SVertex` instances. CurvePoint can be used\n"
45 "as virtual points while querying 0D information along a curve at a\n"
48 ".. method:: __init__()\n"
49 " __init__(brother)\n"
50 " __init__(first_vertex, second_vertex, t2d)\n"
51 " __init__(first_point, second_point, t2d)\n"
53 " Builds a CurvePoint using the default constructor, copy constructor,\n"
54 " or one of the overloaded constructors. The over loaded constructors\n"
55 " can either take two :class:`SVertex` or two :class:`CurvePoint`\n"
56 " objects and an interpolation parameter\n"
58 " :arg brother: A CurvePoint object.\n"
59 " :type brother: :class:`CurvePoint`\n"
60 " :arg first_vertex: The first SVertex.\n"
61 " :type first_vertex: :class:`SVertex`\n"
62 " :arg second_vertex: The second SVertex.\n"
63 " :type second_vertex: :class:`SVertex`\n"
64 " :arg first_point: The first CurvePoint.\n"
65 " :type first_point: :class:`CurvePoint`\n"
66 " :arg second_point: The second CurvePoint.\n"
67 " :type second_point: :class:`CurvePoint`\n"
68 " :arg t2d: A 2D interpolation parameter used to linearly interpolate\n"
69 " first_vertex and second_vertex or first_point and second_point.\n"
70 " :type t2d: float\n");
74 static const char *kwlist_1[] = {
"brother",
nullptr};
75 static const char *kwlist_2[] = {
"first_vertex",
"second_vertex",
"t2d",
nullptr};
76 static const char *kwlist_3[] = {
"first_point",
"second_point",
"t2d",
nullptr};
77 PyObject *obj1 =
nullptr, *obj2 =
nullptr;
80 if (PyArg_ParseTupleAndKeywords(args, kwds,
"|O!", (
char **)kwlist_1, &
CurvePoint_Type, &obj1)) {
88 else if ((
void)PyErr_Clear(),
89 PyArg_ParseTupleAndKeywords(args,
100 else if ((
void)PyErr_Clear(),
101 PyArg_ParseTupleAndKeywords(args,
112 if (!cp1 || cp1->
A() ==
nullptr || cp1->
B() ==
nullptr) {
113 PyErr_SetString(PyExc_TypeError,
"argument 1 is an invalid CurvePoint object");
116 if (!cp2 || cp2->
A() ==
nullptr || cp2->
B() ==
nullptr) {
117 PyErr_SetString(PyExc_TypeError,
"argument 2 is an invalid CurvePoint object");
123 PyErr_SetString(PyExc_TypeError,
"invalid argument(s)");
126 self->py_if0D.if0D =
self->cp;
127 self->py_if0D.borrowed =
false;
136 "The first SVertex upon which the CurvePoint is built.\n"
138 ":type: :class:`SVertex`");
154 PyErr_SetString(PyExc_TypeError,
"value must be an SVertex");
162 "The second SVertex upon which the CurvePoint is built.\n"
164 ":type: :class:`SVertex`");
180 PyErr_SetString(PyExc_TypeError,
"value must be an SVertex");
188 "Gets the FEdge for the two SVertices that given CurvePoints consists out of.\n"
189 "A shortcut for CurvePoint.first_svertex.get_fedge(CurvePoint.second_svertex).\n"
191 ":type: :class:`FEdge`");
205 "The 2D interpolation parameter.\n"
211 return PyFloat_FromDouble(
self->cp->t2d());
217 if ((scalar = PyFloat_AsDouble(value)) == -1.0f && PyErr_Occurred()) {
218 PyErr_SetString(PyExc_TypeError,
"value must be a number");
221 self->cp->setT2d(scalar);
229 CurvePoint_first_svertex_doc,
234 CurvePoint_second_svertex_doc,
238 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
243 PyVarObject_HEAD_INIT(
nullptr, 0)
"CurvePoint",
261 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)