soc-2008-mxcurioni: the native Python system now supports cross-language polymorphism for the following classes: BinaryPredicate0D (__call__), BinaryPredicate1D (__call__), UnaryPredicate0D (__call__), UnaryPredicate1D (__call__), StrokeShader (shade), ChainingIterator (init, traverse).
Other methods could easily be supported in the future. The method now works as planned for the contour style. For style modules with Python shaders, there still is a problem that I will fix right away.
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
#include "Interface0D/BPy_ViewVertex.h"
|
||||
#include "BPy_Interface1D.h"
|
||||
#include "Interface1D/BPy_FEdge.h"
|
||||
#include "Interface1D/BPy_Stroke.h"
|
||||
#include "Interface1D/BPy_ViewEdge.h"
|
||||
#include "BPy_Nature.h"
|
||||
#include "BPy_MediumType.h"
|
||||
@@ -115,6 +116,14 @@ PyObject * BPy_Nature_from_Nature( unsigned short n ) {
|
||||
return py_n;
|
||||
}
|
||||
|
||||
PyObject * BPy_Stroke_from_Stroke( Stroke& s ) {
|
||||
PyObject *py_s = Stroke_Type.tp_new( &Stroke_Type, 0, 0 );
|
||||
((BPy_Stroke *) py_s)->s = new Stroke( s );
|
||||
((BPy_Stroke *) py_s)->py_if1D.if1D = ((BPy_Stroke *) py_s)->s;
|
||||
|
||||
return py_s;
|
||||
}
|
||||
|
||||
PyObject * BPy_StrokeAttribute_from_StrokeAttribute( StrokeAttribute& sa ) {
|
||||
PyObject *py_sa = StrokeAttribute_Type.tp_new( &StrokeAttribute_Type, 0, 0 );
|
||||
((BPy_StrokeAttribute *) py_sa)->sa = new StrokeAttribute( sa );
|
||||
|
||||
Reference in New Issue
Block a user