Changeset View
Changeset View
Standalone View
Standalone View
source/blender/freestyle/intern/python/Interface1D/BPy_Stroke.cpp
| Show First 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | PyDoc_STRVAR(Stroke_doc, | ||||
| "Class hierarchy: :class:`Interface1D` > :class:`Stroke`\n" | "Class hierarchy: :class:`Interface1D` > :class:`Stroke`\n" | ||||
| "\n" | "\n" | ||||
| "Class to define a stroke. A stroke is made of a set of 2D vertices\n" | "Class to define a stroke. A stroke is made of a set of 2D vertices\n" | ||||
| "(:class:`StrokeVertex`), regularly spaced out. This set of vertices\n" | "(:class:`StrokeVertex`), regularly spaced out. This set of vertices\n" | ||||
| "defines the stroke's backbone geometry. Each of these stroke vertices\n" | "defines the stroke's backbone geometry. Each of these stroke vertices\n" | ||||
| "defines the stroke's shape and appearance at this vertex position.\n" | "defines the stroke's shape and appearance at this vertex position.\n" | ||||
| "\n" | "\n" | ||||
| ".. method:: Stroke()\n" | ".. method:: Stroke()\n" | ||||
| " Stroke(brother)\n" | |||||
| "\n" | "\n" | ||||
| " Default constructor\n" | " Creates a :class:`Stroke` using the default constructor or copy constructor\n"); | ||||
| "\n" | |||||
| ".. method:: Stroke(brother)\n" | |||||
| "\n" | |||||
| " Copy constructor"); | |||||
| static int Stroke_init(BPy_Stroke *self, PyObject *args, PyObject *kwds) | static int Stroke_init(BPy_Stroke *self, PyObject *args, PyObject *kwds) | ||||
| { | { | ||||
| static const char *kwlist[] = {"brother", NULL}; | static const char *kwlist[] = {"brother", NULL}; | ||||
| PyObject *brother = 0; | PyObject *brother = 0; | ||||
| if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O!", (char **)kwlist, &Stroke_Type, &brother)) { | if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O!", (char **)kwlist, &Stroke_Type, &brother)) { | ||||
| return -1; | return -1; | ||||
| ▲ Show 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | static PyObject *Stroke_compute_sampling(BPy_Stroke *self, PyObject *args, PyObject *kwds) | ||||
| if (!PyArg_ParseTupleAndKeywords(args, kwds, "i", (char **)kwlist, &i)) { | if (!PyArg_ParseTupleAndKeywords(args, kwds, "i", (char **)kwlist, &i)) { | ||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| return PyFloat_FromDouble(self->s->ComputeSampling(i)); | return PyFloat_FromDouble(self->s->ComputeSampling(i)); | ||||
| } | } | ||||
| PyDoc_STRVAR(Stroke_resample_doc, | PyDoc_STRVAR(Stroke_resample_doc, | ||||
| ".. method:: resample(n)\n" | ".. method:: resample(n)\n" | ||||
| " resample(sampling)\n" | |||||
| "\n" | "\n" | ||||
| " Resamples the stroke so that it eventually has N points. That means\n" | " Resamples the stroke so using one of two methods with the goal\n" | ||||
| " of creating a stroke with fewer points and the same shape.\n" | |||||
| "\n" | |||||
| " :arg n: Resamples the stroke so that it eventually has N points. That means\n" | |||||
| " it is going to add N-vertices_size, where vertices_size is the\n" | " it is going to add N-vertices_size, where vertices_size is the\n" | ||||
| " number of points we already have. If vertices_size >= N, no\n" | " number of points we already have. If vertices_size >= N, no\n" | ||||
| " resampling is done.\n" | " resampling is done.\n" | ||||
| "\n" | |||||
| " :arg n: The number of vertices we eventually want in our stroke.\n" | |||||
| " :type n: int\n" | " :type n: int\n" | ||||
| "\n" | " :arg sampling: Resamples the stroke with a given sampling value. If the\n" | ||||
| ".. method:: resample(sampling)\n" | " sampling is smaller than the actual sampling value, no resampling is done.\n" | ||||
| "\n" | |||||
| " Resamples the stroke with a given sampling. If the sampling is\n" | |||||
| " smaller than the actual sampling value, no resampling is done.\n" | |||||
| "\n" | |||||
| " :arg sampling: The new sampling value.\n" | |||||
| " :type sampling: float"); | " :type sampling: float"); | ||||
| static PyObject *Stroke_resample(BPy_Stroke *self, PyObject *args, PyObject *kwds) | static PyObject *Stroke_resample(BPy_Stroke *self, PyObject *args, PyObject *kwds) | ||||
| { | { | ||||
| static const char *kwlist_1[] = {"n", NULL}; | static const char *kwlist_1[] = {"n", NULL}; | ||||
| static const char *kwlist_2[] = {"sampling", NULL}; | static const char *kwlist_2[] = {"sampling", NULL}; | ||||
| int i; | int i; | ||||
| float f; | float f; | ||||
| ▲ Show 20 Lines • Show All 397 Lines • Show Last 20 Lines | |||||