[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15856] branches/soc-2008-mxcurioni/source /blender/freestyle/intern/python: soc-2008-mxcurioni: add all predicate subclasses( BinaryPredicate1D, UnaryPredicate{0D, 1D} ).

Maxime Curioni maxime.curioni at gmail.com
Tue Jul 29 00:53:43 CEST 2008


Revision: 15856
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15856
Author:   mxcurioni
Date:     2008-07-29 00:53:42 +0200 (Tue, 29 Jul 2008)

Log Message:
-----------
 soc-2008-mxcurioni: add all predicate subclasses( BinaryPredicate1D, UnaryPredicate{0D,1D} ).

There is just one more class remaining to port (and probably the most important): Operators. After that, I'll be able to test whether Freestyle functions well without SWIG.

Modified Paths:
--------------
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_BinaryPredicate1D.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_UnaryPredicate0D.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_UnaryPredicate1D.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BinaryPredicate1D/BPy_FalseBP1D.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BinaryPredicate1D/BPy_Length2DBP1D.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BinaryPredicate1D/BPy_SameShapeIdBP1D.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BinaryPredicate1D/BPy_TrueBP1D.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BinaryPredicate1D/BPy_ViewMapGradientNormBP1D.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/UnaryPredicate0D/BPy_FalseUP0D.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/UnaryPredicate0D/BPy_TrueUP0D.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_ContourUP1D.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_DensityLowerThanUP1D.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_EqualToChainingTimeStampUP1D.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_EqualToTimeStampUP1D.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_ExternalContourUP1D.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_FalseUP1D.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_QuantitativeInvisibilityUP1D.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_ShapeUP1D.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_TrueUP1D.cpp

Added Paths:
-----------
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BinaryPredicate1D/BPy_FalseBP1D.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BinaryPredicate1D/BPy_Length2DBP1D.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BinaryPredicate1D/BPy_SameShapeIdBP1D.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BinaryPredicate1D/BPy_TrueBP1D.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BinaryPredicate1D/BPy_ViewMapGradientNormBP1D.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/UnaryPredicate0D/BPy_FalseUP0D.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/UnaryPredicate0D/BPy_TrueUP0D.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_ContourUP1D.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_DensityLowerThanUP1D.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_EqualToChainingTimeStampUP1D.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_EqualToTimeStampUP1D.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_ExternalContourUP1D.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_FalseUP1D.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_QuantitativeInvisibilityUP1D.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_ShapeUP1D.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_TrueUP1D.h

Removed Paths:
-------------
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_EdgeModifier.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/EdgeModifier/

Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_BinaryPredicate1D.cpp
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_BinaryPredicate1D.cpp	2008-07-28 22:36:27 UTC (rev 15855)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_BinaryPredicate1D.cpp	2008-07-28 22:53:42 UTC (rev 15856)
@@ -3,6 +3,12 @@
 #include "BPy_Convert.h"
 #include "BPy_Interface1D.h"
 
+#include "BinaryPredicate1D/BPy_FalseBP1D.h"
+#include "BinaryPredicate1D/BPy_Length2DBP1D.h"
+#include "BinaryPredicate1D/BPy_SameShapeIdBP1D.h"
+#include "BinaryPredicate1D/BPy_TrueBP1D.h"
+#include "BinaryPredicate1D/BPy_ViewMapGradientNormBP1D.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -116,9 +122,35 @@
 
 	if( PyType_Ready( &BinaryPredicate1D_Type ) < 0 )
 		return;
-
 	Py_INCREF( &BinaryPredicate1D_Type );
 	PyModule_AddObject(module, "BinaryPredicate1D", (PyObject *)&BinaryPredicate1D_Type);
+	
+	if( PyType_Ready( &FalseBP1D_Type ) < 0 )
+		return;
+	Py_INCREF( &FalseBP1D_Type );
+	PyModule_AddObject(module, "FalseBP1D", (PyObject *)&FalseBP1D_Type);
+	
+	if( PyType_Ready( &Length2DBP1D_Type ) < 0 )
+		return;
+	Py_INCREF( &Length2DBP1D_Type );
+	PyModule_AddObject(module, "Length2DBP1D", (PyObject *)&Length2DBP1D_Type);
+	
+	if( PyType_Ready( &SameShapeIdBP1D_Type ) < 0 )
+		return;
+	Py_INCREF( &SameShapeIdBP1D_Type );
+	PyModule_AddObject(module, "SameShapeIdBP1D", (PyObject *)&SameShapeIdBP1D_Type);
+	
+	if( PyType_Ready( &TrueBP1D_Type ) < 0 )
+		return;
+	Py_INCREF( &TrueBP1D_Type );
+	PyModule_AddObject(module, "TrueBP1D", (PyObject *)&TrueBP1D_Type);
+	
+	if( PyType_Ready( &ViewMapGradientNormBP1D_Type ) < 0 )
+		return;
+	Py_INCREF( &ViewMapGradientNormBP1D_Type );
+	PyModule_AddObject(module, "ViewMapGradientNormBP1D", (PyObject *)&ViewMapGradientNormBP1D_Type);
+	
+	
 }
 
 

