* 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.
This commit is contained in:
2009-03-29 21:00:26 +00:00
parent 6dfcbf166b
commit ded03e34bf
2 changed files with 17 additions and 3 deletions

View File

@@ -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;
}

View File

@@ -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 );