Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2009-03-30 01:00:26 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2009-03-30 01:00:26 +0400
commitded03e34bf9a989f1ee4e0fe3e3f26f839394299 (patch)
tree6317864b52dd5fdc1d2f40a882ae8e9e57e5302b /source/blender/freestyle/intern/python
parent6dfcbf166b6892d52c14c0902a3d212ffed0b7f6 (diff)
* 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.
Diffstat (limited to 'source/blender/freestyle/intern/python')
-rw-r--r--source/blender/freestyle/intern/python/BPy_Convert.cpp14
-rw-r--r--source/blender/freestyle/intern/python/BPy_Convert.h6
2 files changed, 17 insertions, 3 deletions
diff --git a/source/blender/freestyle/intern/python/BPy_Convert.cpp b/source/blender/freestyle/intern/python/BPy_Convert.cpp
index 4ae6ca53c89..8b26afd85a5 100644
--- a/source/blender/freestyle/intern/python/BPy_Convert.cpp
+++ b/source/blender/freestyle/intern/python/BPy_Convert.cpp
@@ -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 @@ PyObject * BPy_ViewEdge_from_ViewEdge_ptr( ViewEdge* ve ) {
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 @@ PyObject * BPy_IntegrationType_from_IntegrationType( int i ) {
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;
}
diff --git a/source/blender/freestyle/intern/python/BPy_Convert.h b/source/blender/freestyle/intern/python/BPy_Convert.h
index 80cb0600d6e..099a8ed5804 100644
--- a/source/blender/freestyle/intern/python/BPy_Convert.h
+++ b/source/blender/freestyle/intern/python/BPy_Convert.h
@@ -35,6 +35,9 @@ using namespace Geometry;
// CurvePoint, Curve
#include "../stroke/Curve.h"
+// Chain
+#include "../stroke/Chain.h"
+
//====== ITERATORS
// AdjacencyIterator, ChainingIterator, ChainSilhouetteIterator, ChainPredicateIterator
@@ -71,7 +74,7 @@ PyObject * Vector_from_Vec3f( Vec3f& v );
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_StrokeVertex_from_StrokeVertex_ptr( StrokeVertex *sv );
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 );