[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15900] branches/soc-2008-mxcurioni/source /blender/freestyle/intern/python: soc-2008-mxcurioni: moved Curve to FrsCurve, fixed bugs with some style modules having with strokes without a representation and iterators not being correctly routed .

Maxime Curioni maxime.curioni at gmail.com
Fri Aug 1 04:15:26 CEST 2008


Revision: 15900
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15900
Author:   mxcurioni
Date:     2008-08-01 04:15:25 +0200 (Fri, 01 Aug 2008)

Log Message:
-----------
soc-2008-mxcurioni: moved Curve to FrsCurve, fixed bugs with some style modules having with strokes without a representation and iterators not being correctly routed. For example, the cartoon style module should work now.

Modified Paths:
--------------
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_Convert.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_Freestyle.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_Interface1D.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_Iterator.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Director.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Director.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface1D/Curve/BPy_Chain.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface1D/Curve/BPy_Chain.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Iterator/BPy_AdjacencyIterator.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Iterator/BPy_ChainPredicateIterator.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Iterator/BPy_Interface0DIterator.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Iterator/BPy_ViewEdgeIterator.cpp

Added Paths:
-----------
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_FrsNoise.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_FrsNoise.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface1D/BPy_FrsCurve.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface1D/BPy_FrsCurve.h

Removed Paths:
-------------
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_Noise.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_Noise.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface1D/BPy_Curve.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface1D/BPy_Curve.h

Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_Convert.cpp
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_Convert.cpp	2008-07-31 18:37:03 UTC (rev 15899)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_Convert.cpp	2008-08-01 02:15:25 UTC (rev 15900)
@@ -30,6 +30,8 @@
 #include "Iterator/BPy_ViewEdgeIterator.h"
 #include "Iterator/BPy_orientedViewEdgeIterator.h"
 
+#include "../stroke/StrokeRep.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -242,6 +244,7 @@
 PyObject * BPy_AdjacencyIterator_from_AdjacencyIterator( AdjacencyIterator& a_it ) {
 	PyObject *py_a_it = AdjacencyIterator_Type.tp_new( &AdjacencyIterator_Type, 0, 0 );
 	((BPy_AdjacencyIterator *) py_a_it)->a_it = new AdjacencyIterator( a_it );
+	((BPy_AdjacencyIterator *) py_a_it)->py_it.it = ((BPy_AdjacencyIterator *) py_a_it)->a_it;
 
 	return py_a_it;
 }
@@ -249,62 +252,72 @@
 PyObject * BPy_Interface0DIterator_from_Interface0DIterator( Interface0DIterator& if0D_it ) {
 	PyObject *py_if0D_it = Interface0DIterator_Type.tp_new( &Interface0DIterator_Type, 0, 0 );
 	((BPy_Interface0DIterator *) py_if0D_it)->if0D_it = new Interface0DIterator( if0D_it );
+	((BPy_Interface0DIterator *) py_if0D_it)->py_it.it = ((BPy_Interface0DIterator *) py_if0D_it)->if0D_it;
 
 	return py_if0D_it;
 }
 
 PyObject * BPy_CurvePointIterator_from_CurvePointIterator( CurveInternal::CurvePointIterator& cp_it ) {
 	PyObject *py_cp_it = CurvePointIterator_Type.tp_new( &CurvePointIterator_Type, 0, 0 );
-	((BPy_CurvePointIterator*) py_cp_it)->cp_it = new CurveInternal::CurvePointIterator( cp_it );
+	((BPy_CurvePointIterator *) py_cp_it)->cp_it = new CurveInternal::CurvePointIterator( cp_it );
+	((BPy_CurvePointIterator *) py_cp_it)->py_it.it = ((BPy_CurvePointIterator *) py_cp_it)->cp_it;
 
 	return py_cp_it;
 }
 
 PyObject * BPy_StrokeVertexIterator_from_StrokeVertexIterator( StrokeInternal::StrokeVertexIterator& sv_it) {
 	PyObject *py_sv_it = StrokeVertexIterator_Type.tp_new( &StrokeVertexIterator_Type, 0, 0 );
-	((BPy_StrokeVertexIterator*) py_sv_it)->sv_it = new StrokeInternal::StrokeVertexIterator( sv_it );
+	((BPy_StrokeVertexIterator *) py_sv_it)->sv_it = new StrokeInternal::StrokeVertexIterator( sv_it );
+	((BPy_StrokeVertexIterator *) py_sv_it)->py_it.it = ((BPy_StrokeVertexIterator *) py_sv_it)->sv_it;
 
 	return py_sv_it;
 }
 
 PyObject * BPy_SVertexIterator_from_SVertexIterator( ViewEdgeInternal::SVertexIterator& sv_it ) {
 	PyObject *py_sv_it = SVertexIterator_Type.tp_new( &SVertexIterator_Type, 0, 0 );
-	((BPy_SVertexIterator*) py_sv_it)->sv_it = new ViewEdgeInternal::SVertexIterator( sv_it );
-
+	((BPy_SVertexIterator *) py_sv_it)->sv_it = new ViewEdgeInternal::SVertexIterator( sv_it );
+	((BPy_SVertexIterator *) py_sv_it)->py_it.it = ((BPy_SVertexIterator *) py_sv_it)->sv_it;
+	
 	return py_sv_it;
 }
 
