25 "Class hierarchy: :class:`Interface0D` > :class:`CurvePoint` > :class:`StrokeVertex`\n"
27 "Class to define a stroke vertex.\n"
29 ".. method:: __init__()\n"
30 " __init__(brother)\n"
31 " __init__(first_vertex, second_vertex, t3d)\n"
33 " __init__(svertex)\n"
34 " __init__(svertex, attribute)\n"
36 " Builds a :class:`StrokeVertex` using the default constructor,\n"
37 " copy constructor, from 2 :class:`StrokeVertex` and an interpolation parameter,\n"
38 " from a CurvePoint, from a SVertex, or a :class:`SVertex`"
39 " and a :class:`StrokeAttribute` object.\n"
41 " :arg brother: A StrokeVertex object.\n"
42 " :type brother: :class:`StrokeVertex`\n"
43 " :arg first_vertex: The first StrokeVertex.\n"
44 " :type first_vertex: :class:`StrokeVertex`\n"
45 " :arg second_vertex: The second StrokeVertex.\n"
46 " :type second_vertex: :class:`StrokeVertex`\n"
47 " :arg t3d: An interpolation parameter.\n"
49 " :arg point: A CurvePoint object.\n"
50 " :type point: :class:`CurvePoint`\n"
51 " :arg svertex: An SVertex object.\n"
52 " :type svertex: :class:`SVertex`\n"
53 " :arg svertex: An SVertex object.\n"
54 " :type svertex: :class:`SVertex`\n"
55 " :arg attribute: A StrokeAttribute object.\n"
56 " :type attribute: :class:`StrokeAttribute`");
60 static const char *kwlist_1[] = {
"brother",
nullptr};
61 static const char *kwlist_2[] = {
"first_vertex",
"second_vertex",
"t3d",
nullptr};
62 static const char *kwlist_3[] = {
"point",
nullptr};
63 static const char *kwlist_4[] = {
"svertex",
"attribute",
nullptr};
64 PyObject *obj1 =
nullptr, *obj2 =
nullptr;
67 if (PyArg_ParseTupleAndKeywords(args, kwds,
"|O!", (
char **)kwlist_1, &
StrokeVertex_Type, &obj1))
74 PyErr_SetString(PyExc_TypeError,
"argument 1 is an invalid StrokeVertex object");
80 else if ((
void)PyErr_Clear(),
81 PyArg_ParseTupleAndKeywords(args,
93 if (!sv1 || (sv1->
A() ==
nullptr && sv1->
B() ==
nullptr)) {
94 PyErr_SetString(PyExc_TypeError,
"argument 1 is an invalid StrokeVertex object");
97 if (!sv2 || (sv2->
A() ==
nullptr && sv2->
B() ==
nullptr)) {
98 PyErr_SetString(PyExc_TypeError,
"argument 2 is an invalid StrokeVertex object");
103 else if ((
void)PyErr_Clear(),
104 PyArg_ParseTupleAndKeywords(
108 if (!cp || cp->
A() ==
nullptr || cp->
B() ==
nullptr) {
109 PyErr_SetString(PyExc_TypeError,
"argument 1 is an invalid CurvePoint object");
114 else if ((
void)PyErr_Clear(),
115 (
void)(obj2 =
nullptr),
116 PyArg_ParseTupleAndKeywords(args,
133 PyErr_SetString(PyExc_TypeError,
"invalid argument(s)");
137 self->py_cp.py_if0D.if0D =
self->sv;
138 self->py_cp.py_if0D.borrowed =
false;
158 bmo->data[0] = float(
self->sv->x());
159 bmo->data[1] = float(
self->sv->y());
176 bmo->data[0] = float(
self->sv->x());
179 bmo->data[1] = float(
self->sv->y());
222 StrokeVertex_attribute_doc,
223 "StrokeAttribute for this StrokeVertex.\n"
225 ":type: :class:`StrokeAttribute`");
235 PyErr_SetString(PyExc_TypeError,
"value must be a StrokeAttribute object");
244 StrokeVertex_curvilinear_abscissa_doc,
245 "Curvilinear abscissa of this StrokeVertex in the Stroke.\n"
251 return PyFloat_FromDouble(
self->sv->curvilinearAbscissa());
259 if ((scalar = PyFloat_AsDouble(value)) == -1.0f && PyErr_Occurred()) {
261 PyErr_SetString(PyExc_TypeError,
"value must be a number");
264 self->sv->setCurvilinearAbscissa(scalar);
270 StrokeVertex_point_doc,
271 "2D point coordinates.\n"
273 ":type: :class:`mathutils.Vector`");
286 self->sv->setX(
v[0]);
287 self->sv->setY(
v[1]);
293 StrokeVertex_stroke_length_doc,
294 "Stroke length (it is only a value retained by the StrokeVertex,\n"
295 "and it won't change the real stroke length).\n"
301 return PyFloat_FromDouble(
self->sv->strokeLength());
309 if ((scalar = PyFloat_AsDouble(value)) == -1.0f && PyErr_Occurred()) {
311 PyErr_SetString(PyExc_TypeError,
"value must be a number");
314 self->sv->setStrokeLength(scalar);
321 "Curvilinear abscissa of this StrokeVertex in the Stroke.\n"
327 return PyFloat_FromDouble(
self->sv->u());
334 StrokeVertex_attribute_doc,
336 {
"curvilinear_abscissa",
339 StrokeVertex_curvilinear_abscissa_doc,
344 StrokeVertex_point_doc,
349 StrokeVertex_stroke_length_doc,
352 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
358 PyVarObject_HEAD_INIT(
nullptr, 0)
377 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
PyObject * BPy_StrokeAttribute_from_StrokeAttribute(StrokeAttribute &sa)
PyTypeObject CurvePoint_Type
PyTypeObject SVertex_Type
PyTypeObject StrokeAttribute_Type
#define BPy_StrokeAttribute_Check(v)
static PyGetSetDef BPy_StrokeVertex_getseters[]
static Mathutils_Callback StrokeVertex_mathutils_cb
static int StrokeVertex_point_set(BPy_StrokeVertex *self, PyObject *value, void *)
static int StrokeVertex_mathutils_check(BaseMathObject *bmo)
static int StrokeVertex_curvilinear_abscissa_set(BPy_StrokeVertex *self, PyObject *value, void *)
static PyObject * StrokeVertex_point_get(BPy_StrokeVertex *self, void *)
static PyObject * StrokeVertex_attribute_get(BPy_StrokeVertex *self, void *)
static int StrokeVertex_stroke_length_set(BPy_StrokeVertex *self, PyObject *value, void *)
static int StrokeVertex_mathutils_get(BaseMathObject *bmo, int)
static int StrokeVertex_mathutils_set_index(BaseMathObject *bmo, int, int index)
static int StrokeVertex_init(BPy_StrokeVertex *self, PyObject *args, PyObject *kwds)
static PyObject * StrokeVertex_curvilinear_abscissa_get(BPy_StrokeVertex *self, void *)
static PyObject * StrokeVertex_u_get(BPy_StrokeVertex *self, void *)
static int StrokeVertex_mathutils_get_index(BaseMathObject *bmo, int, int index)
static uchar StrokeVertex_mathutils_cb_index
static int StrokeVertex_mathutils_set(BaseMathObject *bmo, int)
void StrokeVertex_mathutils_register_callback()
static PyObject * StrokeVertex_stroke_length_get(BPy_StrokeVertex *self, void *)
static int StrokeVertex_attribute_set(BPy_StrokeVertex *self, PyObject *value, void *)
PyTypeObject StrokeVertex_Type
PyDoc_STRVAR(StrokeVertex_doc, "Class hierarchy: :class:`Interface0D` > :class:`CurvePoint` > :class:`StrokeVertex`\n" "\n" "Class to define a stroke vertex.\n" "\n" ".. method:: __init__()\n" " __init__(brother)\n" " __init__(first_vertex, second_vertex, t3d)\n" " __init__(point)\n" " __init__(svertex)\n" " __init__(svertex, attribute)\n" "\n" " Builds a :class:`StrokeVertex` using the default constructor,\n" " copy constructor, from 2 :class:`StrokeVertex` and an interpolation parameter,\n" " from a CurvePoint, from a SVertex, or a :class:`SVertex`" " and a :class:`StrokeAttribute` object.\n" "\n" " :arg brother: A StrokeVertex object.\n" " :type brother: :class:`StrokeVertex`\n" " :arg first_vertex: The first StrokeVertex.\n" " :type first_vertex: :class:`StrokeVertex`\n" " :arg second_vertex: The second StrokeVertex.\n" " :type second_vertex: :class:`StrokeVertex`\n" " :arg t3d: An interpolation parameter.\n" " :type t3d: float\n" " :arg point: A CurvePoint object.\n" " :type point: :class:`CurvePoint`\n" " :arg svertex: An SVertex object.\n" " :type svertex: :class:`SVertex`\n" " :arg svertex: An SVertex object.\n" " :type svertex: :class:`SVertex`\n" " :arg attribute: A StrokeAttribute object.\n" " :type attribute: :class:`StrokeAttribute`")
#define BPy_StrokeVertex_Check(v)
ATTR_WARN_UNUSED_RESULT const BMVert * v
int mathutils_array_parse(float *array, int array_num_min, int array_num_max, PyObject *value, const char *error_prefix)
uchar Mathutils_RegisterCallback(Mathutils_Callback *cb)
PyObject * Vector_CreatePyObject_cb(PyObject *cb_user, int vec_num, uchar cb_type, uchar cb_subtype)