From e4748940c0a61171d5c4e45d8d5a9637d05ac429 Mon Sep 17 00:00:00 2001 From: Maxime Curioni Date: Thu, 17 Jul 2008 06:35:30 +0000 Subject: 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. --- source/blender/freestyle/SConscript | 1 + .../freestyle/intern/python/BinaryPredicate0D.cpp | 2 +- .../freestyle/intern/python/BinaryPredicate1D.cpp | 2 +- source/blender/freestyle/intern/python/Convert.cpp | 67 +-- source/blender/freestyle/intern/python/Convert.h | 4 +- source/blender/freestyle/intern/python/Id.cpp | 64 ++- .../freestyle/intern/python/Interface0D.cpp | 14 +- .../intern/python/Interface0D/CurvePoint.cpp | 232 +++++----- .../intern/python/Interface0D/CurvePoint.h | 3 +- .../intern/python/Interface0D/SVertex.cpp | 483 ++++++++++----------- .../freestyle/intern/python/Interface1D.cpp | 2 +- .../intern/python/Interface1D/FEdge/FEdgeSharp.cpp | 2 +- .../freestyle/intern/swig/ModuleWrapper.cpp | 80 ++-- .../blender/freestyle/intern/view_map/Silhouette.h | 12 +- source/blender/freestyle/intern/view_map/ViewMap.h | 18 +- .../blender/freestyle/intern/winged_edge/WEdge.cpp | 20 +- .../blender/freestyle/intern/winged_edge/WEdge.h | 10 +- .../blender/freestyle/intern/winged_edge/WXEdge.h | 8 +- source/blender/freestyle/python/Freestyle.py | 16 +- 19 files changed, 517 insertions(+), 523 deletions(-) diff --git a/source/blender/freestyle/SConscript b/source/blender/freestyle/SConscript index f54c12470a6..42d78a393eb 100644 --- a/source/blender/freestyle/SConscript +++ b/source/blender/freestyle/SConscript @@ -67,6 +67,7 @@ python_sources = [ prefix + '/Id.cpp', prefix + '/Interface0D.cpp', prefix + '/Interface0D/CurvePoint.cpp', + prefix + '/Interface0D/SVertex.cpp', prefix + '/Interface1D.cpp' ] diff --git a/source/blender/freestyle/intern/python/BinaryPredicate0D.cpp b/source/blender/freestyle/intern/python/BinaryPredicate0D.cpp index d76c1ba78ba..67358c65bbf 100644 --- a/source/blender/freestyle/intern/python/BinaryPredicate0D.cpp +++ b/source/blender/freestyle/intern/python/BinaryPredicate0D.cpp @@ -153,7 +153,7 @@ PyObject * BinaryPredicate0D___call__( BPy_BinaryPredicate0D *self, PyObject *ar BPy_Interface0D *obj1, *obj2; bool b; - if( !PyArg_ParseTuple(args,(char *)"OO:BinaryPredicate0D___call__", &obj1, obj2) ) { + if( !PyArg_ParseTuple(args,(char *)"OO", &obj1, &obj2) ) { cout << "ERROR: BinaryPredicate0D___call__ " << endl; return NULL; } diff --git a/source/blender/freestyle/intern/python/BinaryPredicate1D.cpp b/source/blender/freestyle/intern/python/BinaryPredicate1D.cpp index 73d5a3a4232..bf2772ecdcc 100644 --- a/source/blender/freestyle/intern/python/BinaryPredicate1D.cpp +++ b/source/blender/freestyle/intern/python/BinaryPredicate1D.cpp @@ -151,7 +151,7 @@ PyObject *BinaryPredicate1D___call__( BPy_BinaryPredicate1D *self, PyObject *arg BPy_Interface1D *obj1, *obj2; bool b; - if( !PyArg_ParseTuple(args,(char *)"OO:BinaryPredicate1D___call__", &obj1, &obj2) ) { + if( !PyArg_ParseTuple(args,(char *)"OO", &obj1, &obj2) ) { cout << "ERROR: BinaryPredicate1D___call__ " << endl; return NULL; } diff --git a/source/blender/freestyle/intern/python/Convert.cpp b/source/blender/freestyle/intern/python/Convert.cpp index d87848cde8e..59b2406f480 100644 --- a/source/blender/freestyle/intern/python/Convert.cpp +++ b/source/blender/freestyle/intern/python/Convert.cpp @@ -7,21 +7,6 @@ extern "C" { /////////////////////////////////////////////////////////////////////////////////////////// -static char M_Convert_doc[] = "The Blender.Freestyle.Convert utility submodule"; -/*----------------------Freestyle module method def----------------------------*/ -struct PyMethodDef M_Convert_methods[] = { -// {"testOutput", ( PyCFunction ) Freestyle_testOutput, METH_NOARGS, "() - Return Curve Data name"}, - {NULL, NULL, 0, NULL} -}; - - -//-------------------MODULE INITIALIZATION-------------------------------- -PyObject *Convert_Init( void ) -{ - return Py_InitModule3( "Blender.Freestyle.Convert", M_Convert_methods, M_Convert_doc ); -} - -//------------------------------------------------------------------------- PyObject *PyBool_from_bool( bool b ){ // SWIG_From_bool @@ -31,32 +16,64 @@ PyObject *PyBool_from_bool( bool b ){ PyObject *Vector_from_Vec2f( Vec2f vec ) { float vec_data[2]; // because vec->_coord is protected - vec_data[0] = vec.x(); vec_data[1] = vec.y(); - return newVectorObject( vec_data, 2, Py_NEW); + + if( &vec != 0 ){ + vec_data[0] = vec.x(); vec_data[1] = vec.y(); + return newVectorObject( vec_data, 2, Py_NEW); + } + + Py_RETURN_NONE; } PyObject *Vector_from_Vec3f( Vec3f vec ) { float vec_data[3]; // because vec->_coord is protected - vec_data[0] = vec.x(); vec_data[1] = vec.y(); vec_data[2] = vec.z(); - return newVectorObject( vec_data, 3, Py_NEW); + + if( &vec != 0 ){ + vec_data[0] = vec.x(); vec_data[1] = vec.y(); vec_data[2] = vec.z(); + return newVectorObject( vec_data, 3, Py_NEW); + } + + Py_RETURN_NONE; } PyObject *Vector_from_Vec3r( Vec3r vec ) { float vec_data[3]; // because vec->_coord is protected - vec_data[0] = vec.x(); vec_data[1] = vec.y(); vec_data[2] = vec.z(); - return newVectorObject( vec_data, 3, Py_NEW); + + if( &vec != 0 ){ + vec_data[0] = vec.x(); vec_data[1] = vec.y(); vec_data[2] = vec.z(); + return newVectorObject( vec_data, 3, Py_NEW); + } + + Py_RETURN_NONE; } PyObject *BPy_Id_from_Id( Id id ) { BPy_Id *py_id; - py_id = (BPy_Id *) Id_Type.tp_new( &Id_Type, 0, 0 ); - py_id->id->setFirst( id.getFirst() ); - py_id->id->setSecond( id.getSecond() ); + if( &id != 0 ) { + py_id = (BPy_Id *) Id_Type.tp_new( &Id_Type, 0, 0 ); + py_id->id = new Id( id.getFirst(), id.getSecond() ); + + return (PyObject *)py_id; + } - return (PyObject *)py_id; + Py_RETURN_NONE; } +PyObject *BPy_SVertex_from_SVertex( SVertex sv ) { + BPy_SVertex *py_sv; + + if( &sv != 0 ) { + py_sv = (BPy_SVertex *) SVertex_Type.tp_new( &SVertex_Type, 0, 0 ); + py_sv->sv = new SVertex( sv ); + py_sv->py_if0D.if0D = py_sv->sv; + + return (PyObject *)py_sv; + } + + Py_RETURN_NONE; +} + /////////////////////////////////////////////////////////////////////////////////////////// #ifdef __cplusplus diff --git a/source/blender/freestyle/intern/python/Convert.h b/source/blender/freestyle/intern/python/Convert.h index a2e7eeafd94..ba8e3ea02d2 100644 --- a/source/blender/freestyle/intern/python/Convert.h +++ b/source/blender/freestyle/intern/python/Convert.h @@ -5,6 +5,7 @@ using namespace Geometry; #include "Id.h" +#include "Interface0D/SVertex.h" #ifdef __cplusplus extern "C" { @@ -16,8 +17,6 @@ extern "C" { #include "api2_2x/vector.h" #include "api2_2x/gen_utils.h" -PyObject *Convert_Init( void ); - PyObject *PyBool_from_bool( bool b ); PyObject *Vector_from_Vec2f( Vec2f v ); @@ -25,6 +24,7 @@ PyObject *Vector_from_Vec3f( Vec3f v ); PyObject *Vector_from_Vec3r( Vec3r v ); PyObject *BPy_Id_from_Id( Id id ); +PyObject *BPy_SVertex_from_SVertex( SVertex sv ); /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/Id.cpp b/source/blender/freestyle/intern/python/Id.cpp index 3c769933dcc..4f2964d8060 100644 --- a/source/blender/freestyle/intern/python/Id.cpp +++ b/source/blender/freestyle/intern/python/Id.cpp @@ -12,14 +12,12 @@ extern "C" { static int Id___init__(BPy_Id *self, PyObject *args, PyObject *kwds); static void Id___dealloc__(BPy_Id *self); static PyObject * Id___repr__(BPy_Id* self); +static PyObject * Id_RichCompare(BPy_Id *o1, BPy_Id *o2, int opid); static PyObject * Id_getFirst( BPy_Id *self ); static PyObject * Id_getSecond( BPy_Id *self); static PyObject * Id_setFirst( BPy_Id *self , PyObject *args); static PyObject * Id_setSecond( BPy_Id *self , PyObject *args); -static PyObject * Id___eq__( BPy_Id *self , PyObject *args); -static PyObject * Id___ne__( BPy_Id *self , PyObject *args); -static PyObject * Id___lt__( BPy_Id *self , PyObject *args); /*----------------------Id instance definitions ----------------------------*/ static PyMethodDef BPy_Id_methods[] = { @@ -27,9 +25,6 @@ static PyMethodDef BPy_Id_methods[] = { {"getSecond", ( PyCFunction ) Id_getSecond, METH_NOARGS, "Returns the second Id number" }, {"setFirst", ( PyCFunction ) Id_setFirst, METH_VARARGS, "Sets the first number constituing the Id" }, {"setSecond", ( PyCFunction ) Id_setSecond, METH_VARARGS, "Sets the second number constituing the Id" }, - {"__eq__", ( PyCFunction ) Id___eq__, METH_VARARGS, "Operator ==" }, - {"__ne__", ( PyCFunction ) Id___ne__, METH_VARARGS, "Operator !=" }, - {"__lt__", ( PyCFunction ) Id___lt__, METH_VARARGS, "Operator <" }, {NULL, NULL, 0, NULL} }; @@ -80,7 +75,7 @@ PyTypeObject Id_Type = { /*** Assigned meaning in release 2.1 ***/ /*** rich comparisons ***/ - NULL, /* richcmpfunc tp_richcompare; */ + (richcmpfunc)Id_RichCompare, /* richcmpfunc tp_richcompare; */ /*** weak reference enabler ***/ 0, /* long tp_weaklistoffset; */ @@ -170,7 +165,7 @@ PyObject *Id_getSecond( BPy_Id *self) { PyObject *Id_setFirst( BPy_Id *self , PyObject *args) { unsigned int i; - if( !PyArg_ParseTuple(args, (char *)"i:Id_setFirst", i) ) { + if( !PyArg_ParseTuple(args, (char *)"i", &i) ) { cout << "ERROR: Id_setFirst" << endl; Py_RETURN_NONE; } @@ -184,7 +179,7 @@ PyObject *Id_setFirst( BPy_Id *self , PyObject *args) { PyObject *Id_setSecond( BPy_Id *self , PyObject *args) { unsigned int i; - if( !PyArg_ParseTuple(args, (char *)"i:Id_setSecond", i) ) { + if( !PyArg_ParseTuple(args, (char *)"i", &i) ) { cout << "ERROR: Id_setSecond" << endl; Py_RETURN_NONE; } @@ -194,38 +189,29 @@ PyObject *Id_setSecond( BPy_Id *self , PyObject *args) { Py_RETURN_NONE; } -PyObject *Id___eq__( BPy_Id *self , PyObject *args) { - BPy_Id * other = 0 ; - - if( !PyArg_ParseTuple(args, (char *)"O:Id___eq__", &other) ) { - cout << "ERROR: Id___eq__" << endl; - Py_RETURN_NONE; - } - - return PyBool_from_bool( self->id == other->id ); -} - - -PyObject *Id___ne__(BPy_Id *self , PyObject *args) { - BPy_Id * other = 0 ; - - if( !PyArg_ParseTuple(args, (char *)"O:Id___ne__", &other) ) { - cout << "ERROR: Id___ne__" << endl; - Py_RETURN_NONE; - } - - return PyBool_from_bool( self->id != other->id ); -} - -PyObject *Id___lt__(BPy_Id *self , PyObject *args) { - BPy_Id * other = 0 ; - - if( !PyArg_ParseTuple(args, (char *)"O:Id___lt__", &other) ) { - cout << "ERROR: Id___lt__" << endl; - Py_RETURN_NONE; +PyObject * Id_RichCompare(BPy_Id *o1, BPy_Id *o2, int opid) { + switch(opid){ + case Py_LT: + return PyBool_from_bool( o1->id->operator<(*(o2->id)) ); + break; + case Py_LE: + return PyBool_from_bool( o1->id->operator<(*(o2->id)) || o1->id->operator<(*(o2->id)) ); + break; + case Py_EQ: + return PyBool_from_bool( o1->id->operator==(*(o2->id)) ); + break; + case Py_NE: + return PyBool_from_bool( o1->id->operator!=(*(o2->id)) ); + break; + case Py_GT: + return PyBool_from_bool(!( o1->id->operator<(*(o2->id)) || o1->id->operator<(*(o2->id)) )); + break; + case Py_GE: + return PyBool_from_bool(!( o1->id->operator<(*(o2->id)) )); + break; } - return PyBool_from_bool( self->id <= other->id ); + Py_RETURN_NONE; } diff --git a/source/blender/freestyle/intern/python/Interface0D.cpp b/source/blender/freestyle/intern/python/Interface0D.cpp index 216dbaec1e9..27804b3d276 100644 --- a/source/blender/freestyle/intern/python/Interface0D.cpp +++ b/source/blender/freestyle/intern/python/Interface0D.cpp @@ -2,6 +2,7 @@ #include "Convert.h" #include "Interface0D/CurvePoint.h" +#include "Interface0D/SVertex.h" #ifdef __cplusplus extern "C" { @@ -137,14 +138,19 @@ PyMODINIT_FUNC Interface0D_Init( PyObject *module ) if( PyType_Ready( &Interface0D_Type ) < 0 ) return; - - if( PyType_Ready( &CurvePoint_Type ) < 0 ) - return; - Py_INCREF( &Interface0D_Type ); PyModule_AddObject(module, "Interface0D", (PyObject *)&Interface0D_Type); + + if( PyType_Ready( &CurvePoint_Type ) < 0 ) + return; Py_INCREF( &CurvePoint_Type ); PyModule_AddObject(module, "CurvePoint", (PyObject *)&CurvePoint_Type); + + if( PyType_Ready( &SVertex_Type ) < 0 ) + return; + Py_INCREF( &SVertex_Type ); + PyModule_AddObject(module, "SVertex", (PyObject *)&SVertex_Type); + } //------------------------INSTANCE METHODS ---------------------------------- 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 diff --git a/source/blender/freestyle/intern/python/Interface1D.cpp b/source/blender/freestyle/intern/python/Interface1D.cpp index 27bb71b2f50..27c5f4d08ff 100644 --- a/source/blender/freestyle/intern/python/Interface1D.cpp +++ b/source/blender/freestyle/intern/python/Interface1D.cpp @@ -183,7 +183,7 @@ PyObject *Interface1D_getTimeStamp( BPy_Interface1D *self ) { PyObject *Interface1D_setTimeStamp( BPy_Interface1D *self, PyObject *args) { int timestamp = 0 ; - if( !PyArg_ParseTuple(args, (char *)"i:Interface1D_setTimeStamp", ×tamp) ) { + if( !PyArg_ParseTuple(args, (char *)"i", ×tamp) ) { cout << "ERROR: Interface1D_setTimeStamp" << endl; Py_RETURN_NONE; } diff --git a/source/blender/freestyle/intern/python/Interface1D/FEdge/FEdgeSharp.cpp b/source/blender/freestyle/intern/python/Interface1D/FEdge/FEdgeSharp.cpp index d6bd8c6f085..da409ffe209 100644 --- a/source/blender/freestyle/intern/python/Interface1D/FEdge/FEdgeSharp.cpp +++ b/source/blender/freestyle/intern/python/Interface1D/FEdge/FEdgeSharp.cpp @@ -1,4 +1,4 @@ - PyObject *_wrap_FEdgeSharp_dupplicate(PyObject *self , PyObject *args) { + PyObject *_wrap_FEdgeSharp_duplicate(PyObject *self , PyObject *args) { } diff --git a/source/blender/freestyle/intern/swig/ModuleWrapper.cpp b/source/blender/freestyle/intern/swig/ModuleWrapper.cpp index 94662595bd9..df94340e88a 100755 --- a/source/blender/freestyle/intern/swig/ModuleWrapper.cpp +++ b/source/blender/freestyle/intern/swig/ModuleWrapper.cpp @@ -29688,7 +29688,7 @@ fail: } -SWIGINTERN PyObject *_wrap_SVertex_dupplicate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_SVertex_duplicate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; SVertex *arg1 = (SVertex *) 0 ; SVertex *result = 0 ; @@ -29696,15 +29696,15 @@ SWIGINTERN PyObject *_wrap_SVertex_dupplicate(PyObject *SWIGUNUSEDPARM(self), Py int res1 = 0 ; PyObject * obj0 = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:SVertex_dupplicate",&obj0)) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"O:SVertex_duplicate",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SVertex, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SVertex_dupplicate" "', argument " "1"" of type '" "SVertex *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SVertex_duplicate" "', argument " "1"" of type '" "SVertex *""'"); } arg1 = reinterpret_cast< SVertex * >(argp1); { try { - result = (SVertex *)(arg1)->dupplicate(); + result = (SVertex *)(arg1)->duplicate(); } // catch (Swig::DirectorTypeMismatch&) { // cout << "Warning: return type mismatch" << endl; @@ -31592,7 +31592,7 @@ fail: } -SWIGINTERN PyObject *_wrap_FEdge_dupplicate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_FEdge_duplicate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; FEdge *arg1 = (FEdge *) 0 ; FEdge *result = 0 ; @@ -31600,15 +31600,15 @@ SWIGINTERN PyObject *_wrap_FEdge_dupplicate(PyObject *SWIGUNUSEDPARM(self), PyOb int res1 = 0 ; PyObject * obj0 = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:FEdge_dupplicate",&obj0)) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"O:FEdge_duplicate",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_FEdge, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FEdge_dupplicate" "', argument " "1"" of type '" "FEdge *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FEdge_duplicate" "', argument " "1"" of type '" "FEdge *""'"); } arg1 = reinterpret_cast< FEdge * >(argp1); { try { - result = (FEdge *)(arg1)->dupplicate(); + result = (FEdge *)(arg1)->duplicate(); } // catch (Swig::DirectorTypeMismatch&) { // cout << "Warning: return type mismatch" << endl; @@ -34543,7 +34543,7 @@ fail: } -SWIGINTERN PyObject *_wrap_FEdgeSVertexIterator_dupplicate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_FEdgeSVertexIterator_duplicate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; FEdgeInternal::SVertexIterator *arg1 = (FEdgeInternal::SVertexIterator *) 0 ; SVertex *result = 0 ; @@ -34551,15 +34551,15 @@ SWIGINTERN PyObject *_wrap_FEdgeSVertexIterator_dupplicate(PyObject *SWIGUNUSEDP int res1 = 0 ; PyObject * obj0 = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:FEdgeSVertexIterator_dupplicate",&obj0)) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"O:FEdgeSVertexIterator_duplicate",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_FEdgeInternal__SVertexIterator, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FEdgeSVertexIterator_dupplicate" "', argument " "1"" of type '" "FEdgeInternal::SVertexIterator *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FEdgeSVertexIterator_duplicate" "', argument " "1"" of type '" "FEdgeInternal::SVertexIterator *""'"); } arg1 = reinterpret_cast< FEdgeInternal::SVertexIterator * >(argp1); { try { - result = (SVertex *)(*arg1)->dupplicate(); + result = (SVertex *)(*arg1)->duplicate(); } // catch (Swig::DirectorTypeMismatch&) { // cout << "Warning: return type mismatch" << endl; @@ -36256,7 +36256,7 @@ fail: } -SWIGINTERN PyObject *_wrap_FEdgeSharp_dupplicate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_FEdgeSharp_duplicate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; FEdgeSharp *arg1 = (FEdgeSharp *) 0 ; FEdge *result = 0 ; @@ -36264,15 +36264,15 @@ SWIGINTERN PyObject *_wrap_FEdgeSharp_dupplicate(PyObject *SWIGUNUSEDPARM(self), int res1 = 0 ; PyObject * obj0 = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:FEdgeSharp_dupplicate",&obj0)) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"O:FEdgeSharp_duplicate",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_FEdgeSharp, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FEdgeSharp_dupplicate" "', argument " "1"" of type '" "FEdgeSharp *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FEdgeSharp_duplicate" "', argument " "1"" of type '" "FEdgeSharp *""'"); } arg1 = reinterpret_cast< FEdgeSharp * >(argp1); { try { - result = (FEdge *)(arg1)->dupplicate(); + result = (FEdge *)(arg1)->duplicate(); } // catch (Swig::DirectorTypeMismatch&) { // cout << "Warning: return type mismatch" << endl; @@ -36843,7 +36843,7 @@ fail: } -SWIGINTERN PyObject *_wrap_FEdgeSmooth_dupplicate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_FEdgeSmooth_duplicate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; FEdgeSmooth *arg1 = (FEdgeSmooth *) 0 ; FEdge *result = 0 ; @@ -36851,15 +36851,15 @@ SWIGINTERN PyObject *_wrap_FEdgeSmooth_dupplicate(PyObject *SWIGUNUSEDPARM(self) int res1 = 0 ; PyObject * obj0 = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:FEdgeSmooth_dupplicate",&obj0)) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"O:FEdgeSmooth_duplicate",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_FEdgeSmooth, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FEdgeSmooth_dupplicate" "', argument " "1"" of type '" "FEdgeSmooth *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FEdgeSmooth_duplicate" "', argument " "1"" of type '" "FEdgeSmooth *""'"); } arg1 = reinterpret_cast< FEdgeSmooth * >(argp1); { try { - result = (FEdge *)(arg1)->dupplicate(); + result = (FEdge *)(arg1)->duplicate(); } // catch (Swig::DirectorTypeMismatch&) { // cout << "Warning: return type mismatch" << endl; @@ -37278,7 +37278,7 @@ fail: } -SWIGINTERN PyObject *_wrap_SShape_dupplicate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_SShape_duplicate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; SShape *arg1 = (SShape *) 0 ; SShape *result = 0 ; @@ -37286,15 +37286,15 @@ SWIGINTERN PyObject *_wrap_SShape_dupplicate(PyObject *SWIGUNUSEDPARM(self), PyO int res1 = 0 ; PyObject * obj0 = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:SShape_dupplicate",&obj0)) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"O:SShape_duplicate",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SShape, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SShape_dupplicate" "', argument " "1"" of type '" "SShape *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SShape_duplicate" "', argument " "1"" of type '" "SShape *""'"); } arg1 = reinterpret_cast< SShape * >(argp1); { try { - result = (SShape *)(arg1)->dupplicate(); + result = (SShape *)(arg1)->duplicate(); } // catch (Swig::DirectorTypeMismatch&) { // cout << "Warning: return type mismatch" << endl; @@ -54232,7 +54232,7 @@ fail: } -SWIGINTERN PyObject *_wrap_ViewShape_dupplicate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_ViewShape_duplicate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; ViewShape *arg1 = (ViewShape *) 0 ; ViewShape *result = 0 ; @@ -54240,15 +54240,15 @@ SWIGINTERN PyObject *_wrap_ViewShape_dupplicate(PyObject *SWIGUNUSEDPARM(self), int res1 = 0 ; PyObject * obj0 = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:ViewShape_dupplicate",&obj0)) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"O:ViewShape_duplicate",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ViewShape, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ViewShape_dupplicate" "', argument " "1"" of type '" "ViewShape *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ViewShape_duplicate" "', argument " "1"" of type '" "ViewShape *""'"); } arg1 = reinterpret_cast< ViewShape * >(argp1); { try { - result = (ViewShape *)(arg1)->dupplicate(); + result = (ViewShape *)(arg1)->duplicate(); } // catch (Swig::DirectorTypeMismatch&) { // cout << "Warning: return type mismatch" << endl; @@ -56608,7 +56608,7 @@ fail: } -SWIGINTERN PyObject *_wrap_ViewEdgeSVertexIterator_dupplicate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_ViewEdgeSVertexIterator_duplicate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; ViewEdgeInternal::SVertexIterator *arg1 = (ViewEdgeInternal::SVertexIterator *) 0 ; SVertex *result = 0 ; @@ -56616,15 +56616,15 @@ SWIGINTERN PyObject *_wrap_ViewEdgeSVertexIterator_dupplicate(PyObject *SWIGUNUS int res1 = 0 ; PyObject * obj0 = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:ViewEdgeSVertexIterator_dupplicate",&obj0)) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"O:ViewEdgeSVertexIterator_duplicate",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ViewEdgeInternal__SVertexIterator, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ViewEdgeSVertexIterator_dupplicate" "', argument " "1"" of type '" "ViewEdgeInternal::SVertexIterator *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ViewEdgeSVertexIterator_duplicate" "', argument " "1"" of type '" "ViewEdgeInternal::SVertexIterator *""'"); } arg1 = reinterpret_cast< ViewEdgeInternal::SVertexIterator * >(argp1); { try { - result = (SVertex *)(*arg1)->dupplicate(); + result = (SVertex *)(*arg1)->duplicate(); } // catch (Swig::DirectorTypeMismatch&) { // cout << "Warning: return type mismatch" << endl; @@ -106893,7 +106893,7 @@ static PyMethodDef SwigMethods[] = { { (char *)"SVertex_userdata_get", _wrap_SVertex_userdata_get, METH_VARARGS, NULL}, { (char *)"new_SVertex", _wrap_new_SVertex, METH_VARARGS, NULL}, { (char *)"delete_SVertex", _wrap_delete_SVertex, METH_VARARGS, NULL}, - { (char *)"SVertex_dupplicate", _wrap_SVertex_dupplicate, METH_VARARGS, NULL}, + { (char *)"SVertex_duplicate", _wrap_SVertex_duplicate, METH_VARARGS, NULL}, { (char *)"SVertex___eq__", _wrap_SVertex___eq__, METH_VARARGS, NULL}, { (char *)"SVertex_point3D", _wrap_SVertex_point3D, METH_VARARGS, NULL}, { (char *)"SVertex_point2D", _wrap_SVertex_point2D, METH_VARARGS, NULL}, @@ -106943,7 +106943,7 @@ static PyMethodDef SwigMethods[] = { { (char *)"FEdge_userdata_get", _wrap_FEdge_userdata_get, METH_VARARGS, NULL}, { (char *)"new_FEdge", _wrap_new_FEdge, METH_VARARGS, NULL}, { (char *)"delete_FEdge", _wrap_delete_FEdge, METH_VARARGS, NULL}, - { (char *)"FEdge_dupplicate", _wrap_FEdge_dupplicate, METH_VARARGS, NULL}, + { (char *)"FEdge_duplicate", _wrap_FEdge_duplicate, METH_VARARGS, NULL}, { (char *)"FEdge_vertexA", _wrap_FEdge_vertexA, METH_VARARGS, NULL}, { (char *)"FEdge_vertexB", _wrap_FEdge_vertexB, METH_VARARGS, NULL}, { (char *)"FEdge_getNature", _wrap_FEdge_getNature, METH_VARARGS, NULL}, @@ -107021,7 +107021,7 @@ static PyMethodDef SwigMethods[] = { { (char *)"FEdgeSVertexIterator_castToTVertex", _wrap_FEdgeSVertexIterator_castToTVertex, METH_VARARGS, NULL}, { (char *)"FEdgeSVertexIterator_userdata_set", _wrap_FEdgeSVertexIterator_userdata_set, METH_VARARGS, NULL}, { (char *)"FEdgeSVertexIterator_userdata_get", _wrap_FEdgeSVertexIterator_userdata_get, METH_VARARGS, NULL}, - { (char *)"FEdgeSVertexIterator_dupplicate", _wrap_FEdgeSVertexIterator_dupplicate, METH_VARARGS, NULL}, + { (char *)"FEdgeSVertexIterator_duplicate", _wrap_FEdgeSVertexIterator_duplicate, METH_VARARGS, NULL}, { (char *)"FEdgeSVertexIterator_point3D", _wrap_FEdgeSVertexIterator_point3D, METH_VARARGS, NULL}, { (char *)"FEdgeSVertexIterator_point2D", _wrap_FEdgeSVertexIterator_point2D, METH_VARARGS, NULL}, { (char *)"FEdgeSVertexIterator_normals", _wrap_FEdgeSVertexIterator_normals, METH_VARARGS, NULL}, @@ -107065,7 +107065,7 @@ static PyMethodDef SwigMethods[] = { { (char *)"FEdgeSVertexIterator_swigregister", FEdgeSVertexIterator_swigregister, METH_VARARGS, NULL}, { (char *)"new_FEdgeSharp", _wrap_new_FEdgeSharp, METH_VARARGS, NULL}, { (char *)"delete_FEdgeSharp", _wrap_delete_FEdgeSharp, METH_VARARGS, NULL}, - { (char *)"FEdgeSharp_dupplicate", _wrap_FEdgeSharp_dupplicate, METH_VARARGS, NULL}, + { (char *)"FEdgeSharp_duplicate", _wrap_FEdgeSharp_duplicate, METH_VARARGS, NULL}, { (char *)"FEdgeSharp_normalA", _wrap_FEdgeSharp_normalA, METH_VARARGS, NULL}, { (char *)"FEdgeSharp_normalB", _wrap_FEdgeSharp_normalB, METH_VARARGS, NULL}, { (char *)"FEdgeSharp_aMaterialIndex", _wrap_FEdgeSharp_aMaterialIndex, METH_VARARGS, NULL}, @@ -107079,7 +107079,7 @@ static PyMethodDef SwigMethods[] = { { (char *)"FEdgeSharp_swigregister", FEdgeSharp_swigregister, METH_VARARGS, NULL}, { (char *)"new_FEdgeSmooth", _wrap_new_FEdgeSmooth, METH_VARARGS, NULL}, { (char *)"delete_FEdgeSmooth", _wrap_delete_FEdgeSmooth, METH_VARARGS, NULL}, - { (char *)"FEdgeSmooth_dupplicate", _wrap_FEdgeSmooth_dupplicate, METH_VARARGS, NULL}, + { (char *)"FEdgeSmooth_duplicate", _wrap_FEdgeSmooth_duplicate, METH_VARARGS, NULL}, { (char *)"FEdgeSmooth_face", _wrap_FEdgeSmooth_face, METH_VARARGS, NULL}, { (char *)"FEdgeSmooth_normal", _wrap_FEdgeSmooth_normal, METH_VARARGS, NULL}, { (char *)"FEdgeSmooth_materialIndex", _wrap_FEdgeSmooth_materialIndex, METH_VARARGS, NULL}, @@ -107091,7 +107091,7 @@ static PyMethodDef SwigMethods[] = { { (char *)"SShape_userdata_set", _wrap_SShape_userdata_set, METH_VARARGS, NULL}, { (char *)"SShape_userdata_get", _wrap_SShape_userdata_get, METH_VARARGS, NULL}, { (char *)"new_SShape", _wrap_new_SShape, METH_VARARGS, NULL}, - { (char *)"SShape_dupplicate", _wrap_SShape_dupplicate, METH_VARARGS, NULL}, + { (char *)"SShape_duplicate", _wrap_SShape_duplicate, METH_VARARGS, NULL}, { (char *)"delete_SShape", _wrap_delete_SShape, METH_VARARGS, NULL}, { (char *)"SShape_AddEdge", _wrap_SShape_AddEdge, METH_VARARGS, NULL}, { (char *)"SShape_AddNewVertex", _wrap_SShape_AddNewVertex, METH_VARARGS, NULL}, @@ -107439,7 +107439,7 @@ static PyMethodDef SwigMethods[] = { { (char *)"ViewShape_userdata_set", _wrap_ViewShape_userdata_set, METH_VARARGS, NULL}, { (char *)"ViewShape_userdata_get", _wrap_ViewShape_userdata_get, METH_VARARGS, NULL}, { (char *)"new_ViewShape", _wrap_new_ViewShape, METH_VARARGS, NULL}, - { (char *)"ViewShape_dupplicate", _wrap_ViewShape_dupplicate, METH_VARARGS, NULL}, + { (char *)"ViewShape_duplicate", _wrap_ViewShape_duplicate, METH_VARARGS, NULL}, { (char *)"delete_ViewShape", _wrap_delete_ViewShape, METH_VARARGS, NULL}, { (char *)"ViewShape_SplitEdge", _wrap_ViewShape_SplitEdge, METH_VARARGS, NULL}, { (char *)"ViewShape_sshape", _wrap_ViewShape_sshape, METH_VARARGS, NULL}, @@ -107494,7 +107494,7 @@ static PyMethodDef SwigMethods[] = { { (char *)"ViewEdgeSVertexIterator_castToTVertex", _wrap_ViewEdgeSVertexIterator_castToTVertex, METH_VARARGS, NULL}, { (char *)"ViewEdgeSVertexIterator_userdata_set", _wrap_ViewEdgeSVertexIterator_userdata_set, METH_VARARGS, NULL}, { (char *)"ViewEdgeSVertexIterator_userdata_get", _wrap_ViewEdgeSVertexIterator_userdata_get, METH_VARARGS, NULL}, - { (char *)"ViewEdgeSVertexIterator_dupplicate", _wrap_ViewEdgeSVertexIterator_dupplicate, METH_VARARGS, NULL}, + { (char *)"ViewEdgeSVertexIterator_duplicate", _wrap_ViewEdgeSVertexIterator_duplicate, METH_VARARGS, NULL}, { (char *)"ViewEdgeSVertexIterator_point3D", _wrap_ViewEdgeSVertexIterator_point3D, METH_VARARGS, NULL}, { (char *)"ViewEdgeSVertexIterator_point2D", _wrap_ViewEdgeSVertexIterator_point2D, METH_VARARGS, NULL}, { (char *)"ViewEdgeSVertexIterator_normals", _wrap_ViewEdgeSVertexIterator_normals, METH_VARARGS, NULL}, diff --git a/source/blender/freestyle/intern/view_map/Silhouette.h b/source/blender/freestyle/intern/view_map/Silhouette.h index 958c0545d6d..c6a1763eec6 100755 --- a/source/blender/freestyle/intern/view_map/Silhouette.h +++ b/source/blender/freestyle/intern/view_map/Silhouette.h @@ -206,7 +206,7 @@ public: } /*! Cloning method. */ - virtual SVertex * dupplicate() { + virtual SVertex * duplicate() { SVertex *clone = new SVertex(*this); return clone; } @@ -455,7 +455,7 @@ public: /*! Destructor */ virtual ~FEdge() {} /*! Cloning method. */ - virtual FEdge* dupplicate() + virtual FEdge* duplicate() { FEdge *clone = new FEdge(*this); return clone; @@ -805,7 +805,7 @@ public: /*! Destructor. */ virtual ~FEdgeSharp() {} /*! Cloning method. */ - virtual FEdge* dupplicate(){ + virtual FEdge* duplicate(){ FEdge *clone = new FEdgeSharp(*this); return clone; } @@ -886,7 +886,7 @@ public: /*! Destructor. */ virtual ~FEdgeSmooth() {} /*! Cloning method. */ - virtual FEdge* dupplicate(){ + virtual FEdge* duplicate(){ FEdge *clone = new FEdgeSmooth(*this); return clone; } @@ -980,7 +980,7 @@ public: e!=eend; e++) { - FEdge *newe = (*e)->dupplicate(); + FEdge *newe = (*e)->duplicate(); _edgesList.push_back(newe); } @@ -1053,7 +1053,7 @@ public: } } /*! Cloning method. */ - virtual SShape * dupplicate() + virtual SShape * duplicate() { SShape *clone = new SShape(*this); return clone; diff --git a/source/blender/freestyle/intern/view_map/ViewMap.h b/source/blender/freestyle/intern/view_map/ViewMap.h index bdbb140e130..7528d27cac6 100755 --- a/source/blender/freestyle/intern/view_map/ViewMap.h +++ b/source/blender/freestyle/intern/view_map/ViewMap.h @@ -254,7 +254,7 @@ protected: userdata = 0; } /*! Cloning method. */ - virtual ViewVertex * dupplicate() = 0; + virtual ViewVertex * duplicate() = 0; public: /*! Destructor. */ @@ -443,7 +443,7 @@ protected: } /*! Cloning method. */ - virtual ViewVertex * dupplicate() + virtual ViewVertex * duplicate() { TVertex *clone = new TVertex(*this); return clone; @@ -650,7 +650,7 @@ protected: _ViewEdges = iBrother._ViewEdges; } /*! Cloning method. */ - virtual ViewVertex * dupplicate() + virtual ViewVertex * duplicate() { NonTVertex *clone = new NonTVertex(*this); return clone; @@ -878,7 +878,7 @@ protected: userdata = 0; } /*! Cloning method. */ - virtual ViewEdge * dupplicate() + virtual ViewEdge * duplicate() { ViewEdge *clone = new ViewEdge(*this); return clone; @@ -1107,22 +1107,22 @@ public: _SShape = iBrother._SShape; vector& vvertices = iBrother.vertices(); - // dupplicate vertices + // duplicate vertices for(vv=vvertices.begin(), vvend=vvertices.end(); vv!=vvend; vv++) { - ViewVertex * newVertex = (*vv)->dupplicate(); + ViewVertex * newVertex = (*vv)->duplicate(); AddVertex(newVertex); } vector& vvedges = iBrother.edges(); - // dupplicate edges + // duplicate edges for(ve=vvedges.begin(), veend=vvedges.end(); ve!=veend; ve++) { - ViewEdge * newEdge = (*ve)->dupplicate(); + ViewEdge * newEdge = (*ve)->duplicate(); AddEdge(newEdge); // here the shape is set as the edge's shape } @@ -1209,7 +1209,7 @@ public: } /*! Cloning method. */ - virtual ViewShape * dupplicate() + virtual ViewShape * duplicate() { ViewShape *clone = new ViewShape(*this); return clone; diff --git a/source/blender/freestyle/intern/winged_edge/WEdge.cpp b/source/blender/freestyle/intern/winged_edge/WEdge.cpp index 79b3a8dae26..3f27bf6a8a0 100755 --- a/source/blender/freestyle/intern/winged_edge/WEdge.cpp +++ b/source/blender/freestyle/intern/winged_edge/WEdge.cpp @@ -70,7 +70,7 @@ WVertex::WVertex(WVertex& iBrother) ((vertexdata*)(iBrother.userdata))->_copy = this; } -WVertex* WVertex::dupplicate() +WVertex* WVertex::duplicate() { WVertex *clone = new WVertex(*this); return clone; @@ -180,7 +180,7 @@ WOEdge::WOEdge(WOEdge& iBrother) ((oedgedata*)(iBrother.userdata))->_copy = this; } -WOEdge * WOEdge::dupplicate() +WOEdge * WOEdge::duplicate() { WOEdge *clone = new WOEdge(*this); return clone; @@ -221,10 +221,10 @@ WEdge::WEdge(WEdge& iBrother) if(NULL != aoedge) //_paOEdge = new WOEdge(*aoedge); - _paOEdge = aoedge->dupplicate(); + _paOEdge = aoedge->duplicate(); if(NULL != boedge) //_pbOEdge = new WOEdge(*boedge); - _pbOEdge = boedge->dupplicate(); + _pbOEdge = boedge->duplicate(); _nOEdges = iBrother.GetNumberOfOEdges(); _Id = iBrother.GetId(); @@ -232,7 +232,7 @@ WEdge::WEdge(WEdge& iBrother) ((edgedata*)(iBrother.userdata))->_copy = this; } -WEdge * WEdge::dupplicate() +WEdge * WEdge::duplicate() { WEdge *clone = new WEdge(*this); return clone; @@ -260,7 +260,7 @@ WFace::WFace(WFace& iBrother) ((facedata*)(iBrother.userdata))->_copy = this; } -WFace * WFace::dupplicate() +WFace * WFace::duplicate() { WFace * clone = new WFace(*this); return clone; @@ -466,7 +466,7 @@ WShape * WFace::getShape() LIB_WINGED_EDGE_EXPORT unsigned WShape::_SceneCurrentId = 0; -WShape * WShape::dupplicate() +WShape * WShape::duplicate() { WShape *clone = new WShape(*this); return clone; @@ -485,7 +485,7 @@ WShape::WShape(WShape& iBrother) v++) { //WVertex *newVertex = new WVertex(*(*v)); - WVertex *newVertex = (*v)->dupplicate(); + WVertex *newVertex = (*v)->duplicate(); newVertex->SetShape(this); AddVertex(newVertex); @@ -498,7 +498,7 @@ WShape::WShape(WShape& iBrother) e++) { //WEdge *newEdge = new WEdge(*(*e)); - WEdge *newEdge = (*e)->dupplicate(); + WEdge *newEdge = (*e)->duplicate(); AddEdge(newEdge); } @@ -509,7 +509,7 @@ WShape::WShape(WShape& iBrother) f++) { //WFace *newFace = new WFace(*(*f)); - WFace *newFace = (*f)->dupplicate(); + WFace *newFace = (*f)->duplicate(); AddFace(newFace); } diff --git a/source/blender/freestyle/intern/winged_edge/WEdge.h b/source/blender/freestyle/intern/winged_edge/WEdge.h index 1ab37246469..b4c6a38f5bd 100755 --- a/source/blender/freestyle/intern/winged_edge/WEdge.h +++ b/source/blender/freestyle/intern/winged_edge/WEdge.h @@ -68,7 +68,7 @@ public: inline WVertex(const Vec3r &v) {_Id = 0; _Vertex = v; userdata = NULL; _Shape = NULL;_Smooth=true;_Border=-1;} /*! Copy constructor */ WVertex(WVertex& iBrother); - virtual WVertex * dupplicate(); + virtual WVertex * duplicate(); virtual ~WVertex() {} /*! accessors */ @@ -314,7 +314,7 @@ public: /*! copy constructor */ WOEdge(WOEdge& iBrother); - virtual WOEdge * dupplicate(); + virtual WOEdge * duplicate(); /*! accessors */ // inline WOEdge *GetaCWEdge() {return _paCWEdge;} @@ -393,7 +393,7 @@ public: /*! Copy constructor */ WEdge(WEdge& iBrother); - virtual WEdge * dupplicate(); + virtual WEdge * duplicate(); virtual ~WEdge() { @@ -502,7 +502,7 @@ public: inline WFace() {userdata = NULL;_MaterialIndex = 0;} /*! copy constructor */ WFace(WFace& iBrother); - virtual WFace * dupplicate(); + virtual WFace * duplicate(); virtual ~WFace() {} /*! accessors */ @@ -709,7 +709,7 @@ public: inline WShape() {_meanEdgeSize = 0;_Id = _SceneCurrentId; _SceneCurrentId++;} /*! copy constructor */ WShape(WShape& iBrother); - virtual WShape * dupplicate(); + virtual WShape * duplicate(); virtual ~WShape() { if(_EdgeList.size() != 0) diff --git a/source/blender/freestyle/intern/winged_edge/WXEdge.h b/source/blender/freestyle/intern/winged_edge/WXEdge.h index 66204ba5e99..8c53bb8390e 100755 --- a/source/blender/freestyle/intern/winged_edge/WXEdge.h +++ b/source/blender/freestyle/intern/winged_edge/WXEdge.h @@ -58,7 +58,7 @@ public: WXVertex(WXVertex& iBrother) : WVertex(iBrother) {_curvatures = new CurvatureInfo(*iBrother._curvatures);} - virtual WVertex * dupplicate() + virtual WVertex * duplicate() { WXVertex *clone = new WXVertex(*this); return clone; @@ -109,7 +109,7 @@ public: inline WXEdge(WXEdge& iBrother) : WEdge(iBrother) {_nature = iBrother.nature();_front = iBrother._front;_order = iBrother._order;} - virtual WEdge * dupplicate() + virtual WEdge * duplicate() { WXEdge *clone = new WXEdge(*this); return clone; @@ -334,7 +334,7 @@ public: _SmoothLayers.push_back(new WXFaceLayer(**wxf)); } } - virtual WFace * dupplicate() + virtual WFace * duplicate() { WXFace * clone = new WXFace(*this); return clone; @@ -471,7 +471,7 @@ public: { _computeViewIndependant = iBrother._computeViewIndependant; } - virtual WShape * dupplicate() + virtual WShape * duplicate() { WXShape *clone = new WXShape(*this); return clone; diff --git a/source/blender/freestyle/python/Freestyle.py b/source/blender/freestyle/python/Freestyle.py index 43ae6772f35..40e879654bc 100755 --- a/source/blender/freestyle/python/Freestyle.py +++ b/source/blender/freestyle/python/Freestyle.py @@ -853,7 +853,7 @@ class SVertex(Interface0D): except: self.this = this __swig_destroy__ = _Freestyle.delete_SVertex __del__ = lambda self : None; - def dupplicate(*args): return _Freestyle.SVertex_dupplicate(*args) + def duplicate(*args): return _Freestyle.SVertex_duplicate(*args) def __eq__(*args): return _Freestyle.SVertex___eq__(*args) def point3D(*args): return _Freestyle.SVertex_point3D(*args) def point2D(*args): return _Freestyle.SVertex_point2D(*args) @@ -921,7 +921,7 @@ class FEdge(Interface1D): except: self.this = this __swig_destroy__ = _Freestyle.delete_FEdge __del__ = lambda self : None; - def dupplicate(*args): return _Freestyle.FEdge_dupplicate(*args) + def duplicate(*args): return _Freestyle.FEdge_duplicate(*args) def vertexA(*args): return _Freestyle.FEdge_vertexA(*args) def vertexB(*args): return _Freestyle.FEdge_vertexB(*args) def getNature(*args): return _Freestyle.FEdge_getNature(*args) @@ -1016,7 +1016,7 @@ class FEdgeSVertexIterator(Interface0DIteratorNested): __swig_setmethods__["userdata"] = _Freestyle.FEdgeSVertexIterator_userdata_set __swig_getmethods__["userdata"] = _Freestyle.FEdgeSVertexIterator_userdata_get if _newclass:userdata = _swig_property(_Freestyle.FEdgeSVertexIterator_userdata_get, _Freestyle.FEdgeSVertexIterator_userdata_set) - def dupplicate(*args): return _Freestyle.FEdgeSVertexIterator_dupplicate(*args) + def duplicate(*args): return _Freestyle.FEdgeSVertexIterator_duplicate(*args) def point3D(*args): return _Freestyle.FEdgeSVertexIterator_point3D(*args) def point2D(*args): return _Freestyle.FEdgeSVertexIterator_point2D(*args) def normals(*args): return _Freestyle.FEdgeSVertexIterator_normals(*args) @@ -1074,7 +1074,7 @@ class FEdgeSharp(FEdge): except: self.this = this __swig_destroy__ = _Freestyle.delete_FEdgeSharp __del__ = lambda self : None; - def dupplicate(*args): return _Freestyle.FEdgeSharp_dupplicate(*args) + def duplicate(*args): return _Freestyle.FEdgeSharp_duplicate(*args) def normalA(*args): return _Freestyle.FEdgeSharp_normalA(*args) def normalB(*args): return _Freestyle.FEdgeSharp_normalB(*args) def aMaterialIndex(*args): return _Freestyle.FEdgeSharp_aMaterialIndex(*args) @@ -1102,7 +1102,7 @@ class FEdgeSmooth(FEdge): except: self.this = this __swig_destroy__ = _Freestyle.delete_FEdgeSmooth __del__ = lambda self : None; - def dupplicate(*args): return _Freestyle.FEdgeSmooth_dupplicate(*args) + def duplicate(*args): return _Freestyle.FEdgeSmooth_duplicate(*args) def face(*args): return _Freestyle.FEdgeSmooth_face(*args) def normal(*args): return _Freestyle.FEdgeSmooth_normal(*args) def materialIndex(*args): return _Freestyle.FEdgeSmooth_materialIndex(*args) @@ -1126,7 +1126,7 @@ class SShape(_object): this = _Freestyle.new_SShape(*args) try: self.this.append(this) except: self.this = this - def dupplicate(*args): return _Freestyle.SShape_dupplicate(*args) + def duplicate(*args): return _Freestyle.SShape_duplicate(*args) __swig_destroy__ = _Freestyle.delete_SShape __del__ = lambda self : None; def AddEdge(*args): return _Freestyle.SShape_AddEdge(*args) @@ -1623,7 +1623,7 @@ class ViewShape(_object): this = _Freestyle.new_ViewShape(*args) try: self.this.append(this) except: self.this = this - def dupplicate(*args): return _Freestyle.ViewShape_dupplicate(*args) + def duplicate(*args): return _Freestyle.ViewShape_duplicate(*args) __swig_destroy__ = _Freestyle.delete_ViewShape __del__ = lambda self : None; def SplitEdge(*args): return _Freestyle.ViewShape_SplitEdge(*args) @@ -1706,7 +1706,7 @@ class ViewEdgeSVertexIterator(Interface0DIteratorNested): __swig_setmethods__["userdata"] = _Freestyle.ViewEdgeSVertexIterator_userdata_set __swig_getmethods__["userdata"] = _Freestyle.ViewEdgeSVertexIterator_userdata_get if _newclass:userdata = _swig_property(_Freestyle.ViewEdgeSVertexIterator_userdata_get, _Freestyle.ViewEdgeSVertexIterator_userdata_set) - def dupplicate(*args): return _Freestyle.ViewEdgeSVertexIterator_dupplicate(*args) + def duplicate(*args): return _Freestyle.ViewEdgeSVertexIterator_duplicate(*args) def point3D(*args): return _Freestyle.ViewEdgeSVertexIterator_point3D(*args) def point2D(*args): return _Freestyle.ViewEdgeSVertexIterator_point2D(*args) def normals(*args): return _Freestyle.ViewEdgeSVertexIterator_normals(*args) -- cgit v1.2.3