Deleted: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_EdgeModifier.cpp
===================================================================

Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_UnaryPredicate0D.cpp
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_UnaryPredicate0D.cpp	2008-07-28 22:36:27 UTC (rev 15855)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_UnaryPredicate0D.cpp	2008-07-28 22:53:42 UTC (rev 15856)
@@ -2,6 +2,8 @@
 
 #include "BPy_Convert.h"
 #include "Iterator/BPy_Interface0DIterator.h"
+#include "UnaryPredicate0D/BPy_FalseUP0D.h"
+#include "UnaryPredicate0D/BPy_TrueUP0D.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -14,13 +16,13 @@
 static void UnaryPredicate0D___dealloc__(BPy_UnaryPredicate0D *self);
 static PyObject * UnaryPredicate0D___repr__(BPy_UnaryPredicate0D *self);
 
-static PyObject * UnaryPredicate0D_getName( BPy_UnaryPredicate0D *self, PyObject *args);
+static PyObject * UnaryPredicate0D_getName( BPy_UnaryPredicate0D *self );
 static PyObject * UnaryPredicate0D___call__( BPy_UnaryPredicate0D *self, PyObject *args);
 
 /*----------------------UnaryPredicate0D instance definitions ----------------------------*/
 static PyMethodDef BPy_UnaryPredicate0D_methods[] = {
-	{"getName", ( PyCFunction ) UnaryPredicate0D_getName, METH_NOARGS, ""},
-	{"__call__", ( PyCFunction ) UnaryPredicate0D___call__, METH_VARARGS, "" },
+	{"getName", ( PyCFunction ) UnaryPredicate0D_getName, METH_NOARGS, "Returns the string of the name of the UnaryPredicate0D."},
+	{"__call__", ( PyCFunction ) UnaryPredicate0D___call__, METH_VARARGS, "The () operator. Must be overload by inherited classes." },
 	{NULL, NULL, 0, NULL}
 };
 
@@ -119,6 +121,17 @@
 		return;
 	Py_INCREF( &UnaryPredicate0D_Type );
 	PyModule_AddObject(module, "UnaryPredicate0D", (PyObject *)&UnaryPredicate0D_Type);
+	
+	if( PyType_Ready( &FalseUP0D_Type ) < 0 )
+		return;
+	Py_INCREF( &FalseUP0D_Type );
+	PyModule_AddObject(module, "FalseUP0D", (PyObject *)&FalseUP0D_Type);
+	
+	if( PyType_Ready( &TrueUP0D_Type ) < 0 )
+		return;
+	Py_INCREF( &TrueUP0D_Type );
+	PyModule_AddObject(module, "TrueUP0D", (PyObject *)&TrueUP0D_Type);
+	
 }
 
 //------------------------INSTANCE METHODS ----------------------------------
@@ -142,7 +155,7 @@
 }
 
 
-PyObject * UnaryPredicate0D_getName( BPy_UnaryPredicate0D *self, PyObject *args)
+PyObject * UnaryPredicate0D_getName( BPy_UnaryPredicate0D *self )
 {
 	return PyString_FromString( self->up0D->getName().c_str() );
 }

Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_UnaryPredicate1D.cpp
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_UnaryPredicate1D.cpp	2008-07-28 22:36:27 UTC (rev 15855)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_UnaryPredicate1D.cpp	2008-07-28 22:53:42 UTC (rev 15856)
@@ -3,6 +3,16 @@
 #include "BPy_Convert.h"
 #include "BPy_Interface1D.h"
 
+#include "UnaryPredicate1D/BPy_ContourUP1D.h"
+#include "UnaryPredicate1D/BPy_DensityLowerThanUP1D.h"
+#include "UnaryPredicate1D/BPy_EqualToChainingTimeStampUP1D.h"
+#include "UnaryPredicate1D/BPy_EqualToTimeStampUP1D.h"
+#include "UnaryPredicate1D/BPy_ExternalContourUP1D.h"
+#include "UnaryPredicate1D/BPy_FalseUP1D.h"
+#include "UnaryPredicate1D/BPy_QuantitativeInvisibilityUP1D.h"
+#include "UnaryPredicate1D/BPy_ShapeUP1D.h"
+#include "UnaryPredicate1D/BPy_TrueUP1D.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -119,6 +129,51 @@
 		return;
 	Py_INCREF( &UnaryPredicate1D_Type );
 	PyModule_AddObject(module, "UnaryPredicate1D", (PyObject *)&UnaryPredicate1D_Type);
