[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [19456] branches/soc-2008-mxcurioni/source /blender/freestyle/intern/python: * Added BPy_Chain_from_Chain_ptr().
Tamito Kajiyama
rd6t-kjym at asahi-net.or.jp
Sun Mar 29 23:00:26 CEST 2009
Revision: 19456
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=19456
Author: kjym3
Date: 2009-03-29 23:00:26 +0200 (Sun, 29 Mar 2009)
Log Message:
-----------
* Added BPy_Chain_from_Chain_ptr().
* Changed BPy_CurvePoint_from_CurvePoint( CurvePoint& cp ) to
BPy_CurvePoint_from_CurvePoint_ptr( CurvePoint *cp ) so that it
retains a CurvePoint pointer instead of a CurvePoint instance.
Modified Paths:
--------------
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_Convert.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_Convert.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 2009-03-29 19:54:05 UTC (rev 19455)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_Convert.cpp 2009-03-29 21:00:26 UTC (rev 19456)
@@ -13,6 +13,7 @@
#include "Interface1D/BPy_FEdge.h"
#include "Interface1D/BPy_Stroke.h"
#include "Interface1D/BPy_ViewEdge.h"
+#include "Interface1D/Curve/BPy_Chain.h"
#include "BPy_Nature.h"
#include "BPy_MediumType.h"
#include "BPy_SShape.h"
@@ -176,6 +177,14 @@
return py_ve;
}
+PyObject * BPy_Chain_from_Chain_ptr( Chain* c ) {
+ PyObject *py_c = Chain_Type.tp_new( &Chain_Type, 0, 0 );
+ ((BPy_Chain *) py_c)->c = c;
+ ((BPy_Chain *) py_c)->py_c.c = ((BPy_Chain *) py_c)->c;
+ ((BPy_Chain *) py_c)->py_c.py_if1D.if1D = ((BPy_Chain *) py_c)->c;
+ return py_c;
+}
+
PyObject * BPy_SShape_from_SShape( SShape& ss ) {
PyObject *py_ss = SShape_Type.tp_new( &SShape_Type, 0, 0 );
((BPy_SShape *) py_ss)->ss = new SShape( ss );
@@ -208,9 +217,10 @@
return py_it;
}
-PyObject * BPy_CurvePoint_from_CurvePoint( CurvePoint& cp ) {
+PyObject * BPy_CurvePoint_from_CurvePoint_ptr( CurvePoint *cp ) {
PyObject *py_cp = CurvePoint_Type.tp_new( &CurvePoint_Type, 0, 0 );
- ((BPy_CurvePoint*) py_cp)->cp = new CurvePoint( cp );
+ ((BPy_CurvePoint*) py_cp)->cp = cp;
+ ((BPy_CurvePoint*) py_cp)->py_if0D.if0D = ((BPy_CurvePoint*) py_cp)->cp;
return py_cp;
}
Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_Convert.h
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_Convert.h 2009-03-29 19:54:05 UTC (rev 19455)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_Convert.h 2009-03-29 21:00:26 UTC (rev 19456)
@@ -35,6 +35,9 @@
// CurvePoint, Curve
#include "../stroke/Curve.h"
+// Chain
+#include "../stroke/Chain.h"
+
//====== ITERATORS
// AdjacencyIterator, ChainingIterator, ChainSilhouetteIterator, ChainPredicateIterator
@@ -71,7 +74,7 @@
PyObject * Vector_from_Vec3r( Vec3r& v );
PyObject * BPy_BBox_from_BBox( BBox< Vec3r > &bb );
-PyObject * BPy_CurvePoint_from_CurvePoint( CurvePoint& cp );
+PyObject * BPy_CurvePoint_from_CurvePoint_ptr( CurvePoint *cp );
PyObject * BPy_directedViewEdge_from_directedViewEdge( ViewVertex::directedViewEdge& dve );
PyObject * BPy_FEdge_from_FEdge( FEdge& fe );
PyObject * BPy_Id_from_Id( Id& id );
@@ -88,6 +91,7 @@
PyObject * BPy_SVertex_from_SVertex_ptr( SVertex *sv );
PyObject * BPy_ViewVertex_from_ViewVertex_ptr( ViewVertex *vv );
PyObject * BPy_ViewEdge_from_ViewEdge_ptr( ViewEdge *ve );
+PyObject * BPy_Chain_from_Chain_ptr( Chain* c );
PyObject * BPy_ViewShape_from_ViewShape( ViewShape& vs );
PyObject * BPy_AdjacencyIterator_from_AdjacencyIterator( AdjacencyIterator& a_it );
More information about the Bf-blender-cvs
mailing list