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:
authorMaxime Curioni <maxime.curioni@gmail.com>2008-07-17 10:35:30 +0400
committerMaxime Curioni <maxime.curioni@gmail.com>2008-07-17 10:35:30 +0400
commite4748940c0a61171d5c4e45d8d5a9637d05ac429 (patch)
tree12485e1e989e7e1f766c370f92d379ef565599c5 /source/blender/freestyle/intern/python/Interface0D
parentcc1a6b398da9bd2cec78c4242c5b205f079aa4a6 (diff)
soc-2008-mxcurioni: SWIG removal - completed SVertex and CurvePoint classes migration. Stabilized a lot of the code for C++ -> Python conversion. Added the correct rich comparison operator and tested it. Corrected 'dupplicate' typo and changde to __copy__ for Python API.
From now on, when a set should be output (PySet_Type), it is given as a list (PyList_Type). The reason is that it doesn't really matter what we bring back to the Python interpreter. The set is guaranteed in memory on the C++ side. For the CurvePoint class, the userdata variable is not yet ported (and will probably available as a list or a dictionary). The CurvePoint implementation works except for the initialization from other CurvePoints: somehow, the inner variables don't seem to be correctly handled. I do not know if it is a bug in Freestyle or if the CurvePoint object's state is correct for my test case. CurvePoint needs more testing.
Diffstat (limited to 'source/blender/freestyle/intern/python/Interface0D')
-rw-r--r--source/blender/freestyle/intern/python/Interface0D/CurvePoint.cpp232
-rw-r--r--source/blender/freestyle/intern/python/Interface0D/CurvePoint.h3
-rw-r--r--source/blender/freestyle/intern/python/Interface0D/SVertex.cpp483
3 files changed, 351 insertions, 367 deletions
diff --git a/source/blender/freestyle/intern/python/Interface0D/CurvePoint.cpp b/source/blender/freestyle/intern/python/Interface0D/CurvePoint.cpp
index e360062b9d6..5a81f07973d 100644
--- a/source/blender/freestyle/intern/python/Interface0D/CurvePoint.cpp
+++ b/source/blender/freestyle/intern/python/Interface0D/CurvePoint.cpp
@@ -11,9 +11,25 @@ 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}
};
@@ -110,129 +126,113 @@ PyTypeObject CurvePoint_Type = {
int CurvePoint___init__(BPy_CurvePoint *self, PyObject *args, PyObject *kwds)
{
- self->py_if0D.if0D = new CurvePoint();
+ PyObject *obj1 = 0, *obj2 = 0 , *obj3 = 0;
+
+ if (! PyArg_ParseTuple(args, "|OOO", &obj1, &obj2, &obj3) )
+ return -1;
+
+ if( !obj1 && !obj2 && !obj3 ){
+ self->cp = new CurvePoint();
+ } else if( PyFloat_Check(obj3) ) {
+ if( BPy_SVertex_Check(obj1) && BPy_SVertex_Check(obj2) ) {
+ self->cp = new CurvePoint( ((BPy_SVertex *) obj1)->sv,
+ ((BPy_SVertex *) obj2)->sv,
+ PyFloat_AsDouble( obj3 ) );
+ } else if( BPy_CurvePoint_Check(obj1) && BPy_CurvePoint_Check(obj2) ) {
+ self->cp = new CurvePoint( ((BPy_CurvePoint *) obj1)->cp,
+ ((BPy_CurvePoint *) obj2)->cp,
+ PyFloat_AsDouble( obj3 ) );
+ } else {
+ return -1;
+ }
+ } else {
+ return -1;
+ }
+
+ self->py_if0D.if0D = self->cp;
+
return 0;
}
+PyObject * CurvePoint___copy__( BPy_CurvePoint *self ) {
+ BPy_CurvePoint *py_cp;
+
+ py_cp = (BPy_CurvePoint *) CurvePoint_Type.tp_new( &CurvePoint_Type, 0, 0 );
+
+ py_cp->cp = new CurvePoint( *(self->cp) );
+ py_cp->py_if0D.if0D = py_cp->cp;
-///////////////////////////////////////////////////////////////////////////////////////////
+ return (PyObject *) py_cp;
+}
-#ifdef __cplusplus
+PyObject * CurvePoint_A( BPy_CurvePoint *self ) {
+ if( self->cp->A() )
+ return BPy_SVertex_from_SVertex( *(self->cp->A()) );
+
+ Py_RETURN_NONE;
+}
+
+PyObject * CurvePoint_B( BPy_CurvePoint *self ) {
+ if( self->cp->B() )
+ return BPy_SVertex_from_SVertex( *(self->cp->B()) );
+
+ Py_RETURN_NONE;
+}
+
+PyObject * CurvePoint_t2d( BPy_CurvePoint *self ) {
+ return PyFloat_FromDouble( self->cp->t2d() );
+}
+
+PyObject *CurvePoint_SetA( BPy_CurvePoint *self , PyObject *args) {
+ PyObject *py_sv;
+
+ if(!( PyArg_ParseTuple(args, "O", &py_sv) && BPy_SVertex_Check(py_sv) )) {
+ cout << "ERROR: CurvePoint_SetA" << endl;
+ Py_RETURN_NONE;
+ }
+
+ self->cp->SetA( ((BPy_SVertex *) py_sv)->sv );
+
+ Py_RETURN_NONE;
}
-#endif
+PyObject *CurvePoint_SetB( BPy_CurvePoint *self , PyObject *args) {
+ PyObject *py_sv;
-
-//
-// PyObject *_wrap_new_CurvePoint__SWIG_0(PyObject *self , PyObject *args) {
-// }
-//
-//
-// PyObject *_wrap_new_CurvePoint__SWIG_1(PyObject *self , PyObject *args) {
-// }
-//
-//
-// PyObject *_wrap_new_CurvePoint__SWIG_2(PyObject *self , PyObject *args) {
-// }
-//
-//
-// PyObject *_wrap_new_CurvePoint__SWIG_3(PyObject *self , PyObject *args) {
-// }
-//
-//
-// PyObject *_wrap_new_CurvePoint(PyObject *self, PyObject *args) {
-// }
-//
-//
-// PyObject *_wrap_delete_CurvePoint(PyObject *self , PyObject *args) {
-// }
-//
-//
-// PyObject *CurvePoint___eq__(PyObject *self , PyObject *args) {
-// }
-//
-//
-// PyObject *CurvePoint_A(PyObject *self , PyObject *args) {
-// }
-//
-//
-// PyObject *CurvePoint_B(PyObject *self , PyObject *args) {
-// }
-//
-//
-// PyObject *CurvePoint_t2d(PyObject *self , PyObject *args) {
-// }
-//
-//
-// PyObject *CurvePoint_SetA(PyObject *self , PyObject *args) {
-// }
-//
-//
-// PyObject *CurvePoint_SetB(PyObject *self , PyObject *args) {
-// }
-//
-//
-// PyObject *CurvePoint_SetT2d(PyObject *self , PyObject *args) {
-// }
-//
-//
-// PyObject *CurvePoint_fedge(PyObject *self , PyObject *args) {
-// }
-//
-//
-// PyObject *CurvePoint_point2d(PyObject *self , PyObject *args) {
-// }
-//
-//
-// PyObject *CurvePoint_point3d(PyObject *self , PyObject *args) {
-// }
-//
-//
-// PyObject *CurvePoint_normal(PyObject *self , PyObject *args) {
-// }
-//
-//
-// PyObject *CurvePoint_shape(PyObject *self , PyObject *args) {
-// }
-//
-//
-// PyObject *CurvePoint_occluders_begin(PyObject *self , PyObject *args) {
-// }
-//
-//
-// PyObject *CurvePoint_occluders_end(PyObject *self , PyObject *args) {
-// }
-//
-//
-// PyObject *CurvePoint_occluders_empty(PyObject *self , PyObject *args) {
-// }
-//
-//
-// PyObject *CurvePoint_occluders_size(PyObject *self , PyObject *args) {
-// }
-//
-//
-// PyObject *CurvePoint_occludee(PyObject *self , PyObject *args) {
-// }
-//
-//
-// PyObject *CurvePoint_occluded_shape(PyObject *self , PyObject *args) {
-// }
-//
-//
-// PyObject *CurvePoint_occludee_empty(PyObject *self , PyObject *args) {
-// }
-//
-//
-// PyObject *CurvePoint_z_discontinuity(PyObject *self , PyObject *args) {
-// }
-//
-//
-// PyObject *CurvePoint_curvatureFredo(PyObject *self , PyObject *args) {
-// }
-//
-//
-// PyObject *CurvePoint_directionFredo(PyObject *self , PyObject *args) {
-// }
+ if(!( PyArg_ParseTuple(args, "O", &py_sv) && BPy_SVertex_Check(py_sv) )) {
+ cout << "ERROR: CurvePoint_SetB" << endl;
+ Py_RETURN_NONE;
+ }
+ self->cp->SetB( ((BPy_SVertex *) py_sv)->sv );
+ Py_RETURN_NONE;
+}
+
+PyObject *CurvePoint_SetT2d( BPy_CurvePoint *self , PyObject *args) {
+ float t;
+
+ if( !PyArg_ParseTuple(args, "f", &t) ) {
+ cout << "ERROR: CurvePoint_SetT2d" << endl;
+ Py_RETURN_NONE;
+ }
+
+ self->cp->SetT2d( t );
+
+ Py_RETURN_NONE;
+}
+
+PyObject *CurvePoint_curvatureFredo( BPy_CurvePoint *self , PyObject *args) {
+ return PyFloat_FromDouble( self->cp->curvatureFredo() );
+}
+
+///bool operator== (const CurvePoint &b)
+
+
+
+
+///////////////////////////////////////////////////////////////////////////////////////////
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/source/blender/freestyle/intern/python/Interface0D/CurvePoint.h b/source/blender/freestyle/intern/python/Interface0D/CurvePoint.h
index 096de2efed3..ac30f74c4dd 100644
--- a/source/blender/freestyle/intern/python/Interface0D/CurvePoint.h
+++ b/source/blender/freestyle/intern/python/Interface0D/CurvePoint.h
@@ -2,7 +2,7 @@
#define FREESTYLE_PYTHON_CURVEPOINT_H
#include "../Interface0D.h"
-
+#include "../../stroke/Curve.h"
#ifdef __cplusplus
extern "C" {
@@ -20,6 +20,7 @@ extern PyTypeObject CurvePoint_Type;
/*---------------------------Python BPy_CurvePoint structure definition----------*/
typedef struct {
BPy_Interface0D py_if0D;
+ CurvePoint *cp;
} BPy_CurvePoint;
///////////////////////////////////////////////////////////////////////////////////////////
diff --git a/source/blender/freestyle/intern/python/Interface0D/SVertex.cpp b/source/blender/freestyle/intern/python/Interface0D/SVertex.cpp
index 41d01d4b649..fd5b372a1d9 100644
--- a/source/blender/freestyle/intern/python/Interface0D/SVertex.cpp
+++ b/source/blender/freestyle/intern/python/Interface0D/SVertex.cpp
@@ -1,268 +1,251 @@
- PyObject *_wrap_SVertex_getExactTypeName(PyObject *self , PyObject *args) {
-}
-
-
- PyObject *_wrap_SVertex_getX(PyObject *self , PyObject *args) {
-}
-
-
- PyObject *_wrap_SVertex_getY(PyObject *self , PyObject *args) {
-}
-
-
- PyObject *_wrap_SVertex_getZ(PyObject *self , PyObject *args) {
-}
-
-
- PyObject *_wrap_SVertex_getPoint3D(PyObject *self , PyObject *args) {
-}
-
-
- PyObject *_wrap_SVertex_getProjectedX(PyObject *self , PyObject *args) {
-}
-
-
- PyObject *_wrap_SVertex_getProjectedY(PyObject *self , PyObject *args) {
-}
-
-
- PyObject *_wrap_SVertex_getProjectedZ(PyObject *self , PyObject *args) {
-}
-
-
- PyObject *_wrap_SVertex_getPoint2D(PyObject *self , PyObject *args) {
-}
-
-
- PyObject *_wrap_SVertex_getFEdge(PyObject *self , PyObject *args) {
-}
-
-
- PyObject *_wrap_SVertex_getId(PyObject *self , PyObject *args) {
-}
-
-
- PyObject *_wrap_SVertex_getNature(PyObject *self , PyObject *args) {
-}
-
-
- PyObject *_wrap_SVertex_castToSVertex(PyObject *self , PyObject *args) {
-}
-
-
- PyObject *_wrap_SVertex_castToViewVertex(PyObject *self , PyObject *args) {
-}
-
-
- PyObject *_wrap_SVertex_castToNonTVertex(PyObject *self , PyObject *args) {
-}
-
-
- PyObject *_wrap_SVertex_castToTVertex(PyObject *self , PyObject *args) {
-}
+#include "SVertex.h"
+
+#include "../Convert.h"
+#include "../Id.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+///////////////////////////////////////////////////////////////////////////////////////////
+
+/*--------------- 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_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);
+/*----------------------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." },
+ {"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." },
+ {NULL, NULL, 0, NULL}
+};
+
+/*-----------------------BPy_SVertex type definition ------------------------------*/
+
+PyTypeObject SVertex_Type = {
+ PyObject_HEAD_INIT( NULL )
+ 0, /* ob_size */
+ "SVertex", /* tp_name */
+ sizeof( BPy_SVertex ), /* tp_basicsize */
+ 0, /* tp_itemsize */
+
+ /* methods */
+ NULL, /* tp_dealloc */
+ NULL, /* printfunc tp_print; */
+ NULL, /* getattrfunc tp_getattr; */
+ NULL, /* setattrfunc tp_setattr; */
+ NULL, /* tp_compare */
+ NULL, /* tp_repr */
+
+ /* Method suites for standard classes */
+
+ NULL, /* PyNumberMethods *tp_as_number; */
+ NULL, /* PySequenceMethods *tp_as_sequence; */
+ NULL, /* PyMappingMethods *tp_as_mapping; */
+
+ /* More standard operations (here for binary compatibility) */
+
+ NULL, /* hashfunc tp_hash; */
+ NULL, /* ternaryfunc tp_call; */
+ NULL, /* reprfunc tp_str; */
+ NULL, /* getattrofunc tp_getattro; */
+ NULL, /* setattrofunc tp_setattro; */
+
+ /* Functions to access object as input/output buffer */
+ NULL, /* PyBufferProcs *tp_as_buffer; */
+
+ /*** Flags to define presence of optional/expanded features ***/
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* long tp_flags; */
+
+ NULL, /* char *tp_doc; Documentation string */
+ /*** Assigned meaning in release 2.0 ***/
+ /* call function for all accessible objects */
+ NULL, /* traverseproc tp_traverse; */
+
+ /* delete references to contained objects */
+ NULL, /* inquiry tp_clear; */
+
+ /*** Assigned meaning in release 2.1 ***/
+ /*** rich comparisons ***/
+ NULL, /* richcmpfunc tp_richcompare; */
+
+ /*** weak reference enabler ***/
+ 0, /* long tp_weaklistoffset; */
+
+ /*** Added in release 2.2 ***/
+ /* Iterators */
+ NULL, /* getiterfunc tp_iter; */
+ NULL, /* iternextfunc tp_iternext; */
+
+ /*** Attribute descriptor and subclassing stuff ***/
+ BPy_SVertex_methods, /* struct PyMethodDef *tp_methods; */
+ NULL, /* struct PyMemberDef *tp_members; */
+ NULL, /* struct PyGetSetDef *tp_getset; */
+ &Interface0D_Type, /* struct _typeobject *tp_base; */
+ NULL, /* PyObject *tp_dict; */
+ NULL, /* descrgetfunc tp_descr_get; */
+ NULL, /* descrsetfunc tp_descr_set; */
+ 0, /* long tp_dictoffset; */
+ (initproc)SVertex___init__, /* initproc tp_init; */
+ NULL, /* allocfunc tp_alloc; */
+ NULL, /* newfunc tp_new; */
+
+ /* Low-level free-memory routine */
+ NULL, /* freefunc tp_free; */
+
+ /* For PyObject_IS_GC */
+ NULL, /* inquiry tp_is_gc; */
+ NULL, /* PyObject *tp_bases; */
+
+ /* method resolution order */
+ NULL, /* PyObject *tp_mro; */
+ NULL, /* PyObject *tp_cache; */
+ NULL, /* PyObject *tp_subclasses; */
+ NULL, /* PyObject *tp_weaklist; */
+ NULL
+};
+
+//-------------------MODULE INITIALIZATION--------------------------------
+
+
+//------------------------INSTANCE METHODS ----------------------------------
+
+int SVertex___init__(BPy_SVertex *self, PyObject *args, PyObject *kwds)
+{
+ PyObject *py_point = 0;
+ BPy_Id *py_id = 0;
+
+ if (! PyArg_ParseTuple(args, "|OO", &py_point, &py_id) )
+ return -1;
+
+ if( py_point && py_id && PyList_Check(py_point) && PyList_Size(py_point) == 3 ) {
+ Vec3r v( PyFloat_AsDouble( PyList_GetItem(py_point, 0) ),
+ PyFloat_AsDouble( PyList_GetItem(py_point, 1) ),
+ PyFloat_AsDouble( PyList_GetItem(py_point, 2) ) );
+
+ self->sv = new SVertex( v, *(py_id->id) );
+ } else {
+ self->sv = new SVertex();
+ }
+
+ self->py_if0D.if0D = self->sv;
+
+ return 0;
+}
+
+PyObject * SVertex___copy__( BPy_SVertex *self ) {
+ BPy_SVertex *py_svertex;
+
+ py_svertex = (BPy_SVertex *) SVertex_Type.tp_new( &SVertex_Type, 0, 0 );
+
+ py_svertex->sv = self->sv->duplicate();
+ py_svertex->py_if0D.if0D = py_svertex->sv;
+
+ return (PyObject *) py_svertex;
+}
+
+
+PyObject * SVertex_normals( BPy_SVertex *self ) {
+ PyObject *py_normals;
+ set< Vec3r > normals;
+
+ py_normals = PyList_New(NULL);
+ normals = self->sv->normals();
+
+ for( set< Vec3r >::iterator set_iterator = normals.begin(); set_iterator != normals.end(); set_iterator++ ) {
+ PyList_Append( py_normals, Vector_from_Vec3r(*set_iterator) );
+ }
+
+ return py_normals;
+}
+
+PyObject * SVertex_normalsSize( BPy_SVertex *self ) {
+ return PyInt_FromLong( self->sv->normalsSize() );
+}
+
+PyObject *SVertex_SetPoint3D( BPy_SVertex *self , PyObject *args) {
+ PyObject *py_point;
+
+ if(!( PyArg_ParseTuple(args, "O", &py_point)
+ && PyList_Check(py_point) && PyList_Size(py_point) == 3 )) {
+ cout << "ERROR: SVertex_SetPoint3D" << endl;
+ Py_RETURN_NONE;
+ }
+
+ Vec3r v( PyFloat_AsDouble( PyList_GetItem(py_point, 0) ),
+ PyFloat_AsDouble( PyList_GetItem(py_point, 1) ),
+ PyFloat_AsDouble( PyList_GetItem(py_point, 2) ) );
+ self->sv->SetPoint3D( v );
+
+ Py_RETURN_NONE;
+}
+
+PyObject *SVertex_SetPoint2D( BPy_SVertex *self , PyObject *args) {
+ PyObject *py_point;
+
+ if(!( PyArg_ParseTuple(args, "O", &py_point)
+ && PyList_Check(py_point) && PyList_Size(py_point) == 3 )) {
+ cout << "ERROR: SVertex_SetPoint2D" << endl;
+ Py_RETURN_NONE;
+ }
+ Vec3r v( PyFloat_AsDouble( PyList_GetItem(py_point, 0) ),
+ PyFloat_AsDouble( PyList_GetItem(py_point, 1) ),
+ PyFloat_AsDouble( PyList_GetItem(py_point, 2) ) );
+ self->sv->SetPoint2D( v );
- PyObject *_wrap_SVertex_userdata_set(PyObject *self , PyObject *args) {
+ Py_RETURN_NONE;
}
+PyObject *SVertex_AddNormal( BPy_SVertex *self , PyObject *args) {
+ PyObject *py_normal;
- PyObject *_wrap_SVertex_userdata_get(PyObject *self , PyObject *args) {
-}
-
-
- PyObject *_wrap_new_SVertex__SWIG_0(PyObject *self , PyObject *args) {
-}
-
-
- PyObject *_wrap_new_SVertex__SWIG_1(PyObject *self , PyObject *args) {
-}
-
-
- PyObject *_wrap_new_SVertex__SWIG_2(PyObject *self , PyObject *args) {
-}
-
-
- PyObject *_wrap_new_SVertex(PyObject *self, PyObject *args) {
-}
-
-
- PyObject *_wrap_delete_SVertex(PyObject *self , PyObject *args) {
-}
-
-
- PyObject *_wrap_SVertex_dupplicate(PyObject *self , PyObject *args) {
-}
-
-
- PyObject *_wrap_SVertex___eq__(PyObject *self , PyObject *args) {
-}
-
-
- PyObject *_wrap_SVertex_point3D(PyObject *self , PyObject *args) {
-}
-
-
- PyObject *_wrap_SVertex_point2D(PyObject *self , PyObject *args) {
-}
-
-
- PyObject *_wrap_SVertex_normals(PyObject *self , PyObject *args) {
-}
-
-
- PyObject *_wrap_SVertex_normalsSize(PyObject *self , PyObject *args) {
-}
+ if(!( PyArg_ParseTuple(args, "O", &py_normal)
+ && PyList_Check(py_normal) && PyList_Size(py_normal) == 3 )) {
+ cout << "ERROR: SVertex_AddNormal" << endl;
+ Py_RETURN_NONE;
+ }
+
+ cout << "yoyo" << endl;
+ Vec3r n( PyFloat_AsDouble( PyList_GetItem(py_normal, 0) ),
+ PyFloat_AsDouble( PyList_GetItem(py_normal, 1) ),
+ PyFloat_AsDouble( PyList_GetItem(py_normal, 2) ) );
+ self->sv->AddNormal( n );
- PyObject *_wrap_SVertex_fedges(PyObject *self , PyObject *args) {
+ Py_RETURN_NONE;
}
+PyObject *SVertex_SetId( BPy_SVertex *self , PyObject *args) {
+ BPy_Id *py_id;
- PyObject *_wrap_SVertex_fedges_begin(PyObject *self , PyObject *args) {
-}
+ if( !PyArg_ParseTuple(args, "O", &py_id) ) {
+ cout << "ERROR: SVertex_SetId" << endl;
+ Py_RETURN_NONE;
+ }
+ self->sv->SetId( *(py_id->id) );
- PyObject *_wrap_SVertex_fedges_end(PyObject *self , PyObject *args) {
+ Py_RETURN_NONE;
}
+// virtual bool operator== (const SVertex &iBrother)
+// ViewVertex * viewvertex ()
+// void AddFEdge (FEdge *iFEdge)
- PyObject *_wrap_SVertex_shape__SWIG_0(PyObject *self , PyObject *args) {
-}
-
-
- PyObject *_wrap_SVertex_z(PyObject *self , PyObject *args) {
-}
-
-
- PyObject *_wrap_SVertex_viewvertex(PyObject *self , PyObject *args) {
-}
-
-
- PyObject *_wrap_SVertex_SetPoint3D(PyObject *self , PyObject *args) {
-}
-
+///////////////////////////////////////////////////////////////////////////////////////////
- PyObject *_wrap_SVertex_SetPoint2D(PyObject *self , PyObject *args) {
+#ifdef __cplusplus
}
-
-
- PyObject *_wrap_SVertex_AddNormal(PyObject *self , PyObject *args) {
-}
-
-
- PyObject *_wrap_SVertex_setCurvatureInfo(PyObject *self , PyObject *args) {
-}
-
-
- PyObject *_wrap_SVertex_getCurvatureInfo(PyObject *self , PyObject *args) {
-}
-
-
- PyObject *_wrap_SVertex_setCurvatureFredo(PyObject *self , PyObject *args) {
-}
-
-
- PyObject *_wrap_SVertex_setDirectionFredo(PyObject *self , PyObject *args) {
-}
-
-
- PyObject *_wrap_SVertex_curvatureFredo(PyObject *self , PyObject *args) {
-}
-
-
- PyObject *_wrap_SVertex_directionFredo(PyObject *self , PyObject *args) {
-}
-
-
- PyObject *_wrap_SVertex_SetId(PyObject *self , PyObject *args) {
-}
-
-
- PyObject *_wrap_SVertex_SetFEdges(PyObject *self , PyObject *args) {
-}
-
-
- PyObject *_wrap_SVertex_SetShape(PyObject *self , PyObject *args) {
-}
-
-
- PyObject *_wrap_SVertex_SetViewVertex(PyObject *self , PyObject *args) {
-}
-
-
- PyObject *_wrap_SVertex_AddFEdge(PyObject *self , PyObject *args) {
-}
-
-
- PyObject *_wrap_SVertex_Replace(PyObject *self , PyObject *args) {
-}
-
-
- PyObject *_wrap_SVertex_fedge(PyObject *self , PyObject *args) {
-}
-
-
- PyObject *_wrap_SVertex_point2d(PyObject *self , PyObject *args) {
-}
-
-
- PyObject *_wrap_SVertex_point3d(PyObject *self , PyObject *args) {
-}
-
-
- PyObject *_wrap_SVertex_normal(PyObject *self , PyObject *args) {
-}
-
-
- PyObject *_wrap_SVertex_shape_id(PyObject *self , PyObject *args) {
-}
-
-
- PyObject *_wrap_SVertex_shape__SWIG_1(PyObject *self , PyObject *args) {
-}
-
-
- PyObject *_wrap_SVertex_shape(PyObject *self, PyObject *args) {
-}
-
-
- PyObject *_wrap_SVertex_shape_importance(PyObject *self , PyObject *args) {
-}
-
-
- PyObject *_wrap_SVertex_qi(PyObject *self , PyObject *args) {
-}
-
-
- PyObject *_wrap_SVertex_occluders_begin(PyObject *self , PyObject *args) {
-}
-
-
- PyObject *_wrap_SVertex_occluders_end(PyObject *self , PyObject *args) {
-}
-
-
- PyObject *_wrap_SVertex_occluders_empty(PyObject *self , PyObject *args) {
-}
-
-
- PyObject *_wrap_SVertex_occluders_size(PyObject *self , PyObject *args) {
-}
-
-
- PyObject *_wrap_SVertex_occludee(PyObject *self , PyObject *args) {
-}
-
-
- PyObject *_wrap_SVertex_occluded_shape(PyObject *self , PyObject *args) {
-}
-
-
- PyObject *_wrap_SVertex_occludee_empty(PyObject *self , PyObject *args) {
-}
-
-
- PyObject *_wrap_SVertex_z_discontinuity(PyObject *self , PyObject *args) {
-}
-
+#endif