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/Interface0D
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/Interface0D')
-rw-r--r--source/blender/freestyle/intern/python/Interface0D/BPy_CurvePoint.cpp241
-rw-r--r--source/blender/freestyle/intern/python/Interface0D/BPy_SVertex.cpp235
-rw-r--r--source/blender/freestyle/intern/python/Interface0D/BPy_ViewVertex.cpp182
-rw-r--r--source/blender/freestyle/intern/python/Interface0D/CurvePoint/BPy_StrokeVertex.cpp330
-rw-r--r--source/blender/freestyle/intern/python/Interface0D/ViewVertex/BPy_NonTVertex.cpp144
-rw-r--r--source/blender/freestyle/intern/python/Interface0D/ViewVertex/BPy_TVertex.cpp218
6 files changed, 900 insertions, 450 deletions
diff --git a/source/blender/freestyle/intern/python/Interface0D/BPy_CurvePoint.cpp b/source/blender/freestyle/intern/python/Interface0D/BPy_CurvePoint.cpp
index 48aa1e5aa1c..35f8c82f794 100644
--- a/source/blender/freestyle/intern/python/Interface0D/BPy_CurvePoint.cpp
+++ b/source/blender/freestyle/intern/python/Interface0D/BPy_CurvePoint.cpp
@@ -9,76 +9,55 @@ extern "C" {
///////////////////////////////////////////////////////////////////////////////////////////
-/*--------------- Python API function prototypes for CurvePoint instance -----------*/
-static int CurvePoint___init__(BPy_CurvePoint *self, PyObject *args, PyObject *kwds);
-static PyObject * CurvePoint___copy__( BPy_CurvePoint *self );
-static PyObject * CurvePoint_A( BPy_CurvePoint *self );
-static PyObject * CurvePoint_B( BPy_CurvePoint *self );
-static PyObject * CurvePoint_t2d( BPy_CurvePoint *self );
-static PyObject *CurvePoint_setA( BPy_CurvePoint *self , PyObject *args);
-static PyObject *CurvePoint_setB( BPy_CurvePoint *self , PyObject *args);
-static PyObject *CurvePoint_setT2d( BPy_CurvePoint *self , PyObject *args);
-static PyObject *CurvePoint_curvatureFredo( BPy_CurvePoint *self , PyObject *args);
-
-/*----------------------CurvePoint instance definitions ----------------------------*/
-static PyMethodDef BPy_CurvePoint_methods[] = {
- {"__copy__", ( PyCFunction ) CurvePoint___copy__, METH_NOARGS, "() Cloning method."},
- {"A", ( PyCFunction ) CurvePoint_A, METH_NOARGS, "() Returns the first SVertex upon which the CurvePoint is built."},
- {"B", ( PyCFunction ) CurvePoint_B, METH_NOARGS, "() Returns the second SVertex upon which the CurvePoint is built."},
- {"t2d", ( PyCFunction ) CurvePoint_t2d, METH_NOARGS, "() Returns the interpolation parameter."},
- {"setA", ( PyCFunction ) CurvePoint_setA, METH_VARARGS, "(SVertex sv) Sets the first SVertex upon which to build the CurvePoint."},
- {"setB", ( PyCFunction ) CurvePoint_setB, METH_VARARGS, "(SVertex sv) Sets the second SVertex upon which to build the CurvePoint."},
- {"setT2d", ( PyCFunction ) CurvePoint_setT2d, METH_VARARGS, "() Sets the 2D interpolation parameter to use."},
- {"curvatureFredo", ( PyCFunction ) CurvePoint_curvatureFredo, METH_NOARGS, "() angle in radians."},
- {NULL, NULL, 0, NULL}
-};
-
-/*-----------------------BPy_CurvePoint type definition ------------------------------*/
-
-PyTypeObject CurvePoint_Type = {
- PyVarObject_HEAD_INIT(NULL, 0)
- "CurvePoint", /* tp_name */
- sizeof(BPy_CurvePoint), /* 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 */
- "CurvePoint objects", /* tp_doc */
- 0, /* tp_traverse */
- 0, /* tp_clear */
- 0, /* tp_richcompare */
- 0, /* tp_weaklistoffset */
- 0, /* tp_iter */
- 0, /* tp_iternext */
- BPy_CurvePoint_methods, /* tp_methods */
- 0, /* tp_members */
- 0, /* tp_getset */
- &Interface0D_Type, /* tp_base */
- 0, /* tp_dict */
- 0, /* tp_descr_get */
- 0, /* tp_descr_set */
- 0, /* tp_dictoffset */
- (initproc)CurvePoint___init__, /* tp_init */
- 0, /* tp_alloc */
- 0, /* tp_new */
-};
-
//------------------------INSTANCE METHODS ----------------------------------
-int CurvePoint___init__(BPy_CurvePoint *self, PyObject *args, PyObject *kwds)
+static char CurvePoint___doc__[] =
+"Class to represent a point of a curve. A CurvePoint can be any point\n"
+"of a 1D curve (it doesn't have to be a vertex of the curve). Any\n"
+":class:`Interface1D` is built upon ViewEdges, themselves built upon\n"
+"FEdges. Therefore, a curve is basically a polyline made of a list of\n"
+":class:`SVertex` objects. Thus, a CurvePoint is built by linearly\n"
+"interpolating two :class:`SVertex` instances. CurvePoint can be used\n"
+"as virtual points while querying 0D information along a curve at a\n"
+"given resolution.\n"
+"\n"
+".. method:: __init__()\n"
+"\n"
+" Defult constructor.\n"
+"\n"
+".. method:: __init__(iBrother)\n"
+"\n"
+" Copy constructor.\n"
+"\n"
+" :arg iBrother: A CurvePoint object.\n"
+" :type iBrother: :class:`CurvePoint`\n"
+"\n"
+".. method:: __init__(iA, iB, t2d)\n"
+"\n"
+" Builds a CurvePoint from two SVertex and an interpolation parameter.\n"
+"\n"
+" :arg iA: The first SVertex.\n"
+" :type iA: :class:`SVertex`\n"
+" :arg iB: The second SVertex.\n"
+" :type iB: :class:`SVertex`\n"
+" :arg t2d: A 2D interpolation parameter used to linearly interpolate\n"
+" iA and iB.\n"
+" :type t2d: float\n"
+"\n"
+".. method:: __init__(iA, iB, t2d)\n"
+"\n"
+" Builds a CurvePoint from two CurvePoint and an interpolation\n"
+" parameter.\n"
+"\n"
+" :arg iA: The first CurvePoint.\n"
+" :type iA: :class:`CurvePoint`\n"
+" :arg iB: The second CurvePoint.\n"
+" :type iB: :class:`CurvePoint`\n"
+" :arg t2d: The 2D interpolation parameter used to linearly\n"
+" interpolate iA and iB.\n"
+" :type t2d: float\n";
+
+static int CurvePoint___init__(BPy_CurvePoint *self, PyObject *args, PyObject *kwds)
{
PyObject *obj1 = 0, *obj2 = 0 , *obj3 = 0;
@@ -121,7 +100,7 @@ int CurvePoint___init__(BPy_CurvePoint *self, PyObject *args, PyObject *kwds)
return 0;
}
-PyObject * CurvePoint___copy__( BPy_CurvePoint *self ) {
+static PyObject * CurvePoint___copy__( BPy_CurvePoint *self ) {
BPy_CurvePoint *py_cp;
py_cp = (BPy_CurvePoint *) CurvePoint_Type.tp_new( &CurvePoint_Type, 0, 0 );
@@ -133,7 +112,15 @@ PyObject * CurvePoint___copy__( BPy_CurvePoint *self ) {
return (PyObject *) py_cp;
}
-PyObject * CurvePoint_A( BPy_CurvePoint *self ) {
+static char CurvePoint_A___doc__[] =
+".. method:: A()\n"
+"\n"
+" Returns the first SVertex upon which the CurvePoint is built.\n"
+"\n"
+" :return: The first SVertex.\n"
+" :rtype: :class:`SVertex`\n";
+
+static PyObject * CurvePoint_A( BPy_CurvePoint *self ) {
SVertex *A = self->cp->A();
if( A )
return BPy_SVertex_from_SVertex( *A );
@@ -141,7 +128,15 @@ PyObject * CurvePoint_A( BPy_CurvePoint *self ) {
Py_RETURN_NONE;
}
-PyObject * CurvePoint_B( BPy_CurvePoint *self ) {
+static char CurvePoint_B___doc__[] =
+".. method:: B()\n"
+"\n"
+" Returns the second SVertex upon which the CurvePoint is built.\n"
+"\n"
+" :return: The second SVertex.\n"
+" :rtype: :class:`SVertex`\n";
+
+static PyObject * CurvePoint_B( BPy_CurvePoint *self ) {
SVertex *B = self->cp->B();
if( B )
return BPy_SVertex_from_SVertex( *B );
@@ -149,11 +144,27 @@ PyObject * CurvePoint_B( BPy_CurvePoint *self ) {
Py_RETURN_NONE;
}
-PyObject * CurvePoint_t2d( BPy_CurvePoint *self ) {
+static char CurvePoint_t2d___doc__[] =
+".. method:: t2d()\n"
+"\n"
+" Returns the 2D interpolation parameter.\n"
+"\n"
+" :return: The 2D interpolation parameter.\n"
+" :rtype: float\n";
+
+static PyObject * CurvePoint_t2d( BPy_CurvePoint *self ) {
return PyFloat_FromDouble( self->cp->t2d() );
}
-PyObject *CurvePoint_setA( BPy_CurvePoint *self , PyObject *args) {
+static char CurvePoint_setA___doc__[] =
+".. method:: setA(iA)\n"
+"\n"
+" Sets the first SVertex upon which to build the CurvePoint.\n"
+"\n"
+" :arg iA: The first SVertex.\n"
+" :type iA: :class:`SVertex`\n";
+
+static PyObject *CurvePoint_setA( BPy_CurvePoint *self , PyObject *args) {
PyObject *py_sv;
if(!( PyArg_ParseTuple(args, "O!", &SVertex_Type, &py_sv) ))
@@ -164,7 +175,15 @@ PyObject *CurvePoint_setA( BPy_CurvePoint *self , PyObject *args) {
Py_RETURN_NONE;
}
-PyObject *CurvePoint_setB( BPy_CurvePoint *self , PyObject *args) {
+static char CurvePoint_setB___doc__[] =
+".. method:: setB(iB)\n"
+"\n"
+" Sets the first SVertex upon which to build the CurvePoint.\n"
+"\n"
+" :arg iB: The second SVertex.\n"
+" :type iB: :class:`SVertex`\n";
+
+static PyObject *CurvePoint_setB( BPy_CurvePoint *self , PyObject *args) {
PyObject *py_sv;
if(!( PyArg_ParseTuple(args, "O!", &SVertex_Type, &py_sv) ))
@@ -175,7 +194,15 @@ PyObject *CurvePoint_setB( BPy_CurvePoint *self , PyObject *args) {
Py_RETURN_NONE;
}
-PyObject *CurvePoint_setT2d( BPy_CurvePoint *self , PyObject *args) {
+static char CurvePoint_setT2d___doc__[] =
+".. method:: setT2d(t)\n"
+"\n"
+" Sets the 2D interpolation parameter to use.\n"
+"\n"
+" :arg t: The 2D interpolation parameter.\n"
+" :type t: float\n";
+
+static PyObject *CurvePoint_setT2d( BPy_CurvePoint *self , PyObject *args) {
float t;
if(!( PyArg_ParseTuple(args, "f", &t) ))
@@ -186,14 +213,74 @@ PyObject *CurvePoint_setT2d( BPy_CurvePoint *self , PyObject *args) {
Py_RETURN_NONE;
}
-PyObject *CurvePoint_curvatureFredo( BPy_CurvePoint *self , PyObject *args) {
+static char CurvePoint_curvatureFredo___doc__[] =
+".. method:: curvatureFredo()\n"
+"\n"
+" Returns the angle in radians.\n"
+"\n"
+" :return: The angle in radians.\n"
+" :rtype: float\n";
+
+static PyObject *CurvePoint_curvatureFredo( BPy_CurvePoint *self , PyObject *args) {
return PyFloat_FromDouble( self->cp->curvatureFredo() );
}
///bool operator== (const CurvePoint &b)
+/*----------------------CurvePoint instance definitions ----------------------------*/
+static PyMethodDef BPy_CurvePoint_methods[] = {
+ {"__copy__", ( PyCFunction ) CurvePoint___copy__, METH_NOARGS, "() Cloning method."},
+ {"A", ( PyCFunction ) CurvePoint_A, METH_NOARGS, CurvePoint_A___doc__},
+ {"B", ( PyCFunction ) CurvePoint_B, METH_NOARGS, CurvePoint_B___doc__},
+ {"t2d", ( PyCFunction ) CurvePoint_t2d, METH_NOARGS, CurvePoint_t2d___doc__},
+ {"setA", ( PyCFunction ) CurvePoint_setA, METH_VARARGS, CurvePoint_setA___doc__},
+ {"setB", ( PyCFunction ) CurvePoint_setB, METH_VARARGS, CurvePoint_setB___doc__},
+ {"setT2d", ( PyCFunction ) CurvePoint_setT2d, METH_VARARGS, CurvePoint_setT2d___doc__},
+ {"curvatureFredo", ( PyCFunction ) CurvePoint_curvatureFredo, METH_NOARGS, CurvePoint_curvatureFredo___doc__},
+ {NULL, NULL, 0, NULL}
+};
-
+/*-----------------------BPy_CurvePoint type definition ------------------------------*/
+PyTypeObject CurvePoint_Type = {
+ PyVarObject_HEAD_INIT(NULL, 0)
+ "CurvePoint", /* tp_name */
+ sizeof(BPy_CurvePoint), /* 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 */
+ CurvePoint___doc__, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ BPy_CurvePoint_methods, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ &Interface0D_Type, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ (initproc)CurvePoint___init__, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+};
///////////////////////////////////////////////////////////////////////////////////////////
diff --git a/source/blender/freestyle/intern/python/Interface0D/BPy_SVertex.cpp b/source/blender/freestyle/intern/python/Interface0D/BPy_SVertex.cpp
index 84299ef3779..751955e1951 100644
--- a/source/blender/freestyle/intern/python/Interface0D/BPy_SVertex.cpp
+++ b/source/blender/freestyle/intern/python/Interface0D/BPy_SVertex.cpp
@@ -10,78 +10,32 @@ extern "C" {
///////////////////////////////////////////////////////////////////////////////////////////
-/*--------------- Python API function prototypes for SVertex instance -----------*/
-static int SVertex___init__(BPy_SVertex *self, PyObject *args, PyObject *kwds);
-static PyObject * SVertex___copy__( BPy_SVertex *self );
-static PyObject * SVertex_normals( BPy_SVertex *self );
-static PyObject * SVertex_normalsSize( BPy_SVertex *self );
-static PyObject * SVertex_viewvertex( BPy_SVertex *self );
-static PyObject * SVertex_setPoint3D( BPy_SVertex *self , PyObject *args);
-static PyObject * SVertex_setPoint2D( BPy_SVertex *self , PyObject *args);
-static PyObject * SVertex_AddNormal( BPy_SVertex *self , PyObject *args);
-static PyObject * SVertex_setId( BPy_SVertex *self , PyObject *args);
-static PyObject *SVertex_AddFEdge( BPy_SVertex *self , PyObject *args);
-
-/*----------------------SVertex instance definitions ----------------------------*/
-static PyMethodDef BPy_SVertex_methods[] = {
- {"__copy__", ( PyCFunction ) SVertex___copy__, METH_NOARGS, "() Cloning method."},
- {"normals", ( PyCFunction ) SVertex_normals, METH_NOARGS, "Returns the normals for this Vertex as a list. In a smooth surface, a vertex has exactly one normal. In a sharp surface, a vertex can have any number of normals."},
- {"normalsSize", ( PyCFunction ) SVertex_normalsSize, METH_NOARGS, "Returns the number of different normals for this vertex." },
- {"viewvertex", ( PyCFunction ) SVertex_viewvertex, METH_NOARGS, "If this SVertex is also a ViewVertex, this method returns a pointer onto this ViewVertex. 0 is returned otherwise." },
- {"setPoint3D", ( PyCFunction ) SVertex_setPoint3D, METH_VARARGS, "Sets the 3D coordinates of the SVertex." },
- {"setPoint2D", ( PyCFunction ) SVertex_setPoint2D, METH_VARARGS, "Sets the 3D projected coordinates of the SVertex." },
- {"AddNormal", ( PyCFunction ) SVertex_AddNormal, METH_VARARGS, "Adds a normal to the Svertex's set of normals. If the same normal is already in the set, nothing changes." },
- {"setId", ( PyCFunction ) SVertex_setId, METH_VARARGS, "Sets the Id." },
- {"AddFEdge", ( PyCFunction ) SVertex_AddFEdge, METH_VARARGS, "Add an FEdge to the list of edges emanating from this SVertex." },
- {NULL, NULL, 0, NULL}
-};
-
-/*-----------------------BPy_SVertex type definition ------------------------------*/
-
-PyTypeObject SVertex_Type = {
- PyVarObject_HEAD_INIT(NULL, 0)
- "SVertex", /* tp_name */
- sizeof(BPy_SVertex), /* 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 */
- "SVertex objects", /* tp_doc */
- 0, /* tp_traverse */
- 0, /* tp_clear */
- 0, /* tp_richcompare */
- 0, /* tp_weaklistoffset */
- 0, /* tp_iter */
- 0, /* tp_iternext */
- BPy_SVertex_methods, /* tp_methods */
- 0, /* tp_members */
- 0, /* tp_getset */
- &Interface0D_Type, /* tp_base */
- 0, /* tp_dict */
- 0, /* tp_descr_get */
- 0, /* tp_descr_set */
- 0, /* tp_dictoffset */
- (initproc)SVertex___init__, /* tp_init */
- 0, /* tp_alloc */
- 0, /* tp_new */
-};
+static char SVertex___doc__[] =
+"Class to define a vertex of the embedding.\n"
+"\n"
+".. method:: __init__()\n"
+"\n"
+" Default constructor.\n"
+"\n"
+".. method:: __init__(iBrother)\n"
+"\n"
+" Copy constructor.\n"
+"\n"
+" :arg iBrother: A SVertex object.\n"
+" :type iBrother: :class:`SVertex`\n"
+"\n"
+".. method:: __init__(iPoint3D, id)\n"
+"\n"
+" Builds a SVertex from 3D coordinates and an Id.\n"
+"\n"
+" :arg iPoint3D: A three-dimensional vector.\n"
+" :type iPoint3D: :class:`Mathutils.Vector`\n"
+" :arg id: An Id object.\n"
+" :type id: :class:`Id`\n";
//------------------------INSTANCE METHODS ----------------------------------
-int SVertex___init__(BPy_SVertex *self, PyObject *args, PyObject *kwds)
+static int SVertex___init__(BPy_SVertex *self, PyObject *args, PyObject *kwds)
{
PyObject *py_point = 0;
BPy_Id *py_id = 0;
@@ -116,7 +70,7 @@ int SVertex___init__(BPy_SVertex *self, PyObject *args, PyObject *kwds)
return 0;
}
-PyObject * SVertex___copy__( BPy_SVertex *self ) {
+static PyObject * SVertex___copy__( BPy_SVertex *self ) {
BPy_SVertex *py_svertex;
py_svertex = (BPy_SVertex *) SVertex_Type.tp_new( &SVertex_Type, 0, 0 );
@@ -128,8 +82,17 @@ PyObject * SVertex___copy__( BPy_SVertex *self ) {
return (PyObject *) py_svertex;
}
-
-PyObject * SVertex_normals( BPy_SVertex *self ) {
+static char SVertex_normals___doc__[] =
+".. method:: normals()\n"
+"\n"
+" Returns the normals for this Vertex as a list. In a smooth surface,\n"
+" a vertex has exactly one normal. In a sharp surface, a vertex can\n"
+" have any number of normals.\n"
+"\n"
+" :return: A list of normals.\n"
+" :rtype: List of :class:`Mathutils.Vector` objects\n";
+
+static PyObject * SVertex_normals( BPy_SVertex *self ) {
PyObject *py_normals;
set< Vec3r > normals;
@@ -144,11 +107,28 @@ PyObject * SVertex_normals( BPy_SVertex *self ) {
return py_normals;
}
-PyObject * SVertex_normalsSize( BPy_SVertex *self ) {
+static char SVertex_normalsSize___doc__[] =
+".. method:: normalsSize()\n"
+"\n"
+" Returns the number of different normals for this vertex.\n"
+"\n"
+" :return: The number of normals.\n"
+" :rtype: int\n";
+
+static PyObject * SVertex_normalsSize( BPy_SVertex *self ) {
return PyLong_FromLong( self->sv->normalsSize() );
}
-PyObject * SVertex_viewvertex( BPy_SVertex *self ) {
+static char SVertex_viewvertex___doc__[] =
+".. method:: viewvertex()\n"
+"\n"
+" If this SVertex is also a ViewVertex, this method returns the\n"
+" ViewVertex. None is returned otherwise.\n"
+"\n"
+" :return: The ViewVertex object.\n"
+" :rtype: :class:`ViewVertex`\n";
+
+static PyObject * SVertex_viewvertex( BPy_SVertex *self ) {
ViewVertex *vv = self->sv->viewvertex();
if( vv )
return Any_BPy_ViewVertex_from_ViewVertex( *vv );
@@ -156,7 +136,15 @@ PyObject * SVertex_viewvertex( BPy_SVertex *self ) {
Py_RETURN_NONE;
}
-PyObject *SVertex_setPoint3D( BPy_SVertex *self , PyObject *args) {
+static char SVertex_setPoint3D___doc__[] =
+".. method:: setPoint3D(p)\n"
+"\n"
+" Sets the 3D coordinates of the SVertex.\n"
+"\n"
+" :arg p: A three-dimensional vector.\n"
+" :type p: :class:`Mathutils.Vector`, list or tuple of 3 real numbers\n";
+
+static PyObject *SVertex_setPoint3D( BPy_SVertex *self , PyObject *args) {
PyObject *py_point;
if(!( PyArg_ParseTuple(args, "O", &py_point) ))
@@ -172,7 +160,15 @@ PyObject *SVertex_setPoint3D( BPy_SVertex *self , PyObject *args) {
Py_RETURN_NONE;
}
-PyObject *SVertex_setPoint2D( BPy_SVertex *self , PyObject *args) {
+static char SVertex_setPoint2D___doc__[] =
+".. method:: setPoint2D(p)\n"
+"\n"
+" Sets the 2D projected coordinates of the SVertex.\n"
+"\n"
+" :arg p: A three-dimensional vector.\n"
+" :type p: :class:`Mathutils.Vector`, list or tuple of 3 real numbers\n";
+
+static PyObject *SVertex_setPoint2D( BPy_SVertex *self , PyObject *args) {
PyObject *py_point;
if(!( PyArg_ParseTuple(args, "O", &py_point) ))
@@ -188,7 +184,16 @@ PyObject *SVertex_setPoint2D( BPy_SVertex *self , PyObject *args) {
Py_RETURN_NONE;
}
-PyObject *SVertex_AddNormal( BPy_SVertex *self , PyObject *args) {
+static char SVertex_AddNormal___doc__[] =
+".. method:: AddNormal(n)\n"
+"\n"
+" Adds a normal to the SVertex's set of normals. If the same normal\n"
+" is already in the set, nothing changes.\n"
+"\n"
+" :arg n: A three-dimensional vector.\n"
+" :type n: :class:`Mathutils.Vector`, list or tuple of 3 real numbers\n";
+
+static PyObject *SVertex_AddNormal( BPy_SVertex *self , PyObject *args) {
PyObject *py_normal;
if(!( PyArg_ParseTuple(args, "O", &py_normal) ))
@@ -204,7 +209,15 @@ PyObject *SVertex_AddNormal( BPy_SVertex *self , PyObject *args) {
Py_RETURN_NONE;
}
-PyObject *SVertex_setId( BPy_SVertex *self , PyObject *args) {
+static char SVertex_setId___doc__[] =
+".. method:: setId(id)\n"
+"\n"
+" Sets the identifier of the SVertex.\n"
+"\n"
+" :arg id: The identifier.\n"
+" :type id: :class:`Id`\n";
+
+static PyObject *SVertex_setId( BPy_SVertex *self , PyObject *args) {
BPy_Id *py_id;
if( !PyArg_ParseTuple(args, "O!", &Id_Type, &py_id) )
@@ -215,7 +228,15 @@ PyObject *SVertex_setId( BPy_SVertex *self , PyObject *args) {
Py_RETURN_NONE;
}
-PyObject *SVertex_AddFEdge( BPy_SVertex *self , PyObject *args) {
+static char SVertex_AddFEdge___doc__[] =
+".. method:: AddFEdge(fe)\n"
+"\n"
+" Add an FEdge to the list of edges emanating from this SVertex.\n"
+"\n"
+" :arg fe: An FEdge.\n"
+" :type fe: :class:`FEdge`\n";
+
+static PyObject *SVertex_AddFEdge( BPy_SVertex *self , PyObject *args) {
PyObject *py_fe;
if(!( PyArg_ParseTuple(args, "O!", &FEdge_Type, &py_fe) ))
@@ -226,10 +247,64 @@ PyObject *SVertex_AddFEdge( BPy_SVertex *self , PyObject *args) {
Py_RETURN_NONE;
}
-
// virtual bool operator== (const SVertex &iBrother)
// ViewVertex * viewvertex ()
+/*----------------------SVertex instance definitions ----------------------------*/
+static PyMethodDef BPy_SVertex_methods[] = {
+ {"__copy__", ( PyCFunction ) SVertex___copy__, METH_NOARGS, "() Cloning method."},
+ {"normals", ( PyCFunction ) SVertex_normals, METH_NOARGS, SVertex_normals___doc__},
+ {"normalsSize", ( PyCFunction ) SVertex_normalsSize, METH_NOARGS, SVertex_normalsSize___doc__},
+ {"viewvertex", ( PyCFunction ) SVertex_viewvertex, METH_NOARGS, SVertex_viewvertex___doc__},
+ {"setPoint3D", ( PyCFunction ) SVertex_setPoint3D, METH_VARARGS, SVertex_setPoint3D___doc__},
+ {"setPoint2D", ( PyCFunction ) SVertex_setPoint2D, METH_VARARGS, SVertex_setPoint2D___doc__},
+ {"AddNormal", ( PyCFunction ) SVertex_AddNormal, METH_VARARGS, SVertex_AddNormal___doc__},
+ {"setId", ( PyCFunction ) SVertex_setId, METH_VARARGS, SVertex_setId___doc__},
+ {"AddFEdge", ( PyCFunction ) SVertex_AddFEdge, METH_VARARGS, SVertex_AddFEdge___doc__},
+ {NULL, NULL, 0, NULL}
+};
+
+/*-----------------------BPy_SVertex type definition ------------------------------*/
+PyTypeObject SVertex_Type = {
+ PyVarObject_HEAD_INIT(NULL, 0)
+ "SVertex", /* tp_name */
+ sizeof(BPy_SVertex), /* 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 */
+ SVertex___doc__, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ BPy_SVertex_methods, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ &Interface0D_Type, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ (initproc)SVertex___init__, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+};
///////////////////////////////////////////////////////////////////////////////////////////
diff --git a/source/blender/freestyle/intern/python/Interface0D/BPy_ViewVertex.cpp b/source/blender/freestyle/intern/python/Interface0D/BPy_ViewVertex.cpp
index 8e7a9fe547d..9b81ce56400 100644
--- a/source/blender/freestyle/intern/python/Interface0D/BPy_ViewVertex.cpp
+++ b/source/blender/freestyle/intern/python/Interface0D/BPy_ViewVertex.cpp
@@ -10,68 +10,31 @@ extern "C" {
///////////////////////////////////////////////////////////////////////////////////////////
-/*--------------- Python API function prototypes for ViewVertex instance -----------*/
-static int ViewVertex___init__( BPy_ViewVertex *self, PyObject *args, PyObject *kwds );
-static PyObject * ViewVertex_setNature( BPy_ViewVertex *self, PyObject *args );
-static PyObject * ViewVertex_edgesBegin( BPy_ViewVertex *self );
-static PyObject * ViewVertex_edgesEnd( BPy_ViewVertex *self );
-static PyObject * ViewVertex_edgesIterator( BPy_ViewVertex *self, PyObject *args );
-
-/*----------------------ViewVertex instance definitions ----------------------------*/
-static PyMethodDef BPy_ViewVertex_methods[] = {
- {"setNature", ( PyCFunction ) ViewVertex_setNature, METH_VARARGS, "(Nature n) Sets the nature of the vertex."},
- {"edgesBegin", ( PyCFunction ) ViewVertex_edgesBegin, METH_NOARGS, "() Returns an iterator over the ViewEdges that goes to or comes from this ViewVertex pointing to the first ViewEdge of the list. The orientedViewEdgeIterator allows to iterate in CCW order over these ViewEdges and to get the orientation for each ViewEdge (incoming/outgoing). "},
- {"edgesEnd", ( PyCFunction ) ViewVertex_edgesEnd, METH_NOARGS, "() Returns an orientedViewEdgeIterator over the ViewEdges around this ViewVertex, pointing after the last ViewEdge."},
- {"edgesIterator", ( PyCFunction ) ViewVertex_edgesIterator, METH_VARARGS, "(ViewEdge ve) Returns an orientedViewEdgeIterator pointing to the ViewEdge given as argument. "},
- {NULL, NULL, 0, NULL}
-};
-
-/*-----------------------BPy_ViewVertex type definition ------------------------------*/
-
-PyTypeObject ViewVertex_Type = {
- PyVarObject_HEAD_INIT(NULL, 0)
- "ViewVertex", /* tp_name */
- sizeof(BPy_ViewVertex), /* 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 */
- "ViewVertex objects", /* tp_doc */
- 0, /* tp_traverse */
- 0, /* tp_clear */
- 0, /* tp_richcompare */
- 0, /* tp_weaklistoffset */
- 0, /* tp_iter */
- 0, /* tp_iternext */
- BPy_ViewVertex_methods, /* tp_methods */
- 0, /* tp_members */
- 0, /* tp_getset */
- &Interface0D_Type, /* tp_base */
- 0, /* tp_dict */
- 0, /* tp_descr_get */
- 0, /* tp_descr_set */
- 0, /* tp_dictoffset */
- (initproc)ViewVertex___init__, /* tp_init */
- 0, /* tp_alloc */
- 0, /* tp_new */
-};
-
//------------------------INSTANCE METHODS ----------------------------------
-int ViewVertex___init__( BPy_ViewVertex *self, PyObject *args, PyObject *kwds )
+static char ViewVertex___doc__[] =
+"Class to define a view vertex. A view vertex is a feature vertex\n"
+"corresponding to a point of the image graph, where the characteristics\n"
+"of an edge (e.g., nature and visibility) might change. A\n"
+":class:`ViewVertex` can be of two kinds: A :class:`TVertex` when it\n"
+"corresponds to the intersection between two ViewEdges or a\n"
+":class:`NonTVertex` when it corresponds to a vertex of the initial\n"
+"input mesh (it is the case for vertices such as corners for example).\n"
+"Thus, this class can be specialized into two classes, the\n"
+":class:`TVertex` class and the :class:`NonTVertex` class.\n"
+"\n"
+".. method:: __init__()\n"
+"\n"
+" Default constructor.\n"
+"\n"
+".. method:: __init__(iBrother)\n"
+"\n"
+" Copy constructor.\n"
+"\n"
+" :arg iBrother: A ViewVertex object.\n"
+" :type iBrother: :class:`ViewVertex`\n";
+
+static int ViewVertex___init__( BPy_ViewVertex *self, PyObject *args, PyObject *kwds )
{
if( !PyArg_ParseTuple(args, "") )
return -1;
@@ -81,9 +44,15 @@ int ViewVertex___init__( BPy_ViewVertex *self, PyObject *args, PyObject *kwds )
return 0;
}
+static char ViewVertex_setNature___doc__[] =
+".. method:: setNature(iNature)\n"
+"\n"
+" Sets the nature of the vertex.\n"
+"\n"
+" :arg iNature: A Nature object.\n"
+" :type iNature: :class:`Nature`\n";
-
-PyObject * ViewVertex_setNature( BPy_ViewVertex *self, PyObject *args ) {
+static PyObject * ViewVertex_setNature( BPy_ViewVertex *self, PyObject *args ) {
PyObject *py_n;
if( !self->vv )
@@ -98,7 +67,19 @@ PyObject * ViewVertex_setNature( BPy_ViewVertex *self, PyObject *args ) {
Py_RETURN_NONE;
}
-PyObject * ViewVertex_edgesBegin( BPy_ViewVertex *self ) {
+static char ViewVertex_edgesBegin___doc__[] =
+".. method:: edgesBegin()\n"
+"\n"
+" Returns an iterator over the ViewEdges that goes to or comes from\n"
+" this ViewVertex pointing to the first ViewEdge of the list. The\n"
+" orientedViewEdgeIterator allows to iterate in CCW order over these\n"
+" ViewEdges and to get the orientation for each ViewEdge\n"
+" (incoming/outgoing).\n"
+"\n"
+" :return: An orientedViewEdgeIterator pointing to the first ViewEdge.\n"
+" :rtype: :class:`orientedViewEdgeIterator`\n";
+
+static PyObject * ViewVertex_edgesBegin( BPy_ViewVertex *self ) {
if( !self->vv )
Py_RETURN_NONE;
@@ -106,7 +87,16 @@ PyObject * ViewVertex_edgesBegin( BPy_ViewVertex *self ) {
return BPy_orientedViewEdgeIterator_from_orientedViewEdgeIterator( ove_it, 0 );
}
-PyObject * ViewVertex_edgesEnd( BPy_ViewVertex *self ) {
+static char ViewVertex_edgesEnd___doc__[] =
+".. method:: edgesEnd()\n"
+"\n"
+" Returns an orientedViewEdgeIterator over the ViewEdges around this\n"
+" ViewVertex, pointing after the last ViewEdge.\n"
+"\n"
+" :return: An orientedViewEdgeIterator pointing after the last ViewEdge.\n"
+" :rtype: :class:`orientedViewEdgeIterator`\n";
+
+static PyObject * ViewVertex_edgesEnd( BPy_ViewVertex *self ) {
#if 0
if( !self->vv )
Py_RETURN_NONE;
@@ -119,8 +109,18 @@ PyObject * ViewVertex_edgesEnd( BPy_ViewVertex *self ) {
#endif
}
-
-PyObject * ViewVertex_edgesIterator( BPy_ViewVertex *self, PyObject *args ) {
+static char ViewVertex_edgesIterator___doc__[] =
+".. method:: edgesIterator(iEdge)\n"
+"\n"
+" Returns an orientedViewEdgeIterator pointing to the ViewEdge given\n"
+" as argument.\n"
+"\n"
+" :arg iEdge: A ViewEdge object.\n"
+" :type iEdge: :class:`ViewEdge`\n"
+" :return: An orientedViewEdgeIterator pointing to the given ViewEdge.\n"
+" :rtype: :class:`orientedViewEdgeIterator`\n";
+
+static PyObject * ViewVertex_edgesIterator( BPy_ViewVertex *self, PyObject *args ) {
PyObject *py_ve;
if( !self->vv )
@@ -134,6 +134,56 @@ PyObject * ViewVertex_edgesIterator( BPy_ViewVertex *self, PyObject *args ) {
return BPy_orientedViewEdgeIterator_from_orientedViewEdgeIterator( ove_it, 0 );
}
+/*----------------------ViewVertex instance definitions ----------------------------*/
+static PyMethodDef BPy_ViewVertex_methods[] = {
+ {"setNature", ( PyCFunction ) ViewVertex_setNature, METH_VARARGS, ViewVertex_setNature___doc__},
+ {"edgesBegin", ( PyCFunction ) ViewVertex_edgesBegin, METH_NOARGS, ViewVertex_edgesBegin___doc__},
+ {"edgesEnd", ( PyCFunction ) ViewVertex_edgesEnd, METH_NOARGS, ViewVertex_edgesEnd___doc__},
+ {"edgesIterator", ( PyCFunction ) ViewVertex_edgesIterator, METH_VARARGS, ViewVertex_edgesIterator___doc__},
+ {NULL, NULL, 0, NULL}
+};
+
+/*-----------------------BPy_ViewVertex type definition ------------------------------*/
+PyTypeObject ViewVertex_Type = {
+ PyVarObject_HEAD_INIT(NULL, 0)
+ "ViewVertex", /* tp_name */
+ sizeof(BPy_ViewVertex), /* 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 */
+ ViewVertex___doc__, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ BPy_ViewVertex_methods, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ &Interface0D_Type, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ (initproc)ViewVertex___init__, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+};
///////////////////////////////////////////////////////////////////////////////////////////
diff --git a/source/blender/freestyle/intern/python/Interface0D/CurvePoint/BPy_StrokeVertex.cpp b/source/blender/freestyle/intern/python/Interface0D/CurvePoint/BPy_StrokeVertex.cpp
index 4e4713c8a3d..91002b81c87 100644
--- a/source/blender/freestyle/intern/python/Interface0D/CurvePoint/BPy_StrokeVertex.cpp
+++ b/source/blender/freestyle/intern/python/Interface0D/CurvePoint/BPy_StrokeVertex.cpp
@@ -10,88 +10,58 @@ extern "C" {
///////////////////////////////////////////////////////////////////////////////////////////
-/*--------------- Python API function prototypes for StrokeVertex instance -----------*/
-static int StrokeVertex___init__(BPy_StrokeVertex *self, PyObject *args, PyObject *kwds);
-
-static PyObject * StrokeVertex_x( BPy_StrokeVertex *self );
-static PyObject * StrokeVertex_y( BPy_StrokeVertex *self );
-static PyObject * StrokeVertex_getPoint( BPy_StrokeVertex *self );
-static PyObject * StrokeVertex_attribute( BPy_StrokeVertex *self );
-static PyObject * StrokeVertex_curvilinearAbscissa( BPy_StrokeVertex *self );
-static PyObject * StrokeVertex_strokeLength( BPy_StrokeVertex *self );
-static PyObject * StrokeVertex_u( BPy_StrokeVertex *self );
-static PyObject * StrokeVertex_setX( BPy_StrokeVertex *self , PyObject *args);
-static PyObject * StrokeVertex_setY( BPy_StrokeVertex *self , PyObject *args);
-static PyObject * StrokeVertex_setPoint( BPy_StrokeVertex *self , PyObject *args);
-static PyObject * StrokeVertex_setAttribute( BPy_StrokeVertex *self , PyObject *args);
-static PyObject * StrokeVertex_setCurvilinearAbscissa( BPy_StrokeVertex *self , PyObject *args);
-static PyObject * StrokeVertex_setStrokeLength( BPy_StrokeVertex *self , PyObject *args);
-
-/*----------------------StrokeVertex instance definitions ----------------------------*/
-static PyMethodDef BPy_StrokeVertex_methods[] = {
-// {"__copy__", ( PyCFunction ) StrokeVertex___copy__, METH_NOARGS, "() Cloning method."},
- {"x", ( PyCFunction ) StrokeVertex_x, METH_NOARGS, "() Returns the 2D point x coordinate"},
- {"y", ( PyCFunction ) StrokeVertex_y, METH_NOARGS, "() Returns the 2D point y coordinate"},
- {"getPoint", ( PyCFunction ) StrokeVertex_getPoint, METH_NOARGS, "() Returns the 2D point coordinates as a Vec2d"},
- {"attribute", ( PyCFunction ) StrokeVertex_attribute, METH_NOARGS, "() Returns the StrokeAttribute of this StrokeVertex"},
- {"curvilinearAbscissa", ( PyCFunction ) StrokeVertex_curvilinearAbscissa, METH_NOARGS, "() Returns the curvilinear abscissa "},
- {"strokeLength", ( PyCFunction ) StrokeVertex_strokeLength, METH_NOARGS, "() Returns the length of the Stroke to which this StrokeVertex belongs"},
- {"u", ( PyCFunction ) StrokeVertex_u, METH_NOARGS, "() Returns the curvilinear abscissa of this StrokeVertex in the Stroke"},
- {"setX", ( PyCFunction ) StrokeVertex_setX, METH_VARARGS, "(double r) Sets the 2D x value "},
- {"setY", ( PyCFunction ) StrokeVertex_setY, METH_VARARGS, "(double r) Sets the 2D y value "},
- {"setPoint", ( PyCFunction ) StrokeVertex_setPoint, METH_VARARGS, "(double x, double y) / ( [x,y] ) Sets the 2D x and y values"},
- {"setAttribute", ( PyCFunction ) StrokeVertex_setAttribute, METH_VARARGS, "(StrokeAttribute sa) Sets the attribute."},
- {"setCurvilinearAbscissa", ( PyCFunction ) StrokeVertex_setCurvilinearAbscissa, METH_VARARGS, "(double r) Sets the curvilinear abscissa of this StrokeVertex in the Stroke"},
- {"setStrokeLength", ( PyCFunction ) StrokeVertex_setStrokeLength, METH_VARARGS, "(double r) Sets the Stroke's length (it's only a value stored by the Stroke Vertex, it won't change the real Stroke's length.) "},
- {NULL, NULL, 0, NULL}
-};
-
-/*-----------------------BPy_StrokeVertex type definition ------------------------------*/
-
-PyTypeObject StrokeVertex_Type = {
- PyVarObject_HEAD_INIT(NULL, 0)
- "StrokeVertex", /* tp_name */
- sizeof(BPy_StrokeVertex), /* 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 */
- "StrokeVertex objects", /* tp_doc */
- 0, /* tp_traverse */
- 0, /* tp_clear */
- 0, /* tp_richcompare */
- 0, /* tp_weaklistoffset */
- 0, /* tp_iter */
- 0, /* tp_iternext */
- BPy_StrokeVertex_methods, /* tp_methods */
- 0, /* tp_members */
- 0, /* tp_getset */
- &CurvePoint_Type, /* tp_base */
- 0, /* tp_dict */
- 0, /* tp_descr_get */
- 0, /* tp_descr_set */
- 0, /* tp_dictoffset */
- (initproc)StrokeVertex___init__, /* tp_init */
- 0, /* tp_alloc */
- 0, /* tp_new */
-};
-
//------------------------INSTANCE METHODS ----------------------------------
-int StrokeVertex___init__(BPy_StrokeVertex *self, PyObject *args, PyObject *kwds)
+static char StrokeVertex___doc__[] =
+"Class to define a stroke vertex.\n"
+"\n"
+".. method:: __init__()\n"
+"\n"
+" Default constructor.\n"
+"\n"
+".. method:: __init__(iBrother)\n"
+"\n"
+" Copy constructor.\n"
+"\n"
+" :arg iBrother: A StrokeVertex object.\n"
+" :type iBrother: :class:`StrokeVertex`\n"
+"\n"
+".. method:: __init__(iA, iB, t3)\n"
+"\n"
+" Builds a stroke vertex from 2 stroke vertices and an interpolation\n"
+" parameter.\n"
+"\n"
+" :arg iA: The first StrokeVertex.\n"
+" :type iA: :class:`StrokeVertex`\n"
+" :arg iB: The second StrokeVertex.\n"
+" :type iB: :class:`StrokeVertex`\n"
+" :arg t3: An interpolation parameter.\n"
+" :type t3: float\n"
+"\n"
+".. method:: __init__(iPoint)\n"
+"\n"
+" Builds a stroke vertex from a CurvePoint\n"
+"\n"
+" :arg iPoint: A CurvePoint object.\n"
+" :type iPoint: :class:`CurvePoint`\n"
+"\n"
+".. method:: __init__(iSVertex)\n"
+"\n"
+" Builds a stroke vertex from a SVertex\n"
+"\n"
+" :arg iSVertex: An SVertex object.\n"
+" :type iSVertex: :class:`SVertex`\n"
+"\n"
+".. method:: __init__(iSVertex, iAttribute)\n"
+"\n"
+" Builds a stroke vertex from an SVertex and a StrokeAttribute object.\n"
+"\n"
+" :arg iSVertex: An SVertex object.\n"
+" :type iSVertex: :class:`SVertex`\n"
+" :arg iAttribute: A StrokeAttribute object.\n"
+" :type iAttribute: :class:`StrokeAttribute`\n";
+
+static int StrokeVertex___init__(BPy_StrokeVertex *self, PyObject *args, PyObject *kwds)
{
PyObject *obj1 = 0, *obj2 = 0 , *obj3 = 0;
@@ -136,37 +106,100 @@ int StrokeVertex___init__(BPy_StrokeVertex *self, PyObject *args, PyObject *kwds
return 0;
}
-PyObject * StrokeVertex_x( BPy_StrokeVertex *self ) {
+static char StrokeVertex_x___doc__[] =
+".. method:: x()\n"
+"\n"
+" Returns the 2D point X coordinate.\n"
+"\n"
+" :return: The X coordinate.\n"
+" :rtype: float\n";
+
+static PyObject * StrokeVertex_x( BPy_StrokeVertex *self ) {
return PyFloat_FromDouble( self->sv->x() );
}
-PyObject * StrokeVertex_y( BPy_StrokeVertex *self ) {
+static char StrokeVertex_y___doc__[] =
+".. method:: y()\n"
+"\n"
+" Returns the 2D point Y coordinate.\n"
+"\n"
+" :return: The Y coordinate.\n"
+" :rtype: float\n";
+
+static PyObject * StrokeVertex_y( BPy_StrokeVertex *self ) {
return PyFloat_FromDouble( self->sv->y() );
}
-PyObject * StrokeVertex_getPoint( BPy_StrokeVertex *self ) {
+static char StrokeVertex_getPoint___doc__[] =
+".. method:: getPoint()\n"
+"\n"
+" Returns the 2D point coordinates as a two-dimensional vector.\n"
+"\n"
+" :return: The 2D coordinates.\n"
+" :rtype: :class:`Mathutils.Vector`\n";
+
+static PyObject * StrokeVertex_getPoint( BPy_StrokeVertex *self ) {
Vec2f v( self->sv->getPoint() );
return Vector_from_Vec2f( v );
}
-PyObject * StrokeVertex_attribute( BPy_StrokeVertex *self ) {
+static char StrokeVertex_attribute___doc__[] =
+".. method:: attribute()\n"
+"\n"
+" Returns the StrokeAttribute for this StrokeVertex.\n"
+"\n"
+" :return: The StrokeAttribute object.\n"
+" :rtype: :class:`StrokeAttribute`\n";
+
+static PyObject * StrokeVertex_attribute( BPy_StrokeVertex *self ) {
return BPy_StrokeAttribute_from_StrokeAttribute( self->sv->attribute() );
}
-PyObject * StrokeVertex_curvilinearAbscissa( BPy_StrokeVertex *self ) {
+static char StrokeVertex_curvilinearAbscissa___doc__[] =
+".. method:: curvilinearAbscissa()\n"
+"\n"
+" Returns the curvilinear abscissa.\n"
+"\n"
+" :return: The curvilinear abscissa.\n"
+" :rtype: float\n";
+
+static PyObject * StrokeVertex_curvilinearAbscissa( BPy_StrokeVertex *self ) {
return PyFloat_FromDouble( self->sv->curvilinearAbscissa() );
}
-PyObject * StrokeVertex_strokeLength( BPy_StrokeVertex *self ) {
+static char StrokeVertex_strokeLength___doc__[] =
+".. method:: strokeLength()\n"
+"\n"
+" Returns the length of the Stroke to which this StrokeVertex belongs\n"
+"\n"
+" :return: The stroke length.\n"
+" :rtype: float\n";
+
+static PyObject * StrokeVertex_strokeLength( BPy_StrokeVertex *self ) {
return PyFloat_FromDouble( self->sv->strokeLength() );
}
-PyObject * StrokeVertex_u( BPy_StrokeVertex *self ) {
+static char StrokeVertex_u___doc__[] =
+".. method:: u()\n"
+"\n"
+" Returns the curvilinear abscissa of this StrokeVertex in the Stroke\n"
+"\n"
+" :return: The curvilinear abscissa.\n"
+" :rtype: float\n";
+
+static PyObject * StrokeVertex_u( BPy_StrokeVertex *self ) {
return PyFloat_FromDouble( self->sv->u() );
}
+static char StrokeVertex_setX___doc__[] =
+".. method:: setX(x)\n"
+"\n"
+" Sets the 2D point X coordinate.\n"
+"\n"
+" :arg x: The X coordinate.\n"
+" :type x: float\n";
-PyObject *StrokeVertex_setX( BPy_StrokeVertex *self , PyObject *args) {
+static PyObject *StrokeVertex_setX( BPy_StrokeVertex *self , PyObject *args) {
double r;
if(!( PyArg_ParseTuple(args, "d", &r) ))
@@ -177,7 +210,15 @@ PyObject *StrokeVertex_setX( BPy_StrokeVertex *self , PyObject *args) {
Py_RETURN_NONE;
}
-PyObject *StrokeVertex_setY( BPy_StrokeVertex *self , PyObject *args) {
+static char StrokeVertex_setY___doc__[] =
+".. method:: setY(y)\n"
+"\n"
+" Sets the 2D point Y coordinate.\n"
+"\n"
+" :arg y: The Y coordinate.\n"
+" :type y: float\n";
+
+static PyObject *StrokeVertex_setY( BPy_StrokeVertex *self , PyObject *args) {
double r;
if(!( PyArg_ParseTuple(args, "d", &r) ))
@@ -188,8 +229,24 @@ PyObject *StrokeVertex_setY( BPy_StrokeVertex *self , PyObject *args) {
Py_RETURN_NONE;
}
-
-PyObject *StrokeVertex_setPoint( BPy_StrokeVertex *self , PyObject *args) {
+static char StrokeVertex_setPoint___doc__[] =
+".. method:: setPoint(x, y)\n"
+"\n"
+" Sets the 2D point X and Y coordinates.\n"
+"\n"
+" :arg x: The X coordinate.\n"
+" :type x: float\n"
+" :arg y: The Y coordinate.\n"
+" :type y: float\n"
+"\n"
+".. method:: SetPoint(p)\n"
+"\n"
+" Sets the 2D point X and Y coordinates.\n"
+"\n"
+" :arg p: A two-dimensional vector.\n"
+" :type p: :class:`Mathutils.Vector`, list or tuple of 2 real numbers\n";
+
+static PyObject *StrokeVertex_setPoint( BPy_StrokeVertex *self , PyObject *args) {
PyObject *obj1 = 0, *obj2 = 0;
if(!( PyArg_ParseTuple(args, "O|O", &obj1, &obj2) ))
@@ -213,7 +270,15 @@ PyObject *StrokeVertex_setPoint( BPy_StrokeVertex *self , PyObject *args) {
Py_RETURN_NONE;
}
-PyObject *StrokeVertex_setAttribute( BPy_StrokeVertex *self , PyObject *args) {
+static char StrokeVertex_setAttribute___doc__[] =
+".. method:: setAttribute(iAttribute)\n"
+"\n"
+" Sets the attribute.\n"
+"\n"
+" :arg iAttribute: A StrokeAttribute object.\n"
+" :type iAttribute: :class:`StrokeAttribute`\n";
+
+static PyObject *StrokeVertex_setAttribute( BPy_StrokeVertex *self , PyObject *args) {
PyObject *py_sa;
if(!( PyArg_ParseTuple(args, "O!", &StrokeAttribute_Type, &py_sa) ))
@@ -224,7 +289,15 @@ PyObject *StrokeVertex_setAttribute( BPy_StrokeVertex *self , PyObject *args) {
Py_RETURN_NONE;
}
-PyObject *StrokeVertex_setCurvilinearAbscissa( BPy_StrokeVertex *self , PyObject *args) {
+static char StrokeVertex_setCurvilinearAbscissa___doc__[] =
+".. method:: setCurvilinearAbscissa(iAbscissa)\n"
+"\n"
+" Sets the curvilinear abscissa of this StrokeVertex in the Stroke\n"
+"\n"
+" :arg iAbscissa: The curvilinear abscissa.\n"
+" :type iAbscissa: float\n";
+
+static PyObject *StrokeVertex_setCurvilinearAbscissa( BPy_StrokeVertex *self , PyObject *args) {
double r;
if(!( PyArg_ParseTuple(args, "d", &r) ))
@@ -235,8 +308,16 @@ PyObject *StrokeVertex_setCurvilinearAbscissa( BPy_StrokeVertex *self , PyObject
Py_RETURN_NONE;
}
+static char StrokeVertex_setStrokeLength___doc__[] =
+".. method:: setStrokeLength(iLength)\n"
+"\n"
+" Sets the stroke length (it is only a value retained by the\n"
+" StrokeVertex, and it won't change the real stroke length).\n"
+"\n"
+" :arg iLength: The stroke length.\n"
+" :type iLength: float\n";
-PyObject *StrokeVertex_setStrokeLength( BPy_StrokeVertex *self , PyObject *args) {
+static PyObject *StrokeVertex_setStrokeLength( BPy_StrokeVertex *self , PyObject *args) {
double r;
if(!( PyArg_ParseTuple(args, "d", &r) ))
@@ -250,6 +331,67 @@ PyObject *StrokeVertex_setStrokeLength( BPy_StrokeVertex *self , PyObject *args)
// real operator[] (const int i) const
// real & operator[] (const int i)
+/*----------------------StrokeVertex instance definitions ----------------------------*/
+static PyMethodDef BPy_StrokeVertex_methods[] = {
+// {"__copy__", ( PyCFunction ) StrokeVertex___copy__, METH_NOARGS, "() Cloning method."},
+ {"x", ( PyCFunction ) StrokeVertex_x, METH_NOARGS, StrokeVertex_x___doc__},
+ {"y", ( PyCFunction ) StrokeVertex_y, METH_NOARGS, StrokeVertex_y___doc__},
+ {"getPoint", ( PyCFunction ) StrokeVertex_getPoint, METH_NOARGS, StrokeVertex_getPoint___doc__},
+ {"attribute", ( PyCFunction ) StrokeVertex_attribute, METH_NOARGS, StrokeVertex_attribute___doc__},
+ {"curvilinearAbscissa", ( PyCFunction ) StrokeVertex_curvilinearAbscissa, METH_NOARGS, StrokeVertex_curvilinearAbscissa___doc__},
+ {"strokeLength", ( PyCFunction ) StrokeVertex_strokeLength, METH_NOARGS, StrokeVertex_strokeLength___doc__},
+ {"u", ( PyCFunction ) StrokeVertex_u, METH_NOARGS, StrokeVertex_u___doc__},
+ {"setX", ( PyCFunction ) StrokeVertex_setX, METH_VARARGS, StrokeVertex_setX___doc__},
+ {"setY", ( PyCFunction ) StrokeVertex_setY, METH_VARARGS, StrokeVertex_setY___doc__},
+ {"setPoint", ( PyCFunction ) StrokeVertex_setPoint, METH_VARARGS, StrokeVertex_setPoint___doc__},
+ {"setAttribute", ( PyCFunction ) StrokeVertex_setAttribute, METH_VARARGS, StrokeVertex_setAttribute___doc__},
+ {"setCurvilinearAbscissa", ( PyCFunction ) StrokeVertex_setCurvilinearAbscissa, METH_VARARGS, StrokeVertex_setCurvilinearAbscissa___doc__},
+ {"setStrokeLength", ( PyCFunction ) StrokeVertex_setStrokeLength, METH_VARARGS, StrokeVertex_setStrokeLength___doc__},
+ {NULL, NULL, 0, NULL}
+};
+
+/*-----------------------BPy_StrokeVertex type definition ------------------------------*/
+PyTypeObject StrokeVertex_Type = {
+ PyVarObject_HEAD_INIT(NULL, 0)
+ "StrokeVertex", /* tp_name */
+ sizeof(BPy_StrokeVertex), /* 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 */
+ StrokeVertex___doc__, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ BPy_StrokeVertex_methods, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ &CurvePoint_Type, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ (initproc)StrokeVertex___init__, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+};
+
///////////////////////////////////////////////////////////////////////////////////////////
#ifdef __cplusplus
diff --git a/source/blender/freestyle/intern/python/Interface0D/ViewVertex/BPy_NonTVertex.cpp b/source/blender/freestyle/intern/python/Interface0D/ViewVertex/BPy_NonTVertex.cpp
index 8aca6ef9ede..c842be49136 100644
--- a/source/blender/freestyle/intern/python/Interface0D/ViewVertex/BPy_NonTVertex.cpp
+++ b/source/blender/freestyle/intern/python/Interface0D/ViewVertex/BPy_NonTVertex.cpp
@@ -9,22 +9,101 @@ extern "C" {
///////////////////////////////////////////////////////////////////////////////////////////
-/*--------------- Python API function prototypes for NonTVertex___init__ instance -----------*/
-static int NonTVertex___init__(BPy_NonTVertex *self, PyObject *args, PyObject *kwds);
+//------------------------INSTANCE METHODS ----------------------------------
+
+static char NonTVertex___doc__[] =
+"View vertex for corners, cusps, etc. associated to a single SVertex.\n"
+"Can be associated to 2 or more view edges.\n"
+"\n"
+".. method:: __init__()\n"
+"\n"
+" Default constructor.\n"
+"\n"
+".. method:: __init__(iBrother)\n"
+"\n"
+" Copy constructor.\n"
+"\n"
+" :arg iBrother: A NonTVertex object.\n"
+" :type iBrother: :class:`NonTVertex`\n"
+"\n"
+".. method:: __init__(iSVertex)\n"
+"\n"
+" Builds a NonTVertex from a SVertex.\n"
+"\n"
+" :arg iSVertex: An SVertex object.\n"
+" :type iSVertex: :class:`SVertex`\n";
+
+static int NonTVertex___init__(BPy_NonTVertex *self, PyObject *args, PyObject *kwds)
+{
+
+ PyObject *obj = 0;
+
+ if (! PyArg_ParseTuple(args, "|O!", &SVertex_Type, &obj) )
+ return -1;
+
+ if( !obj ){
+ self->ntv = new NonTVertex();
+
+ } else if( ((BPy_SVertex *) obj)->sv ) {
+ self->ntv = new NonTVertex( ((BPy_SVertex *) obj)->sv );
+
+ } else {
+ PyErr_SetString(PyExc_TypeError, "invalid argument");
+ return -1;
+ }
+
+ self->py_vv.vv = self->ntv;
+ self->py_vv.py_if0D.if0D = self->ntv;
+ self->py_vv.py_if0D.borrowed = 0;
-static PyObject * NonTVertex_svertex( BPy_NonTVertex *self );
-static PyObject * NonTVertex_setSVertex( BPy_NonTVertex *self, PyObject *args);
+ return 0;
+}
+
+static char NonTVertex_svertex___doc__[] =
+".. method:: svertex()\n"
+"\n"
+" Returns the SVertex on top of which this NonTVertex is built.\n"
+"\n"
+" :return: The SVertex on top of which this NonTVertex is built.\n"
+" :rtype: :class:`SVertex`\n";
+
+static PyObject * NonTVertex_svertex( BPy_NonTVertex *self ) {
+ SVertex *v = self->ntv->svertex();
+ if( v ){
+ return BPy_SVertex_from_SVertex( *v );
+ }
+
+ Py_RETURN_NONE;
+}
+
+static char NonTVertex_setSVertex___doc__[] =
+".. method:: setSVertex(iSVertex)\n"
+"\n"
+" Sets the SVertex on top of which this NonTVertex is built.\n"
+"\n"
+" :arg iSVertex: The SVertex on top of which this NonTVertex is built.\n"
+" :type iSVertex: :class:`SVertex`\n";
+
+static PyObject * NonTVertex_setSVertex( BPy_NonTVertex *self, PyObject *args) {
+ PyObject *py_sv;
+
+ if(!( PyArg_ParseTuple(args, "O!", &SVertex_Type, &py_sv) ))
+ return NULL;
+
+ self->ntv->setSVertex( ((BPy_SVertex *) py_sv)->sv );
+
+ Py_RETURN_NONE;
+}
/*----------------------NonTVertex instance definitions ----------------------------*/
static PyMethodDef BPy_NonTVertex_methods[] = {
// {"__copy__", ( PyCFunction ) NonTVertex___copy__, METH_NOARGS, "() Cloning method."},
- {"svertex", ( PyCFunction ) NonTVertex_svertex, METH_NOARGS, "() Returns the SVertex on top of which this NonTVertex is built. "},
- {"setSVertex", ( PyCFunction ) NonTVertex_setSVertex, METH_VARARGS, "(SVertex sv) Sets the SVertex on top of which this NonTVertex is built. "},
+ {"svertex", ( PyCFunction ) NonTVertex_svertex, METH_NOARGS, NonTVertex_svertex___doc__},
+ {"setSVertex", ( PyCFunction ) NonTVertex_setSVertex, METH_VARARGS, NonTVertex_setSVertex___doc__},
{NULL, NULL, 0, NULL}
};
/*-----------------------BPy_NonTVertex type definition ------------------------------*/
-
PyTypeObject NonTVertex_Type = {
PyVarObject_HEAD_INIT(NULL, 0)
"NonTVertex", /* tp_name */
@@ -46,7 +125,7 @@ PyTypeObject NonTVertex_Type = {
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
- "NonTVertex objects", /* tp_doc */
+ NonTVertex___doc__, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompare */
@@ -66,55 +145,6 @@ PyTypeObject NonTVertex_Type = {
0, /* tp_new */
};
-//------------------------INSTANCE METHODS ----------------------------------
-
-int NonTVertex___init__(BPy_NonTVertex *self, PyObject *args, PyObject *kwds)
-{
-
- PyObject *obj = 0;
-
- if (! PyArg_ParseTuple(args, "|O!", &SVertex_Type, &obj) )
- return -1;
-
- if( !obj ){
- self->ntv = new NonTVertex();
-
- } else if( ((BPy_SVertex *) obj)->sv ) {
- self->ntv = new NonTVertex( ((BPy_SVertex *) obj)->sv );
-
- } else {
- PyErr_SetString(PyExc_TypeError, "invalid argument");
- return -1;
- }
-
- self->py_vv.vv = self->ntv;
- self->py_vv.py_if0D.if0D = self->ntv;
- self->py_vv.py_if0D.borrowed = 0;
-
- return 0;
-}
-
-PyObject * NonTVertex_svertex( BPy_NonTVertex *self ) {
- SVertex *v = self->ntv->svertex();
- if( v ){
- return BPy_SVertex_from_SVertex( *v );
- }
-
- Py_RETURN_NONE;
-}
-
-PyObject * NonTVertex_setSVertex( BPy_NonTVertex *self, PyObject *args) {
- PyObject *py_sv;
-
- if(!( PyArg_ParseTuple(args, "O!", &SVertex_Type, &py_sv) ))
- return NULL;
-
- self->ntv->setSVertex( ((BPy_SVertex *) py_sv)->sv );
-
- Py_RETURN_NONE;
-}
-
-
///////////////////////////////////////////////////////////////////////////////////////////
#ifdef __cplusplus
diff --git a/source/blender/freestyle/intern/python/Interface0D/ViewVertex/BPy_TVertex.cpp b/source/blender/freestyle/intern/python/Interface0D/ViewVertex/BPy_TVertex.cpp
index 90b6e578b4d..f7e36e753b5 100644
--- a/source/blender/freestyle/intern/python/Interface0D/ViewVertex/BPy_TVertex.cpp
+++ b/source/blender/freestyle/intern/python/Interface0D/ViewVertex/BPy_TVertex.cpp
@@ -12,76 +12,27 @@ extern "C" {
///////////////////////////////////////////////////////////////////////////////////////////
-/*--------------- Python API function prototypes for TVertex___init__ instance -----------*/
-static int TVertex___init__(BPy_TVertex *self, PyObject *args, PyObject *kwds);
-
-static PyObject * TVertex_frontSVertex( BPy_TVertex *self );
-static PyObject * TVertex_backSVertex( BPy_TVertex *self );
-static PyObject * TVertex_setFrontSVertex( BPy_TVertex *self, PyObject *args);
-static PyObject * TVertex_setBackSVertex( BPy_TVertex *self, PyObject *args);
-static PyObject * TVertex_setId( BPy_TVertex *self, PyObject *args);
-static PyObject * TVertex_getSVertex( BPy_TVertex *self, PyObject *args);
-static PyObject * TVertex_mate( BPy_TVertex *self, PyObject *args);
-
-/*----------------------TVertex instance definitions ----------------------------*/
-static PyMethodDef BPy_TVertex_methods[] = {
-// {"__copy__", ( PyCFunction ) TVertex___copy__, METH_NOARGS, "() Cloning method."},
- {"frontSVertex", ( PyCFunction ) TVertex_frontSVertex, METH_NOARGS, "() Returns the SVertex that is closer to the viewpoint. "},
- {"backSVertex", ( PyCFunction ) TVertex_backSVertex, METH_NOARGS, "() Returns the SVertex that is further away from the viewpoint. "},
- {"setFrontSVertex", ( PyCFunction ) TVertex_setFrontSVertex, METH_VARARGS, "(SVertex sv) Sets the SVertex that is closer to the viewpoint. "},
- {"setBackSVertex", ( PyCFunction ) TVertex_setBackSVertex, METH_VARARGS, "(SVertex sv) Sets the SVertex that is further away from the viewpoint. "},
- {"setId", ( PyCFunction ) TVertex_setId, METH_VARARGS, "(Id id) Sets the Id."},
- {"getSVertex", ( PyCFunction ) TVertex_getSVertex, METH_VARARGS, "(FEdge fe) Returns the SVertex (among the 2) belonging to the FEdge iFEdge "},
- {"mate", ( PyCFunction ) TVertex_mate, METH_VARARGS, "(ViewEdge ve) Returns the mate edge of iEdgeA. For example, if iEdgeA is frontEdgeA, then frontEdgeB is returned. If iEdgeA is frontEdgeB then frontEdgeA is returned. Same for back edges"},
- {NULL, NULL, 0, NULL}
-};
-
-/*-----------------------BPy_TVertex type definition ------------------------------*/
-
-PyTypeObject TVertex_Type = {
- PyVarObject_HEAD_INIT(NULL, 0)
- "TVertex", /* tp_name */
- sizeof(BPy_TVertex), /* 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 */
- "TVertex objects", /* tp_doc */
- 0, /* tp_traverse */
- 0, /* tp_clear */
- 0, /* tp_richcompare */
- 0, /* tp_weaklistoffset */
- 0, /* tp_iter */
- 0, /* tp_iternext */
- BPy_TVertex_methods, /* tp_methods */
- 0, /* tp_members */
- 0, /* tp_getset */
- &ViewVertex_Type, /* tp_base */
- 0, /* tp_dict */
- 0, /* tp_descr_get */
- 0, /* tp_descr_set */
- 0, /* tp_dictoffset */
- (initproc)TVertex___init__, /* tp_init */
- 0, /* tp_alloc */
- 0, /* tp_new */
-};
-
//------------------------INSTANCE METHODS ----------------------------------
-int TVertex___init__(BPy_TVertex *self, PyObject *args, PyObject *kwds)
+static char TVertex___doc__[] =
+"Class to define a T vertex, i.e. an intersection between two edges.\n"
+"It points towards two SVertex and four ViewEdges. Among the\n"
+"ViewEdges, two are front and the other two are back. Basically a\n"
+"front edge hides part of a back edge. So, among the back edges, one\n"
+"is of invisibility N and the other of invisibility N+1.\n"
+"\n"
+".. method:: __init__()\n"
+"\n"
+" Default constructor.\n"
+"\n"
+".. method:: __init__(iBrother)\n"
+"\n"
+" Copy constructor.\n"
+"\n"
+" :arg iBrother: A TVertex object.\n"
+" :type iBrother: :class:`TVertex`\n";
+
+static int TVertex___init__(BPy_TVertex *self, PyObject *args, PyObject *kwds)
{
if( !PyArg_ParseTuple(args, "") )
return -1;
@@ -93,8 +44,15 @@ int TVertex___init__(BPy_TVertex *self, PyObject *args, PyObject *kwds)
return 0;
}
+static char TVertex_frontSVertex___doc__[] =
+".. method:: frontSVertex()\n"
+"\n"
+" Returns the SVertex that is closer to the viewpoint.\n"
+"\n"
+" :return: The SVertex that is closer to the viewpoint.\n"
+" :rtype: :class:`SVertex`\n";
-PyObject * TVertex_frontSVertex( BPy_TVertex *self ) {
+static PyObject * TVertex_frontSVertex( BPy_TVertex *self ) {
SVertex *v = self->tv->frontSVertex();
if( v ){
return BPy_SVertex_from_SVertex( *v );
@@ -103,7 +61,15 @@ PyObject * TVertex_frontSVertex( BPy_TVertex *self ) {
Py_RETURN_NONE;
}
-PyObject * TVertex_backSVertex( BPy_TVertex *self ) {
+static char TVertex_backSVertex___doc__[] =
+".. method:: backSVertex()\n"
+"\n"
+" Returns the SVertex that is further away from the viewpoint.\n"
+"\n"
+" :return: The SVertex that is further away from the viewpoint.\n"
+" :rtype: :class:`SVertex`\n";
+
+static PyObject * TVertex_backSVertex( BPy_TVertex *self ) {
SVertex *v = self->tv->backSVertex();
if( v ){
return BPy_SVertex_from_SVertex( *v );
@@ -112,7 +78,15 @@ PyObject * TVertex_backSVertex( BPy_TVertex *self ) {
Py_RETURN_NONE;
}
-PyObject * TVertex_setFrontSVertex( BPy_TVertex *self, PyObject *args) {
+static char TVertex_setFrontSVertex___doc__[] =
+".. method:: setFrontSVertex(iFrontSVertex)\n"
+"\n"
+" Sets the SVertex that is closer to the viewpoint.\n"
+"\n"
+" :arg iFrontSVertex: An SVertex object.\n"
+" :type iFrontSVertex: :class:`SVertex`\n";
+
+static PyObject * TVertex_setFrontSVertex( BPy_TVertex *self, PyObject *args) {
PyObject *py_sv;
if(!( PyArg_ParseTuple(args, "O!", &SVertex_Type, &py_sv) ))
@@ -123,7 +97,15 @@ PyObject * TVertex_setFrontSVertex( BPy_TVertex *self, PyObject *args) {
Py_RETURN_NONE;
}
-PyObject * TVertex_setBackSVertex( BPy_TVertex *self, PyObject *args) {
+static char TVertex_setBackSVertex___doc__[] =
+".. method:: setBackSVertex(iBackSVertex)\n"
+"\n"
+" Sets the SVertex that is further away from the viewpoint.\n"
+"\n"
+" :arg iBackSVertex: An SVertex object.\n"
+" :type iBackSVertex: :class:`SVertex`\n";
+
+static PyObject * TVertex_setBackSVertex( BPy_TVertex *self, PyObject *args) {
PyObject *py_sv;
if(!( PyArg_ParseTuple(args, "O", &SVertex_Type, &py_sv) ))
@@ -134,7 +116,15 @@ PyObject * TVertex_setBackSVertex( BPy_TVertex *self, PyObject *args) {
Py_RETURN_NONE;
}
-PyObject * TVertex_setId( BPy_TVertex *self, PyObject *args) {
+static char TVertex_setId___doc__[] =
+".. method:: setId(iId)\n"
+"\n"
+" Sets the Id.\n"
+"\n"
+" :arg iId: An Id object.\n"
+" :type iId: :class:`Id`\n";
+
+static PyObject * TVertex_setId( BPy_TVertex *self, PyObject *args) {
PyObject *py_id;
if(!( PyArg_ParseTuple(args, "O!", &Id_Type, &py_id) ))
@@ -146,7 +136,17 @@ PyObject * TVertex_setId( BPy_TVertex *self, PyObject *args) {
Py_RETURN_NONE;
}
-PyObject * TVertex_getSVertex( BPy_TVertex *self, PyObject *args) {
+static char TVertex_getSVertex___doc__[] =
+".. method:: getSVertex(iFEdge)\n"
+"\n"
+" Returns the SVertex (among the 2) belonging to the given FEdge.\n"
+"\n"
+" :arg iFEdge: An FEdge object.\n"
+" :type iFEdge: :class:`FEdge`\n"
+" :return: The SVertex belonging to the given FEdge.\n"
+" :rtype: :class:`SVertex`\n";
+
+static PyObject * TVertex_getSVertex( BPy_TVertex *self, PyObject *args) {
PyObject *py_fe;
if(!( PyArg_ParseTuple(args, "O!", &FEdge_Type, &py_fe) ))
@@ -160,7 +160,19 @@ PyObject * TVertex_getSVertex( BPy_TVertex *self, PyObject *args) {
Py_RETURN_NONE;
}
-PyObject * TVertex_mate( BPy_TVertex *self, PyObject *args) {
+static char TVertex_mate___doc__[] =
+".. method:: mate(iEdgeA)\n"
+"\n"
+" Returns the mate edge of the ViewEdge given as argument. If the\n"
+" ViewEdge is frontEdgeA, frontEdgeB is returned. If the ViewEdge is\n"
+" frontEdgeB, frontEdgeA is returned. Same for back edges.\n"
+"\n"
+" :arg iEdgeA: A ViewEdge object.\n"
+" :type iEdgeA: :class:`ViewEdge`\n"
+" :return: The mate edge of the given ViewEdge.\n"
+" :rtype: :class:`ViewEdge`\n";
+
+static PyObject * TVertex_mate( BPy_TVertex *self, PyObject *args) {
PyObject *py_ve;
if(!( PyArg_ParseTuple(args, "O!", &ViewEdge_Type, &py_ve) ))
@@ -174,7 +186,61 @@ PyObject * TVertex_mate( BPy_TVertex *self, PyObject *args) {
Py_RETURN_NONE;
}
-
+/*----------------------TVertex instance definitions ----------------------------*/
+static PyMethodDef BPy_TVertex_methods[] = {
+// {"__copy__", ( PyCFunction ) TVertex___copy__, METH_NOARGS, "() Cloning method."},
+ {"frontSVertex", ( PyCFunction ) TVertex_frontSVertex, METH_NOARGS, TVertex_frontSVertex___doc__},
+ {"backSVertex", ( PyCFunction ) TVertex_backSVertex, METH_NOARGS, TVertex_backSVertex___doc__},
+ {"setFrontSVertex", ( PyCFunction ) TVertex_setFrontSVertex, METH_VARARGS, TVertex_setFrontSVertex___doc__},
+ {"setBackSVertex", ( PyCFunction ) TVertex_setBackSVertex, METH_VARARGS, TVertex_setBackSVertex___doc__},
+ {"setId", ( PyCFunction ) TVertex_setId, METH_VARARGS, TVertex_setId___doc__},
+ {"getSVertex", ( PyCFunction ) TVertex_getSVertex, METH_VARARGS, TVertex_getSVertex___doc__},
+ {"mate", ( PyCFunction ) TVertex_mate, METH_VARARGS, TVertex_mate___doc__},
+ {NULL, NULL, 0, NULL}
+};
+
+/*-----------------------BPy_TVertex type definition ------------------------------*/
+PyTypeObject TVertex_Type = {
+ PyVarObject_HEAD_INIT(NULL, 0)
+ "TVertex", /* tp_name */
+ sizeof(BPy_TVertex), /* 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 */
+ TVertex___doc__, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ BPy_TVertex_methods, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ &ViewVertex_Type, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ (initproc)TVertex___init__, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+};
+
///////////////////////////////////////////////////////////////////////////////////////////
#ifdef __cplusplus