Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2010-04-18 03:47:47 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2010-04-18 03:47:47 +0400
commitd7e08f2d33207fdf76b1b597ef0de9dec26e3987 (patch)
treeb310235b1d441e160c50bbfb7eceadb090694339 /source/blender/freestyle/intern/python/Interface1D
parent11fc330f7ecfcb60bac3e29a83016ec7dfb85182 (diff)
Major documentation updates. The original Freestyle API reference
(http://freestyle.sourceforge.net/doc/html/index.html) has been incorporated into the Blender/Freestyle Python API implementation in the form of Sphinx-based embedded docstrings. Some C++-specific descriptions of classes and functions were revised so that they are suitable for Python programmers. Missing docstrings were filled, and sparse descriptions were extended. By means of the new documentation system for Blender, an up-to-date Freestyle Python API reference will be part of the Blender 2.5 documentation.
Diffstat (limited to 'source/blender/freestyle/intern/python/Interface1D')
-rw-r--r--source/blender/freestyle/intern/python/Interface1D/BPy_FEdge.cpp326
-rw-r--r--source/blender/freestyle/intern/python/Interface1D/BPy_FrsCurve.cpp178
-rw-r--r--source/blender/freestyle/intern/python/Interface1D/BPy_Stroke.cpp399
-rw-r--r--source/blender/freestyle/intern/python/Interface1D/BPy_ViewEdge.cpp376
-rw-r--r--source/blender/freestyle/intern/python/Interface1D/Curve/BPy_Chain.cpp148
-rw-r--r--source/blender/freestyle/intern/python/Interface1D/FEdge/BPy_FEdgeSharp.cpp270
-rw-r--r--source/blender/freestyle/intern/python/Interface1D/FEdge/BPy_FEdgeSmooth.cpp193
7 files changed, 1278 insertions, 612 deletions
diff --git a/source/blender/freestyle/intern/python/Interface1D/BPy_FEdge.cpp b/source/blender/freestyle/intern/python/Interface1D/BPy_FEdge.cpp
index 266c420f241..5e4f9257afb 100644
--- a/source/blender/freestyle/intern/python/Interface1D/BPy_FEdge.cpp
+++ b/source/blender/freestyle/intern/python/Interface1D/BPy_FEdge.cpp
@@ -12,92 +12,40 @@ extern "C" {
///////////////////////////////////////////////////////////////////////////////////////////
-/*--------------- Python API function prototypes for FEdge instance -----------*/
-static int FEdge___init__(BPy_FEdge *self, PyObject *args, PyObject *kwds);
-static PyObject * FEdge___copy__( BPy_FEdge *self );
-static PyObject * FEdge_vertexA( BPy_FEdge *self );
-static PyObject * FEdge_vertexB( BPy_FEdge *self );
-static PyObject * FEdge___getitem__( BPy_FEdge *self, PyObject *args );
-static PyObject * FEdge_nextEdge( BPy_FEdge *self );
-static PyObject * FEdge_previousEdge( BPy_FEdge *self );
-static PyObject * FEdge_viewedge( BPy_FEdge *self );
-static PyObject * FEdge_isSmooth( BPy_FEdge *self );
-static PyObject * FEdge_setVertexA( BPy_FEdge *self , PyObject *args);
-static PyObject * FEdge_setVertexB( BPy_FEdge *self , PyObject *args);
-static PyObject * FEdge_setId( BPy_FEdge *self , PyObject *args);
-static PyObject * FEdge_setNextEdge( BPy_FEdge *self , PyObject *args);
-static PyObject * FEdge_setPreviousEdge( BPy_FEdge *self , PyObject *args);
-static PyObject * FEdge_setSmooth( BPy_FEdge *self , PyObject *args);
-static PyObject * FEdge_setNature( BPy_FEdge *self, PyObject *args );
-static PyObject * FEdge_setViewEdge( BPy_FEdge *self, PyObject *args );
-
-/*----------------------FEdge instance definitions ----------------------------*/
-static PyMethodDef BPy_FEdge_methods[] = {
- {"__copy__", ( PyCFunction ) FEdge___copy__, METH_NOARGS, "() Cloning method."},
- {"vertexA", ( PyCFunction ) FEdge_vertexA, METH_NOARGS, "() Returns the first SVertex."},
- {"vertexB", ( PyCFunction ) FEdge_vertexB, METH_NOARGS, "() Returns the second SVertex."},
- {"__getitem__", ( PyCFunction ) FEdge___getitem__, METH_VARARGS, "(int i) Returns the first SVertex if i=0, the seccond SVertex if i=1."},
- {"nextEdge", ( PyCFunction ) FEdge_nextEdge, METH_NOARGS, "() Returns the FEdge following this one in the ViewEdge. If this FEdge is the last of the ViewEdge, 0 is returned."},
- {"previousEdge", ( PyCFunction ) FEdge_previousEdge, METH_NOARGS, "Returns the Edge preceding this one in the ViewEdge. If this FEdge is the first one of the ViewEdge, 0 is returned."},
- {"viewedge", ( PyCFunction ) FEdge_viewedge, METH_NOARGS, "Returns a pointer to the ViewEdge to which this FEdge belongs to."},
- {"isSmooth", ( PyCFunction ) FEdge_isSmooth, METH_NOARGS, "() Returns true if this FEdge is a smooth FEdge."},
- {"setVertexA", ( PyCFunction ) FEdge_setVertexA, METH_VARARGS, "(SVertex v) Sets the first SVertex. ."},
- {"setVertexB", ( PyCFunction ) FEdge_setVertexB, METH_VARARGS, "(SVertex v) Sets the second SVertex. "},
- {"setId", ( PyCFunction ) FEdge_setId, METH_VARARGS, "(Id id) Sets the FEdge Id ."},
- {"setNextEdge", ( PyCFunction ) FEdge_setNextEdge, METH_VARARGS, "(FEdge e) Sets the pointer to the next FEdge. "},
- {"setPreviousEdge", ( PyCFunction ) FEdge_setPreviousEdge, METH_VARARGS, "(FEdge e) Sets the pointer to the previous FEdge. "},
- {"setSmooth", ( PyCFunction ) FEdge_setSmooth, METH_VARARGS, "(bool b) Sets the flag telling whether this FEdge is smooth or sharp. true for Smooth, false for Sharp. "},
- {"setViewEdge", ( PyCFunction ) FEdge_setViewEdge, METH_VARARGS, "(ViewEdge ve) Sets the ViewEdge to which this FEdge belongs to."},
- {"setNature", ( PyCFunction ) FEdge_setNature, METH_VARARGS, "(Nature n) Sets the nature of this FEdge. "},
- {NULL, NULL, 0, NULL}
-};
-
-/*-----------------------BPy_FEdge type definition ------------------------------*/
-
-PyTypeObject FEdge_Type = {
- PyVarObject_HEAD_INIT(NULL, 0)
- "FEdge", /* tp_name */
- sizeof(BPy_FEdge), /* tp_basicsize */
- 0, /* tp_itemsize */
- 0, /* tp_dealloc */
- 0, /* tp_print */
- 0, /* tp_getattr */
- 0, /* tp_setattr */
- 0, /* tp_reserved */
- 0, /* tp_repr */
- 0, /* tp_as_number */
- 0, /* tp_as_sequence */
- 0, /* tp_as_mapping */
- 0, /* tp_hash */
- 0, /* tp_call */
- 0, /* tp_str */
- 0, /* tp_getattro */
- 0, /* tp_setattro */
- 0, /* tp_as_buffer */
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
- "FEdge objects", /* tp_doc */
- 0, /* tp_traverse */
- 0, /* tp_clear */
- 0, /* tp_richcompare */
- 0, /* tp_weaklistoffset */
- 0, /* tp_iter */
- 0, /* tp_iternext */
- BPy_FEdge_methods, /* tp_methods */
- 0, /* tp_members */
- 0, /* tp_getset */
- &Interface1D_Type, /* tp_base */
- 0, /* tp_dict */
- 0, /* tp_descr_get */
- 0, /* tp_descr_set */
- 0, /* tp_dictoffset */
- (initproc)FEdge___init__, /* tp_init */
- 0, /* tp_alloc */
- 0, /* tp_new */
-};
-
//------------------------INSTANCE METHODS ----------------------------------
-int FEdge___init__(BPy_FEdge *self, PyObject *args, PyObject *kwds)
+static char FEdge___doc__[] =
+"Base Class for feature edges. This FEdge can represent a silhouette,\n"
+"a crease, a ridge/valley, a border or a suggestive contour. For\n"
+"silhouettes, the FEdge is oriented so that the visible face lies on\n"
+"the left of the edge. For borders, the FEdge is oriented so that the\n"
+"face lies on the left of the edge. An FEdge can represent an initial\n"
+"edge of the mesh or runs accross a face of the initial mesh depending\n"
+"on the smoothness or sharpness of the mesh. This class is specialized\n"
+"into a smooth and a sharp version since their properties slightly vary\n"
+"from one to the other.\n"
+"\n"
+".. method:: FEdge()\n"
+"\n"
+" Default constructor.\n"
+"\n"
+".. method:: FEdge(iBrother)\n"
+"\n"
+" Copy constructor.\n"
+"\n"
+" :arg iBrother: An FEdge object.\n"
+" :type iBrother: :class:`FEdge`\n"
+"\n"
+".. method:: FEdge(vA, vB)\n"
+"\n"
+" Builds an FEdge going from vA to vB.\n"
+"\n"
+" :arg vA: The first SVertex.\n"
+" :type vA: :class:`SVertex`\n"
+" :arg vB: The second SVertex.\n"
+" :type vB: :class:`SVertex`\n";
+
+static int FEdge___init__(BPy_FEdge *self, PyObject *args, PyObject *kwds)
{
PyObject *obj1 = 0, *obj2 = 0;
@@ -125,7 +73,7 @@ int FEdge___init__(BPy_FEdge *self, PyObject *args, PyObject *kwds)
}
-PyObject * FEdge___copy__( BPy_FEdge *self ) {
+static PyObject * FEdge___copy__( BPy_FEdge *self ) {
BPy_FEdge *py_fe;
py_fe = (BPy_FEdge *) FEdge_Type.tp_new( &FEdge_Type, 0, 0 );
@@ -137,7 +85,15 @@ PyObject * FEdge___copy__( BPy_FEdge *self ) {
return (PyObject *) py_fe;
}
-PyObject * FEdge_vertexA( BPy_FEdge *self ) {
+static char FEdge_vertexA___doc__[] =
+".. method:: vertexA()\n"
+"\n"
+" Returns the first SVertex.\n"
+"\n"
+" :return: The first SVertex.\n"
+" :rtype: :class:`SVertex`\n";
+
+static PyObject * FEdge_vertexA( BPy_FEdge *self ) {
SVertex *A = self->fe->vertexA();
if( A ){
return BPy_SVertex_from_SVertex( *A );
@@ -146,7 +102,15 @@ PyObject * FEdge_vertexA( BPy_FEdge *self ) {
Py_RETURN_NONE;
}
-PyObject * FEdge_vertexB( BPy_FEdge *self ) {
+static char FEdge_vertexB___doc__[] =
+".. method:: vertexB()\n"
+"\n"
+" Returns the second SVertex.\n"
+"\n"
+" :return: The second SVertex.\n"
+" :rtype: :class:`SVertex`\n";
+
+static PyObject * FEdge_vertexB( BPy_FEdge *self ) {
SVertex *B = self->fe->vertexB();
if( B ){
return BPy_SVertex_from_SVertex( *B );
@@ -156,7 +120,7 @@ PyObject * FEdge_vertexB( BPy_FEdge *self ) {
}
-PyObject * FEdge___getitem__( BPy_FEdge *self, PyObject *args ) {
+static PyObject * FEdge___getitem__( BPy_FEdge *self, PyObject *args ) {
int i;
if(!( PyArg_ParseTuple(args, "i", &i) ))
@@ -173,7 +137,16 @@ PyObject * FEdge___getitem__( BPy_FEdge *self, PyObject *args ) {
Py_RETURN_NONE;
}
-PyObject * FEdge_nextEdge( BPy_FEdge *self ) {
+static char FEdge_nextEdge___doc__[] =
+".. method:: nextEdge()\n"
+"\n"
+" Returns the FEdge following this one in the ViewEdge. If this FEdge\n"
+" is the last of the ViewEdge, None is returned.\n"
+"\n"
+" :return: The edge following this one in the ViewEdge.\n"
+" :rtype: :class:`FEdge`\n";
+
+static PyObject * FEdge_nextEdge( BPy_FEdge *self ) {
FEdge *fe = self->fe->nextEdge();
if( fe )
return Any_BPy_FEdge_from_FEdge( *fe );
@@ -181,7 +154,16 @@ PyObject * FEdge_nextEdge( BPy_FEdge *self ) {
Py_RETURN_NONE;
}
-PyObject * FEdge_previousEdge( BPy_FEdge *self ) {
+static char FEdge_previousEdge___doc__[] =
+".. method:: previousEdge()\n"
+"\n"
+" Returns the FEdge preceding this one in the ViewEdge. If this FEdge\n"
+" is the first one of the ViewEdge, None is returned.\n"
+"\n"
+" :return: The edge preceding this one in the ViewEdge.\n"
+" :rtype: :class:`FEdge`\n";
+
+static PyObject * FEdge_previousEdge( BPy_FEdge *self ) {
FEdge *fe = self->fe->previousEdge();
if( fe )
return Any_BPy_FEdge_from_FEdge( *fe );
@@ -189,7 +171,15 @@ PyObject * FEdge_previousEdge( BPy_FEdge *self ) {
Py_RETURN_NONE;
}
-PyObject * FEdge_viewedge( BPy_FEdge *self ) {
+static char FEdge_viewedge___doc__[] =
+".. method:: viewedge()\n"
+"\n"
+" Returns the ViewEdge to which this FEdge belongs to.\n"
+"\n"
+" :return: The ViewEdge to which this FEdge belongs to.\n"
+" :rtype: :class:`ViewEdge`\n";
+
+static PyObject * FEdge_viewedge( BPy_FEdge *self ) {
ViewEdge *ve = self->fe->viewedge();
if( ve )
return BPy_ViewEdge_from_ViewEdge( *ve );
@@ -197,11 +187,27 @@ PyObject * FEdge_viewedge( BPy_FEdge *self ) {
Py_RETURN_NONE;
}
-PyObject * FEdge_isSmooth( BPy_FEdge *self ) {
+static char FEdge_isSmooth___doc__[] =
+".. method:: isSmooth()\n"
+"\n"
+" Returns true if this FEdge is a smooth FEdge.\n"
+"\n"
+" :return: True if this FEdge is a smooth FEdge.\n"
+" :rtype: bool\n";
+
+static PyObject * FEdge_isSmooth( BPy_FEdge *self ) {
return PyBool_from_bool( self->fe->isSmooth() );
}
-PyObject *FEdge_setVertexA( BPy_FEdge *self , PyObject *args) {
+static char FEdge_setVertexA___doc__[] =
+".. method:: setVertexA(vA)\n"
+"\n"
+" Sets the first SVertex.\n"
+"\n"
+" :arg vA: An SVertex object.\n"
+" :type vA: :class:`SVertex`\n";
+
+static PyObject *FEdge_setVertexA( BPy_FEdge *self , PyObject *args) {
PyObject *py_sv;
if(!( PyArg_ParseTuple(args, "O!", &SVertex_Type, &py_sv) ))
@@ -212,7 +218,15 @@ PyObject *FEdge_setVertexA( BPy_FEdge *self , PyObject *args) {
Py_RETURN_NONE;
}
-PyObject *FEdge_setVertexB( BPy_FEdge *self , PyObject *args) {
+static char FEdge_setVertexB___doc__[] =
+".. method:: setVertexB(vB)\n"
+"\n"
+" Sets the second SVertex.\n"
+"\n"
+" :arg vB: An SVertex object.\n"
+" :type vB: :class:`SVertex`\n";
+
+static PyObject *FEdge_setVertexB( BPy_FEdge *self , PyObject *args) {
PyObject *py_sv;
if(!( PyArg_ParseTuple(args, "O", &py_sv) && BPy_SVertex_Check(py_sv) )) {
@@ -225,7 +239,15 @@ PyObject *FEdge_setVertexB( BPy_FEdge *self , PyObject *args) {
Py_RETURN_NONE;
}
-PyObject *FEdge_setId( BPy_FEdge *self , PyObject *args) {
+static char FEdge_setId___doc__[] =
+".. method:: setId(id)\n"
+"\n"
+" Sets the Id of this FEdge.\n"
+"\n"
+" :arg id: An Id object.\n"
+" :type id: :class:`Id`\n";
+
+static PyObject *FEdge_setId( BPy_FEdge *self , PyObject *args) {
PyObject *py_id;
if(!( PyArg_ParseTuple(args, "O!", &Id_Type, &py_id) ))
@@ -236,8 +258,15 @@ PyObject *FEdge_setId( BPy_FEdge *self , PyObject *args) {
Py_RETURN_NONE;
}
+static char FEdge_setNextEdge___doc__[] =
+".. method:: setNextEdge(iEdge)\n"
+"\n"
+" Sets the pointer to the next FEdge.\n"
+"\n"
+" :arg iEdge: An FEdge object.\n"
+" :type iEdge: :class:`FEdge`\n";
-PyObject *FEdge_setNextEdge( BPy_FEdge *self , PyObject *args) {
+static PyObject *FEdge_setNextEdge( BPy_FEdge *self , PyObject *args) {
PyObject *py_fe;
if(!( PyArg_ParseTuple(args, "O!", &FEdge_Type, &py_fe) ))
@@ -248,7 +277,15 @@ PyObject *FEdge_setNextEdge( BPy_FEdge *self , PyObject *args) {
Py_RETURN_NONE;
}
-PyObject *FEdge_setPreviousEdge( BPy_FEdge *self , PyObject *args) {
+static char FEdge_setPreviousEdge___doc__[] =
+".. method:: setPreviousEdge(iEdge)\n"
+"\n"
+" Sets the pointer to the previous FEdge.\n"
+"\n"
+" :arg iEdge: An FEdge object.\n"
+" :type iEdge: :class:`FEdge`\n";
+
+static PyObject *FEdge_setPreviousEdge( BPy_FEdge *self , PyObject *args) {
PyObject *py_fe;
if(!( PyArg_ParseTuple(args, "O!", &FEdge_Type, &py_fe) ))
@@ -259,7 +296,15 @@ PyObject *FEdge_setPreviousEdge( BPy_FEdge *self , PyObject *args) {
Py_RETURN_NONE;
}
-PyObject * FEdge_setNature( BPy_FEdge *self, PyObject *args ) {
+static char FEdge_setNature___doc__[] =
+".. method:: setNature(iNature)\n"
+"\n"
+" Sets the nature of this FEdge.\n"
+"\n"
+" :arg iNature: A Nature object.\n"
+" :type iNature: :class:`Nature`\n";
+
+static PyObject * FEdge_setNature( BPy_FEdge *self, PyObject *args ) {
PyObject *py_n;
if(!( PyArg_ParseTuple(args, "O!", &Nature_Type, &py_n) ))
@@ -271,8 +316,15 @@ PyObject * FEdge_setNature( BPy_FEdge *self, PyObject *args ) {
Py_RETURN_NONE;
}
+static char FEdge_setViewEdge___doc__[] =
+".. method:: setViewEdge(iViewEdge)\n"
+"\n"
+" Sets the ViewEdge to which this FEdge belongs to.\n"
+"\n"
+" :arg iViewEdge: A ViewEdge object.\n"
+" :type iViewEdge: :class:`ViewEdge`\n";
-PyObject * FEdge_setViewEdge( BPy_FEdge *self, PyObject *args ) {
+static PyObject * FEdge_setViewEdge( BPy_FEdge *self, PyObject *args ) {
PyObject *py_ve;
if(!( PyArg_ParseTuple(args, "O!", &ViewEdge_Type, &py_ve) ))
@@ -284,9 +336,16 @@ PyObject * FEdge_setViewEdge( BPy_FEdge *self, PyObject *args ) {
Py_RETURN_NONE;
}
+static char FEdge_setSmooth___doc__[] =
+".. method:: setSmooth(iFlag)\n"
+"\n"
+" Sets the flag telling whether this FEdge is smooth or sharp. True\n"
+" for Smooth, false for Sharp.\n"
+"\n"
+" :arg iFlag: True for Smooth, false for Sharp.\n"
+" :type iFlag: bool\n";
-
-PyObject *FEdge_setSmooth( BPy_FEdge *self , PyObject *args) {
+static PyObject *FEdge_setSmooth( BPy_FEdge *self , PyObject *args) {
PyObject *py_b;
if(!( PyArg_ParseTuple(args, "O", &py_b) ))
@@ -297,6 +356,71 @@ PyObject *FEdge_setSmooth( BPy_FEdge *self , PyObject *args) {
Py_RETURN_NONE;
}
+/*----------------------FEdge instance definitions ----------------------------*/
+
+static PyMethodDef BPy_FEdge_methods[] = {
+ {"__copy__", ( PyCFunction ) FEdge___copy__, METH_NOARGS, "() Cloning method."},
+ {"vertexA", ( PyCFunction ) FEdge_vertexA, METH_NOARGS, FEdge_vertexA___doc__},
+ {"vertexB", ( PyCFunction ) FEdge_vertexB, METH_NOARGS, FEdge_vertexB___doc__},
+ {"__getitem__", ( PyCFunction ) FEdge___getitem__, METH_VARARGS, "(int i) Returns the first SVertex if i=0, the seccond SVertex if i=1."},
+ {"nextEdge", ( PyCFunction ) FEdge_nextEdge, METH_NOARGS, FEdge_nextEdge___doc__},
+ {"previousEdge", ( PyCFunction ) FEdge_previousEdge, METH_NOARGS, FEdge_previousEdge___doc__},
+ {"viewedge", ( PyCFunction ) FEdge_viewedge, METH_NOARGS, FEdge_viewedge___doc__},
+ {"isSmooth", ( PyCFunction ) FEdge_isSmooth, METH_NOARGS, FEdge_isSmooth___doc__},
+ {"setVertexA", ( PyCFunction ) FEdge_setVertexA, METH_VARARGS, FEdge_setVertexA___doc__},
+ {"setVertexB", ( PyCFunction ) FEdge_setVertexB, METH_VARARGS, FEdge_setVertexB___doc__},
+ {"setId", ( PyCFunction ) FEdge_setId, METH_VARARGS, FEdge_setId___doc__},
+ {"setNextEdge", ( PyCFunction ) FEdge_setNextEdge, METH_VARARGS, FEdge_setNextEdge___doc__},
+ {"setPreviousEdge", ( PyCFunction ) FEdge_setPreviousEdge, METH_VARARGS, FEdge_setPreviousEdge___doc__},
+ {"setSmooth", ( PyCFunction ) FEdge_setSmooth, METH_VARARGS, FEdge_setSmooth___doc__},
+ {"setViewEdge", ( PyCFunction ) FEdge_setViewEdge, METH_VARARGS, FEdge_setViewEdge___doc__},
+ {"setNature", ( PyCFunction ) FEdge_setNature, METH_VARARGS, FEdge_setNature___doc__},
+ {NULL, NULL, 0, NULL}
+};
+
+/*-----------------------BPy_FEdge type definition ------------------------------*/
+
+PyTypeObject FEdge_Type = {
+ PyVarObject_HEAD_INIT(NULL, 0)
+ "FEdge", /* tp_name */
+ sizeof(BPy_FEdge), /* tp_basicsize */
+ 0, /* tp_itemsize */
+ 0, /* tp_dealloc */
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_reserved */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
+ FEdge___doc__, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ BPy_FEdge_methods, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ &Interface1D_Type, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ (initproc)FEdge___init__, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+};
+
///////////////////////////////////////////////////////////////////////////////////////////
#ifdef __cplusplus
diff --git a/source/blender/freestyle/intern/python/Interface1D/BPy_FrsCurve.cpp b/source/blender/freestyle/intern/python/Interface1D/BPy_FrsCurve.cpp
index ef9cd8bfebd..1ec9e3efc53 100644
--- a/source/blender/freestyle/intern/python/Interface1D/BPy_FrsCurve.cpp
+++ b/source/blender/freestyle/intern/python/Interface1D/BPy_FrsCurve.cpp
@@ -11,68 +11,32 @@ extern "C" {
///////////////////////////////////////////////////////////////////////////////////////////
-/*--------------- Python API function prototypes for FrsCurve instance -----------*/
-static int FrsCurve___init__(BPy_FrsCurve *self, PyObject *args, PyObject *kwds);
-static PyObject * FrsCurve_push_vertex_back( BPy_FrsCurve *self, PyObject *args );
-static PyObject * FrsCurve_push_vertex_front( BPy_FrsCurve *self, PyObject *args );
-static PyObject * FrsCurve_empty( BPy_FrsCurve *self );
-static PyObject * FrsCurve_nSegments( BPy_FrsCurve *self );
-
-/*----------------------FrsCurve instance definitions ----------------------------*/
-static PyMethodDef BPy_FrsCurve_methods[] = {
- {"push_vertex_back", ( PyCFunction ) FrsCurve_push_vertex_back, METH_VARARGS, "(CurvePoint cp | SVertex sv) Adds a single vertex at the front of the Curve."},
- {"push_vertex_front", ( PyCFunction ) FrsCurve_push_vertex_front, METH_VARARGS, "(CurvePoint cp | SVertex sv) Adds a single vertex at the end of the Curve."},
- {"empty", ( PyCFunction ) FrsCurve_empty, METH_NOARGS, "() Returns true is the Curve doesn't have any Vertex yet."},
- {"nSegments", ( PyCFunction ) FrsCurve_nSegments, METH_NOARGS, "() Returns the number of segments in the oplyline constituing the Curve."},
- {NULL, NULL, 0, NULL}
-};
-
-/*-----------------------BPy_FrsCurve type definition ------------------------------*/
-
-PyTypeObject FrsCurve_Type = {
- PyVarObject_HEAD_INIT(NULL, 0)
- "FrsCurve", /* tp_name */
- sizeof(BPy_FrsCurve), /* tp_basicsize */
- 0, /* tp_itemsize */
- 0, /* tp_dealloc */
- 0, /* tp_print */
- 0, /* tp_getattr */
- 0, /* tp_setattr */
- 0, /* tp_reserved */
- 0, /* tp_repr */
- 0, /* tp_as_number */
- 0, /* tp_as_sequence */
- 0, /* tp_as_mapping */
- 0, /* tp_hash */
- 0, /* tp_call */
- 0, /* tp_str */
- 0, /* tp_getattro */
- 0, /* tp_setattro */
- 0, /* tp_as_buffer */
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
- "FrsCurve objects", /* tp_doc */
- 0, /* tp_traverse */
- 0, /* tp_clear */
- 0, /* tp_richcompare */
- 0, /* tp_weaklistoffset */
- 0, /* tp_iter */
- 0, /* tp_iternext */
- BPy_FrsCurve_methods, /* tp_methods */
- 0, /* tp_members */
- 0, /* tp_getset */
- &Interface1D_Type, /* tp_base */
- 0, /* tp_dict */
- 0, /* tp_descr_get */
- 0, /* tp_descr_set */
- 0, /* tp_dictoffset */
- (initproc)FrsCurve___init__, /* tp_init */
- 0, /* tp_alloc */
- 0, /* tp_new */
-};
-
//------------------------INSTANCE METHODS ----------------------------------
-
-int FrsCurve___init__(BPy_FrsCurve *self, PyObject *args, PyObject *kwds)
+
+static char FrsCurve___doc__[] =
+"Base class for curves made of CurvePoints. :class:`SVertex` is the\n"
+"type of the initial curve vertices. A :class:`Chain` is a\n"
+"specialization of a Curve.\n"
+"\n"
+".. method:: __init__()\n"
+"\n"
+" Default Constructor.\n"
+"\n"
+".. method:: __init__(iBrother)\n"
+"\n"
+" Copy Constructor.\n"
+"\n"
+" :arg iBrother: A FrsCurve object.\n"
+" :type iBrother: :class:`FrsCurve`\n"
+"\n"
+".. method:: __init__(iId)\n"
+"\n"
+" Builds a FrsCurve from its Id.\n"
+"\n"
+" :arg iId: An Id object.\n"
+" :type iId: :class:`Id`\n";
+
+static int FrsCurve___init__(BPy_FrsCurve *self, PyObject *args, PyObject *kwds)
{
PyObject *obj = 0;
@@ -100,8 +64,15 @@ int FrsCurve___init__(BPy_FrsCurve *self, PyObject *args, PyObject *kwds)
return 0;
}
+static char FrsCurve_push_vertex_back___doc__[] =
+".. method:: push_vertex_back(iVertex)\n"
+"\n"
+" Adds a single vertex at the end of the FrsCurve.\n"
+"\n"
+" :arg iVertex: A vertex object.\n"
+" :type iVertex: :class:`SVertex` or :class:`CurvePoint`\n";
-PyObject * FrsCurve_push_vertex_back( BPy_FrsCurve *self, PyObject *args ) {
+static PyObject * FrsCurve_push_vertex_back( BPy_FrsCurve *self, PyObject *args ) {
PyObject *obj;
if(!( PyArg_ParseTuple(args, "O", &obj) ))
@@ -119,7 +90,15 @@ PyObject * FrsCurve_push_vertex_back( BPy_FrsCurve *self, PyObject *args ) {
Py_RETURN_NONE;
}
-PyObject * FrsCurve_push_vertex_front( BPy_FrsCurve *self, PyObject *args ) {
+static char FrsCurve_push_vertex_front___doc__[] =
+".. method:: push_vertex_front(iVertex)\n"
+"\n"
+" Adds a single vertex at the front of the FrsCurve.\n"
+"\n"
+" :arg iVertex: A vertex object.\n"
+" :type iVertex: :class:`SVertex` or :class:`CurvePoint`\n";
+
+static PyObject * FrsCurve_push_vertex_front( BPy_FrsCurve *self, PyObject *args ) {
PyObject *obj;
if(!( PyArg_ParseTuple(args, "O", &obj) ))
@@ -137,14 +116,83 @@ PyObject * FrsCurve_push_vertex_front( BPy_FrsCurve *self, PyObject *args ) {
Py_RETURN_NONE;
}
-PyObject * FrsCurve_empty( BPy_FrsCurve *self ) {
+static char FrsCurve_empty___doc__[] =
+".. method:: empty()\n"
+"\n"
+" Returns true if the FrsCurve doesn't have any Vertex yet.\n"
+"\n"
+" :return: True if the FrsCurve has no vertices.\n"
+" :rtype: bool\n";
+
+static PyObject * FrsCurve_empty( BPy_FrsCurve *self ) {
return PyBool_from_bool( self->c->empty() );
}
-PyObject * FrsCurve_nSegments( BPy_FrsCurve *self ) {
+static char FrsCurve_nSegments___doc__[] =
+".. method:: nSegments()\n"
+"\n"
+" Returns the number of segments in the polyline constituing the\n"
+" FrsCurve.\n"
+"\n"
+" :return: The number of segments.\n"
+" :rtype: int\n";
+
+static PyObject * FrsCurve_nSegments( BPy_FrsCurve *self ) {
return PyLong_FromLong( self->c->nSegments() );
}
+/*----------------------FrsCurve instance definitions ----------------------------*/
+static PyMethodDef BPy_FrsCurve_methods[] = {
+ {"push_vertex_back", ( PyCFunction ) FrsCurve_push_vertex_back, METH_VARARGS, FrsCurve_push_vertex_back___doc__},
+ {"push_vertex_front", ( PyCFunction ) FrsCurve_push_vertex_front, METH_VARARGS, FrsCurve_push_vertex_front___doc__},
+ {"empty", ( PyCFunction ) FrsCurve_empty, METH_NOARGS, FrsCurve_empty___doc__},
+ {"nSegments", ( PyCFunction ) FrsCurve_nSegments, METH_NOARGS, FrsCurve_nSegments___doc__},
+ {NULL, NULL, 0, NULL}
+};
+
+/*-----------------------BPy_FrsCurve type definition ------------------------------*/
+
+PyTypeObject FrsCurve_Type = {
+ PyVarObject_HEAD_INIT(NULL, 0)
+ "FrsCurve", /* tp_name */
+ sizeof(BPy_FrsCurve), /* tp_basicsize */
+ 0, /* tp_itemsize */
+ 0, /* tp_dealloc */
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_reserved */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
+ FrsCurve___doc__, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ BPy_FrsCurve_methods, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ &Interface1D_Type, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ (initproc)FrsCurve___init__, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+};
+
///////////////////////////////////////////////////////////////////////////////////////////
#ifdef __cplusplus
diff --git a/source/blender/freestyle/intern/python/Interface1D/BPy_Stroke.cpp b/source/blender/freestyle/intern/python/Interface1D/BPy_Stroke.cpp
index 8f88ee1f1f9..4edcc52fabf 100644
--- a/source/blender/freestyle/intern/python/Interface1D/BPy_Stroke.cpp
+++ b/source/blender/freestyle/intern/python/Interface1D/BPy_Stroke.cpp
@@ -13,107 +13,6 @@ extern "C" {
///////////////////////////////////////////////////////////////////////////////////////////
-/*--------------- Python API function prototypes for Stroke instance -----------*/
-static int Stroke___init__(BPy_Stroke *self, PyObject *args, PyObject *kwds);
-static PyObject * Stroke___iter__(PyObject *self);
-
-static Py_ssize_t Stroke_length( BPy_Stroke *self );
-static PyObject * Stroke_item( BPy_Stroke *self, Py_ssize_t i );
-static PyObject * Stroke___getitem__( BPy_Stroke *self, PyObject *item );
-
-static PyObject * Stroke_ComputeSampling( BPy_Stroke *self, PyObject *args );
-static PyObject * Stroke_Resample( BPy_Stroke *self, PyObject *args );
-static PyObject * Stroke_InsertVertex( BPy_Stroke *self, PyObject *args );
-static PyObject * Stroke_RemoveVertex( BPy_Stroke *self, PyObject *args );
-static PyObject * Stroke_getMediumType( BPy_Stroke *self );
-static PyObject * Stroke_getTextureId( BPy_Stroke *self );
-static PyObject * Stroke_hasTips( BPy_Stroke *self );
-static PyObject * Stroke_setId( BPy_Stroke *self , PyObject *args);
-static PyObject * Stroke_setLength( BPy_Stroke *self , PyObject *args);
-static PyObject * Stroke_setMediumType( BPy_Stroke *self , PyObject *args);
-static PyObject * Stroke_setTextureId( BPy_Stroke *self , PyObject *args);
-static PyObject * Stroke_setTips( BPy_Stroke *self , PyObject *args);
-static PyObject * Stroke_strokeVerticesBegin( BPy_Stroke *self , PyObject *args);
-static PyObject * Stroke_strokeVerticesEnd( BPy_Stroke *self );
-static PyObject * Stroke_strokeVerticesSize( BPy_Stroke *self );
-
-/*----------------------Stroke instance definitions ----------------------------*/
-static PyMethodDef BPy_Stroke_methods[] = {
- {"__getitem__", ( PyCFunction ) Stroke___getitem__, METH_O, "(int i) Returns the i-th StrokeVertex constituting the Stroke."},
- {"ComputeSampling", ( PyCFunction ) Stroke_ComputeSampling, METH_VARARGS, "(int nVertices) Compute the sampling needed to get nVertices vertices. If the specified number of vertices is less than the actual number of vertices, the actual sampling value is returned."},
- {"Resample", ( PyCFunction ) Stroke_Resample, METH_VARARGS, "(float f | int n) Resampling method. If the argument is a float, Resamples the curve with a given sampling; if this sampling is < to the actual sampling value, no resampling is done. If the argument is an integer, Resamples the curve so that it eventually has n. That means it is going to add n-vertices_size, if vertices_size is the number of points we already have. Is vertices_size >= n, no resampling is done."},
- {"RemoveVertex", ( PyCFunction ) Stroke_RemoveVertex, METH_VARARGS, "(StrokeVertex sv) Removes the stroke vertex sv from the stroke. The length and curvilinear abscissa are updated consequently."},
- {"InsertVertex", ( PyCFunction ) Stroke_InsertVertex, METH_VARARGS, "(StrokeVertex sv, StrokeVertexIterator next) Inserts the stroke vertex iVertex in the stroke before next. The length, curvilinear abscissa are updated consequently."},
- {"getMediumType", ( PyCFunction ) Stroke_getMediumType, METH_NOARGS, "() Returns the MediumType used for this Stroke."},
- {"getTextureId", ( PyCFunction ) Stroke_getTextureId, METH_NOARGS, "() Returns the id of the texture used to simulate th marks system for this Stroke."},
- {"hasTips", ( PyCFunction ) Stroke_hasTips, METH_NOARGS, "() Returns true if this Stroke uses a texture with tips, false otherwise."},
- {"setId", ( PyCFunction ) Stroke_setId, METH_VARARGS, "(Id id) Sets the Id of the Stroke."},
- {"setLength", ( PyCFunction ) Stroke_setLength, METH_VARARGS, "(float l) Sets the 2D length of the Stroke."},
- {"setMediumType", ( PyCFunction ) Stroke_setMediumType, METH_VARARGS, "(MediumType mt) Sets the medium type that must be used for this Stroke."},
- {"setTextureId", ( PyCFunction ) Stroke_setTextureId, METH_VARARGS, "(unsigned int id) Sets the texture id to be used to simulate the marks system for this Stroke."},
- {"setTips", ( PyCFunction ) Stroke_setTips, METH_VARARGS, "(bool b) Sets the flag telling whether this stroke is using a texture with tips or not."},
- {"strokeVerticesBegin", ( PyCFunction ) Stroke_strokeVerticesBegin, METH_VARARGS, "(float t=0.f) Returns a StrokeVertexIterator pointing on the first StrokeVertex of the Stroke. One can specifly a sampling value t to resample the Stroke on the fly if needed. "},
- {"strokeVerticesEnd", ( PyCFunction ) Stroke_strokeVerticesEnd, METH_NOARGS, "() Returns a StrokeVertexIterator pointing after the last StrokeVertex of the Stroke."},
- {"strokeVerticesSize", ( PyCFunction ) Stroke_strokeVerticesSize, METH_NOARGS, "() Returns the number of StrokeVertex constituing the Stroke."},
- {NULL, NULL, 0, NULL}
-};
-
-/*-----------------------BPy_Stroke type definition ------------------------------*/
-
-static PySequenceMethods Stroke_as_sequence = {
- (lenfunc)Stroke_length, /* sq_length */
- NULL, /* sq_concat */
- NULL, /* sq_repeat */
- (ssizeargfunc)Stroke_item, /* sq_item */
- NULL, /* sq_slice */
- NULL, /* sq_ass_item */
- NULL, /* sq_ass_slice */
- NULL, /* sq_contains */
- NULL, /* sq_inplace_concat */
- NULL, /* sq_inplace_repeat */
-};
-
-PyTypeObject Stroke_Type = {
- PyVarObject_HEAD_INIT(NULL, 0)
- "Stroke", /* tp_name */
- sizeof(BPy_Stroke), /* tp_basicsize */
- 0, /* tp_itemsize */
- 0, /* tp_dealloc */
- 0, /* tp_print */
- 0, /* tp_getattr */
- 0, /* tp_setattr */
- 0, /* tp_reserved */
- 0, /* tp_repr */
- 0, /* tp_as_number */
- &Stroke_as_sequence, /* tp_as_sequence */
- 0, /* tp_as_mapping */
- 0, /* tp_hash */
- 0, /* tp_call */
- 0, /* tp_str */
- 0, /* tp_getattro */
- 0, /* tp_setattro */
- 0, /* tp_as_buffer */
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
- "Stroke objects", /* tp_doc */
- 0, /* tp_traverse */
- 0, /* tp_clear */
- 0, /* tp_richcompare */
- 0, /* tp_weaklistoffset */
- (getiterfunc)Stroke___iter__, /* tp_iter */
- 0, /* tp_iternext */
- BPy_Stroke_methods, /* tp_methods */
- 0, /* tp_members */
- 0, /* tp_getset */
- &Interface1D_Type, /* tp_base */
- 0, /* tp_dict */
- 0, /* tp_descr_get */
- 0, /* tp_descr_set */
- 0, /* tp_dictoffset */
- (initproc)Stroke___init__, /* tp_init */
- 0, /* tp_alloc */
- 0, /* tp_new */
-};
-
//------------------------INSTANCE METHODS ----------------------------------
// Stroke ()
@@ -122,7 +21,35 @@ PyTypeObject Stroke_Type = {
// pb: - need to be able to switch representation: InputVertexIterator <=> position
// - is it even used ? not even in SWIG version
-int Stroke___init__(BPy_Stroke *self, PyObject *args, PyObject *kwds)
+static char Stroke___doc__[] =
+"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"
+"defines the stroke's backbone geometry. Each of these stroke vertices\n"
+"defines the stroke's shape and appearance at this vertex position.\n"
+"\n"
+".. method:: Stroke()\n"
+"\n"
+" Default constructor\n"
+"\n"
+".. method:: Stroke(iBrother)\n"
+"\n"
+" Copy constructor\n"
+"\n"
+" :arg iBrother: \n"
+" :type iBrother: :class:`Stroke`\n"
+"\n"
+".. method:: Stroke(iBegin, iEnd)\n"
+"\n"
+" Builds a stroke from a set of StrokeVertex. This constructor is\n"
+" templated by an iterator type. This iterator type must allow the\n"
+" vertices parsing using the ++ operator.\n"
+"\n"
+" :arg iBegin: The iterator pointing to the first vertex.\n"
+" :type iBegin: InputVertexIterator\n"
+" :arg iEnd: The iterator pointing to the end of the vertex list.\n"
+" :type iEnd: InputVertexIterator\n";
+
+static int Stroke___init__(BPy_Stroke *self, PyObject *args, PyObject *kwds)
{
PyObject *obj1 = NULL, *obj2 = NULL;
@@ -150,16 +77,16 @@ int Stroke___init__(BPy_Stroke *self, PyObject *args, PyObject *kwds)
return 0;
}
-PyObject * Stroke___iter__( PyObject *self ) {
+static PyObject * Stroke___iter__( PyObject *self ) {
StrokeInternal::StrokeVertexIterator sv_it( ((BPy_Stroke *)self)->s->strokeVerticesBegin() );
return BPy_StrokeVertexIterator_from_StrokeVertexIterator( sv_it, 0 );
}
-Py_ssize_t Stroke_length( BPy_Stroke *self ) {
+static Py_ssize_t Stroke_length( BPy_Stroke *self ) {
return self->s->strokeVerticesSize();
}
-PyObject * Stroke_item( BPy_Stroke *self, Py_ssize_t i ) {
+static PyObject * Stroke_item( BPy_Stroke *self, Py_ssize_t i ) {
if (i < 0 || i >= (Py_ssize_t)self->s->strokeVerticesSize()) {
PyErr_SetString(PyExc_IndexError, "subscript index out of range");
return NULL;
@@ -167,7 +94,7 @@ PyObject * Stroke_item( BPy_Stroke *self, Py_ssize_t i ) {
return BPy_StrokeVertex_from_StrokeVertex( self->s->strokeVerticeAt(i) );
}
-PyObject * Stroke___getitem__( BPy_Stroke *self, PyObject *item ) {
+static PyObject * Stroke___getitem__( BPy_Stroke *self, PyObject *item ) {
long i;
if (!PyLong_Check(item)) {
@@ -183,7 +110,22 @@ PyObject * Stroke___getitem__( BPy_Stroke *self, PyObject *item ) {
return Stroke_item(self, i);
}
-PyObject * Stroke_ComputeSampling( BPy_Stroke *self, PyObject *args ) {
+static char Stroke_ComputeSampling___doc__[] =
+".. method:: ComputeSampling(iNVertices)\n"
+"\n"
+" Compute the sampling needed to get iNVertices vertices. If the\n"
+" specified number of vertices is less than the actual number of\n"
+" vertices, the actual sampling value is returned. (To remove Vertices,\n"
+" use the RemoveVertex() method of this class.)\n"
+"\n"
+" :arg iNVertices: The number of stroke vertices we eventually want\n"
+" in our Stroke.\n"
+" :type iNVertices: int\n"
+" :return: The sampling that must be used in the Resample(float)\n"
+" method.\n"
+" :rtype: float\n";
+
+static PyObject * Stroke_ComputeSampling( BPy_Stroke *self, PyObject *args ) {
int i;
if(!( PyArg_ParseTuple(args, "i", &i) ))
@@ -192,7 +134,26 @@ PyObject * Stroke_ComputeSampling( BPy_Stroke *self, PyObject *args ) {
return PyFloat_FromDouble( self->s->ComputeSampling( i ) );
}
-PyObject * Stroke_Resample( BPy_Stroke *self, PyObject *args ) {
+static char Stroke_Resample___doc__[] =
+".. method:: Resample(iNPoints)\n"
+"\n"
+" Resamples the stroke so that it eventually has iNPoints. That means\n"
+" it is going to add iNPoints-vertices_size, if vertices_size is the\n"
+" number of points we already have. If vertices_size >= iNPoints, no\n"
+" resampling is done.\n"
+"\n"
+" :arg iNPoints: The number of vertices we eventually want in our stroke.\n"
+" :type iNPoints: int\n"
+"\n"
+".. method:: Resample(iSampling)\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 iSampling: The new sampling value.\n"
+" :type iSampling: float\n";
+
+static PyObject * Stroke_Resample( BPy_Stroke *self, PyObject *args ) {
PyObject *obj;
if(!( PyArg_ParseTuple(args, "O", &obj) ))
@@ -210,7 +171,19 @@ PyObject * Stroke_Resample( BPy_Stroke *self, PyObject *args ) {
Py_RETURN_NONE;
}
-PyObject * Stroke_InsertVertex( BPy_Stroke *self, PyObject *args ) {
+static char Stroke_InsertVertex___doc__[] =
+".. method:: InsertVertex(iVertex, next)\n"
+"\n"
+" Inserts the stroke vertex iVertex in the stroke before next. The\n"
+" length, curvilinear abscissa are updated consequently.\n"
+"\n"
+" :arg iVertex: The StrokeVertex to insert in the Stroke.\n"
+" :type iVertex: :class:`StrokeVertex`\n"
+" :arg next: A StrokeVertexIterator pointing to the StrokeVertex\n"
+" before which iVertex must be inserted.\n"
+" :type next: :class:`StrokeVertexIterator`\n";
+
+static PyObject * Stroke_InsertVertex( BPy_Stroke *self, PyObject *args ) {
PyObject *py_sv = 0, *py_sv_it = 0;
if(!( PyArg_ParseTuple(args, "O!O!", &StrokeVertex_Type, &py_sv, &StrokeVertexIterator_Type, &py_sv_it) ))
@@ -223,7 +196,16 @@ PyObject * Stroke_InsertVertex( BPy_Stroke *self, PyObject *args ) {
Py_RETURN_NONE;
}
-PyObject * Stroke_RemoveVertex( BPy_Stroke *self, PyObject *args ) {
+static char Stroke_RemoveVertex___doc__[] =
+".. method:: RemoveVertex(iVertex)\n"
+"\n"
+" Removes the stroke vertex iVertex from the stroke. The length and\n"
+" curvilinear abscissa are updated consequently.\n"
+"\n"
+" :arg iVertex: \n"
+" :type iVertex: :class:`StrokeVertex`\n";
+
+static PyObject * Stroke_RemoveVertex( BPy_Stroke *self, PyObject *args ) {
PyObject *py_sv;
if(!( PyArg_ParseTuple(args, "O!", &StrokeVertex_Type, &py_sv) ))
@@ -239,20 +221,53 @@ PyObject * Stroke_RemoveVertex( BPy_Stroke *self, PyObject *args ) {
Py_RETURN_NONE;
}
-PyObject * Stroke_getMediumType( BPy_Stroke *self ) {
+static char Stroke_getMediumType___doc__[] =
+".. method:: getMediumType()\n"
+"\n"
+" Returns the MediumType used for this Stroke.\n"
+"\n"
+" :return: the MediumType used for this Stroke.\n"
+" :rtype: :class:`MediumType`\n";
+
+static PyObject * Stroke_getMediumType( BPy_Stroke *self ) {
return BPy_MediumType_from_MediumType( self->s->getMediumType() );
}
-PyObject * Stroke_getTextureId( BPy_Stroke *self ) {
+static char Stroke_getTextureId___doc__[] =
+".. method:: getTextureId()\n"
+"\n"
+" Returns the ID of the texture used to simulate th marks system for\n"
+" this Stroke\n"
+"\n"
+" :return: The texture ID.\n"
+" :rtype: int\n";
+
+static PyObject * Stroke_getTextureId( BPy_Stroke *self ) {
return PyLong_FromLong( self->s->getTextureId() );
}
-PyObject * Stroke_hasTips( BPy_Stroke *self ) {
+static char Stroke_hasTips___doc__[] =
+".. method:: hasTips()\n"
+"\n"
+" Returns true if this Stroke uses a texture with tips, false\n"
+" otherwise.\n"
+"\n"
+" :return: True if this Stroke uses a texture with tips.\n"
+" :rtype: bool\n";
+
+static PyObject * Stroke_hasTips( BPy_Stroke *self ) {
return PyBool_from_bool( self->s->hasTips() );
}
+static char Stroke_setId___doc__[] =
+".. method:: setId(id)\n"
+"\n"
+" Sets the Id of the Stroke.\n"
+"\n"
+" :arg id: the Id of the Stroke.\n"
+" :type id: :class:`Id`\n";
-PyObject *Stroke_setId( BPy_Stroke *self , PyObject *args) {
+static PyObject *Stroke_setId( BPy_Stroke *self , PyObject *args) {
PyObject *py_id;
if(!( PyArg_ParseTuple(args, "O!", &Id_Type, &py_id) ))
@@ -263,7 +278,15 @@ PyObject *Stroke_setId( BPy_Stroke *self , PyObject *args) {
Py_RETURN_NONE;
}
-PyObject *Stroke_setLength( BPy_Stroke *self , PyObject *args) {
+static char Stroke_setLength___doc__[] =
+".. method:: setLength(iLength)\n"
+"\n"
+" Sets the 2D length of the Stroke.\n"
+"\n"
+" :arg iLength: The 2D length of the Stroke.\n"
+" :type iLength: float\n";
+
+static PyObject *Stroke_setLength( BPy_Stroke *self , PyObject *args) {
float f;
if(!( PyArg_ParseTuple(args, "f", &f) ))
@@ -274,7 +297,15 @@ PyObject *Stroke_setLength( BPy_Stroke *self , PyObject *args) {
Py_RETURN_NONE;
}
-PyObject *Stroke_setMediumType( BPy_Stroke *self , PyObject *args) {
+static char Stroke_setMediumType___doc__[] =
+".. method:: setMediumType(iType)\n"
+"\n"
+" Sets the medium type that must be used for this Stroke.\n"
+"\n"
+" :arg iType: A MediumType object.\n"
+" :type iType: :class:`MediumType`\n";
+
+static PyObject *Stroke_setMediumType( BPy_Stroke *self , PyObject *args) {
PyObject *py_mt;
if(!( PyArg_ParseTuple(args, "O!", &MediumType_Type, &py_mt) ))
@@ -285,7 +316,16 @@ PyObject *Stroke_setMediumType( BPy_Stroke *self , PyObject *args) {
Py_RETURN_NONE;
}
-PyObject *Stroke_setTextureId( BPy_Stroke *self , PyObject *args) {
+static char Stroke_setTextureId___doc__[] =
+".. method:: setTextureId(iId)\n"
+"\n"
+" Sets the texture ID to be used to simulate the marks system for this\n"
+" Stroke.\n"
+"\n"
+" :arg iId: A texture ID.\n"
+" :type iId: int\n";
+
+static PyObject *Stroke_setTextureId( BPy_Stroke *self , PyObject *args) {
unsigned int i;
if(!( PyArg_ParseTuple(args, "I", &i) ))
@@ -296,7 +336,16 @@ PyObject *Stroke_setTextureId( BPy_Stroke *self , PyObject *args) {
Py_RETURN_NONE;
}
-PyObject *Stroke_setTips( BPy_Stroke *self , PyObject *args) {
+static char Stroke_setTips___doc__[] =
+".. method:: setTips(iTips)\n"
+"\n"
+" Sets the flag telling whether this stroke is using a texture with\n"
+" tips or not.\n"
+"\n"
+" :arg iTips: True if this stroke uses a texture with tips.\n"
+" :type iTips: bool\n";
+
+static PyObject *Stroke_setTips( BPy_Stroke *self , PyObject *args) {
PyObject *py_b;
if(!( PyArg_ParseTuple(args, "O", &py_b) ))
@@ -307,7 +356,20 @@ PyObject *Stroke_setTips( BPy_Stroke *self , PyObject *args) {
Py_RETURN_NONE;
}
-PyObject * Stroke_strokeVerticesBegin( BPy_Stroke *self , PyObject *args) {
+static char Stroke_strokeVerticesBegin___doc__[] =
+".. method:: strokeVerticesBegin(t=0.0)\n"
+"\n"
+" Returns a StrokeVertexIterator pointing on the first StrokeVertex of\n"
+" the Stroke. O ne can specify a sampling value to resample the Stroke\n"
+" on the fly if needed.\n"
+"\n"
+" :arg t: The resampling value with which we want our Stroke to be\n"
+" resampled. If 0 is specified, no resampling is done.\n"
+" :type t: float\n"
+" :return: A StrokeVertexIterator pointing on the first StrokeVertex.\n"
+" :rtype: :class:`StrokeVertexIterator`\n";
+
+static PyObject * Stroke_strokeVerticesBegin( BPy_Stroke *self , PyObject *args) {
float f = 0;
if(!( PyArg_ParseTuple(args, "|f", &f) ))
@@ -317,15 +379,110 @@ PyObject * Stroke_strokeVerticesBegin( BPy_Stroke *self , PyObject *args) {
return BPy_StrokeVertexIterator_from_StrokeVertexIterator( sv_it, 0 );
}
-PyObject * Stroke_strokeVerticesEnd( BPy_Stroke *self ) {
+static char Stroke_strokeVerticesEnd___doc__[] =
+".. method:: strokeVerticesEnd()\n"
+"\n"
+" Returns a StrokeVertexIterator pointing after the last StrokeVertex\n"
+" of the Stroke.\n"
+"\n"
+" :return: A StrokeVertexIterator pointing after the last StrokeVertex.\n"
+" :rtype: :class:`StrokeVertexIterator`\n";
+
+static PyObject * Stroke_strokeVerticesEnd( BPy_Stroke *self ) {
StrokeInternal::StrokeVertexIterator sv_it( self->s->strokeVerticesEnd() );
return BPy_StrokeVertexIterator_from_StrokeVertexIterator( sv_it, 1 );
}
-PyObject * Stroke_strokeVerticesSize( BPy_Stroke *self ) {
+static char Stroke_strokeVerticesSize___doc__[] =
+".. method:: strokeVerticesSize()\n"
+"\n"
+" Returns the number of StrokeVertex constituing the Stroke.\n"
+"\n"
+" :return: The number of stroke vertices.\n"
+" :rtype: int\n";
+
+static PyObject * Stroke_strokeVerticesSize( BPy_Stroke *self ) {
return PyLong_FromLong( self->s->strokeVerticesSize() );
}
+/*----------------------Stroke instance definitions ----------------------------*/
+
+static PyMethodDef BPy_Stroke_methods[] = {
+ {"__getitem__", ( PyCFunction ) Stroke___getitem__, METH_O, "(int i) Returns the i-th StrokeVertex constituting the Stroke."},
+ {"ComputeSampling", ( PyCFunction ) Stroke_ComputeSampling, METH_VARARGS, Stroke_ComputeSampling___doc__},
+ {"Resample", ( PyCFunction ) Stroke_Resample, METH_VARARGS, Stroke_Resample___doc__},
+ {"RemoveVertex", ( PyCFunction ) Stroke_RemoveVertex, METH_VARARGS, Stroke_RemoveVertex___doc__},
+ {"InsertVertex", ( PyCFunction ) Stroke_InsertVertex, METH_VARARGS, Stroke_InsertVertex___doc__},
+ {"getMediumType", ( PyCFunction ) Stroke_getMediumType, METH_NOARGS, Stroke_getMediumType___doc__},
+ {"getTextureId", ( PyCFunction ) Stroke_getTextureId, METH_NOARGS, Stroke_getTextureId___doc__},
+ {"hasTips", ( PyCFunction ) Stroke_hasTips, METH_NOARGS, Stroke_hasTips___doc__},
+ {"setId", ( PyCFunction ) Stroke_setId, METH_VARARGS, Stroke_setId___doc__},
+ {"setLength", ( PyCFunction ) Stroke_setLength, METH_VARARGS, Stroke_setLength___doc__},
+ {"setMediumType", ( PyCFunction ) Stroke_setMediumType, METH_VARARGS, Stroke_setMediumType___doc__},
+ {"setTextureId", ( PyCFunction ) Stroke_setTextureId, METH_VARARGS, Stroke_setTextureId___doc__},
+ {"setTips", ( PyCFunction ) Stroke_setTips, METH_VARARGS, Stroke_setTips___doc__},
+ {"strokeVerticesBegin", ( PyCFunction ) Stroke_strokeVerticesBegin, METH_VARARGS, Stroke_strokeVerticesBegin___doc__},
+ {"strokeVerticesEnd", ( PyCFunction ) Stroke_strokeVerticesEnd, METH_NOARGS, Stroke_strokeVerticesEnd___doc__},
+ {"strokeVerticesSize", ( PyCFunction ) Stroke_strokeVerticesSize, METH_NOARGS, Stroke_strokeVerticesSize___doc__},
+ {NULL, NULL, 0, NULL}
+};
+
+/*-----------------------BPy_Stroke type definition ------------------------------*/
+
+static PySequenceMethods Stroke_as_sequence = {
+ (lenfunc)Stroke_length, /* sq_length */
+ NULL, /* sq_concat */
+ NULL, /* sq_repeat */
+ (ssizeargfunc)Stroke_item, /* sq_item */
+ NULL, /* sq_slice */
+ NULL, /* sq_ass_item */
+ NULL, /* sq_ass_slice */
+ NULL, /* sq_contains */
+ NULL, /* sq_inplace_concat */
+ NULL, /* sq_inplace_repeat */
+};
+
+PyTypeObject Stroke_Type = {
+ PyVarObject_HEAD_INIT(NULL, 0)
+ "Stroke", /* tp_name */
+ sizeof(BPy_Stroke), /* tp_basicsize */
+ 0, /* tp_itemsize */
+ 0, /* tp_dealloc */
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_reserved */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ &Stroke_as_sequence, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
+ Stroke___doc__, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ (getiterfunc)Stroke___iter__, /* tp_iter */
+ 0, /* tp_iternext */
+ BPy_Stroke_methods, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ &Interface1D_Type, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ (initproc)Stroke___init__, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+};
+
///////////////////////////////////////////////////////////////////////////////////////////
#ifdef __cplusplus
diff --git a/source/blender/freestyle/intern/python/Interface1D/BPy_ViewEdge.cpp b/source/blender/freestyle/intern/python/Interface1D/BPy_ViewEdge.cpp
index 837dbb700c9..49ef52f87aa 100644
--- a/source/blender/freestyle/intern/python/Interface1D/BPy_ViewEdge.cpp
+++ b/source/blender/freestyle/intern/python/Interface1D/BPy_ViewEdge.cpp
@@ -14,102 +14,25 @@ extern "C" {
///////////////////////////////////////////////////////////////////////////////////////////
-/*--------------- Python API function prototypes for ViewEdge instance -----------*/
-static int ViewEdge___init__(BPy_ViewEdge *self, PyObject *args, PyObject *kwds);
-
-static PyObject * ViewEdge_A( BPy_ViewEdge *self );
-static PyObject * ViewEdge_B( BPy_ViewEdge *self );
-static PyObject * ViewEdge_fedgeA( BPy_ViewEdge *self ) ;
-static PyObject * ViewEdge_fedgeB( BPy_ViewEdge *self ) ;
-static PyObject * ViewEdge_viewShape( BPy_ViewEdge *self ) ;
-static PyObject * ViewEdge_aShape( BPy_ViewEdge *self ) ;
-static PyObject * ViewEdge_isClosed( BPy_ViewEdge *self );
-static PyObject * ViewEdge_getChainingTimeStamp( BPy_ViewEdge *self );
-static PyObject * ViewEdge_setChainingTimeStamp( BPy_ViewEdge *self, PyObject *args) ;
-static PyObject * ViewEdge_setA( BPy_ViewEdge *self , PyObject *args) ;
-static PyObject * ViewEdge_setB( BPy_ViewEdge *self , PyObject *args);
-static PyObject * ViewEdge_setNature( BPy_ViewEdge *self, PyObject *args );
-static PyObject * ViewEdge_setFEdgeA( BPy_ViewEdge *self, PyObject *args ) ;
-static PyObject * ViewEdge_setFEdgeB( BPy_ViewEdge *self, PyObject *args ) ;
-static PyObject * ViewEdge_setShape( BPy_ViewEdge *self, PyObject *args ) ;
-static PyObject * ViewEdge_setId( BPy_ViewEdge *self, PyObject *args ) ;
-static PyObject * ViewEdge_UpdateFEdges( BPy_ViewEdge *self );
-static PyObject * ViewEdge_setaShape( BPy_ViewEdge *self, PyObject *args );
-static PyObject * ViewEdge_setQI( BPy_ViewEdge *self, PyObject *args );
-static PyObject * ViewEdge_qi( BPy_ViewEdge *self );
-
-
-/*----------------------ViewEdge instance definitions ----------------------------*/
-static PyMethodDef BPy_ViewEdge_methods[] = {
- {"A", ( PyCFunction ) ViewEdge_A, METH_NOARGS, "() Returns the first ViewVertex."},
- {"B", ( PyCFunction ) ViewEdge_B, METH_NOARGS, "() Returns the second ViewVertex."},
- {"fedgeA", ( PyCFunction ) ViewEdge_fedgeA, METH_NOARGS, "() Returns the first FEdge that constitues this ViewEdge."},
- {"fedgeB", ( PyCFunction ) ViewEdge_fedgeB, METH_NOARGS, "() Returns the last FEdge that constitues this ViewEdge."},
- {"viewShape", ( PyCFunction ) ViewEdge_viewShape, METH_NOARGS, "() Returns the ViewShape to which this ViewEdge belongs to . "},
- {"aShape", ( PyCFunction ) ViewEdge_aShape, METH_NOARGS, "() Returns the shape that is occluded by the ViewShape to which this ViewEdge belongs to. If no object is occluded, 0 is returned."},
- {"isClosed", ( PyCFunction ) ViewEdge_isClosed, METH_NOARGS, "() Tells whether this ViewEdge forms a closed loop or not."},
- {"getChainingTimeStamp", ( PyCFunction ) ViewEdge_getChainingTimeStamp, METH_NOARGS, "() Returns the time stamp of this ViewEdge."},
- {"setChainingTimeStamp", ( PyCFunction ) ViewEdge_setChainingTimeStamp, METH_VARARGS, "(int ts) Sets the time stamp value."},
- {"setA", ( PyCFunction ) ViewEdge_setA, METH_VARARGS, "(ViewVertex sv) Sets the first ViewVertex of the ViewEdge."},
- {"setB", ( PyCFunction ) ViewEdge_setB, METH_VARARGS, "(ViewVertex sv) Sets the last ViewVertex of the ViewEdge."},
- {"setNature", ( PyCFunction ) ViewEdge_setNature, METH_VARARGS, "(Nature n) Sets the nature of the ViewEdge."},
- {"setFEdgeA", ( PyCFunction ) ViewEdge_setFEdgeA, METH_VARARGS, "(FEdge fe) Sets the first FEdge of the ViewEdge."},
- {"setFEdgeB", ( PyCFunction ) ViewEdge_setFEdgeB, METH_VARARGS, "(FEdge fe) Sets the last FEdge of the ViewEdge."},
- {"setShape", ( PyCFunction ) ViewEdge_setShape, METH_VARARGS, "(ViewShape vs) Sets the ViewShape to which this ViewEdge belongs to."},
- {"setId", ( PyCFunction ) ViewEdge_setId, METH_VARARGS, "(Id id) Sets the ViewEdge id."},
- {"UpdateFEdges", ( PyCFunction ) ViewEdge_UpdateFEdges, METH_NOARGS, "() Sets ViewEdge to this for all embedded fedges"},
- {"setaShape", ( PyCFunction ) ViewEdge_setaShape, METH_VARARGS, "(ViewShape vs) Sets the occluded ViewShape"},
- {"setQI", ( PyCFunction ) ViewEdge_setQI, METH_VARARGS, "(int qi) Sets the quantitative invisibility value."},
- {"qi", ( PyCFunction ) ViewEdge_qi, METH_NOARGS, "() Returns the quantitative invisibility of the ViewEdge."},
- {NULL, NULL, 0, NULL}
-};
-
-/*-----------------------BPy_ViewEdge type definition ------------------------------*/
-
-PyTypeObject ViewEdge_Type = {
- PyVarObject_HEAD_INIT(NULL, 0)
- "ViewEdge", /* tp_name */
- sizeof(BPy_ViewEdge), /* tp_basicsize */
- 0, /* tp_itemsize */
- 0, /* tp_dealloc */
- 0, /* tp_print */
- 0, /* tp_getattr */
- 0, /* tp_setattr */
- 0, /* tp_reserved */
- 0, /* tp_repr */
- 0, /* tp_as_number */
- 0, /* tp_as_sequence */
- 0, /* tp_as_mapping */
- 0, /* tp_hash */
- 0, /* tp_call */
- 0, /* tp_str */
- 0, /* tp_getattro */
- 0, /* tp_setattro */
- 0, /* tp_as_buffer */
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
- "ViewEdge objects", /* tp_doc */
- 0, /* tp_traverse */
- 0, /* tp_clear */
- 0, /* tp_richcompare */
- 0, /* tp_weaklistoffset */
- 0, /* tp_iter */
- 0, /* tp_iternext */
- BPy_ViewEdge_methods, /* tp_methods */
- 0, /* tp_members */
- 0, /* tp_getset */
- &Interface1D_Type, /* tp_base */
- 0, /* tp_dict */
- 0, /* tp_descr_get */
- 0, /* tp_descr_set */
- 0, /* tp_dictoffset */
- (initproc)ViewEdge___init__, /* tp_init */
- 0, /* tp_alloc */
- 0, /* tp_new */
-};
-
//------------------------INSTANCE METHODS ----------------------------------
-int ViewEdge___init__(BPy_ViewEdge *self, PyObject *args, PyObject *kwds)
+static char ViewEdge___doc__[] =
+"Class defining a ViewEdge. A ViewEdge in an edge of the image graph.\n"
+"it connnects two :class:`ViewVertex` objects. It is made by connecting\n"
+"a set of FEdges.\n"
+"\n"
+".. method:: __init__()\n"
+"\n"
+" Default constructor.\n"
+"\n"
+".. method:: __init__(iBrother)\n"
+"\n"
+" Copy constructor.\n"
+"\n"
+" :arg iBrother: A ViewEdge object.\n"
+" :type iBrother: :class:`ViewEdge`\n";
+
+static int ViewEdge___init__(BPy_ViewEdge *self, PyObject *args, PyObject *kwds)
{
if ( !PyArg_ParseTuple(args, "") )
return -1;
@@ -120,8 +43,15 @@ int ViewEdge___init__(BPy_ViewEdge *self, PyObject *args, PyObject *kwds)
return 0;
}
+static char ViewEdge_A___doc__[] =
+".. method:: A()\n"
+"\n"
+" Returns the first ViewVertex.\n"
+"\n"
+" :return: The first ViewVertex.\n"
+" :rtype: :class:`ViewVertex`\n";
-PyObject * ViewEdge_A( BPy_ViewEdge *self ) {
+static PyObject * ViewEdge_A( BPy_ViewEdge *self ) {
ViewVertex *v = self->ve->A();
if( v ){
return Any_BPy_ViewVertex_from_ViewVertex( *v );
@@ -130,7 +60,15 @@ PyObject * ViewEdge_A( BPy_ViewEdge *self ) {
Py_RETURN_NONE;
}
-PyObject * ViewEdge_B( BPy_ViewEdge *self ) {
+static char ViewEdge_B___doc__[] =
+".. method:: B()\n"
+"\n"
+" Returns the second ViewVertex.\n"
+"\n"
+" :return: The second ViewVertex.\n"
+" :rtype: :class:`ViewVertex`\n";
+
+static PyObject * ViewEdge_B( BPy_ViewEdge *self ) {
ViewVertex *v = self->ve->B();
if( v ){
return Any_BPy_ViewVertex_from_ViewVertex( *v );
@@ -139,7 +77,15 @@ PyObject * ViewEdge_B( BPy_ViewEdge *self ) {
Py_RETURN_NONE;
}
-PyObject * ViewEdge_fedgeA( BPy_ViewEdge *self ) {
+static char ViewEdge_fedgeA___doc__[] =
+".. method:: fedgeA()\n"
+"\n"
+" Returns the first FEdge that constitutes this ViewEdge.\n"
+"\n"
+" :return: The first FEdge constituting this ViewEdge.\n"
+" :rtype: :class:`FEdge`\n";
+
+static PyObject * ViewEdge_fedgeA( BPy_ViewEdge *self ) {
FEdge *A = self->ve->fedgeA();
if( A ){
return Any_BPy_FEdge_from_FEdge( *A );
@@ -148,7 +94,15 @@ PyObject * ViewEdge_fedgeA( BPy_ViewEdge *self ) {
Py_RETURN_NONE;
}
-PyObject * ViewEdge_fedgeB( BPy_ViewEdge *self ) {
+static char ViewEdge_fedgeB___doc__[] =
+".. method:: fedgeB()\n"
+"\n"
+" Returns the last FEdge that constitutes this ViewEdge.\n"
+"\n"
+" :return: The last FEdge constituting this ViewEdge.\n"
+" :rtype: :class:`FEdge`\n";
+
+static PyObject * ViewEdge_fedgeB( BPy_ViewEdge *self ) {
FEdge *B = self->ve->fedgeB();
if( B ){
return Any_BPy_FEdge_from_FEdge( *B );
@@ -157,7 +111,15 @@ PyObject * ViewEdge_fedgeB( BPy_ViewEdge *self ) {
Py_RETURN_NONE;
}
-PyObject * ViewEdge_viewShape( BPy_ViewEdge *self ) {
+static char ViewEdge_viewShape___doc__[] =
+".. method:: viewShape()\n"
+"\n"
+" Returns the ViewShape to which this ViewEdge belongs to.\n"
+"\n"
+" :return: The ViewShape to which this ViewEdge belongs to.\n"
+" :rtype: :class:`ViewShape`\n";
+
+static PyObject * ViewEdge_viewShape( BPy_ViewEdge *self ) {
ViewShape *vs = self->ve->viewShape();
if( vs ){
return BPy_ViewShape_from_ViewShape( *vs );
@@ -166,7 +128,16 @@ PyObject * ViewEdge_viewShape( BPy_ViewEdge *self ) {
Py_RETURN_NONE;
}
-PyObject * ViewEdge_aShape( BPy_ViewEdge *self ) {
+static char ViewEdge_aShape___doc__[] =
+".. method:: aShape()\n"
+"\n"
+" Returns the shape that is occluded by the ViewShape to which this\n"
+" ViewEdge belongs to. If no object is occluded, None is returned.\n"
+"\n"
+" :return: The occluded ViewShape.\n"
+" :rtype: :class:`ViewShape`\n";
+
+static PyObject * ViewEdge_aShape( BPy_ViewEdge *self ) {
ViewShape *vs = self->ve->aShape();
if( vs ){
return BPy_ViewShape_from_ViewShape( *vs );
@@ -175,15 +146,39 @@ PyObject * ViewEdge_aShape( BPy_ViewEdge *self ) {
Py_RETURN_NONE;
}
-PyObject * ViewEdge_isClosed( BPy_ViewEdge *self ) {
+static char ViewEdge_isClosed___doc__[] =
+".. method:: isClosed()\n"
+"\n"
+" Tells whether this ViewEdge forms a closed loop or not.\n"
+"\n"
+" :return: True if this ViewEdge forms a closed loop.\n"
+" :rtype: bool\n";
+
+static PyObject * ViewEdge_isClosed( BPy_ViewEdge *self ) {
return PyBool_from_bool( self->ve->isClosed() );
}
-PyObject * ViewEdge_getChainingTimeStamp( BPy_ViewEdge *self ) {
+static char ViewEdge_getChainingTimeStamp___doc__[] =
+".. method:: getChainingTimeStamp()\n"
+"\n"
+" Returns the time stamp of this ViewEdge.\n"
+"\n"
+" :return: The time stamp.\n"
+" :rtype: int\n";
+
+static PyObject * ViewEdge_getChainingTimeStamp( BPy_ViewEdge *self ) {
return PyLong_FromLong( self->ve->getChainingTimeStamp() );
}
-PyObject * ViewEdge_setChainingTimeStamp( BPy_ViewEdge *self, PyObject *args) {
+static char ViewEdge_setChainingTimeStamp___doc__[] =
+".. method:: setChainingTimeStamp(ts)\n"
+"\n"
+" Sets the time stamp value.\n"
+"\n"
+" :arg ts: The time stamp.\n"
+" :type ts: int\n";
+
+static PyObject * ViewEdge_setChainingTimeStamp( BPy_ViewEdge *self, PyObject *args) {
int timestamp = 0 ;
if( !PyArg_ParseTuple(args, "i", &timestamp) )
@@ -194,7 +189,15 @@ PyObject * ViewEdge_setChainingTimeStamp( BPy_ViewEdge *self, PyObject *args) {
Py_RETURN_NONE;
}
-PyObject *ViewEdge_setA( BPy_ViewEdge *self , PyObject *args) {
+static char ViewEdge_setA___doc__[] =
+".. method:: setA(iA)\n"
+"\n"
+" Sets the first ViewVertex of the ViewEdge.\n"
+"\n"
+" :arg iA: The first ViewVertex of the ViewEdge.\n"
+" :type iA: :class:`ViewVertex`\n";
+
+static PyObject *ViewEdge_setA( BPy_ViewEdge *self , PyObject *args) {
PyObject *py_vv;
if(!( PyArg_ParseTuple(args, "O!", &ViewVertex_Type, &py_vv) ))
@@ -205,7 +208,15 @@ PyObject *ViewEdge_setA( BPy_ViewEdge *self , PyObject *args) {
Py_RETURN_NONE;
}
-PyObject *ViewEdge_setB( BPy_ViewEdge *self , PyObject *args) {
+static char ViewEdge_setB___doc__[] =
+".. method:: setB(iB)\n"
+"\n"
+" Sets the last ViewVertex of the ViewEdge.\n"
+"\n"
+" :arg iB: The last ViewVertex of the ViewEdge.\n"
+" :type iB: :class:`ViewVertex`\n";
+
+static PyObject *ViewEdge_setB( BPy_ViewEdge *self , PyObject *args) {
PyObject *py_vv;
if(!( PyArg_ParseTuple(args, "O!", &ViewVertex_Type, &py_vv) ))
@@ -216,7 +227,15 @@ PyObject *ViewEdge_setB( BPy_ViewEdge *self , PyObject *args) {
Py_RETURN_NONE;
}
-PyObject * ViewEdge_setNature( BPy_ViewEdge *self, PyObject *args ) {
+static char ViewEdge_setNature___doc__[] =
+".. method:: setNature(iNature)\n"
+"\n"
+" Sets the nature of the ViewEdge.\n"
+"\n"
+" :arg iNature: The nature of the ViewEdge.\n"
+" :type iNature: :class:`Nature`\n";
+
+static PyObject * ViewEdge_setNature( BPy_ViewEdge *self, PyObject *args ) {
PyObject *py_n;
if(!( PyArg_ParseTuple(args, "O!", &Nature_Type, &py_n) ))
@@ -228,7 +247,15 @@ PyObject * ViewEdge_setNature( BPy_ViewEdge *self, PyObject *args ) {
Py_RETURN_NONE;
}
-PyObject * ViewEdge_setFEdgeA( BPy_ViewEdge *self, PyObject *args ) {
+static char ViewEdge_setFEdgeA___doc__[] =
+".. method:: setFEdgeA(iFEdge)\n"
+"\n"
+" Sets the first FEdge of the ViewEdge.\n"
+"\n"
+" :arg iFEdge: The first FEdge of the ViewEdge.\n"
+" :type iFEdge: :class:`FEdge`\n";
+
+static PyObject * ViewEdge_setFEdgeA( BPy_ViewEdge *self, PyObject *args ) {
PyObject *py_fe;
if(!( PyArg_ParseTuple(args, "O!", &FEdge_Type, &py_fe) ))
@@ -239,7 +266,15 @@ PyObject * ViewEdge_setFEdgeA( BPy_ViewEdge *self, PyObject *args ) {
Py_RETURN_NONE;
}
-PyObject * ViewEdge_setFEdgeB( BPy_ViewEdge *self, PyObject *args ) {
+static char ViewEdge_setFEdgeB___doc__[] =
+".. method:: setFEdgeB(iFEdge)\n"
+"\n"
+" Sets the last FEdge of the ViewEdge.\n"
+"\n"
+" :arg iFEdge: The last FEdge of the ViewEdge.\n"
+" :type iFEdge: :class:`FEdge`\n";
+
+static PyObject * ViewEdge_setFEdgeB( BPy_ViewEdge *self, PyObject *args ) {
PyObject *py_fe;
if(!( PyArg_ParseTuple(args, "O!", &FEdge_Type, &py_fe) ))
@@ -250,7 +285,15 @@ PyObject * ViewEdge_setFEdgeB( BPy_ViewEdge *self, PyObject *args ) {
Py_RETURN_NONE;
}
-PyObject * ViewEdge_setShape( BPy_ViewEdge *self, PyObject *args ) {
+static char ViewEdge_setShape___doc__[] =
+".. method:: setShape(iVShape)\n"
+"\n"
+" Sets the ViewShape to which this ViewEdge belongs to.\n"
+"\n"
+" :arg iVShape: The ViewShape to which this ViewEdge belongs to.\n"
+" :type iVShape: :class:`ViewShape`\n";
+
+static PyObject * ViewEdge_setShape( BPy_ViewEdge *self, PyObject *args ) {
PyObject *py_vs;
if(!( PyArg_ParseTuple(args, "O", &ViewShape_Type, &py_vs) ))
@@ -261,7 +304,15 @@ PyObject * ViewEdge_setShape( BPy_ViewEdge *self, PyObject *args ) {
Py_RETURN_NONE;
}
-PyObject * ViewEdge_setId( BPy_ViewEdge *self, PyObject *args ) {
+static char ViewEdge_setId___doc__[] =
+".. method:: setId(id)\n"
+"\n"
+" Sets the ViewEdge id.\n"
+"\n"
+" :arg id: An Id object.\n"
+" :type id: :class:`Id`\n";
+
+static PyObject * ViewEdge_setId( BPy_ViewEdge *self, PyObject *args ) {
PyObject *py_id;
if(!( PyArg_ParseTuple(args, "O!", &Id_Type, &py_id) ))
@@ -273,13 +324,26 @@ PyObject * ViewEdge_setId( BPy_ViewEdge *self, PyObject *args ) {
Py_RETURN_NONE;
}
-PyObject * ViewEdge_UpdateFEdges( BPy_ViewEdge *self ) {
+static char ViewEdge_UpdateFEdges___doc__[] =
+".. method:: UpdateFEdges()\n"
+"\n"
+" Sets Viewedge to this for all embedded fedges.\n";
+
+static PyObject * ViewEdge_UpdateFEdges( BPy_ViewEdge *self ) {
self->ve->UpdateFEdges();
Py_RETURN_NONE;
}
-PyObject * ViewEdge_setaShape( BPy_ViewEdge *self, PyObject *args ) {
+static char ViewEdge_setaShape___doc__[] =
+".. method:: setaShape(iShape)\n"
+"\n"
+" Sets the occluded ViewShape.\n"
+"\n"
+" :arg iShape: A ViewShape object.\n"
+" :type iShape: :class:`ViewShape`\n";
+
+static PyObject * ViewEdge_setaShape( BPy_ViewEdge *self, PyObject *args ) {
PyObject *py_vs;
if(!( PyArg_ParseTuple(args, "O!", &ViewShape_Type, &py_vs) ))
@@ -291,7 +355,15 @@ PyObject * ViewEdge_setaShape( BPy_ViewEdge *self, PyObject *args ) {
Py_RETURN_NONE;
}
-PyObject * ViewEdge_setQI( BPy_ViewEdge *self, PyObject *args ) {
+static char ViewEdge_setQI___doc__[] =
+".. method:: setQI(qi)\n"
+"\n"
+" Sets the quantitative invisibility value of the ViewEdge.\n"
+"\n"
+" :arg qi: The quantitative invisibility.\n"
+" :type qi: int\n";
+
+static PyObject * ViewEdge_setQI( BPy_ViewEdge *self, PyObject *args ) {
int qi;
if(!( PyArg_ParseTuple(args, "i", &qi) ))
@@ -302,10 +374,86 @@ PyObject * ViewEdge_setQI( BPy_ViewEdge *self, PyObject *args ) {
Py_RETURN_NONE;
}
-PyObject * ViewEdge_qi( BPy_ViewEdge *self ) {
+static char ViewEdge_qi___doc__[] =
+".. method:: getChainingTimeStamp()\n"
+"\n"
+" Returns the quantitative invisibility value of the ViewEdge.\n"
+"\n"
+" :return: The quantitative invisibility.\n"
+" :rtype: int\n";
+
+static PyObject * ViewEdge_qi( BPy_ViewEdge *self ) {
return PyLong_FromLong( self->ve->qi() );
}
+/*----------------------ViewEdge instance definitions ----------------------------*/
+static PyMethodDef BPy_ViewEdge_methods[] = {
+ {"A", ( PyCFunction ) ViewEdge_A, METH_NOARGS, ViewEdge_A___doc__},
+ {"B", ( PyCFunction ) ViewEdge_B, METH_NOARGS, ViewEdge_B___doc__},
+ {"fedgeA", ( PyCFunction ) ViewEdge_fedgeA, METH_NOARGS, ViewEdge_fedgeA___doc__},
+ {"fedgeB", ( PyCFunction ) ViewEdge_fedgeB, METH_NOARGS, ViewEdge_fedgeB___doc__},
+ {"viewShape", ( PyCFunction ) ViewEdge_viewShape, METH_NOARGS, ViewEdge_viewShape___doc__},
+ {"aShape", ( PyCFunction ) ViewEdge_aShape, METH_NOARGS, ViewEdge_aShape___doc__},
+ {"isClosed", ( PyCFunction ) ViewEdge_isClosed, METH_NOARGS, ViewEdge_isClosed___doc__},
+ {"getChainingTimeStamp", ( PyCFunction ) ViewEdge_getChainingTimeStamp, METH_NOARGS, ViewEdge_getChainingTimeStamp___doc__},
+ {"setChainingTimeStamp", ( PyCFunction ) ViewEdge_setChainingTimeStamp, METH_VARARGS, ViewEdge_setChainingTimeStamp___doc__},
+ {"setA", ( PyCFunction ) ViewEdge_setA, METH_VARARGS, ViewEdge_setA___doc__},
+ {"setB", ( PyCFunction ) ViewEdge_setB, METH_VARARGS, ViewEdge_setB___doc__},
+ {"setNature", ( PyCFunction ) ViewEdge_setNature, METH_VARARGS, ViewEdge_setNature___doc__},
+ {"setFEdgeA", ( PyCFunction ) ViewEdge_setFEdgeA, METH_VARARGS, ViewEdge_setFEdgeA___doc__},
+ {"setFEdgeB", ( PyCFunction ) ViewEdge_setFEdgeB, METH_VARARGS, ViewEdge_setFEdgeB___doc__},
+ {"setShape", ( PyCFunction ) ViewEdge_setShape, METH_VARARGS, ViewEdge_setShape___doc__},
+ {"setId", ( PyCFunction ) ViewEdge_setId, METH_VARARGS, ViewEdge_setId___doc__},
+ {"UpdateFEdges", ( PyCFunction ) ViewEdge_UpdateFEdges, METH_NOARGS, ViewEdge_UpdateFEdges___doc__},
+ {"setaShape", ( PyCFunction ) ViewEdge_setaShape, METH_VARARGS, ViewEdge_setaShape___doc__},
+ {"setQI", ( PyCFunction ) ViewEdge_setQI, METH_VARARGS, ViewEdge_setQI___doc__},
+ {"qi", ( PyCFunction ) ViewEdge_qi, METH_NOARGS, ViewEdge_qi___doc__},
+ {NULL, NULL, 0, NULL}
+};
+
+/*-----------------------BPy_ViewEdge type definition ------------------------------*/
+
+PyTypeObject ViewEdge_Type = {
+ PyVarObject_HEAD_INIT(NULL, 0)
+ "ViewEdge", /* tp_name */
+ sizeof(BPy_ViewEdge), /* tp_basicsize */
+ 0, /* tp_itemsize */
+ 0, /* tp_dealloc */
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_reserved */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
+ ViewEdge___doc__, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ BPy_ViewEdge_methods, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ &Interface1D_Type, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ (initproc)ViewEdge___init__, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+};
+
///////////////////////////////////////////////////////////////////////////////////////////
#ifdef __cplusplus
diff --git a/source/blender/freestyle/intern/python/Interface1D/Curve/BPy_Chain.cpp b/source/blender/freestyle/intern/python/Interface1D/Curve/BPy_Chain.cpp
index e3b6927dbbc..7958a35b851 100644
--- a/source/blender/freestyle/intern/python/Interface1D/Curve/BPy_Chain.cpp
+++ b/source/blender/freestyle/intern/python/Interface1D/Curve/BPy_Chain.cpp
@@ -10,64 +10,31 @@ extern "C" {
///////////////////////////////////////////////////////////////////////////////////////////
-/*--------------- Python API function prototypes for Chain instance -----------*/
-static int Chain___init__(BPy_Chain *self, PyObject *args, PyObject *kwds);
-static PyObject * Chain_push_viewedge_back( BPy_Chain *self, PyObject *args );
-static PyObject * Chain_push_viewedge_front( BPy_Chain *self, PyObject *args );
-
-
-/*----------------------Chain instance definitions ----------------------------*/
-static PyMethodDef BPy_Chain_methods[] = {
- {"push_viewedge_back", ( PyCFunction ) Chain_push_viewedge_back, METH_VARARGS, "(ViewEdge ve, bool orientation) Adds a ViewEdge at the end of the chain."},
- {"push_viewedge_front", ( PyCFunction ) Chain_push_viewedge_front, METH_VARARGS, "(ViewEdge ve, bool orientation) Adds a ViewEdge at the beginning of the chain."},
- {NULL, NULL, 0, NULL}
-};
-
-/*-----------------------BPy_Chain type definition ------------------------------*/
-
-PyTypeObject Chain_Type = {
- PyVarObject_HEAD_INIT(NULL, 0)
- "Chain", /* tp_name */
- sizeof(BPy_Chain), /* tp_basicsize */
- 0, /* tp_itemsize */
- 0, /* tp_dealloc */
- 0, /* tp_print */
- 0, /* tp_getattr */
- 0, /* tp_setattr */
- 0, /* tp_reserved */
- 0, /* tp_repr */
- 0, /* tp_as_number */
- 0, /* tp_as_sequence */
- 0, /* tp_as_mapping */
- 0, /* tp_hash */
- 0, /* tp_call */
- 0, /* tp_str */
- 0, /* tp_getattro */
- 0, /* tp_setattro */
- 0, /* tp_as_buffer */
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
- "Chain objects", /* tp_doc */
- 0, /* tp_traverse */
- 0, /* tp_clear */
- 0, /* tp_richcompare */
- 0, /* tp_weaklistoffset */
- 0, /* tp_iter */
- 0, /* tp_iternext */
- BPy_Chain_methods, /* tp_methods */
- 0, /* tp_members */
- 0, /* tp_getset */
- &FrsCurve_Type, /* tp_base */
- 0, /* tp_dict */
- 0, /* tp_descr_get */
- 0, /* tp_descr_set */
- 0, /* tp_dictoffset */
- (initproc)Chain___init__, /* tp_init */
- 0, /* tp_alloc */
- 0, /* tp_new */
-};
-
//------------------------INSTANCE METHODS ----------------------------------
+static char Chain___doc__[] =
+"Class to represent a 1D elements issued from the chaining process. A\n"
+"Chain is the last step before the :class:`Stroke` and is used in the\n"
+"Splitting and Creation processes.\n"
+"\n"
+".. method:: __init__()\n"
+"\n"
+" Defult constructor.\n"
+"\n"
+".. method:: __init__(iBrother)\n"
+"\n"
+" Copy constructor.\n"
+"\n"
+" :arg iBrother: A Chain object.\n"
+" :type iBrother: :class:`Chain`\n"
+"\n"
+".. method:: __init__(id)\n"
+"\n"
+" Builds a chain from its Id.\n"
+"\n"
+" :arg id: An Id object.\n"
+" :type id: :class:`Id`\n";
+
int Chain___init__(BPy_Chain *self, PyObject *args, PyObject *kwds)
{
@@ -97,6 +64,16 @@ int Chain___init__(BPy_Chain *self, PyObject *args, PyObject *kwds)
return 0;
}
+static char Chain_push_viewedge_back___doc__[] =
+".. method:: push_viewedge_back(iViewEdge, orientation)\n"
+"\n"
+" Adds a ViewEdge at the end of the Chain.\n"
+"\n"
+" :arg iViewEdge: The ViewEdge that must be added.\n"
+" :type iViewEdge: :class:`ViewEdge`\n"
+" :arg orientation: The orientation with which the ViewEdge must be\n"
+" processed.\n"
+" :type orientation: bool\n";
PyObject * Chain_push_viewedge_back( BPy_Chain *self, PyObject *args ) {
PyObject *obj1 = 0, *obj2 = 0;
@@ -111,6 +88,17 @@ PyObject * Chain_push_viewedge_back( BPy_Chain *self, PyObject *args ) {
Py_RETURN_NONE;
}
+static char Chain_push_viewedge_front___doc__[] =
+".. method:: push_viewedge_front(iViewEdge, orientation)\n"
+"\n"
+" Adds a ViewEdge at the beginning of the Chain.\n"
+"\n"
+" :arg iViewEdge: The ViewEdge that must be added.\n"
+" :type iViewEdge: :class:`ViewEdge`\n"
+" :arg orientation: The orientation with which the ViewEdge must be\n"
+" processed.\n"
+" :type orientation: bool\n";
+
PyObject * Chain_push_viewedge_front( BPy_Chain *self, PyObject *args ) {
PyObject *obj1 = 0, *obj2 = 0;
@@ -124,9 +112,55 @@ PyObject * Chain_push_viewedge_front( BPy_Chain *self, PyObject *args ) {
Py_RETURN_NONE;
}
+/*----------------------Chain instance definitions ----------------------------*/
+static PyMethodDef BPy_Chain_methods[] = {
+ {"push_viewedge_back", ( PyCFunction ) Chain_push_viewedge_back, METH_VARARGS, Chain_push_viewedge_back___doc__},
+ {"push_viewedge_front", ( PyCFunction ) Chain_push_viewedge_front, METH_VARARGS, Chain_push_viewedge_front___doc__},
+ {NULL, NULL, 0, NULL}
+};
+/*-----------------------BPy_Chain type definition ------------------------------*/
-
+PyTypeObject Chain_Type = {
+ PyVarObject_HEAD_INIT(NULL, 0)
+ "Chain", /* tp_name */
+ sizeof(BPy_Chain), /* tp_basicsize */
+ 0, /* tp_itemsize */
+ 0, /* tp_dealloc */
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_reserved */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
+ Chain___doc__, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ BPy_Chain_methods, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ &FrsCurve_Type, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ (initproc)Chain___init__, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+};
///////////////////////////////////////////////////////////////////////////////////////////
diff --git a/source/blender/freestyle/intern/python/Interface1D/FEdge/BPy_FEdgeSharp.cpp b/source/blender/freestyle/intern/python/Interface1D/FEdge/BPy_FEdgeSharp.cpp
index e699d843ed8..2c666534d66 100644
--- a/source/blender/freestyle/intern/python/Interface1D/FEdge/BPy_FEdgeSharp.cpp
+++ b/source/blender/freestyle/intern/python/Interface1D/FEdge/BPy_FEdgeSharp.cpp
@@ -9,81 +9,37 @@ extern "C" {
///////////////////////////////////////////////////////////////////////////////////////////
-/*--------------- Python API function prototypes for FEdgeSharp instance -----------*/
-static int FEdgeSharp___init__(BPy_FEdgeSharp *self, PyObject *args, PyObject *kwds);
-
-static PyObject * FEdgeSharp_normalA( BPy_FEdgeSharp *self ) ;
-static PyObject * FEdgeSharp_normalB( BPy_FEdgeSharp *self );
-static PyObject * FEdgeSharp_aMaterialIndex( BPy_FEdgeSharp *self ) ;
-static PyObject * FEdgeSharp_bMaterialIndex( BPy_FEdgeSharp *self );
-static PyObject * FEdgeSharp_aMaterial( BPy_FEdgeSharp *self );
-static PyObject * FEdgeSharp_bMaterial( BPy_FEdgeSharp *self );
-static PyObject * FEdgeSharp_setNormalA( BPy_FEdgeSharp *self, PyObject *args );
-static PyObject * FEdgeSharp_setNormalB( BPy_FEdgeSharp *self, PyObject *args );
-static PyObject * FEdgeSharp_setaMaterialIndex( BPy_FEdgeSharp *self, PyObject *args );
-static PyObject * FEdgeSharp_setbMaterialIndex( BPy_FEdgeSharp *self, PyObject *args );
-
-/*----------------------FEdgeSharp instance definitions ----------------------------*/
-static PyMethodDef BPy_FEdgeSharp_methods[] = {
- {"normalA", ( PyCFunction ) FEdgeSharp_normalA, METH_NOARGS, "() Returns the normal to the face lying on the right of the FEdge. If this FEdge is a border, it has no Face on its right and therefore, no normal."},
- {"normalB", ( PyCFunction ) FEdgeSharp_normalB, METH_NOARGS, "() Returns the normal to the face lying on the left of the FEdge."},
- {"aMaterialIndex", ( PyCFunction ) FEdgeSharp_aMaterialIndex, METH_NOARGS, "() Returns the index of the material of the face lying on the right of the FEdge. If this FEdge is a border, it has no Face on its right and therefore, no material. "},
- {"bMaterialIndex", ( PyCFunction ) FEdgeSharp_bMaterialIndex, METH_NOARGS, "() Returns the material of the face lying on the left of the FEdge. "},
- {"aMaterial", ( PyCFunction ) FEdgeSharp_aMaterial, METH_NOARGS, "() Returns the material of the face lying on the right of the FEdge. If this FEdge is a border, it has no Face on its right and therefore, no material."},
- {"bMaterial", ( PyCFunction ) FEdgeSharp_bMaterial, METH_NOARGS, "() Returns the material of the face lying on the left of the FEdge."},
- {"setNormalA", ( PyCFunction ) FEdgeSharp_setNormalA, METH_VARARGS, "([x,y,z]) Sets the normal to the face lying on the right of the FEdge."},
- {"setNormalB", ( PyCFunction ) FEdgeSharp_setNormalB, METH_VARARGS, "([x,y,z]) Sets the normal to the face lying on the left of the FEdge. "},
- {"setaMaterialIndex", ( PyCFunction ) FEdgeSharp_setaMaterialIndex, METH_VARARGS, "(unsigned int i) Sets the index of the material lying on the right of the FEdge. "},
- {"setbMaterialIndex", ( PyCFunction ) FEdgeSharp_setbMaterialIndex, METH_VARARGS, "(unsigned int i) Sets the index of the material lying on the left of the FEdge. "},
- {NULL, NULL, 0, NULL}
-};
-
-/*-----------------------BPy_FEdgeSharp type definition ------------------------------*/
-
-PyTypeObject FEdgeSharp_Type = {
- PyVarObject_HEAD_INIT(NULL, 0)
- "FEdgeSharp", /* tp_name */
- sizeof(BPy_FEdgeSharp), /* tp_basicsize */
- 0, /* tp_itemsize */
- 0, /* tp_dealloc */
- 0, /* tp_print */
- 0, /* tp_getattr */
- 0, /* tp_setattr */
- 0, /* tp_reserved */
- 0, /* tp_repr */
- 0, /* tp_as_number */
- 0, /* tp_as_sequence */
- 0, /* tp_as_mapping */
- 0, /* tp_hash */
- 0, /* tp_call */
- 0, /* tp_str */
- 0, /* tp_getattro */
- 0, /* tp_setattro */
- 0, /* tp_as_buffer */
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
- "FEdgeSharp objects", /* tp_doc */
- 0, /* tp_traverse */
- 0, /* tp_clear */
- 0, /* tp_richcompare */
- 0, /* tp_weaklistoffset */
- 0, /* tp_iter */
- 0, /* tp_iternext */
- BPy_FEdgeSharp_methods, /* tp_methods */
- 0, /* tp_members */
- 0, /* tp_getset */
- &FEdge_Type, /* tp_base */
- 0, /* tp_dict */
- 0, /* tp_descr_get */
- 0, /* tp_descr_set */
- 0, /* tp_dictoffset */
- (initproc)FEdgeSharp___init__, /* tp_init */
- 0, /* tp_alloc */
- 0, /* tp_new */
-};
-
//------------------------INSTANCE METHODS ----------------------------------
-int FEdgeSharp___init__(BPy_FEdgeSharp *self, PyObject *args, PyObject *kwds)
+static char FEdgeSharp___doc__[] =
+"Class defining a sharp FEdge. A Sharp FEdge corresponds to an initial\n"
+"edge of the input mesh. It can be a silhouette, a crease or a border.\n"
+"If it is a crease edge, then it is borded by two faces of the mesh.\n"
+"Face a lies on its right whereas Face b lies on its left. If it is a\n"
+"border edge, then it doesn't have any face on its right, and thus Face\n"
+"a is None.\n"
+"\n"
+".. method:: __init__()\n"
+"\n"
+" Default constructor.\n"
+"\n"
+".. method:: __init__(iBrother)\n"
+"\n"
+" Copy constructor.\n"
+"\n"
+" :arg iBrother: An FEdgeSharp object.\n"
+" :type iBrother: :class:`FEdgeSharp`\n"
+"\n"
+".. method:: __init__(vA, vB)\n"
+"\n"
+" Builds an FEdgeSharp going from vA to vB.\n"
+"\n"
+" :arg vA: The first SVertex object.\n"
+" :type vA: :class:`SVertex`\n"
+" :arg vB: The second SVertex object.\n"
+" :type vB: :class:`SVertex`\n";
+
+static int FEdgeSharp___init__(BPy_FEdgeSharp *self, PyObject *args, PyObject *kwds)
{
PyObject *obj1 = 0, *obj2 = 0;
@@ -111,36 +67,100 @@ int FEdgeSharp___init__(BPy_FEdgeSharp *self, PyObject *args, PyObject *kwds)
return 0;
}
-
-PyObject * FEdgeSharp_normalA( BPy_FEdgeSharp *self ) {
+static char FEdgeSharp_normalA___doc__[] =
+".. method:: normalA()\n"
+"\n"
+" Returns the normal to the face lying on the right of the FEdge. If\n"
+" this FEdge is a border, it has no Face on its right and therefore, no\n"
+" normal.\n"
+"\n"
+" :return: The normal to the face lying on the right of the FEdge.\n"
+" :rtype: :class:`Mathutils.Vector`\n";
+
+static PyObject * FEdgeSharp_normalA( BPy_FEdgeSharp *self ) {
Vec3r v( self->fes->normalA() );
return Vector_from_Vec3r( v );
}
-PyObject * FEdgeSharp_normalB( BPy_FEdgeSharp *self ) {
+static char FEdgeSharp_normalB___doc__[] =
+".. method:: normalB()\n"
+"\n"
+" Returns the normal to the face lying on the left of the FEdge.\n"
+"\n"
+" :return: The normal to the face lying on the left of the FEdge.\n"
+" :rtype: :class:`Mathutils.Vector`\n";
+
+static PyObject * FEdgeSharp_normalB( BPy_FEdgeSharp *self ) {
Vec3r v( self->fes->normalB() );
return Vector_from_Vec3r( v );
}
-PyObject * FEdgeSharp_aMaterialIndex( BPy_FEdgeSharp *self ) {
+static char FEdgeSharp_aMaterialIndex___doc__[] =
+".. method:: aMaterialIndex()\n"
+"\n"
+" Returns the index of the material of the face lying on the right of\n"
+" the FEdge. If this FEdge is a border, it has no Face on its right and\n"
+" therefore, no material.\n"
+"\n"
+" :return: The index of the material of the face lying on the right of\n"
+" the FEdge.\n"
+" :rtype: int\n";
+
+static PyObject * FEdgeSharp_aMaterialIndex( BPy_FEdgeSharp *self ) {
return PyLong_FromLong( self->fes->aFrsMaterialIndex() );
}
-PyObject * FEdgeSharp_bMaterialIndex( BPy_FEdgeSharp *self ) {
+static char FEdgeSharp_bMaterialIndex___doc__[] =
+".. method:: bMaterialIndex()\n"
+"\n"
+" Returns the index of the material of the face lying on the left of\n"
+" the FEdge.\n"
+"\n"
+" :return: The index of the material of the face lying on the left of\n"
+" the FEdge.\n"
+" :rtype: int\n";
+
+static PyObject * FEdgeSharp_bMaterialIndex( BPy_FEdgeSharp *self ) {
return PyLong_FromLong( self->fes->bFrsMaterialIndex() );
}
-PyObject * FEdgeSharp_aMaterial( BPy_FEdgeSharp *self ) {
+static char FEdgeSharp_aMaterial___doc__[] =
+".. method:: aMaterial()\n"
+"\n"
+" Returns the material of the face lying on the right of the FEdge. If\n"
+" this FEdge is a border, it has no Face on its right and therefore, no\n"
+" material.\n"
+"\n"
+" :return: The material of the face lying on the right of the FEdge.\n"
+" :rtype: :class:`Material`\n";
+
+static PyObject * FEdgeSharp_aMaterial( BPy_FEdgeSharp *self ) {
FrsMaterial m( self->fes->aFrsMaterial() );
return BPy_FrsMaterial_from_FrsMaterial(m);
}
-PyObject * FEdgeSharp_bMaterial( BPy_FEdgeSharp *self ) {
+static char FEdgeSharp_bMaterial___doc__[] =
+".. method:: bMaterial()\n"
+"\n"
+" Returns the material of the face lying on the left of the FEdge.\n"
+"\n"
+" :return: The material of the face lying on the left of the FEdge.\n"
+" :rtype: :class:`Material`\n";
+
+static PyObject * FEdgeSharp_bMaterial( BPy_FEdgeSharp *self ) {
FrsMaterial m( self->fes->aFrsMaterial() );
return BPy_FrsMaterial_from_FrsMaterial(m);
}
-PyObject * FEdgeSharp_setNormalA( BPy_FEdgeSharp *self, PyObject *args ) {
+static char FEdgeSharp_setNormalA___doc__[] =
+".. method:: setNormalA(iNormal)\n"
+"\n"
+" Sets the normal to the face lying on the right of the FEdge.\n"
+"\n"
+" :arg iNormal: A three-dimensional vector.\n"
+" :type iNormal: :class:`Mathutils.Vector`, list or tuple of 3 real numbers\n";
+
+static PyObject * FEdgeSharp_setNormalA( BPy_FEdgeSharp *self, PyObject *args ) {
PyObject *obj = 0;
if(!( PyArg_ParseTuple(args, "O", &obj) ))
@@ -156,7 +176,15 @@ PyObject * FEdgeSharp_setNormalA( BPy_FEdgeSharp *self, PyObject *args ) {
Py_RETURN_NONE;
}
-PyObject * FEdgeSharp_setNormalB( BPy_FEdgeSharp *self, PyObject *args ) {
+static char FEdgeSharp_setNormalB___doc__[] =
+".. method:: setNormalB(iNormal)\n"
+"\n"
+" Sets the normal to the face lying on the left of the FEdge.\n"
+"\n"
+" :arg iNormal: A three-dimensional vector.\n"
+" :type iNormal: :class:`Mathutils.Vector`, list or tuple of 3 real numbers\n";
+
+static PyObject * FEdgeSharp_setNormalB( BPy_FEdgeSharp *self, PyObject *args ) {
PyObject *obj = 0;
if(!( PyArg_ParseTuple(args, "O", &obj) ))
@@ -172,7 +200,15 @@ PyObject * FEdgeSharp_setNormalB( BPy_FEdgeSharp *self, PyObject *args ) {
Py_RETURN_NONE;
}
-PyObject * FEdgeSharp_setaMaterialIndex( BPy_FEdgeSharp *self, PyObject *args ) {
+static char FEdgeSharp_setaMaterialIndex___doc__[] =
+".. method:: setaMaterialIndex(i)\n"
+"\n"
+" Sets the index of the material lying on the right of the FEdge.\n"
+"\n"
+" :arg i: A material index.\n"
+" :type i: int\n";
+
+static PyObject * FEdgeSharp_setaMaterialIndex( BPy_FEdgeSharp *self, PyObject *args ) {
unsigned int i;
if(!( PyArg_ParseTuple(args, "I", &i) ))
@@ -183,7 +219,15 @@ PyObject * FEdgeSharp_setaMaterialIndex( BPy_FEdgeSharp *self, PyObject *args )
Py_RETURN_NONE;
}
-PyObject * FEdgeSharp_setbMaterialIndex( BPy_FEdgeSharp *self, PyObject *args ) {
+static char FEdgeSharp_setbMaterialIndex___doc__[] =
+".. method:: setbMaterialIndex(i)\n"
+"\n"
+" Sets the index of the material lying on the left of the FEdge.\n"
+"\n"
+" :arg i: A material index.\n"
+" :type i: int\n";
+
+static PyObject * FEdgeSharp_setbMaterialIndex( BPy_FEdgeSharp *self, PyObject *args ) {
unsigned int i;
if(!( PyArg_ParseTuple(args, "I", &i) ))
@@ -194,6 +238,64 @@ PyObject * FEdgeSharp_setbMaterialIndex( BPy_FEdgeSharp *self, PyObject *args )
Py_RETURN_NONE;
}
+/*----------------------FEdgeSharp instance definitions ----------------------------*/
+static PyMethodDef BPy_FEdgeSharp_methods[] = {
+ {"normalA", ( PyCFunction ) FEdgeSharp_normalA, METH_NOARGS, FEdgeSharp_normalA___doc__},
+ {"normalB", ( PyCFunction ) FEdgeSharp_normalB, METH_NOARGS, FEdgeSharp_normalB___doc__},
+ {"aMaterialIndex", ( PyCFunction ) FEdgeSharp_aMaterialIndex, METH_NOARGS, FEdgeSharp_aMaterialIndex___doc__},
+ {"bMaterialIndex", ( PyCFunction ) FEdgeSharp_bMaterialIndex, METH_NOARGS, FEdgeSharp_bMaterialIndex___doc__},
+ {"aMaterial", ( PyCFunction ) FEdgeSharp_aMaterial, METH_NOARGS, FEdgeSharp_aMaterial___doc__},
+ {"bMaterial", ( PyCFunction ) FEdgeSharp_bMaterial, METH_NOARGS, FEdgeSharp_bMaterial___doc__},
+ {"setNormalA", ( PyCFunction ) FEdgeSharp_setNormalA, METH_VARARGS, FEdgeSharp_setNormalA___doc__},
+ {"setNormalB", ( PyCFunction ) FEdgeSharp_setNormalB, METH_VARARGS, FEdgeSharp_setNormalB___doc__},
+ {"setaMaterialIndex", ( PyCFunction ) FEdgeSharp_setaMaterialIndex, METH_VARARGS, FEdgeSharp_setaMaterialIndex___doc__},
+ {"setbMaterialIndex", ( PyCFunction ) FEdgeSharp_setbMaterialIndex, METH_VARARGS, FEdgeSharp_setbMaterialIndex___doc__},
+ {NULL, NULL, 0, NULL}
+};
+
+/*-----------------------BPy_FEdgeSharp type definition ------------------------------*/
+
+PyTypeObject FEdgeSharp_Type = {
+ PyVarObject_HEAD_INIT(NULL, 0)
+ "FEdgeSharp", /* tp_name */
+ sizeof(BPy_FEdgeSharp), /* tp_basicsize */
+ 0, /* tp_itemsize */
+ 0, /* tp_dealloc */
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_reserved */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
+ FEdgeSharp___doc__, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ BPy_FEdgeSharp_methods, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ &FEdge_Type, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ (initproc)FEdgeSharp___init__, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+};
+
///////////////////////////////////////////////////////////////////////////////////////////
#ifdef __cplusplus
diff --git a/source/blender/freestyle/intern/python/Interface1D/FEdge/BPy_FEdgeSmooth.cpp b/source/blender/freestyle/intern/python/Interface1D/FEdge/BPy_FEdgeSmooth.cpp
index bdf17f1a7ad..71dbe6f2136 100644
--- a/source/blender/freestyle/intern/python/Interface1D/FEdge/BPy_FEdgeSmooth.cpp
+++ b/source/blender/freestyle/intern/python/Interface1D/FEdge/BPy_FEdgeSmooth.cpp
@@ -9,73 +9,34 @@ extern "C" {
///////////////////////////////////////////////////////////////////////////////////////////
-/*--------------- Python API function prototypes for FEdgeSmooth instance -----------*/
-static int FEdgeSmooth___init__(BPy_FEdgeSmooth *self, PyObject *args, PyObject *kwds);
-
-static PyObject * FEdgeSmooth_normal( BPy_FEdgeSmooth *self ) ;
-static PyObject * FEdgeSmooth_materialIndex( BPy_FEdgeSmooth *self ) ;
-static PyObject * FEdgeSmooth_material( BPy_FEdgeSmooth *self );
-static PyObject * FEdgeSmooth_setNormal( BPy_FEdgeSmooth *self, PyObject *args );
-static PyObject * FEdgeSmooth_setMaterialIndex( BPy_FEdgeSmooth *self, PyObject *args );
-
-
-/*----------------------FEdgeSmooth instance definitions ----------------------------*/
-static PyMethodDef BPy_FEdgeSmooth_methods[] = {
- {"normal", ( PyCFunction ) FEdgeSmooth_normal, METH_NOARGS, "() Returns the normal to the Face it is running accross."},
- {"materialIndex", ( PyCFunction ) FEdgeSmooth_materialIndex, METH_NOARGS, "() Returns the index of the material of the face it is running accross. "},
- {"material", ( PyCFunction ) FEdgeSmooth_material, METH_NOARGS, "() Returns the material of the face it is running accross. "},
- {"setNormal", ( PyCFunction ) FEdgeSmooth_setNormal, METH_VARARGS, "([x,y,z]) Sets the normal to the Face it is running accross."},
- {"setMaterialIndex", ( PyCFunction ) FEdgeSmooth_setMaterialIndex, METH_VARARGS, "(unsigned int i) Sets the index of the material of the face it is running accross. "},
- {NULL, NULL, 0, NULL}
-};
-
-/*-----------------------BPy_FEdgeSmooth type definition ------------------------------*/
-
-PyTypeObject FEdgeSmooth_Type = {
- PyVarObject_HEAD_INIT(NULL, 0)
- "FEdgeSmooth", /* tp_name */
- sizeof(BPy_FEdgeSmooth), /* tp_basicsize */
- 0, /* tp_itemsize */
- 0, /* tp_dealloc */
- 0, /* tp_print */
- 0, /* tp_getattr */
- 0, /* tp_setattr */
- 0, /* tp_reserved */
- 0, /* tp_repr */
- 0, /* tp_as_number */
- 0, /* tp_as_sequence */
- 0, /* tp_as_mapping */
- 0, /* tp_hash */
- 0, /* tp_call */
- 0, /* tp_str */
- 0, /* tp_getattro */
- 0, /* tp_setattro */
- 0, /* tp_as_buffer */
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
- "FEdgeSmooth objects", /* tp_doc */
- 0, /* tp_traverse */
- 0, /* tp_clear */
- 0, /* tp_richcompare */
- 0, /* tp_weaklistoffset */
- 0, /* tp_iter */
- 0, /* tp_iternext */
- BPy_FEdgeSmooth_methods, /* tp_methods */
- 0, /* tp_members */
- 0, /* tp_getset */
- &FEdge_Type, /* tp_base */
- 0, /* tp_dict */
- 0, /* tp_descr_get */
- 0, /* tp_descr_set */
- 0, /* tp_dictoffset */
- (initproc)FEdgeSmooth___init__, /* tp_init */
- 0, /* tp_alloc */
- 0, /* tp_new */
-};
-
//------------------------INSTANCE METHODS ----------------------------------
-
-int FEdgeSmooth___init__(BPy_FEdgeSmooth *self, PyObject *args, PyObject *kwds)
+static char FEdgeSmooth___doc__[] =
+"Class defining a smooth edge. This kind of edge typically runs across\n"
+"a face of the input mesh. It can be a silhouette, a ridge or valley,\n"
+"a suggestive contour.\n"
+"\n"
+".. method:: __init__()\n"
+"\n"
+" Default constructor.\n"
+"\n"
+".. method:: __init__(iBrother)\n"
+"\n"
+" Copy constructor.\n"
+"\n"
+" :arg iBrother: An FEdgeSmooth object.\n"
+" :type iBrother: :class:`FEdgeSmooth`\n"
+"\n"
+".. method:: __init__(vA, vB)\n"
+"\n"
+" Builds an FEdgeSmooth going from vA to vB.\n"
+"\n"
+" :arg vA: The first SVertex object.\n"
+" :type vA: :class:`SVertex`\n"
+" :arg vB: The second SVertex object.\n"
+" :type vB: :class:`SVertex`\n";
+
+static int FEdgeSmooth___init__(BPy_FEdgeSmooth *self, PyObject *args, PyObject *kwds)
{
PyObject *obj1 = 0, *obj2 = 0;
@@ -103,22 +64,53 @@ int FEdgeSmooth___init__(BPy_FEdgeSmooth *self, PyObject *args, PyObject *kwds)
return 0;
}
-PyObject * FEdgeSmooth_normal( BPy_FEdgeSmooth *self ) {
+static char FEdgeSmooth_normal___doc__[] =
+".. method:: normal()\n"
+"\n"
+" Returns the normal to the Face it is running accross.\n"
+"\n"
+" :return: The normal to the Face it is running accross.\n"
+" :rtype: :class:`Mathutils.Vector`\n";
+
+static PyObject * FEdgeSmooth_normal( BPy_FEdgeSmooth *self ) {
Vec3r v( self->fes->normal() );
return Vector_from_Vec3r( v );
}
-PyObject * FEdgeSmooth_materialIndex( BPy_FEdgeSmooth *self ) {
+static char FEdgeSmooth_materialIndex___doc__[] =
+".. method:: materialIndex()\n"
+"\n"
+" Returns the index of the material of the face it is running accross.\n"
+"\n"
+" :return: The index of the material of the face it is running accross.\n"
+" :rtype: int\n";
+
+static PyObject * FEdgeSmooth_materialIndex( BPy_FEdgeSmooth *self ) {
return PyLong_FromLong( self->fes->frs_materialIndex() );
}
+static char FEdgeSmooth_material___doc__[] =
+".. method:: material()\n"
+"\n"
+" Returns the material of the face it is running accross.\n"
+"\n"
+" :return: The material of the face it is running accross.\n"
+" :rtype: :class:`Material`\n";
-PyObject * FEdgeSmooth_material( BPy_FEdgeSmooth *self ) {
+static PyObject * FEdgeSmooth_material( BPy_FEdgeSmooth *self ) {
FrsMaterial m( self->fes->frs_material() );
return BPy_FrsMaterial_from_FrsMaterial(m);
}
-PyObject * FEdgeSmooth_setNormal( BPy_FEdgeSmooth *self, PyObject *args ) {
+static char FEdgeSmooth_setNormal___doc__[] =
+".. method:: setNormal(iNormal)\n"
+"\n"
+" Sets the normal to the Face it is running accross.\n"
+"\n"
+" :arg iNormal: A three-dimensional vector.\n"
+" :type iNormal: :class:`Mathutils.Vector`, list or tuple of 3 real numbers\n";
+
+static PyObject * FEdgeSmooth_setNormal( BPy_FEdgeSmooth *self, PyObject *args ) {
PyObject *obj = 0;
if(!( PyArg_ParseTuple(args, "O", &obj) ))
@@ -134,7 +126,15 @@ PyObject * FEdgeSmooth_setNormal( BPy_FEdgeSmooth *self, PyObject *args ) {
Py_RETURN_NONE;
}
-PyObject * FEdgeSmooth_setMaterialIndex( BPy_FEdgeSmooth *self, PyObject *args ) {
+static char FEdgeSmooth_setMaterialIndex___doc__[] =
+".. method:: setMaterialIndex(i)\n"
+"\n"
+" Sets the index of the material of the face it is running accross.\n"
+"\n"
+" :arg i: The index of the material of the face it is running accross.\n"
+" :type i: int\n";
+
+static PyObject * FEdgeSmooth_setMaterialIndex( BPy_FEdgeSmooth *self, PyObject *args ) {
unsigned int i;
if(!( PyArg_ParseTuple(args, "I", &i) ))
@@ -145,6 +145,59 @@ PyObject * FEdgeSmooth_setMaterialIndex( BPy_FEdgeSmooth *self, PyObject *args )
Py_RETURN_NONE;
}
+/*----------------------FEdgeSmooth instance definitions ----------------------------*/
+static PyMethodDef BPy_FEdgeSmooth_methods[] = {
+ {"normal", ( PyCFunction ) FEdgeSmooth_normal, METH_NOARGS, FEdgeSmooth_normal___doc__},
+ {"materialIndex", ( PyCFunction ) FEdgeSmooth_materialIndex, METH_NOARGS, FEdgeSmooth_materialIndex___doc__},
+ {"material", ( PyCFunction ) FEdgeSmooth_material, METH_NOARGS, FEdgeSmooth_material___doc__},
+ {"setNormal", ( PyCFunction ) FEdgeSmooth_setNormal, METH_VARARGS, FEdgeSmooth_setNormal___doc__},
+ {"setMaterialIndex", ( PyCFunction ) FEdgeSmooth_setMaterialIndex, METH_VARARGS, FEdgeSmooth_setMaterialIndex___doc__},
+ {NULL, NULL, 0, NULL}
+};
+
+/*-----------------------BPy_FEdgeSmooth type definition ------------------------------*/
+
+PyTypeObject FEdgeSmooth_Type = {
+ PyVarObject_HEAD_INIT(NULL, 0)
+ "FEdgeSmooth", /* tp_name */
+ sizeof(BPy_FEdgeSmooth), /* tp_basicsize */
+ 0, /* tp_itemsize */
+ 0, /* tp_dealloc */
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_reserved */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
+ FEdgeSmooth___doc__, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ BPy_FEdgeSmooth_methods, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ &FEdge_Type, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ (initproc)FEdgeSmooth___init__, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+};
+
///////////////////////////////////////////////////////////////////////////////////////////
#ifdef __cplusplus