From 7565990db264dbb7771744cea0a1c87b3e11fc3f Mon Sep 17 00:00:00 2001 From: Maxime Curioni Date: Fri, 1 Aug 2008 21:55:58 +0000 Subject: soc-2008-mxcurioni: made considerable changes to support cross-language polymorphism for UnaryFunction0D, Interface0D, Interface1D. Add to change UnaryFunction1D to static UnaryFunction1D_void. Resolved namespace collision on the Image class (changed to FrsImage). There is greater support for style modules but somehow, some do not show anything yet (japanese_bigbrush being an example). --- .../intern/python/UnaryFunction0D/BPy_UnaryFunction0DDouble.cpp | 6 +++++- .../intern/python/UnaryFunction0D/BPy_UnaryFunction0DEdgeNature.cpp | 1 + .../intern/python/UnaryFunction0D/BPy_UnaryFunction0DFloat.cpp | 1 + .../intern/python/UnaryFunction0D/BPy_UnaryFunction0DId.cpp | 1 + .../intern/python/UnaryFunction0D/BPy_UnaryFunction0DMaterial.cpp | 1 + .../intern/python/UnaryFunction0D/BPy_UnaryFunction0DUnsigned.cpp | 1 + .../intern/python/UnaryFunction0D/BPy_UnaryFunction0DVec2f.cpp | 1 + .../intern/python/UnaryFunction0D/BPy_UnaryFunction0DVec3f.cpp | 1 + .../python/UnaryFunction0D/BPy_UnaryFunction0DVectorViewShape.cpp | 1 + .../intern/python/UnaryFunction0D/BPy_UnaryFunction0DViewShape.cpp | 1 + 10 files changed, 14 insertions(+), 1 deletion(-) (limited to 'source/blender/freestyle/intern/python/UnaryFunction0D') diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DDouble.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DDouble.cpp index e7ac46122b6..45f5c297b8a 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DDouble.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DDouble.cpp @@ -14,6 +14,8 @@ #include "UnaryFunction0D_double/BPy_LocalAverageDepthF0D.h" #include "UnaryFunction0D_double/BPy_ZDiscontinuityF0D.h" +#include "../Director.h" + #ifdef __cplusplus extern "C" { #endif @@ -190,6 +192,7 @@ PyMODINIT_FUNC UnaryFunction0DDouble_Init( PyObject *module ) { int UnaryFunction0DDouble___init__(BPy_UnaryFunction0DDouble* self) { self->uf0D_double = new UnaryFunction0D(); + self->uf0D_double->py_uf0D = (PyObject *)self; return 0; } @@ -219,7 +222,8 @@ PyObject * UnaryFunction0DDouble___call__( BPy_UnaryFunction0DDouble *self, PyOb return NULL; } - double d = self->uf0D_double->operator()(*( ((BPy_Interface0DIterator *) obj)->if0D_it )); + double d = self->uf0D_double->operator()(*( ((BPy_Interface0DIterator *) obj)->if0D_it)); + return PyFloat_FromDouble( d ); } diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DEdgeNature.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DEdgeNature.cpp index 3dfcb74cddd..79f8ff1f648 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DEdgeNature.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DEdgeNature.cpp @@ -135,6 +135,7 @@ PyMODINIT_FUNC UnaryFunction0DEdgeNature_Init( PyObject *module ) { int UnaryFunction0DEdgeNature___init__(BPy_UnaryFunction0DEdgeNature* self) { self->uf0D_edgenature = new UnaryFunction0D(); + self->uf0D_edgenature->py_uf0D = (PyObject *)self; return 0; } diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DFloat.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DFloat.cpp index 2c11eb92ed5..bff5fa962c1 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DFloat.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DFloat.cpp @@ -164,6 +164,7 @@ PyMODINIT_FUNC UnaryFunction0DFloat_Init( PyObject *module ) { int UnaryFunction0DFloat___init__(BPy_UnaryFunction0DFloat* self) { self->uf0D_float = new UnaryFunction0D(); + self->uf0D_float->py_uf0D = (PyObject *)self; return 0; } diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DId.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DId.cpp index 2d6cbf09be1..6e21f5f687e 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DId.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DId.cpp @@ -135,6 +135,7 @@ PyMODINIT_FUNC UnaryFunction0DId_Init( PyObject *module ) { int UnaryFunction0DId___init__(BPy_UnaryFunction0DId* self) { self->uf0D_id = new UnaryFunction0D(); + self->uf0D_id->py_uf0D = (PyObject *)self; return 0; } diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DMaterial.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DMaterial.cpp index 733acce6ab8..2aef794617a 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DMaterial.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DMaterial.cpp @@ -135,6 +135,7 @@ PyMODINIT_FUNC UnaryFunction0DMaterial_Init( PyObject *module ) { int UnaryFunction0DMaterial___init__(BPy_UnaryFunction0DMaterial* self) { self->uf0D_material = new UnaryFunction0D(); + self->uf0D_material->py_uf0D = (PyObject *)self; return 0; } diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DUnsigned.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DUnsigned.cpp index a7d8e9f42a7..2d33419032b 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DUnsigned.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DUnsigned.cpp @@ -135,6 +135,7 @@ PyMODINIT_FUNC UnaryFunction0DUnsigned_Init( PyObject *module ) { int UnaryFunction0DUnsigned___init__(BPy_UnaryFunction0DUnsigned* self) { self->uf0D_unsigned = new UnaryFunction0D(); + self->uf0D_unsigned->py_uf0D = (PyObject *)self; return 0; } diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DVec2f.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DVec2f.cpp index fb7fc4f19fe..3eedf16c575 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DVec2f.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DVec2f.cpp @@ -141,6 +141,7 @@ PyMODINIT_FUNC UnaryFunction0DVec2f_Init( PyObject *module ) { int UnaryFunction0DVec2f___init__(BPy_UnaryFunction0DVec2f* self) { self->uf0D_vec2f = new UnaryFunction0D(); + self->uf0D_vec2f->py_uf0D = (PyObject *)self; return 0; } diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DVec3f.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DVec3f.cpp index d0412d7c7d0..aa77d17b18b 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DVec3f.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DVec3f.cpp @@ -135,6 +135,7 @@ PyMODINIT_FUNC UnaryFunction0DVec3f_Init( PyObject *module ) { int UnaryFunction0DVec3f___init__(BPy_UnaryFunction0DVec3f* self) { self->uf0D_vec3f = new UnaryFunction0D(); + self->uf0D_vec3f->py_uf0D = (PyObject *)self; return 0; } diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DVectorViewShape.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DVectorViewShape.cpp index 02aef4e28cf..93bea5c114e 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DVectorViewShape.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DVectorViewShape.cpp @@ -135,6 +135,7 @@ PyMODINIT_FUNC UnaryFunction0DVectorViewShape_Init( PyObject *module ) { int UnaryFunction0DVectorViewShape___init__(BPy_UnaryFunction0DVectorViewShape* self) { self->uf0D_vectorviewshape = new UnaryFunction0D< std::vector >(); + self->uf0D_vectorviewshape->py_uf0D = (PyObject *)self; return 0; } diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DViewShape.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DViewShape.cpp index eb2fceb3f06..a9714e0b2c6 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DViewShape.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DViewShape.cpp @@ -141,6 +141,7 @@ PyMODINIT_FUNC UnaryFunction0DViewShape_Init( PyObject *module ) { int UnaryFunction0DViewShape___init__(BPy_UnaryFunction0DViewShape* self) { self->uf0D_viewshape = new UnaryFunction0D(); + self->uf0D_viewshape->py_uf0D = (PyObject *)self; return 0; } -- cgit v1.2.3