+
 PyObject * BPy_orientedViewEdgeIterator_from_orientedViewEdgeIterator( ViewVertexInternal::orientedViewEdgeIterator& ove_it ) {
 	PyObject *py_ove_it = orientedViewEdgeIterator_Type.tp_new( &orientedViewEdgeIterator_Type, 0, 0 );
 	((BPy_orientedViewEdgeIterator *) py_ove_it)->ove_it = new ViewVertexInternal::orientedViewEdgeIterator( ove_it );
-
+	((BPy_orientedViewEdgeIterator *) py_ove_it)->py_it.it = ((BPy_orientedViewEdgeIterator *) py_ove_it)->ove_it;
+	
 	return py_ove_it;
 }
 
 PyObject * BPy_ViewEdgeIterator_from_ViewEdgeIterator( ViewEdgeInternal::ViewEdgeIterator& ve_it )  {
 	PyObject *py_ve_it = ViewEdgeIterator_Type.tp_new( &ViewEdgeIterator_Type, 0, 0 );
-	((BPy_ViewEdgeIterator*) py_ve_it)->ve_it = new ViewEdgeInternal::ViewEdgeIterator( ve_it );
-
+	((BPy_ViewEdgeIterator *) py_ve_it)->ve_it = new ViewEdgeInternal::ViewEdgeIterator( ve_it );
+	((BPy_ViewEdgeIterator *) py_ve_it)->py_it.it =	((BPy_ViewEdgeIterator *) py_ve_it)->ve_it;
+	
 	return py_ve_it;
 }
 
 PyObject * BPy_ChainingIterator_from_ChainingIterator( ChainingIterator& c_it ) {
 	PyObject *py_c_it = ChainingIterator_Type.tp_new( &ChainingIterator_Type, 0, 0 );
-	((BPy_ChainingIterator*) py_c_it)->c_it = new ChainingIterator( c_it );
-
+	((BPy_ChainingIterator *) py_c_it)->c_it = new ChainingIterator( c_it );
+	((BPy_ChainingIterator *) py_c_it)->py_ve_it.py_it.it = ((BPy_ChainingIterator *) py_c_it)->c_it;
+	
 	return py_c_it;
 }
 
 PyObject * BPy_ChainPredicateIterator_from_ChainPredicateIterator( ChainPredicateIterator& cp_it ) {
 	PyObject *py_cp_it = ChainPredicateIterator_Type.tp_new( &ChainPredicateIterator_Type, 0, 0 );
-	((BPy_ChainPredicateIterator*) py_cp_it)->cp_it = new ChainPredicateIterator( cp_it );
+	((BPy_ChainPredicateIterator *) py_cp_it)->cp_it = new ChainPredicateIterator( cp_it );
+	((BPy_ChainPredicateIterator *) py_cp_it)->py_c_it.py_ve_it.py_it.it = ((BPy_ChainPredicateIterator *) py_cp_it)->cp_it;
 
 	return py_cp_it;
 }
 
 PyObject * BPy_ChainSilhouetteIterator_from_ChainSilhouetteIterator( ChainSilhouetteIterator& cs_it ) {
 	PyObject *py_cs_it = ChainSilhouetteIterator_Type.tp_new( &ChainSilhouetteIterator_Type, 0, 0 );
-	((BPy_ChainSilhouetteIterator*) py_cs_it)->cs_it = new ChainSilhouetteIterator( cs_it );
+	((BPy_ChainSilhouetteIterator *) py_cs_it)->cs_it = new ChainSilhouetteIterator( cs_it );
+	((BPy_ChainSilhouetteIterator *) py_cs_it)->py_c_it.py_ve_it.py_it.it = ((BPy_ChainSilhouetteIterator *) py_cs_it)->cs_it;
 
 	return py_cs_it;
 }

Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_Freestyle.cpp
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_Freestyle.cpp	2008-07-31 18:37:03 UTC (rev 15899)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_Freestyle.cpp	2008-08-01 02:15:25 UTC (rev 15900)
@@ -4,6 +4,7 @@
 #include "BPy_BinaryPredicate0D.h"
 #include "BPy_BinaryPredicate1D.h"
 #include "BPy_Material.h"
