soc-2008-mxcurioni: FEdge class added. Modifed converting functions to passing-by-reference format. Improved the type checking for FEdge and CurvePoint. Modified FEdge C++ class to test for null vertices. Updated previous classes to support FEdge.

So far, whenever a Python object is created from its corresponding C++ object, the input object reference is copied into a new object. Due to Freestyle's functions (especially regarding the way it is iterated), it is currently impossible to deal with a pointer-based Python object. It is not a real drawback, just an aspect to keep in mind.
This commit is contained in:
Maxime Curioni
2008-07-18 02:55:23 +00:00
parent e4748940c0
commit d3973dac71
11 changed files with 474 additions and 297 deletions

View File

@@ -1,7 +1,6 @@
#include "CurvePoint.h"
#include "../Convert.h"
#include "../../stroke/Curve.h"
#ifdef __cplusplus
extern "C" {
@@ -166,15 +165,15 @@ PyObject * CurvePoint___copy__( BPy_CurvePoint *self ) {
}
PyObject * CurvePoint_A( BPy_CurvePoint *self ) {
if( self->cp->A() )
return BPy_SVertex_from_SVertex( *(self->cp->A()) );
if( SVertex *A = self->cp->A() )
return BPy_SVertex_from_SVertex( *A );
Py_RETURN_NONE;
}
PyObject * CurvePoint_B( BPy_CurvePoint *self ) {
if( self->cp->B() )
return BPy_SVertex_from_SVertex( *(self->cp->B()) );
if( SVertex *B = self->cp->B() )
return BPy_SVertex_from_SVertex( *B );
Py_RETURN_NONE;
}