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`\n");
59 static const char *kwlist_1[] = {
"brother",
nullptr};
60 static const char *kwlist_2[] = {
"first_vertex",
"second_vertex",
"t3d",
nullptr};
61 static const char *kwlist_3[] = {
"point",
nullptr};
62 static const char *kwlist_4[] = {
"svertex",
"attribute",
nullptr};
63 PyObject *obj1 =
nullptr, *obj2 =
nullptr;
66 if (PyArg_ParseTupleAndKeywords(args, kwds,
"|O!", (
char **)kwlist_1, &
StrokeVertex_Type, &obj1))
73 PyErr_SetString(PyExc_TypeError,
"argument 1 is an invalid StrokeVertex object");
79 else if ((
void)PyErr_Clear(),
80 PyArg_ParseTupleAndKeywords(args,
92 if (!sv1 || (sv1->
A() ==
nullptr && sv1->
B() ==
nullptr)) {
93 PyErr_SetString(PyExc_TypeError,
"argument 1 is an invalid StrokeVertex object");
96 if (!sv2 || (sv2->
A() ==
nullptr && sv2->
B() ==
nullptr)) {
97 PyErr_SetString(PyExc_TypeError,
"argument 2 is an invalid StrokeVertex object");
102 else if ((
void)PyErr_Clear(),
103 PyArg_ParseTupleAndKeywords(
107 if (!cp || cp->
A() ==
nullptr || cp->
B() ==
nullptr) {
108 PyErr_SetString(PyExc_TypeError,
"argument 1 is an invalid CurvePoint object");
113 else if ((
void)PyErr_Clear(),
114 (
void)(obj2 =
nullptr),
115 PyArg_ParseTupleAndKeywords(args,
132 PyErr_SetString(PyExc_TypeError,
"invalid argument(s)");
136 self->py_cp.py_if0D.if0D =
self->sv;
137 self->py_cp.py_if0D.borrowed =
false;
221 StrokeVertex_attribute_doc,
222 "StrokeAttribute for this StrokeVertex.\n"
224 ":type: :class:`StrokeAttribute`\n");
233 PyErr_SetString(PyExc_TypeError,
"value must be a StrokeAttribute object");
242 StrokeVertex_curvilinear_abscissa_doc,
243 "Curvilinear abscissa of this StrokeVertex in the Stroke.\n"
248 return PyFloat_FromDouble(
self->sv->curvilinearAbscissa());
256 if ((scalar = PyFloat_AsDouble(value)) == -1.0f && PyErr_Occurred()) {
258 PyErr_SetString(PyExc_TypeError,
"value must be a number");
261 self->sv->setCurvilinearAbscissa(scalar);
267 StrokeVertex_point_doc,
268 "2D point coordinates.\n"
270 ":type: :class:`mathutils.Vector`\n");
282 self->sv->setX(
v[0]);
283 self->sv->setY(
v[1]);
289 StrokeVertex_stroke_length_doc,
290 "Stroke length (it is only a value retained by the StrokeVertex,\n"
291 "and it won't change the real stroke length).\n"
296 return PyFloat_FromDouble(
self->sv->strokeLength());
304 if ((scalar = PyFloat_AsDouble(value)) == -1.0f && PyErr_Occurred()) {
306 PyErr_SetString(PyExc_TypeError,
"value must be a number");
309 self->sv->setStrokeLength(scalar);
316 "Curvilinear abscissa of this StrokeVertex in the Stroke.\n"
321 return PyFloat_FromDouble(
self->sv->u());
328 StrokeVertex_attribute_doc,
330 {
"curvilinear_abscissa",
333 StrokeVertex_curvilinear_abscissa_doc,
338 StrokeVertex_point_doc,
343 StrokeVertex_stroke_length_doc,
346 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
352 PyVarObject_HEAD_INIT(
nullptr, 0)
371 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)
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`\n")
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
#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)