+#include "BPy_FrsNoise.h"
 #include "BPy_Id.h"
 #include "BPy_IntegrationType.h"
 #include "BPy_Interface0D.h"
@@ -12,7 +13,6 @@
 #include "BPy_MediumType.h"
 #include "BPy_Nature.h"
 #include "BPy_Operators.h"
-#include "BPy_Noise.h"
 #include "BPy_SShape.h"
 #include "BPy_StrokeAttribute.h"
 #include "BPy_StrokeShader.h"
@@ -148,13 +148,13 @@
 	BinaryPredicate0D_Init( module );
 	BinaryPredicate1D_Init( module );
 	Material_Init( module );
+	FrsNoise_Init( module );
 	Id_Init( module );
 	IntegrationType_Init( module );
 	Interface0D_Init( module );
 	Interface1D_Init( module );
 	Iterator_Init( module );
 	Operators_Init( module );
-	Noise_Init( module );
 	SShape_Init( module );
 	StrokeAttribute_Init( module );
 	StrokeShader_Init( module );

Copied: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_FrsNoise.cpp (from rev 15890, branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_Noise.cpp)
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_FrsNoise.cpp	                        (rev 0)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_FrsNoise.cpp	2008-08-01 02:15:25 UTC (rev 15900)
@@ -0,0 +1,239 @@
+#include "BPy_FrsNoise.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+///////////////////////////////////////////////////////////////////////////////////////////
+
+/*---------------  Python API function prototypes for FrsNoise instance  -----------*/
+static int FrsNoise___init__(BPy_FrsNoise *self, PyObject *args, PyObject *kwds);
+static void FrsNoise___dealloc__(BPy_FrsNoise *self);
+static PyObject * FrsNoise___repr__(BPy_FrsNoise *self);
+
+static PyObject * FrsNoise_turbulence1( BPy_FrsNoise *self, PyObject *args);
+static PyObject * FrsNoise_turbulence2( BPy_FrsNoise *self, PyObject *args);
+static PyObject * FrsNoise_turbulence3( BPy_FrsNoise *self, PyObject *args);
+static PyObject * FrsNoise_smoothNoise1( BPy_FrsNoise *self, PyObject *args);
+static PyObject * FrsNoise_smoothNoise2( BPy_FrsNoise *self, PyObject *args);
+static PyObject * FrsNoise_smoothNoise3( BPy_FrsNoise *self, PyObject *args);
+
+/*----------------------FrsNoise instance definitions ----------------------------*/
+static PyMethodDef BPy_FrsNoise_methods[] = {
+	{"turbulence1", ( PyCFunction ) FrsNoise_turbulence1, METH_VARARGS, "(float arg, float freq, float amp, unsigned oct=4))Returns a noise value for a 1D element"},
+	{"turbulence2", ( PyCFunction ) FrsNoise_turbulence2, METH_VARARGS, "([x, y], float freq, float amp, unsigned oct=4)))Returns a noise value for a 2D element"},
+	{"turbulence3", ( PyCFunction ) FrsNoise_turbulence3, METH_VARARGS, "([x, y, z], float freq, float amp, unsigned oct=4)))Returns a noise value for a 3D element"},
+	{"smoothNoise1", ( PyCFunction ) FrsNoise_smoothNoise1, METH_VARARGS, "(float arg))Returns a smooth noise value for a 1D element "},
+	{"smoothNoise2", ( PyCFunction ) FrsNoise_smoothNoise2, METH_VARARGS, "([x, y]))Returns a smooth noise value for a 2D element "},
+	{"smoothNoise3", ( PyCFunction ) FrsNoise_smoothNoise3, METH_VARARGS, "([x, y, z))Returns a smooth noise value for a 3D element "},
+	{NULL, NULL, 0, NULL}
+};
+
+/*-----------------------BPy_FrsNoise type definition ------------------------------*/
+
+PyTypeObject FrsNoise_Type = {
+	PyObject_HEAD_INIT( NULL ) 
+	0,							/* ob_size */
+	"FrsNoise",				/* tp_name */
+	sizeof( BPy_FrsNoise ),	/* tp_basicsize */
+	0,							/* tp_itemsize */
+	
+	/* methods */
+	(destructor)FrsNoise___dealloc__,	/* tp_dealloc */
+	NULL,                       				/* printfunc tp_print; */
+	NULL,                       				/* getattrfunc tp_getattr; */
+	NULL,                       				/* setattrfunc tp_setattr; */
+	NULL,										/* tp_compare */
+	(reprfunc)FrsNoise___repr__,					/* 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; */

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list