+	
+	if( PyType_Ready( &ContourUP1D_Type ) < 0 )
+		return;
+	Py_INCREF( &ContourUP1D_Type );
+	PyModule_AddObject(module, "ContourUP1D", (PyObject *)&ContourUP1D_Type);
+	
+	if( PyType_Ready( &DensityLowerThanUP1D_Type ) < 0 )
+		return;
+	Py_INCREF( &DensityLowerThanUP1D_Type );
+	PyModule_AddObject(module, "DensityLowerThanUP1D", (PyObject *)&DensityLowerThanUP1D_Type);
+	
+	if( PyType_Ready( &EqualToChainingTimeStampUP1D_Type ) < 0 )
+		return;
+	Py_INCREF( &EqualToChainingTimeStampUP1D_Type );
+	PyModule_AddObject(module, "EqualToChainingTimeStampUP1D", (PyObject *)&EqualToChainingTimeStampUP1D_Type);
+
+	if( PyType_Ready( &EqualToTimeStampUP1D_Type ) < 0 )
+		return;
+	Py_INCREF( &EqualToTimeStampUP1D_Type );
+	PyModule_AddObject(module, "EqualToTimeStampUP1D", (PyObject *)&EqualToTimeStampUP1D_Type);
+	
+	if( PyType_Ready( &ExternalContourUP1D_Type ) < 0 )
+		return;
+	Py_INCREF( &ExternalContourUP1D_Type );
+	PyModule_AddObject(module, "ExternalContourUP1D", (PyObject *)&ExternalContourUP1D_Type);
+	
+	if( PyType_Ready( &FalseUP1D_Type ) < 0 )
+		return;
+	Py_INCREF( &FalseUP1D_Type );
+	PyModule_AddObject(module, "FalseUP1D", (PyObject *)&FalseUP1D_Type);
+	
+	if( PyType_Ready( &QuantitativeInvisibilityUP1D_Type ) < 0 )
+		return;
+	Py_INCREF( &QuantitativeInvisibilityUP1D_Type );
+	PyModule_AddObject(module, "QuantitativeInvisibilityUP1D", (PyObject *)&QuantitativeInvisibilityUP1D_Type);
+	
+	if( PyType_Ready( &ShapeUP1D_Type ) < 0 )
+		return;
+	Py_INCREF( &ShapeUP1D_Type );
+	PyModule_AddObject(module, "ShapeUP1D", (PyObject *)&ShapeUP1D_Type);
+	
+	if( PyType_Ready( &TrueUP1D_Type ) < 0 )
+		return;
+	Py_INCREF( &TrueUP1D_Type );
+	PyModule_AddObject(module, "TrueUP1D", (PyObject *)&TrueUP1D_Type);
 }
 
 //------------------------INSTANCE METHODS ----------------------------------

Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BinaryPredicate1D/BPy_FalseBP1D.cpp
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BinaryPredicate1D/BPy_FalseBP1D.cpp	2008-07-28 22:36:27 UTC (rev 15855)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BinaryPredicate1D/BPy_FalseBP1D.cpp	2008-07-28 22:53:42 UTC (rev 15856)
@@ -1,16 +1,109 @@
- PyObject *_wrap_FalseBP1D_getName(PyObject *self , PyObject *args) {
-}
+#include "BPy_FalseBP1D.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
 
- PyObject *_wrap_FalseBP1D___call__(PyObject *self , PyObject *args) {
-}
+///////////////////////////////////////////////////////////////////////////////////////////
 
+/*---------------  Python API function prototypes for FalseBP1D instance  -----------*/
+	static int FalseBP1D___init__(BPy_FalseBP1D* self);
 
- PyObject *_wrap_new_FalseBP1D(PyObject *self , PyObject *args) {
-}
+/*-----------------------BPy_FalseBP1D type definition ------------------------------*/
 
+PyTypeObject FalseBP1D_Type = {
+	PyObject_HEAD_INIT( NULL ) 
+	0,							/* ob_size */
+	"FalseBP1D",				/* tp_name */
+	sizeof( BPy_FalseBP1D ),	/* 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 */
 
- PyObject *_wrap_delete_FalseBP1D(PyObject *self , PyObject *args) {
+	/* 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; */
+

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list