forked from bartvdbraak/blender
Code clean-up and fix for typos in docstrings.
This commit is contained in:
parent
3bd0b89716
commit
d38a335d47
@ -81,10 +81,6 @@ static PyObject * BBox_repr(BPy_BBox* self)
|
||||
return PyUnicode_FromFormat("BBox - address: %p", self->bb);
|
||||
}
|
||||
|
||||
static PyMethodDef BPy_BBox_methods[] = {
|
||||
{NULL, NULL, 0, NULL}
|
||||
};
|
||||
|
||||
/*-----------------------BPy_BBox type definition ------------------------------*/
|
||||
|
||||
PyTypeObject BBox_Type = {
|
||||
@ -115,7 +111,7 @@ PyTypeObject BBox_Type = {
|
||||
0, /* tp_weaklistoffset */
|
||||
0, /* tp_iter */
|
||||
0, /* tp_iternext */
|
||||
BPy_BBox_methods, /* tp_methods */
|
||||
0, /* tp_methods */
|
||||
0, /* tp_members */
|
||||
0, /* tp_getset */
|
||||
0, /* tp_base */
|
||||
|
@ -48,9 +48,9 @@ int BinaryPredicate0D_Init(PyObject *module)
|
||||
|
||||
if (PyType_Ready(&BinaryPredicate0D_Type) < 0)
|
||||
return -1;
|
||||
|
||||
Py_INCREF(&BinaryPredicate0D_Type);
|
||||
PyModule_AddObject(module, "BinaryPredicate0D", (PyObject *)&BinaryPredicate0D_Type);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -56,32 +56,32 @@ int BinaryPredicate1D_Init(PyObject *module)
|
||||
return -1;
|
||||
Py_INCREF(&BinaryPredicate1D_Type);
|
||||
PyModule_AddObject(module, "BinaryPredicate1D", (PyObject *)&BinaryPredicate1D_Type);
|
||||
|
||||
|
||||
if (PyType_Ready(&FalseBP1D_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&FalseBP1D_Type);
|
||||
PyModule_AddObject(module, "FalseBP1D", (PyObject *)&FalseBP1D_Type);
|
||||
|
||||
|
||||
if (PyType_Ready(&Length2DBP1D_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&Length2DBP1D_Type);
|
||||
PyModule_AddObject(module, "Length2DBP1D", (PyObject *)&Length2DBP1D_Type);
|
||||
|
||||
|
||||
if (PyType_Ready(&SameShapeIdBP1D_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&SameShapeIdBP1D_Type);
|
||||
PyModule_AddObject(module, "SameShapeIdBP1D", (PyObject *)&SameShapeIdBP1D_Type);
|
||||
|
||||
|
||||
if (PyType_Ready(&TrueBP1D_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&TrueBP1D_Type);
|
||||
PyModule_AddObject(module, "TrueBP1D", (PyObject *)&TrueBP1D_Type);
|
||||
|
||||
|
||||
if (PyType_Ready(&ViewMapGradientNormBP1D_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&ViewMapGradientNormBP1D_Type);
|
||||
PyModule_AddObject(module, "ViewMapGradientNormBP1D", (PyObject *)&ViewMapGradientNormBP1D_Type);
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -72,61 +72,71 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//==============================
|
||||
// C++ => Python
|
||||
//==============================
|
||||
|
||||
|
||||
PyObject * PyBool_from_bool( bool b ){
|
||||
return PyBool_FromLong( b ? 1 : 0);
|
||||
PyObject *PyBool_from_bool(bool b)
|
||||
{
|
||||
return PyBool_FromLong(b ? 1 : 0);
|
||||
}
|
||||
|
||||
|
||||
PyObject * Vector_from_Vec2f( Vec2f& vec ) {
|
||||
PyObject *Vector_from_Vec2f(Vec2f& vec)
|
||||
{
|
||||
float vec_data[2]; // because vec->_coord is protected
|
||||
|
||||
vec_data[0] = vec.x(); vec_data[1] = vec.y();
|
||||
return Vector_CreatePyObject( vec_data, 2, Py_NEW, NULL);
|
||||
vec_data[0] = vec.x();
|
||||
vec_data[1] = vec.y();
|
||||
return Vector_CreatePyObject(vec_data, 2, Py_NEW, NULL);
|
||||
}
|
||||
|
||||
PyObject * Vector_from_Vec3f( Vec3f& vec ) {
|
||||
PyObject *Vector_from_Vec3f(Vec3f& vec)
|
||||
{
|
||||
float vec_data[3]; // because vec->_coord is protected
|
||||
|
||||
vec_data[0] = vec.x(); vec_data[1] = vec.y(); vec_data[2] = vec.z();
|
||||
return Vector_CreatePyObject( vec_data, 3, Py_NEW, NULL);
|
||||
vec_data[0] = vec.x();
|
||||
vec_data[1] = vec.y();
|
||||
vec_data[2] = vec.z();
|
||||
return Vector_CreatePyObject(vec_data, 3, Py_NEW, NULL);
|
||||
}
|
||||
|
||||
PyObject * Vector_from_Vec3r( Vec3r& vec ) {
|
||||
PyObject *Vector_from_Vec3r(Vec3r& vec)
|
||||
{
|
||||
float vec_data[3]; // because vec->_coord is protected
|
||||
|
||||
vec_data[0] = vec.x(); vec_data[1] = vec.y(); vec_data[2] = vec.z();
|
||||
return Vector_CreatePyObject( vec_data, 3, Py_NEW, NULL);
|
||||
vec_data[0] = vec.x();
|
||||
vec_data[1] = vec.y();
|
||||
vec_data[2] = vec.z();
|
||||
return Vector_CreatePyObject(vec_data, 3, Py_NEW, NULL);
|
||||
}
|
||||
|
||||
PyObject * BPy_Id_from_Id( Id& id ) {
|
||||
PyObject *py_id = Id_Type.tp_new( &Id_Type, 0, 0 );
|
||||
((BPy_Id *) py_id)->id = new Id( id.getFirst(), id.getSecond() );
|
||||
|
||||
PyObject *BPy_Id_from_Id(Id& id)
|
||||
{
|
||||
PyObject *py_id = Id_Type.tp_new(&Id_Type, 0, 0);
|
||||
((BPy_Id *)py_id)->id = new Id(id.getFirst(), id.getSecond());
|
||||
return py_id;
|
||||
}
|
||||
|
||||
PyObject * Any_BPy_Interface0D_from_Interface0D( Interface0D& if0D ) {
|
||||
PyObject *Any_BPy_Interface0D_from_Interface0D(Interface0D& if0D)
|
||||
{
|
||||
if (typeid(if0D) == typeid(CurvePoint)) {
|
||||
return BPy_CurvePoint_from_CurvePoint(dynamic_cast<CurvePoint&>(if0D));
|
||||
} else if (typeid(if0D) == typeid(StrokeVertex)) {
|
||||
}
|
||||
else if (typeid(if0D) == typeid(StrokeVertex)) {
|
||||
return BPy_StrokeVertex_from_StrokeVertex(dynamic_cast<StrokeVertex&>(if0D));
|
||||
} else if (typeid(if0D) == typeid(SVertex)) {
|
||||
}
|
||||
else if (typeid(if0D) == typeid(SVertex)) {
|
||||
return BPy_SVertex_from_SVertex(dynamic_cast<SVertex&>(if0D));
|
||||
} else if (typeid(if0D) == typeid(ViewVertex)) {
|
||||
}
|
||||
else if (typeid(if0D) == typeid(ViewVertex)) {
|
||||
return BPy_ViewVertex_from_ViewVertex(dynamic_cast<ViewVertex&>(if0D));
|
||||
} else if (typeid(if0D) == typeid(NonTVertex)) {
|
||||
}
|
||||
else if (typeid(if0D) == typeid(NonTVertex)) {
|
||||
return BPy_NonTVertex_from_NonTVertex(dynamic_cast<NonTVertex&>(if0D));
|
||||
} else if (typeid(if0D) == typeid(TVertex)) {
|
||||
}
|
||||
else if (typeid(if0D) == typeid(TVertex)) {
|
||||
return BPy_TVertex_from_TVertex(dynamic_cast<TVertex&>(if0D));
|
||||
} else if (typeid(if0D) == typeid(Interface0D)) {
|
||||
}
|
||||
else if (typeid(if0D) == typeid(Interface0D)) {
|
||||
return BPy_Interface0D_from_Interface0D(if0D);
|
||||
}
|
||||
string msg("unexpected type: " + if0D.getExactTypeName());
|
||||
@ -134,259 +144,267 @@ PyObject * Any_BPy_Interface0D_from_Interface0D( Interface0D& if0D ) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PyObject * Any_BPy_Interface1D_from_Interface1D( Interface1D& if1D ) {
|
||||
PyObject *Any_BPy_Interface1D_from_Interface1D(Interface1D& if1D)
|
||||
{
|
||||
if (typeid(if1D) == typeid(ViewEdge)) {
|
||||
return BPy_ViewEdge_from_ViewEdge(dynamic_cast<ViewEdge&>(if1D));
|
||||
} else if (typeid(if1D) == typeid(Chain)) {
|
||||
}
|
||||
else if (typeid(if1D) == typeid(Chain)) {
|
||||
return BPy_Chain_from_Chain(dynamic_cast<Chain&>(if1D));
|
||||
} else if (typeid(if1D) == typeid(Stroke)) {
|
||||
}
|
||||
else if (typeid(if1D) == typeid(Stroke)) {
|
||||
return BPy_Stroke_from_Stroke(dynamic_cast<Stroke&>(if1D));
|
||||
} else if (typeid(if1D) == typeid(FEdgeSharp)) {
|
||||
}
|
||||
else if (typeid(if1D) == typeid(FEdgeSharp)) {
|
||||
return BPy_FEdgeSharp_from_FEdgeSharp(dynamic_cast<FEdgeSharp&>(if1D));
|
||||
} else if (typeid(if1D) == typeid(FEdgeSmooth)) {
|
||||
}
|
||||
else if (typeid(if1D) == typeid(FEdgeSmooth)) {
|
||||
return BPy_FEdgeSmooth_from_FEdgeSmooth(dynamic_cast<FEdgeSmooth&>(if1D));
|
||||
} else if (typeid(if1D) == typeid(FEdge)) {
|
||||
}
|
||||
else if (typeid(if1D) == typeid(FEdge)) {
|
||||
return BPy_FEdge_from_FEdge(dynamic_cast<FEdge&>(if1D));
|
||||
} else if (typeid(if1D) == typeid(Interface1D)) {
|
||||
return BPy_Interface1D_from_Interface1D( if1D );
|
||||
}
|
||||
else if (typeid(if1D) == typeid(Interface1D)) {
|
||||
return BPy_Interface1D_from_Interface1D(if1D);
|
||||
}
|
||||
string msg("unexpected type: " + if1D.getExactTypeName());
|
||||
PyErr_SetString(PyExc_TypeError, msg.c_str());
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PyObject * Any_BPy_FEdge_from_FEdge( FEdge& fe ) {
|
||||
PyObject *Any_BPy_FEdge_from_FEdge(FEdge& fe)
|
||||
{
|
||||
if (typeid(fe) == typeid(FEdgeSharp)) {
|
||||
return BPy_FEdgeSharp_from_FEdgeSharp( dynamic_cast<FEdgeSharp&>(fe) );
|
||||
} else if (typeid(fe) == typeid(FEdgeSmooth)) {
|
||||
return BPy_FEdgeSmooth_from_FEdgeSmooth( dynamic_cast<FEdgeSmooth&>(fe) );
|
||||
} else if (typeid(fe) == typeid(FEdge)) {
|
||||
return BPy_FEdge_from_FEdge( fe );
|
||||
return BPy_FEdgeSharp_from_FEdgeSharp(dynamic_cast<FEdgeSharp&>(fe));
|
||||
}
|
||||
else if (typeid(fe) == typeid(FEdgeSmooth)) {
|
||||
return BPy_FEdgeSmooth_from_FEdgeSmooth(dynamic_cast<FEdgeSmooth&>(fe));
|
||||
}
|
||||
else if (typeid(fe) == typeid(FEdge)) {
|
||||
return BPy_FEdge_from_FEdge(fe);
|
||||
}
|
||||
string msg("unexpected type: " + fe.getExactTypeName());
|
||||
PyErr_SetString(PyExc_TypeError, msg.c_str());
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PyObject * Any_BPy_ViewVertex_from_ViewVertex( ViewVertex& vv ) {
|
||||
PyObject *Any_BPy_ViewVertex_from_ViewVertex(ViewVertex& vv)
|
||||
{
|
||||
if (typeid(vv) == typeid(NonTVertex)) {
|
||||
return BPy_NonTVertex_from_NonTVertex( dynamic_cast<NonTVertex&>(vv) );
|
||||
} else if (typeid(vv) == typeid(TVertex)) {
|
||||
return BPy_TVertex_from_TVertex( dynamic_cast<TVertex&>(vv) );
|
||||
} else if (typeid(vv) == typeid(ViewVertex)) {
|
||||
return BPy_ViewVertex_from_ViewVertex( vv );
|
||||
return BPy_NonTVertex_from_NonTVertex(dynamic_cast<NonTVertex&>(vv));
|
||||
}
|
||||
else if (typeid(vv) == typeid(TVertex)) {
|
||||
return BPy_TVertex_from_TVertex(dynamic_cast<TVertex&>(vv));
|
||||
}
|
||||
else if (typeid(vv) == typeid(ViewVertex)) {
|
||||
return BPy_ViewVertex_from_ViewVertex(vv);
|
||||
}
|
||||
string msg("unexpected type: " + vv.getExactTypeName());
|
||||
PyErr_SetString(PyExc_TypeError, msg.c_str());
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PyObject * BPy_Interface0D_from_Interface0D( Interface0D& if0D ) {
|
||||
PyObject *py_if0D = Interface0D_Type.tp_new( &Interface0D_Type, 0, 0 );
|
||||
((BPy_Interface0D *) py_if0D)->if0D = &if0D;
|
||||
((BPy_Interface0D *) py_if0D)->borrowed = 1;
|
||||
|
||||
PyObject *BPy_Interface0D_from_Interface0D(Interface0D& if0D)
|
||||
{
|
||||
PyObject *py_if0D = Interface0D_Type.tp_new(&Interface0D_Type, 0, 0);
|
||||
((BPy_Interface0D *)py_if0D)->if0D = &if0D;
|
||||
((BPy_Interface0D *)py_if0D)->borrowed = 1;
|
||||
return py_if0D;
|
||||
}
|
||||
|
||||
PyObject * BPy_Interface1D_from_Interface1D( Interface1D& if1D ) {
|
||||
PyObject *py_if1D = Interface1D_Type.tp_new( &Interface1D_Type, 0, 0 );
|
||||
((BPy_Interface1D *) py_if1D)->if1D = &if1D;
|
||||
((BPy_Interface1D *) py_if1D)->borrowed = 1;
|
||||
|
||||
PyObject *BPy_Interface1D_from_Interface1D(Interface1D& if1D)
|
||||
{
|
||||
PyObject *py_if1D = Interface1D_Type.tp_new(&Interface1D_Type, 0, 0);
|
||||
((BPy_Interface1D *)py_if1D)->if1D = &if1D;
|
||||
((BPy_Interface1D *)py_if1D)->borrowed = 1;
|
||||
return py_if1D;
|
||||
}
|
||||
|
||||
PyObject * BPy_SVertex_from_SVertex( SVertex& sv ) {
|
||||
PyObject *py_sv = SVertex_Type.tp_new( &SVertex_Type, 0, 0 );
|
||||
((BPy_SVertex *) py_sv)->sv = &sv;
|
||||
((BPy_SVertex *) py_sv)->py_if0D.if0D = ((BPy_SVertex *) py_sv)->sv;
|
||||
((BPy_SVertex *) py_sv)->py_if0D.borrowed = 1;
|
||||
|
||||
PyObject *BPy_SVertex_from_SVertex(SVertex& sv)
|
||||
{
|
||||
PyObject *py_sv = SVertex_Type.tp_new(&SVertex_Type, 0, 0);
|
||||
((BPy_SVertex *)py_sv)->sv = &sv;
|
||||
((BPy_SVertex *)py_sv)->py_if0D.if0D = ((BPy_SVertex *)py_sv)->sv;
|
||||
((BPy_SVertex *)py_sv)->py_if0D.borrowed = 1;
|
||||
return py_sv;
|
||||
}
|
||||
|
||||
PyObject * BPy_FEdgeSharp_from_FEdgeSharp( FEdgeSharp& fes ) {
|
||||
PyObject *py_fe = FEdgeSharp_Type.tp_new( &FEdgeSharp_Type, 0, 0 );
|
||||
((BPy_FEdgeSharp *) py_fe)->fes = &fes;
|
||||
((BPy_FEdgeSharp *) py_fe)->py_fe.fe = ((BPy_FEdgeSharp *) py_fe)->fes;
|
||||
((BPy_FEdgeSharp *) py_fe)->py_fe.py_if1D.if1D = ((BPy_FEdgeSharp *) py_fe)->fes;
|
||||
((BPy_FEdgeSharp *) py_fe)->py_fe.py_if1D.borrowed = 1;
|
||||
|
||||
PyObject *BPy_FEdgeSharp_from_FEdgeSharp(FEdgeSharp& fes)
|
||||
{
|
||||
PyObject *py_fe = FEdgeSharp_Type.tp_new(&FEdgeSharp_Type, 0, 0);
|
||||
((BPy_FEdgeSharp *)py_fe)->fes = &fes;
|
||||
((BPy_FEdgeSharp *)py_fe)->py_fe.fe = ((BPy_FEdgeSharp *)py_fe)->fes;
|
||||
((BPy_FEdgeSharp *)py_fe)->py_fe.py_if1D.if1D = ((BPy_FEdgeSharp *)py_fe)->fes;
|
||||
((BPy_FEdgeSharp *)py_fe)->py_fe.py_if1D.borrowed = 1;
|
||||
return py_fe;
|
||||
}
|
||||
|
||||
PyObject * BPy_FEdgeSmooth_from_FEdgeSmooth( FEdgeSmooth& fes ) {
|
||||
PyObject *py_fe = FEdgeSmooth_Type.tp_new( &FEdgeSmooth_Type, 0, 0 );
|
||||
((BPy_FEdgeSmooth *) py_fe)->fes = &fes;
|
||||
((BPy_FEdgeSmooth *) py_fe)->py_fe.fe = ((BPy_FEdgeSmooth *) py_fe)->fes;
|
||||
((BPy_FEdgeSmooth *) py_fe)->py_fe.py_if1D.if1D = ((BPy_FEdgeSmooth *) py_fe)->fes;
|
||||
((BPy_FEdgeSmooth *) py_fe)->py_fe.py_if1D.borrowed = 1;
|
||||
|
||||
PyObject *BPy_FEdgeSmooth_from_FEdgeSmooth(FEdgeSmooth& fes)
|
||||
{
|
||||
PyObject *py_fe = FEdgeSmooth_Type.tp_new(&FEdgeSmooth_Type, 0, 0);
|
||||
((BPy_FEdgeSmooth *)py_fe)->fes = &fes;
|
||||
((BPy_FEdgeSmooth *)py_fe)->py_fe.fe = ((BPy_FEdgeSmooth *)py_fe)->fes;
|
||||
((BPy_FEdgeSmooth *)py_fe)->py_fe.py_if1D.if1D = ((BPy_FEdgeSmooth *)py_fe)->fes;
|
||||
((BPy_FEdgeSmooth *)py_fe)->py_fe.py_if1D.borrowed = 1;
|
||||
return py_fe;
|
||||
}
|
||||
|
||||
PyObject * BPy_FEdge_from_FEdge( FEdge& fe ) {
|
||||
PyObject *py_fe = FEdge_Type.tp_new( &FEdge_Type, 0, 0 );
|
||||
((BPy_FEdge *) py_fe)->fe = &fe;
|
||||
((BPy_FEdge *) py_fe)->py_if1D.if1D = ((BPy_FEdge *) py_fe)->fe;
|
||||
((BPy_FEdge *) py_fe)->py_if1D.borrowed = 1;
|
||||
|
||||
PyObject *BPy_FEdge_from_FEdge(FEdge& fe)
|
||||
{
|
||||
PyObject *py_fe = FEdge_Type.tp_new(&FEdge_Type, 0, 0);
|
||||
((BPy_FEdge *)py_fe)->fe = &fe;
|
||||
((BPy_FEdge *)py_fe)->py_if1D.if1D = ((BPy_FEdge *)py_fe)->fe;
|
||||
((BPy_FEdge *)py_fe)->py_if1D.borrowed = 1;
|
||||
return py_fe;
|
||||
}
|
||||
|
||||
PyObject * BPy_Nature_from_Nature( unsigned short n ) {
|
||||
PyObject *py_n;
|
||||
|
||||
PyObject *BPy_Nature_from_Nature(unsigned short n)
|
||||
{
|
||||
PyObject *args = PyTuple_New(1);
|
||||
PyTuple_SET_ITEM( args, 0, PyLong_FromLong(n) );
|
||||
py_n = Nature_Type.tp_new(&Nature_Type, args, NULL);
|
||||
PyTuple_SET_ITEM(args, 0, PyLong_FromLong(n));
|
||||
PyObject *py_n = Nature_Type.tp_new(&Nature_Type, args, NULL);
|
||||
Py_DECREF(args);
|
||||
|
||||
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 = &s;
|
||||
((BPy_Stroke *) py_s)->py_if1D.if1D = ((BPy_Stroke *) py_s)->s;
|
||||
((BPy_Stroke *) py_s)->py_if1D.borrowed = 1;
|
||||
|
||||
PyObject *BPy_Stroke_from_Stroke(Stroke& s)
|
||||
{
|
||||
PyObject *py_s = Stroke_Type.tp_new(&Stroke_Type, 0, 0);
|
||||
((BPy_Stroke *)py_s)->s = &s;
|
||||
((BPy_Stroke *)py_s)->py_if1D.if1D = ((BPy_Stroke *)py_s)->s;
|
||||
((BPy_Stroke *)py_s)->py_if1D.borrowed = 1;
|
||||
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 = &sa;
|
||||
((BPy_StrokeAttribute *) py_sa)->borrowed = 1;
|
||||
return py_sa;
|
||||
PyObject *BPy_StrokeAttribute_from_StrokeAttribute(StrokeAttribute& sa)
|
||||
{
|
||||
PyObject *py_sa = StrokeAttribute_Type.tp_new(&StrokeAttribute_Type, 0, 0);
|
||||
((BPy_StrokeAttribute *)py_sa)->sa = &sa;
|
||||
((BPy_StrokeAttribute *)py_sa)->borrowed = 1;
|
||||
return py_sa;
|
||||
}
|
||||
|
||||
PyObject * BPy_MediumType_from_MediumType( Stroke::MediumType n ) {
|
||||
PyObject *py_mt;
|
||||
|
||||
PyObject *BPy_MediumType_from_MediumType(Stroke::MediumType n)
|
||||
{
|
||||
PyObject *args = PyTuple_New(1);
|
||||
PyTuple_SET_ITEM( args, 0, PyLong_FromLong(n) );
|
||||
py_mt = MediumType_Type.tp_new( &MediumType_Type, args, NULL );
|
||||
PyTuple_SET_ITEM(args, 0, PyLong_FromLong(n));
|
||||
PyObject *py_mt = MediumType_Type.tp_new(&MediumType_Type, args, NULL);
|
||||
Py_DECREF(args);
|
||||
|
||||
return py_mt;
|
||||
}
|
||||
|
||||
PyObject * BPy_StrokeVertex_from_StrokeVertex( StrokeVertex& sv ) {
|
||||
PyObject *py_sv = StrokeVertex_Type.tp_new( &StrokeVertex_Type, 0, 0 );
|
||||
((BPy_StrokeVertex *) py_sv)->sv = &sv;
|
||||
((BPy_StrokeVertex *) py_sv)->py_cp.cp = ((BPy_StrokeVertex *) py_sv)->sv;
|
||||
((BPy_StrokeVertex *) py_sv)->py_cp.py_if0D.if0D = ((BPy_StrokeVertex *) py_sv)->sv;
|
||||
((BPy_StrokeVertex *) py_sv)->py_cp.py_if0D.borrowed = 1;
|
||||
|
||||
PyObject *BPy_StrokeVertex_from_StrokeVertex(StrokeVertex& sv)
|
||||
{
|
||||
PyObject *py_sv = StrokeVertex_Type.tp_new(&StrokeVertex_Type, 0, 0);
|
||||
((BPy_StrokeVertex *)py_sv)->sv = &sv;
|
||||
((BPy_StrokeVertex *)py_sv)->py_cp.cp = ((BPy_StrokeVertex *)py_sv)->sv;
|
||||
((BPy_StrokeVertex *)py_sv)->py_cp.py_if0D.if0D = ((BPy_StrokeVertex *)py_sv)->sv;
|
||||
((BPy_StrokeVertex *)py_sv)->py_cp.py_if0D.borrowed = 1;
|
||||
return py_sv;
|
||||
}
|
||||
|
||||
PyObject * BPy_ViewVertex_from_ViewVertex( ViewVertex& vv ) {
|
||||
PyObject *py_vv = ViewVertex_Type.tp_new( &ViewVertex_Type, 0, 0 );
|
||||
((BPy_ViewVertex *) py_vv)->vv = &vv;
|
||||
((BPy_ViewVertex *) py_vv)->py_if0D.if0D = ((BPy_ViewVertex *) py_vv)->vv;
|
||||
((BPy_ViewVertex *) py_vv)->py_if0D.borrowed = 1;
|
||||
|
||||
PyObject *BPy_ViewVertex_from_ViewVertex(ViewVertex& vv)
|
||||
{
|
||||
PyObject *py_vv = ViewVertex_Type.tp_new(&ViewVertex_Type, 0, 0);
|
||||
((BPy_ViewVertex *)py_vv)->vv = &vv;
|
||||
((BPy_ViewVertex *)py_vv)->py_if0D.if0D = ((BPy_ViewVertex *)py_vv)->vv;
|
||||
((BPy_ViewVertex *)py_vv)->py_if0D.borrowed = 1;
|
||||
return py_vv;
|
||||
}
|
||||
|
||||
PyObject * BPy_NonTVertex_from_NonTVertex( NonTVertex& ntv ) {
|
||||
PyObject *py_ntv = NonTVertex_Type.tp_new( &NonTVertex_Type, 0, 0 );
|
||||
((BPy_NonTVertex *) py_ntv)->ntv = &ntv;
|
||||
((BPy_NonTVertex *) py_ntv)->py_vv.vv = ((BPy_NonTVertex *) py_ntv)->ntv;
|
||||
((BPy_NonTVertex *) py_ntv)->py_vv.py_if0D.if0D = ((BPy_NonTVertex *) py_ntv)->ntv;
|
||||
((BPy_NonTVertex *) py_ntv)->py_vv.py_if0D.borrowed = 1;
|
||||
|
||||
PyObject *BPy_NonTVertex_from_NonTVertex(NonTVertex& ntv)
|
||||
{
|
||||
PyObject *py_ntv = NonTVertex_Type.tp_new(&NonTVertex_Type, 0, 0);
|
||||
((BPy_NonTVertex *)py_ntv)->ntv = &ntv;
|
||||
((BPy_NonTVertex *)py_ntv)->py_vv.vv = ((BPy_NonTVertex *)py_ntv)->ntv;
|
||||
((BPy_NonTVertex *)py_ntv)->py_vv.py_if0D.if0D = ((BPy_NonTVertex *)py_ntv)->ntv;
|
||||
((BPy_NonTVertex *)py_ntv)->py_vv.py_if0D.borrowed = 1;
|
||||
return py_ntv;
|
||||
}
|
||||
|
||||
PyObject * BPy_TVertex_from_TVertex( TVertex& tv ) {
|
||||
PyObject *py_tv = TVertex_Type.tp_new( &TVertex_Type, 0, 0 );
|
||||
((BPy_TVertex *) py_tv)->tv = &tv;
|
||||
((BPy_TVertex *) py_tv)->py_vv.vv = ((BPy_TVertex *) py_tv)->tv;
|
||||
((BPy_TVertex *) py_tv)->py_vv.py_if0D.if0D = ((BPy_TVertex *) py_tv)->tv;
|
||||
((BPy_TVertex *) py_tv)->py_vv.py_if0D.borrowed = 1;
|
||||
|
||||
PyObject *BPy_TVertex_from_TVertex(TVertex& tv)
|
||||
{
|
||||
PyObject *py_tv = TVertex_Type.tp_new(&TVertex_Type, 0, 0);
|
||||
((BPy_TVertex *)py_tv)->tv = &tv;
|
||||
((BPy_TVertex *)py_tv)->py_vv.vv = ((BPy_TVertex *)py_tv)->tv;
|
||||
((BPy_TVertex *)py_tv)->py_vv.py_if0D.if0D = ((BPy_TVertex *)py_tv)->tv;
|
||||
((BPy_TVertex *)py_tv)->py_vv.py_if0D.borrowed = 1;
|
||||
return py_tv;
|
||||
}
|
||||
|
||||
PyObject * BPy_BBox_from_BBox(const BBox< Vec3r > &bb) {
|
||||
PyObject *py_bb = BBox_Type.tp_new( &BBox_Type, 0, 0 );
|
||||
((BPy_BBox *) py_bb)->bb = new BBox< Vec3r >( bb );
|
||||
|
||||
PyObject *BPy_BBox_from_BBox(const BBox< Vec3r > &bb)
|
||||
{
|
||||
PyObject *py_bb = BBox_Type.tp_new(&BBox_Type, 0, 0);
|
||||
((BPy_BBox *)py_bb)->bb = new BBox< Vec3r >(bb);
|
||||
return py_bb;
|
||||
}
|
||||
|
||||
PyObject * BPy_ViewEdge_from_ViewEdge( ViewEdge& ve ) {
|
||||
PyObject *py_ve = ViewEdge_Type.tp_new( &ViewEdge_Type, 0, 0 );
|
||||
((BPy_ViewEdge *) py_ve)->ve = &ve;
|
||||
((BPy_ViewEdge *) py_ve)->py_if1D.if1D = ((BPy_ViewEdge *) py_ve)->ve;
|
||||
((BPy_ViewEdge *) py_ve)->py_if1D.borrowed = 1;
|
||||
|
||||
PyObject *BPy_ViewEdge_from_ViewEdge(ViewEdge& ve)
|
||||
{
|
||||
PyObject *py_ve = ViewEdge_Type.tp_new(&ViewEdge_Type, 0, 0);
|
||||
((BPy_ViewEdge *)py_ve)->ve = &ve;
|
||||
((BPy_ViewEdge *)py_ve)->py_if1D.if1D = ((BPy_ViewEdge *)py_ve)->ve;
|
||||
((BPy_ViewEdge *)py_ve)->py_if1D.borrowed = 1;
|
||||
return py_ve;
|
||||
}
|
||||
|
||||
PyObject * BPy_Chain_from_Chain( 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;
|
||||
((BPy_Chain *) py_c)->py_c.py_if1D.borrowed = 1;
|
||||
PyObject *BPy_Chain_from_Chain(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;
|
||||
((BPy_Chain *)py_c)->py_c.py_if1D.borrowed = 1;
|
||||
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 = &ss;
|
||||
((BPy_SShape *) py_ss)->borrowed = 1;
|
||||
|
||||
PyObject *BPy_SShape_from_SShape(SShape& ss)
|
||||
{
|
||||
PyObject *py_ss = SShape_Type.tp_new(&SShape_Type, 0, 0);
|
||||
((BPy_SShape *)py_ss)->ss = &ss;
|
||||
((BPy_SShape *)py_ss)->borrowed = 1;
|
||||
return py_ss;
|
||||
}
|
||||
|
||||
PyObject * BPy_ViewShape_from_ViewShape( ViewShape& vs ) {
|
||||
PyObject *py_vs = ViewShape_Type.tp_new( &ViewShape_Type, 0, 0 );
|
||||
((BPy_ViewShape *) py_vs)->vs = &vs;
|
||||
((BPy_ViewShape *) py_vs)->borrowed = 1;
|
||||
((BPy_ViewShape *) py_vs)->py_ss = NULL;
|
||||
|
||||
PyObject *BPy_ViewShape_from_ViewShape(ViewShape& vs)
|
||||
{
|
||||
PyObject *py_vs = ViewShape_Type.tp_new(&ViewShape_Type, 0, 0);
|
||||
((BPy_ViewShape *)py_vs)->vs = &vs;
|
||||
((BPy_ViewShape *)py_vs)->borrowed = 1;
|
||||
((BPy_ViewShape *)py_vs)->py_ss = NULL;
|
||||
return py_vs;
|
||||
}
|
||||
|
||||
PyObject * BPy_FrsMaterial_from_FrsMaterial(const FrsMaterial& m) {
|
||||
PyObject *py_m = FrsMaterial_Type.tp_new( &FrsMaterial_Type, 0, 0 );
|
||||
((BPy_FrsMaterial*) py_m)->m = new FrsMaterial( m );
|
||||
|
||||
PyObject *BPy_FrsMaterial_from_FrsMaterial(const FrsMaterial& m)
|
||||
{
|
||||
PyObject *py_m = FrsMaterial_Type.tp_new(&FrsMaterial_Type, 0, 0);
|
||||
((BPy_FrsMaterial*) py_m)->m = new FrsMaterial(m);
|
||||
return py_m;
|
||||
}
|
||||
|
||||
PyObject * BPy_IntegrationType_from_IntegrationType( IntegrationType i ) {
|
||||
PyObject *py_it;
|
||||
|
||||
PyObject *BPy_IntegrationType_from_IntegrationType(IntegrationType i)
|
||||
{
|
||||
PyObject *args = PyTuple_New(1);
|
||||
PyTuple_SET_ITEM( args, 0, PyLong_FromLong(i) );
|
||||
py_it = IntegrationType_Type.tp_new( &IntegrationType_Type, args, NULL );
|
||||
PyTuple_SET_ITEM(args, 0, PyLong_FromLong(i));
|
||||
PyObject *py_it = IntegrationType_Type.tp_new(&IntegrationType_Type, args, NULL);
|
||||
Py_DECREF(args);
|
||||
|
||||
return py_it;
|
||||
}
|
||||
|
||||
PyObject * BPy_CurvePoint_from_CurvePoint( CurvePoint& cp ) {
|
||||
PyObject *py_cp = CurvePoint_Type.tp_new( &CurvePoint_Type, 0, 0 );
|
||||
PyObject *BPy_CurvePoint_from_CurvePoint(CurvePoint& cp)
|
||||
{
|
||||
PyObject *py_cp = CurvePoint_Type.tp_new(&CurvePoint_Type, 0, 0);
|
||||
((BPy_CurvePoint*) py_cp)->cp = &cp;
|
||||
((BPy_CurvePoint*) py_cp)->py_if0D.if0D = ((BPy_CurvePoint*) py_cp)->cp;
|
||||
((BPy_CurvePoint*) py_cp)->py_if0D.borrowed = 1;
|
||||
|
||||
return py_cp;
|
||||
}
|
||||
|
||||
PyObject * BPy_directedViewEdge_from_directedViewEdge( ViewVertex::directedViewEdge& dve ) {
|
||||
PyObject *BPy_directedViewEdge_from_directedViewEdge(ViewVertex::directedViewEdge& dve)
|
||||
{
|
||||
PyObject *py_dve = PyTuple_New(2);
|
||||
|
||||
PyTuple_SET_ITEM( py_dve, 0, BPy_ViewEdge_from_ViewEdge(*(dve.first)) );
|
||||
PyTuple_SET_ITEM( py_dve, 1, PyBool_from_bool(dve.second) );
|
||||
|
||||
PyTuple_SET_ITEM(py_dve, 0, BPy_ViewEdge_from_ViewEdge(*(dve.first)));
|
||||
PyTuple_SET_ITEM(py_dve, 1, PyBool_from_bool(dve.second));
|
||||
return py_dve;
|
||||
}
|
||||
|
||||
@ -394,149 +412,155 @@ PyObject * BPy_directedViewEdge_from_directedViewEdge( ViewVertex::directedViewE
|
||||
// Iterators
|
||||
//==============================
|
||||
|
||||
PyObject * BPy_AdjacencyIterator_from_AdjacencyIterator( AdjacencyIterator& a_it ) {
|
||||
PyObject *py_a_it = AdjacencyIterator_Type.tp_new( &AdjacencyIterator_Type, 0, 0 );
|
||||
((BPy_AdjacencyIterator *) py_a_it)->a_it = new AdjacencyIterator( a_it );
|
||||
((BPy_AdjacencyIterator *) py_a_it)->py_it.it = ((BPy_AdjacencyIterator *) py_a_it)->a_it;
|
||||
|
||||
PyObject *BPy_AdjacencyIterator_from_AdjacencyIterator(AdjacencyIterator& a_it)
|
||||
{
|
||||
PyObject *py_a_it = AdjacencyIterator_Type.tp_new(&AdjacencyIterator_Type, 0, 0);
|
||||
((BPy_AdjacencyIterator *)py_a_it)->a_it = new AdjacencyIterator(a_it);
|
||||
((BPy_AdjacencyIterator *)py_a_it)->py_it.it = ((BPy_AdjacencyIterator *)py_a_it)->a_it;
|
||||
return py_a_it;
|
||||
}
|
||||
|
||||
PyObject * BPy_Interface0DIterator_from_Interface0DIterator( Interface0DIterator& if0D_it, int reversed ) {
|
||||
PyObject *py_if0D_it = Interface0DIterator_Type.tp_new( &Interface0DIterator_Type, 0, 0 );
|
||||
((BPy_Interface0DIterator *) py_if0D_it)->if0D_it = new Interface0DIterator( if0D_it );
|
||||
((BPy_Interface0DIterator *) py_if0D_it)->py_it.it = ((BPy_Interface0DIterator *) py_if0D_it)->if0D_it;
|
||||
((BPy_Interface0DIterator *) py_if0D_it)->reversed = reversed;
|
||||
|
||||
PyObject *BPy_Interface0DIterator_from_Interface0DIterator(Interface0DIterator& if0D_it, int reversed)
|
||||
{
|
||||
PyObject *py_if0D_it = Interface0DIterator_Type.tp_new(&Interface0DIterator_Type, 0, 0);
|
||||
((BPy_Interface0DIterator *)py_if0D_it)->if0D_it = new Interface0DIterator(if0D_it);
|
||||
((BPy_Interface0DIterator *)py_if0D_it)->py_it.it = ((BPy_Interface0DIterator *)py_if0D_it)->if0D_it;
|
||||
((BPy_Interface0DIterator *)py_if0D_it)->reversed = reversed;
|
||||
return py_if0D_it;
|
||||
}
|
||||
|
||||
PyObject * BPy_CurvePointIterator_from_CurvePointIterator( CurveInternal::CurvePointIterator& cp_it ) {
|
||||
PyObject *py_cp_it = CurvePointIterator_Type.tp_new( &CurvePointIterator_Type, 0, 0 );
|
||||
((BPy_CurvePointIterator *) py_cp_it)->cp_it = new CurveInternal::CurvePointIterator( cp_it );
|
||||
((BPy_CurvePointIterator *) py_cp_it)->py_it.it = ((BPy_CurvePointIterator *) py_cp_it)->cp_it;
|
||||
|
||||
PyObject *BPy_CurvePointIterator_from_CurvePointIterator(CurveInternal::CurvePointIterator& cp_it)
|
||||
{
|
||||
PyObject *py_cp_it = CurvePointIterator_Type.tp_new(&CurvePointIterator_Type, 0, 0);
|
||||
((BPy_CurvePointIterator *)py_cp_it)->cp_it = new CurveInternal::CurvePointIterator(cp_it);
|
||||
((BPy_CurvePointIterator *)py_cp_it)->py_it.it = ((BPy_CurvePointIterator *)py_cp_it)->cp_it;
|
||||
return py_cp_it;
|
||||
}
|
||||
|
||||
PyObject * BPy_StrokeVertexIterator_from_StrokeVertexIterator( StrokeInternal::StrokeVertexIterator& sv_it, int reversed) {
|
||||
PyObject *py_sv_it = StrokeVertexIterator_Type.tp_new( &StrokeVertexIterator_Type, 0, 0 );
|
||||
((BPy_StrokeVertexIterator *) py_sv_it)->sv_it = new StrokeInternal::StrokeVertexIterator( sv_it );
|
||||
((BPy_StrokeVertexIterator *) py_sv_it)->py_it.it = ((BPy_StrokeVertexIterator *) py_sv_it)->sv_it;
|
||||
((BPy_StrokeVertexIterator *) py_sv_it)->reversed = reversed;
|
||||
|
||||
PyObject *BPy_StrokeVertexIterator_from_StrokeVertexIterator(StrokeInternal::StrokeVertexIterator& sv_it, int reversed)
|
||||
{
|
||||
PyObject *py_sv_it = StrokeVertexIterator_Type.tp_new(&StrokeVertexIterator_Type, 0, 0);
|
||||
((BPy_StrokeVertexIterator *)py_sv_it)->sv_it = new StrokeInternal::StrokeVertexIterator(sv_it);
|
||||
((BPy_StrokeVertexIterator *)py_sv_it)->py_it.it = ((BPy_StrokeVertexIterator *)py_sv_it)->sv_it;
|
||||
((BPy_StrokeVertexIterator *)py_sv_it)->reversed = reversed;
|
||||
return py_sv_it;
|
||||
}
|
||||
|
||||
PyObject * BPy_SVertexIterator_from_SVertexIterator( ViewEdgeInternal::SVertexIterator& sv_it ) {
|
||||
PyObject *py_sv_it = SVertexIterator_Type.tp_new( &SVertexIterator_Type, 0, 0 );
|
||||
((BPy_SVertexIterator *) py_sv_it)->sv_it = new ViewEdgeInternal::SVertexIterator( sv_it );
|
||||
((BPy_SVertexIterator *) py_sv_it)->py_it.it = ((BPy_SVertexIterator *) py_sv_it)->sv_it;
|
||||
|
||||
PyObject *BPy_SVertexIterator_from_SVertexIterator(ViewEdgeInternal::SVertexIterator& sv_it)
|
||||
{
|
||||
PyObject *py_sv_it = SVertexIterator_Type.tp_new(&SVertexIterator_Type, 0, 0);
|
||||
((BPy_SVertexIterator *)py_sv_it)->sv_it = new ViewEdgeInternal::SVertexIterator(sv_it);
|
||||
((BPy_SVertexIterator *)py_sv_it)->py_it.it = ((BPy_SVertexIterator *)py_sv_it)->sv_it;
|
||||
return py_sv_it;
|
||||
}
|
||||
|
||||
|
||||
PyObject * BPy_orientedViewEdgeIterator_from_orientedViewEdgeIterator( ViewVertexInternal::orientedViewEdgeIterator& ove_it, int reversed ) {
|
||||
PyObject *py_ove_it = orientedViewEdgeIterator_Type.tp_new( &orientedViewEdgeIterator_Type, 0, 0 );
|
||||
((BPy_orientedViewEdgeIterator *) py_ove_it)->ove_it = new ViewVertexInternal::orientedViewEdgeIterator( ove_it );
|
||||
((BPy_orientedViewEdgeIterator *) py_ove_it)->py_it.it = ((BPy_orientedViewEdgeIterator *) py_ove_it)->ove_it;
|
||||
((BPy_orientedViewEdgeIterator *) py_ove_it)->reversed = reversed;
|
||||
|
||||
PyObject *BPy_orientedViewEdgeIterator_from_orientedViewEdgeIterator(ViewVertexInternal::orientedViewEdgeIterator& ove_it, int reversed)
|
||||
{
|
||||
PyObject *py_ove_it = orientedViewEdgeIterator_Type.tp_new(&orientedViewEdgeIterator_Type, 0, 0);
|
||||
((BPy_orientedViewEdgeIterator *)py_ove_it)->ove_it = new ViewVertexInternal::orientedViewEdgeIterator(ove_it);
|
||||
((BPy_orientedViewEdgeIterator *)py_ove_it)->py_it.it = ((BPy_orientedViewEdgeIterator *)py_ove_it)->ove_it;
|
||||
((BPy_orientedViewEdgeIterator *)py_ove_it)->reversed = reversed;
|
||||
return py_ove_it;
|
||||
}
|
||||
|
||||
PyObject * BPy_ViewEdgeIterator_from_ViewEdgeIterator( ViewEdgeInternal::ViewEdgeIterator& ve_it ) {
|
||||
PyObject *py_ve_it = ViewEdgeIterator_Type.tp_new( &ViewEdgeIterator_Type, 0, 0 );
|
||||
((BPy_ViewEdgeIterator *) py_ve_it)->ve_it = new ViewEdgeInternal::ViewEdgeIterator( ve_it );
|
||||
((BPy_ViewEdgeIterator *) py_ve_it)->py_it.it = ((BPy_ViewEdgeIterator *) py_ve_it)->ve_it;
|
||||
|
||||
PyObject *BPy_ViewEdgeIterator_from_ViewEdgeIterator(ViewEdgeInternal::ViewEdgeIterator& ve_it)
|
||||
{
|
||||
PyObject *py_ve_it = ViewEdgeIterator_Type.tp_new(&ViewEdgeIterator_Type, 0, 0);
|
||||
((BPy_ViewEdgeIterator *)py_ve_it)->ve_it = new ViewEdgeInternal::ViewEdgeIterator(ve_it);
|
||||
((BPy_ViewEdgeIterator *)py_ve_it)->py_it.it = ((BPy_ViewEdgeIterator *)py_ve_it)->ve_it;
|
||||
return py_ve_it;
|
||||
}
|
||||
|
||||
PyObject * BPy_ChainingIterator_from_ChainingIterator( ChainingIterator& c_it ) {
|
||||
PyObject *py_c_it = ChainingIterator_Type.tp_new( &ChainingIterator_Type, 0, 0 );
|
||||
((BPy_ChainingIterator *) py_c_it)->c_it = new ChainingIterator( c_it );
|
||||
((BPy_ChainingIterator *) py_c_it)->py_ve_it.py_it.it = ((BPy_ChainingIterator *) py_c_it)->c_it;
|
||||
|
||||
PyObject *BPy_ChainingIterator_from_ChainingIterator(ChainingIterator& c_it)
|
||||
{
|
||||
PyObject *py_c_it = ChainingIterator_Type.tp_new(&ChainingIterator_Type, 0, 0);
|
||||
((BPy_ChainingIterator *)py_c_it)->c_it = new ChainingIterator(c_it);
|
||||
((BPy_ChainingIterator *)py_c_it)->py_ve_it.py_it.it = ((BPy_ChainingIterator *)py_c_it)->c_it;
|
||||
return py_c_it;
|
||||
}
|
||||
|
||||
PyObject * BPy_ChainPredicateIterator_from_ChainPredicateIterator( ChainPredicateIterator& cp_it ) {
|
||||
PyObject *py_cp_it = ChainPredicateIterator_Type.tp_new( &ChainPredicateIterator_Type, 0, 0 );
|
||||
((BPy_ChainPredicateIterator *) py_cp_it)->cp_it = new ChainPredicateIterator( cp_it );
|
||||
((BPy_ChainPredicateIterator *) py_cp_it)->py_c_it.py_ve_it.py_it.it = ((BPy_ChainPredicateIterator *) py_cp_it)->cp_it;
|
||||
|
||||
PyObject *BPy_ChainPredicateIterator_from_ChainPredicateIterator(ChainPredicateIterator& cp_it)
|
||||
{
|
||||
PyObject *py_cp_it = ChainPredicateIterator_Type.tp_new(&ChainPredicateIterator_Type, 0, 0);
|
||||
((BPy_ChainPredicateIterator *)py_cp_it)->cp_it = new ChainPredicateIterator(cp_it);
|
||||
((BPy_ChainPredicateIterator *)py_cp_it)->py_c_it.py_ve_it.py_it.it = ((BPy_ChainPredicateIterator *)py_cp_it)->cp_it;
|
||||
return py_cp_it;
|
||||
}
|
||||
|
||||
PyObject * BPy_ChainSilhouetteIterator_from_ChainSilhouetteIterator( ChainSilhouetteIterator& cs_it ) {
|
||||
PyObject *py_cs_it = ChainSilhouetteIterator_Type.tp_new( &ChainSilhouetteIterator_Type, 0, 0 );
|
||||
((BPy_ChainSilhouetteIterator *) py_cs_it)->cs_it = new ChainSilhouetteIterator( cs_it );
|
||||
((BPy_ChainSilhouetteIterator *) py_cs_it)->py_c_it.py_ve_it.py_it.it = ((BPy_ChainSilhouetteIterator *) py_cs_it)->cs_it;
|
||||
|
||||
PyObject *BPy_ChainSilhouetteIterator_from_ChainSilhouetteIterator(ChainSilhouetteIterator& cs_it)
|
||||
{
|
||||
PyObject *py_cs_it = ChainSilhouetteIterator_Type.tp_new(&ChainSilhouetteIterator_Type, 0, 0);
|
||||
((BPy_ChainSilhouetteIterator *)py_cs_it)->cs_it = new ChainSilhouetteIterator(cs_it);
|
||||
((BPy_ChainSilhouetteIterator *)py_cs_it)->py_c_it.py_ve_it.py_it.it = ((BPy_ChainSilhouetteIterator *)py_cs_it)->cs_it;
|
||||
return py_cs_it;
|
||||
}
|
||||
|
||||
|
||||
//==============================
|
||||
// Python => C++
|
||||
//==============================
|
||||
|
||||
bool bool_from_PyBool( PyObject *b ) {
|
||||
bool bool_from_PyBool(PyObject *b)
|
||||
{
|
||||
return PyObject_IsTrue(b) != 0;
|
||||
}
|
||||
|
||||
IntegrationType IntegrationType_from_BPy_IntegrationType( PyObject* obj ) {
|
||||
return static_cast<IntegrationType>( PyLong_AsLong(obj) );
|
||||
IntegrationType IntegrationType_from_BPy_IntegrationType(PyObject* obj)
|
||||
{
|
||||
return static_cast<IntegrationType>(PyLong_AsLong(obj));
|
||||
}
|
||||
|
||||
Stroke::MediumType MediumType_from_BPy_MediumType( PyObject* obj ) {
|
||||
return static_cast<Stroke::MediumType>( PyLong_AsLong(obj) );
|
||||
Stroke::MediumType MediumType_from_BPy_MediumType(PyObject* obj)
|
||||
{
|
||||
return static_cast<Stroke::MediumType>(PyLong_AsLong(obj));
|
||||
}
|
||||
|
||||
Nature::EdgeNature EdgeNature_from_BPy_Nature( PyObject* obj ) {
|
||||
return static_cast<Nature::EdgeNature>( PyLong_AsLong(obj) );
|
||||
Nature::EdgeNature EdgeNature_from_BPy_Nature(PyObject* obj)
|
||||
{
|
||||
return static_cast<Nature::EdgeNature>(PyLong_AsLong(obj));
|
||||
}
|
||||
|
||||
Vec2f * Vec2f_ptr_from_PyObject( PyObject* obj ) {
|
||||
Vec2f * Vec2f_ptr_from_PyObject(PyObject* obj)
|
||||
{
|
||||
Vec2f *v;
|
||||
if( (v = Vec2f_ptr_from_Vector( obj )) )
|
||||
if ((v = Vec2f_ptr_from_Vector(obj)))
|
||||
return v;
|
||||
if( (v = Vec2f_ptr_from_PyList( obj )) )
|
||||
if ((v = Vec2f_ptr_from_PyList(obj)))
|
||||
return v;
|
||||
if( (v = Vec2f_ptr_from_PyTuple( obj )) )
|
||||
if ((v = Vec2f_ptr_from_PyTuple(obj)))
|
||||
return v;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Vec3f * Vec3f_ptr_from_PyObject( PyObject* obj ) {
|
||||
Vec3f * Vec3f_ptr_from_PyObject(PyObject* obj)
|
||||
{
|
||||
Vec3f *v;
|
||||
if( (v = Vec3f_ptr_from_Vector( obj )) )
|
||||
if ((v = Vec3f_ptr_from_Vector(obj)))
|
||||
return v;
|
||||
if( (v = Vec3f_ptr_from_Color( obj )) )
|
||||
if ((v = Vec3f_ptr_from_Color(obj)))
|
||||
return v;
|
||||
if( (v = Vec3f_ptr_from_PyList( obj )) )
|
||||
if ((v = Vec3f_ptr_from_PyList(obj)))
|
||||
return v;
|
||||
if( (v = Vec3f_ptr_from_PyTuple( obj )) )
|
||||
if ((v = Vec3f_ptr_from_PyTuple(obj)))
|
||||
return v;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Vec3r * Vec3r_ptr_from_PyObject( PyObject* obj ) {
|
||||
Vec3r * Vec3r_ptr_from_PyObject(PyObject* obj)
|
||||
{
|
||||
Vec3r *v;
|
||||
if( (v = Vec3r_ptr_from_Vector( obj )) )
|
||||
if ((v = Vec3r_ptr_from_Vector(obj)))
|
||||
return v;
|
||||
if( (v = Vec3r_ptr_from_Color( obj )) )
|
||||
if ((v = Vec3r_ptr_from_Color(obj)))
|
||||
return v;
|
||||
if( (v = Vec3r_ptr_from_PyList( obj )) )
|
||||
if ((v = Vec3r_ptr_from_PyList(obj)))
|
||||
return v;
|
||||
if( (v = Vec3r_ptr_from_PyTuple( obj )) )
|
||||
if ((v = Vec3r_ptr_from_PyTuple(obj)))
|
||||
return v;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Vec2f * Vec2f_ptr_from_Vector( PyObject* obj ) {
|
||||
Vec2f * Vec2f_ptr_from_Vector(PyObject* obj)
|
||||
{
|
||||
if (!VectorObject_Check(obj) || ((VectorObject *)obj)->size != 2)
|
||||
return NULL;
|
||||
float x = ((VectorObject *)obj)->vec[0];
|
||||
@ -544,7 +568,8 @@ Vec2f * Vec2f_ptr_from_Vector( PyObject* obj ) {
|
||||
return new Vec2f(x, y);
|
||||
}
|
||||
|
||||
Vec3f * Vec3f_ptr_from_Vector( PyObject* obj ) {
|
||||
Vec3f * Vec3f_ptr_from_Vector(PyObject* obj)
|
||||
{
|
||||
if (!VectorObject_Check(obj) || ((VectorObject *)obj)->size != 3)
|
||||
return NULL;
|
||||
float x = ((VectorObject *)obj)->vec[0];
|
||||
@ -553,7 +578,8 @@ Vec3f * Vec3f_ptr_from_Vector( PyObject* obj ) {
|
||||
return new Vec3f(x,y,z);
|
||||
}
|
||||
|
||||
Vec3r * Vec3r_ptr_from_Vector( PyObject* obj ) {
|
||||
Vec3r * Vec3r_ptr_from_Vector(PyObject* obj)
|
||||
{
|
||||
if (!VectorObject_Check(obj) || ((VectorObject *)obj)->size != 3)
|
||||
return NULL;
|
||||
real x = ((VectorObject *)obj)->vec[0];
|
||||
@ -562,7 +588,8 @@ Vec3r * Vec3r_ptr_from_Vector( PyObject* obj ) {
|
||||
return new Vec3r(x,y,z);
|
||||
}
|
||||
|
||||
Vec3f * Vec3f_ptr_from_Color( PyObject* obj ) {
|
||||
Vec3f * Vec3f_ptr_from_Color(PyObject* obj)
|
||||
{
|
||||
if (!ColorObject_Check(obj))
|
||||
return NULL;
|
||||
float r = ((ColorObject *)obj)->col[0];
|
||||
@ -571,7 +598,8 @@ Vec3f * Vec3f_ptr_from_Color( PyObject* obj ) {
|
||||
return new Vec3f(r,g,b);
|
||||
}
|
||||
|
||||
Vec3r * Vec3r_ptr_from_Color( PyObject* obj ) {
|
||||
Vec3r * Vec3r_ptr_from_Color(PyObject* obj)
|
||||
{
|
||||
if (!ColorObject_Check(obj))
|
||||
return NULL;
|
||||
real r = ((ColorObject *)obj)->col[0];
|
||||
@ -580,16 +608,18 @@ Vec3r * Vec3r_ptr_from_Color( PyObject* obj ) {
|
||||
return new Vec3r(r,g,b);
|
||||
}
|
||||
|
||||
Vec2f * Vec2f_ptr_from_PyList( PyObject* obj ) {
|
||||
if( !PyList_Check(obj) || PyList_Size(obj) != 2 )
|
||||
Vec2f * Vec2f_ptr_from_PyList(PyObject* obj)
|
||||
{
|
||||
if (!PyList_Check(obj) || PyList_Size(obj) != 2)
|
||||
return NULL;
|
||||
float x = PyFloat_AsDouble(PyList_GetItem(obj, 0));
|
||||
float y = PyFloat_AsDouble(PyList_GetItem(obj, 1));
|
||||
return new Vec2f(x,y);
|
||||
}
|
||||
|
||||
Vec3f * Vec3f_ptr_from_PyList( PyObject* obj ) {
|
||||
if( !PyList_Check(obj) || PyList_Size(obj) != 3 )
|
||||
Vec3f * Vec3f_ptr_from_PyList(PyObject* obj)
|
||||
{
|
||||
if (!PyList_Check(obj) || PyList_Size(obj) != 3)
|
||||
return NULL;
|
||||
float x = PyFloat_AsDouble(PyList_GetItem(obj, 0));
|
||||
float y = PyFloat_AsDouble(PyList_GetItem(obj, 1));
|
||||
@ -597,8 +627,9 @@ Vec3f * Vec3f_ptr_from_PyList( PyObject* obj ) {
|
||||
return new Vec3f(x,y,z);
|
||||
}
|
||||
|
||||
Vec3r * Vec3r_ptr_from_PyList( PyObject* obj ) {
|
||||
if( !PyList_Check(obj) || PyList_Size(obj) != 3 )
|
||||
Vec3r * Vec3r_ptr_from_PyList(PyObject* obj)
|
||||
{
|
||||
if (!PyList_Check(obj) || PyList_Size(obj) != 3)
|
||||
return NULL;
|
||||
float x = PyFloat_AsDouble(PyList_GetItem(obj, 0));
|
||||
float y = PyFloat_AsDouble(PyList_GetItem(obj, 1));
|
||||
@ -606,16 +637,18 @@ Vec3r * Vec3r_ptr_from_PyList( PyObject* obj ) {
|
||||
return new Vec3r(x,y,z);
|
||||
}
|
||||
|
||||
Vec2f * Vec2f_ptr_from_PyTuple( PyObject* obj ) {
|
||||
if( !PyTuple_Check(obj) || PyTuple_Size(obj) != 2 )
|
||||
Vec2f * Vec2f_ptr_from_PyTuple(PyObject* obj)
|
||||
{
|
||||
if (!PyTuple_Check(obj) || PyTuple_Size(obj) != 2)
|
||||
return NULL;
|
||||
float x = PyFloat_AsDouble(PyTuple_GetItem(obj, 0));
|
||||
float y = PyFloat_AsDouble(PyTuple_GetItem(obj, 1));
|
||||
return new Vec2f(x,y);
|
||||
}
|
||||
|
||||
Vec3f * Vec3f_ptr_from_PyTuple( PyObject* obj ) {
|
||||
if( !PyTuple_Check(obj) || PyTuple_Size(obj) != 3 )
|
||||
Vec3f * Vec3f_ptr_from_PyTuple(PyObject* obj)
|
||||
{
|
||||
if (!PyTuple_Check(obj) || PyTuple_Size(obj) != 3)
|
||||
return NULL;
|
||||
float x = PyFloat_AsDouble(PyTuple_GetItem(obj, 0));
|
||||
float y = PyFloat_AsDouble(PyTuple_GetItem(obj, 1));
|
||||
@ -623,8 +656,9 @@ Vec3f * Vec3f_ptr_from_PyTuple( PyObject* obj ) {
|
||||
return new Vec3f(x,y,z);
|
||||
}
|
||||
|
||||
Vec3r * Vec3r_ptr_from_PyTuple( PyObject* obj ) {
|
||||
if( !PyTuple_Check(obj) || PyTuple_Size(obj) != 3 )
|
||||
Vec3r * Vec3r_ptr_from_PyTuple(PyObject* obj)
|
||||
{
|
||||
if (!PyTuple_Check(obj) || PyTuple_Size(obj) != 3)
|
||||
return NULL;
|
||||
float x = PyFloat_AsDouble(PyTuple_GetItem(obj, 0));
|
||||
float y = PyFloat_AsDouble(PyTuple_GetItem(obj, 1));
|
||||
@ -639,19 +673,21 @@ int float_array_from_PyObject(PyObject *obj, float *v, int n)
|
||||
if (VectorObject_Check(obj) && ((VectorObject *)obj)->size == n) {
|
||||
for (int i = 0; i < n; i++)
|
||||
v[i] = ((VectorObject *)obj)->vec[i];
|
||||
} else if (PyList_Check(obj) && PyList_Size(obj) == n) {
|
||||
}
|
||||
else if (PyList_Check(obj) && PyList_Size(obj) == n) {
|
||||
for (int i = 0; i < n; i++)
|
||||
v[i] = PyFloat_AsDouble(PyList_GetItem(obj, i));
|
||||
} else if (PyTuple_Check(obj) && PyTuple_Size(obj) == n) {
|
||||
}
|
||||
else if (PyTuple_Check(obj) && PyTuple_Size(obj) == n) {
|
||||
for (int i = 0; i < n; i++)
|
||||
v[i] = PyFloat_AsDouble(PyTuple_GetItem(obj, i));
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -77,7 +77,7 @@ static char Freestyle_getCurrentScene___doc__[] =
|
||||
" :return: The current scene.\n"
|
||||
" :rtype: :class:`bpy.types.Scene`\n";
|
||||
|
||||
static PyObject *Freestyle_getCurrentScene( PyObject *self )
|
||||
static PyObject *Freestyle_getCurrentScene(PyObject *self)
|
||||
{
|
||||
if (!freestyle_scene) {
|
||||
PyErr_SetString(PyExc_TypeError, "current scene not available");
|
||||
@ -131,7 +131,7 @@ static char Freestyle_blendRamp___doc__[] =
|
||||
" :return: Blended color in RGB format.\n"
|
||||
" :rtype: :class:`mathutils.Vector`\n";
|
||||
|
||||
static PyObject *Freestyle_blendRamp( PyObject *self, PyObject *args )
|
||||
static PyObject *Freestyle_blendRamp(PyObject *self, PyObject *args)
|
||||
{
|
||||
PyObject *obj1, *obj2;
|
||||
char *s;
|
||||
@ -162,7 +162,7 @@ static PyObject *Freestyle_blendRamp( PyObject *self, PyObject *args )
|
||||
ramp_blend(type, a, fac, b);
|
||||
delete v1;
|
||||
delete v2;
|
||||
return Vector_CreatePyObject( a, 3, Py_NEW, NULL);
|
||||
return Vector_CreatePyObject(a, 3, Py_NEW, NULL);
|
||||
|
||||
error:
|
||||
if (v1) delete v1;
|
||||
@ -184,15 +184,15 @@ static char Freestyle_evaluateColorRamp___doc__[] =
|
||||
" :return: color in RGBA format.\n"
|
||||
" :rtype: :class:`mathutils.Vector`\n";
|
||||
|
||||
static PyObject *Freestyle_evaluateColorRamp( PyObject *self, PyObject *args )
|
||||
static PyObject *Freestyle_evaluateColorRamp(PyObject *self, PyObject *args)
|
||||
{
|
||||
BPy_StructRNA *py_srna;
|
||||
ColorBand *coba;
|
||||
float in, out[4];
|
||||
|
||||
if(!( PyArg_ParseTuple(args, "O!f", &pyrna_struct_Type, &py_srna, &in) ))
|
||||
if (!(PyArg_ParseTuple(args, "O!f", &pyrna_struct_Type, &py_srna, &in)))
|
||||
return NULL;
|
||||
if(!RNA_struct_is_a(py_srna->ptr.type, &RNA_ColorRamp)) {
|
||||
if (!RNA_struct_is_a(py_srna->ptr.type, &RNA_ColorRamp)) {
|
||||
PyErr_SetString(PyExc_TypeError, "1st argument is not a ColorRamp object");
|
||||
return NULL;
|
||||
}
|
||||
@ -201,7 +201,7 @@ static PyObject *Freestyle_evaluateColorRamp( PyObject *self, PyObject *args )
|
||||
PyErr_SetString(PyExc_ValueError, "failed to evaluate the color ramp");
|
||||
return NULL;
|
||||
}
|
||||
return Vector_CreatePyObject( out, 4, Py_NEW, NULL);
|
||||
return Vector_CreatePyObject(out, 4, Py_NEW, NULL);
|
||||
}
|
||||
|
||||
#include "DNA_color_types.h"
|
||||
@ -221,16 +221,16 @@ static char Freestyle_evaluateCurveMappingF___doc__[] =
|
||||
" :return: Mapped output value.\n"
|
||||
" :rtype: float\n";
|
||||
|
||||
static PyObject *Freestyle_evaluateCurveMappingF( PyObject *self, PyObject *args )
|
||||
static PyObject *Freestyle_evaluateCurveMappingF(PyObject *self, PyObject *args)
|
||||
{
|
||||
BPy_StructRNA *py_srna;
|
||||
CurveMapping *cumap;
|
||||
int cur;
|
||||
float value;
|
||||
|
||||
if(!( PyArg_ParseTuple(args, "O!if", &pyrna_struct_Type, &py_srna, &cur, &value) ))
|
||||
if (!(PyArg_ParseTuple(args, "O!if", &pyrna_struct_Type, &py_srna, &cur, &value)))
|
||||
return NULL;
|
||||
if(!RNA_struct_is_a(py_srna->ptr.type, &RNA_CurveMapping)) {
|
||||
if (!RNA_struct_is_a(py_srna->ptr.type, &RNA_CurveMapping)) {
|
||||
PyErr_SetString(PyExc_TypeError, "1st argument is not a CurveMapping object");
|
||||
return NULL;
|
||||
}
|
||||
@ -242,7 +242,7 @@ static PyObject *Freestyle_evaluateCurveMappingF( PyObject *self, PyObject *args
|
||||
curvemapping_initialize(cumap);
|
||||
/* disable extrapolation if enabled */
|
||||
if ((cumap->cm[cur].flag & CUMA_EXTEND_EXTRAPOLATE)) {
|
||||
cumap->cm[cur].flag &= ~( CUMA_EXTEND_EXTRAPOLATE );
|
||||
cumap->cm[cur].flag &= ~(CUMA_EXTEND_EXTRAPOLATE);
|
||||
curvemapping_changed(cumap, 0);
|
||||
}
|
||||
return PyFloat_FromDouble(curvemapping_evaluateF(cumap, cur, value));
|
||||
@ -475,10 +475,10 @@ static char module_docstring[] =
|
||||
/*-----------------------Freestyle module method def---------------------------*/
|
||||
|
||||
static PyMethodDef module_functions[] = {
|
||||
{"getCurrentScene", ( PyCFunction ) Freestyle_getCurrentScene, METH_NOARGS, Freestyle_getCurrentScene___doc__},
|
||||
{"blendRamp", ( PyCFunction ) Freestyle_blendRamp, METH_VARARGS, Freestyle_blendRamp___doc__},
|
||||
{"evaluateColorRamp", ( PyCFunction ) Freestyle_evaluateColorRamp, METH_VARARGS, Freestyle_evaluateColorRamp___doc__},
|
||||
{"evaluateCurveMappingF", ( PyCFunction ) Freestyle_evaluateCurveMappingF, METH_VARARGS, Freestyle_evaluateCurveMappingF___doc__},
|
||||
{"getCurrentScene", (PyCFunction) Freestyle_getCurrentScene, METH_NOARGS, Freestyle_getCurrentScene___doc__},
|
||||
{"blendRamp", (PyCFunction) Freestyle_blendRamp, METH_VARARGS, Freestyle_blendRamp___doc__},
|
||||
{"evaluateColorRamp", (PyCFunction) Freestyle_evaluateColorRamp, METH_VARARGS, Freestyle_evaluateColorRamp___doc__},
|
||||
{"evaluateCurveMappingF", (PyCFunction) Freestyle_evaluateCurveMappingF, METH_VARARGS, Freestyle_evaluateCurveMappingF___doc__},
|
||||
{NULL, NULL, 0, NULL}
|
||||
};
|
||||
|
||||
@ -493,43 +493,43 @@ static PyModuleDef module_definition = {
|
||||
};
|
||||
|
||||
//-------------------MODULE INITIALIZATION--------------------------------
|
||||
PyObject *Freestyle_Init( void )
|
||||
PyObject *Freestyle_Init(void)
|
||||
{
|
||||
PyObject *module;
|
||||
|
||||
// initialize modules
|
||||
module = PyModule_Create(&module_definition);
|
||||
if (!module)
|
||||
if (!module)
|
||||
return NULL;
|
||||
PyDict_SetItemString(PySys_GetObject("modules"), module_definition.m_name, module);
|
||||
|
||||
// attach its classes (adding the object types to the module)
|
||||
|
||||
// those classes have to be initialized before the others
|
||||
MediumType_Init( module );
|
||||
Nature_Init( module );
|
||||
|
||||
BBox_Init( module );
|
||||
BinaryPredicate0D_Init( module );
|
||||
BinaryPredicate1D_Init( module );
|
||||
ContextFunctions_Init( module );
|
||||
FrsMaterial_Init( module );
|
||||
FrsNoise_Init( module );
|
||||
Id_Init( module );
|
||||
IntegrationType_Init( module );
|
||||
Interface0D_Init( module );
|
||||
Interface1D_Init( module );
|
||||
Iterator_Init( module );
|
||||
Operators_Init( module );
|
||||
SShape_Init( module );
|
||||
StrokeAttribute_Init( module );
|
||||
StrokeShader_Init( module );
|
||||
UnaryFunction0D_Init( module );
|
||||
UnaryFunction1D_Init( module );
|
||||
UnaryPredicate0D_Init( module );
|
||||
UnaryPredicate1D_Init( module );
|
||||
ViewMap_Init( module );
|
||||
ViewShape_Init( module );
|
||||
MediumType_Init(module);
|
||||
Nature_Init(module);
|
||||
|
||||
BBox_Init(module);
|
||||
BinaryPredicate0D_Init(module);
|
||||
BinaryPredicate1D_Init(module);
|
||||
ContextFunctions_Init(module);
|
||||
FrsMaterial_Init(module);
|
||||
FrsNoise_Init(module);
|
||||
Id_Init(module);
|
||||
IntegrationType_Init(module);
|
||||
Interface0D_Init(module);
|
||||
Interface1D_Init(module);
|
||||
Iterator_Init(module);
|
||||
Operators_Init(module);
|
||||
SShape_Init(module);
|
||||
StrokeAttribute_Init(module);
|
||||
StrokeShader_Init(module);
|
||||
UnaryFunction0D_Init(module);
|
||||
UnaryFunction1D_Init(module);
|
||||
UnaryPredicate0D_Init(module);
|
||||
UnaryPredicate1D_Init(module);
|
||||
ViewMap_Init(module);
|
||||
ViewShape_Init(module);
|
||||
|
||||
return module;
|
||||
}
|
||||
|
@ -139,11 +139,6 @@ static PyObject * FrsMaterial_repr(BPy_FrsMaterial* self)
|
||||
return PyUnicode_FromFormat("Material - address: %p", self->m);
|
||||
}
|
||||
|
||||
/*----------------------FrsMaterial instance definitions ----------------------------*/
|
||||
static PyMethodDef BPy_FrsMaterial_methods[] = {
|
||||
{NULL, NULL, 0, NULL}
|
||||
};
|
||||
|
||||
/*----------------------mathutils callbacks ----------------------------*/
|
||||
|
||||
/* subtype */
|
||||
@ -441,7 +436,7 @@ PyTypeObject FrsMaterial_Type = {
|
||||
0, /* tp_weaklistoffset */
|
||||
0, /* tp_iter */
|
||||
0, /* tp_iternext */
|
||||
BPy_FrsMaterial_methods, /* tp_methods */
|
||||
0, /* tp_methods */
|
||||
0, /* tp_members */
|
||||
BPy_FrsMaterial_getseters, /* tp_getset */
|
||||
0, /* tp_base */
|
||||
|
@ -129,14 +129,9 @@ static PyObject * Id_RichCompare(BPy_Id *o1, BPy_Id *o2, int opid)
|
||||
return PyBool_from_bool(!(o1->id->operator<(*(o2->id))));
|
||||
break;
|
||||
}
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static PyMethodDef BPy_Id_methods[] = {
|
||||
{NULL, NULL, 0, NULL}
|
||||
};
|
||||
|
||||
/*----------------------Id get/setters ----------------------------*/
|
||||
|
||||
PyDoc_STRVAR(Id_first_doc,
|
||||
@ -217,7 +212,7 @@ PyTypeObject Id_Type = {
|
||||
0, /* tp_weaklistoffset */
|
||||
0, /* tp_iter */
|
||||
0, /* tp_iternext */
|
||||
BPy_Id_methods, /* tp_methods */
|
||||
0, /* tp_methods */
|
||||
0, /* tp_members */
|
||||
BPy_Id_getseters, /* tp_getset */
|
||||
0, /* tp_base */
|
||||
|
@ -69,47 +69,47 @@ int Iterator_Init(PyObject *module)
|
||||
return -1;
|
||||
Py_INCREF(&Interface0DIterator_Type);
|
||||
PyModule_AddObject(module, "Interface0DIterator", (PyObject *)&Interface0DIterator_Type);
|
||||
|
||||
|
||||
if (PyType_Ready(&CurvePointIterator_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&CurvePointIterator_Type);
|
||||
PyModule_AddObject(module, "CurvePointIterator", (PyObject *)&CurvePointIterator_Type);
|
||||
|
||||
|
||||
if (PyType_Ready(&StrokeVertexIterator_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&StrokeVertexIterator_Type);
|
||||
PyModule_AddObject(module, "StrokeVertexIterator", (PyObject *)&StrokeVertexIterator_Type);
|
||||
|
||||
|
||||
if (PyType_Ready(&SVertexIterator_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&SVertexIterator_Type);
|
||||
PyModule_AddObject(module, "SVertexIterator", (PyObject *)&SVertexIterator_Type);
|
||||
|
||||
|
||||
if (PyType_Ready(&orientedViewEdgeIterator_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&orientedViewEdgeIterator_Type);
|
||||
PyModule_AddObject(module, "orientedViewEdgeIterator", (PyObject *)&orientedViewEdgeIterator_Type);
|
||||
|
||||
|
||||
if (PyType_Ready(&ViewEdgeIterator_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&ViewEdgeIterator_Type);
|
||||
PyModule_AddObject(module, "ViewEdgeIterator", (PyObject *)&ViewEdgeIterator_Type);
|
||||
|
||||
|
||||
if (PyType_Ready(&ChainingIterator_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&ChainingIterator_Type);
|
||||
PyModule_AddObject(module, "ChainingIterator", (PyObject *)&ChainingIterator_Type);
|
||||
|
||||
|
||||
if (PyType_Ready(&ChainPredicateIterator_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&ChainPredicateIterator_Type);
|
||||
PyModule_AddObject(module, "ChainPredicateIterator", (PyObject *)&ChainPredicateIterator_Type);
|
||||
|
||||
|
||||
if (PyType_Ready(&ChainSilhouetteIterator_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&ChainSilhouetteIterator_Type);
|
||||
PyModule_AddObject(module, "ChainSilhouetteIterator", (PyObject *)&ChainSilhouetteIterator_Type);
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -109,14 +109,14 @@ PyLongObject _BPy_MediumType_OPAQUE_MEDIUM = {
|
||||
|
||||
//-------------------MODULE INITIALIZATION--------------------------------
|
||||
|
||||
int MediumType_Init( PyObject *module )
|
||||
int MediumType_Init(PyObject *module)
|
||||
{
|
||||
if( module == NULL )
|
||||
if (module == NULL)
|
||||
return -1;
|
||||
|
||||
if( PyType_Ready( &MediumType_Type ) < 0 )
|
||||
if (PyType_Ready(&MediumType_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF( &MediumType_Type );
|
||||
Py_INCREF(&MediumType_Type);
|
||||
PyModule_AddObject(module, "MediumType", (PyObject *)&MediumType_Type);
|
||||
|
||||
return 0;
|
||||
|
@ -252,7 +252,7 @@ int Nature_Init(PyObject *module)
|
||||
PyDict_SetItemString(Nature_Type.tp_dict, "NON_T_VERTEX", BPy_Nature_NON_T_VERTEX);
|
||||
PyDict_SetItemString(Nature_Type.tp_dict, "T_VERTEX", BPy_Nature_T_VERTEX);
|
||||
PyDict_SetItemString(Nature_Type.tp_dict, "CUSP", BPy_Nature_CUSP);
|
||||
|
||||
|
||||
// EdgeNature
|
||||
PyDict_SetItemString(Nature_Type.tp_dict, "NO_FEATURE", BPy_Nature_NO_FEATURE);
|
||||
PyDict_SetItemString(Nature_Type.tp_dict, "SILHOUETTE", BPy_Nature_SILHOUETTE);
|
||||
|
@ -42,7 +42,6 @@
|
||||
#include "UnaryFunction0D/BPy_UnaryFunction0DVectorViewShape.h"
|
||||
#include "UnaryFunction0D/BPy_UnaryFunction0DViewShape.h"
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@ -70,7 +69,7 @@ int UnaryFunction0D_Init(PyObject *module)
|
||||
UnaryFunction0DVec3f_Init(module);
|
||||
UnaryFunction0DVectorViewShape_Init(module);
|
||||
UnaryFunction0DViewShape_Init(module);
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -65,6 +65,7 @@ int UnaryFunction1D_Init(PyObject *module)
|
||||
UnaryFunction1DVec3f_Init(module);
|
||||
UnaryFunction1DVectorViewShape_Init(module);
|
||||
UnaryFunction1DVoid_Init(module);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -52,17 +52,17 @@ int UnaryPredicate0D_Init(PyObject *module)
|
||||
return -1;
|
||||
Py_INCREF(&UnaryPredicate0D_Type);
|
||||
PyModule_AddObject(module, "UnaryPredicate0D", (PyObject *)&UnaryPredicate0D_Type);
|
||||
|
||||
|
||||
if (PyType_Ready(&FalseUP0D_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&FalseUP0D_Type);
|
||||
PyModule_AddObject(module, "FalseUP0D", (PyObject *)&FalseUP0D_Type);
|
||||
|
||||
|
||||
if (PyType_Ready(&TrueUP0D_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&TrueUP0D_Type);
|
||||
PyModule_AddObject(module, "TrueUP0D", (PyObject *)&TrueUP0D_Type);
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -61,17 +61,17 @@ int UnaryPredicate1D_Init(PyObject *module)
|
||||
return -1;
|
||||
Py_INCREF(&UnaryPredicate1D_Type);
|
||||
PyModule_AddObject(module, "UnaryPredicate1D", (PyObject *)&UnaryPredicate1D_Type);
|
||||
|
||||
|
||||
if (PyType_Ready(&ContourUP1D_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&ContourUP1D_Type);
|
||||
PyModule_AddObject(module, "ContourUP1D", (PyObject *)&ContourUP1D_Type);
|
||||
|
||||
|
||||
if (PyType_Ready(&DensityLowerThanUP1D_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&DensityLowerThanUP1D_Type);
|
||||
PyModule_AddObject(module, "DensityLowerThanUP1D", (PyObject *)&DensityLowerThanUP1D_Type);
|
||||
|
||||
|
||||
if (PyType_Ready(&EqualToChainingTimeStampUP1D_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&EqualToChainingTimeStampUP1D_Type);
|
||||
@ -81,27 +81,27 @@ int UnaryPredicate1D_Init(PyObject *module)
|
||||
return -1;
|
||||
Py_INCREF(&EqualToTimeStampUP1D_Type);
|
||||
PyModule_AddObject(module, "EqualToTimeStampUP1D", (PyObject *)&EqualToTimeStampUP1D_Type);
|
||||
|
||||
|
||||
if (PyType_Ready(&ExternalContourUP1D_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&ExternalContourUP1D_Type);
|
||||
PyModule_AddObject(module, "ExternalContourUP1D", (PyObject *)&ExternalContourUP1D_Type);
|
||||
|
||||
|
||||
if (PyType_Ready(&FalseUP1D_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&FalseUP1D_Type);
|
||||
PyModule_AddObject(module, "FalseUP1D", (PyObject *)&FalseUP1D_Type);
|
||||
|
||||
|
||||
if (PyType_Ready(&QuantitativeInvisibilityUP1D_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&QuantitativeInvisibilityUP1D_Type);
|
||||
PyModule_AddObject(module, "QuantitativeInvisibilityUP1D", (PyObject *)&QuantitativeInvisibilityUP1D_Type);
|
||||
|
||||
|
||||
if (PyType_Ready(&ShapeUP1D_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&ShapeUP1D_Type);
|
||||
PyModule_AddObject(module, "ShapeUP1D", (PyObject *)&ShapeUP1D_Type);
|
||||
|
||||
|
||||
if (PyType_Ready(&TrueUP1D_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&TrueUP1D_Type);
|
||||
@ -111,7 +111,7 @@ int UnaryPredicate1D_Init(PyObject *module)
|
||||
return -1;
|
||||
Py_INCREF(&WithinImageBoundaryUP1D_Type);
|
||||
PyModule_AddObject(module, "WithinImageBoundaryUP1D", (PyObject *)&WithinImageBoundaryUP1D_Type);
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -67,9 +67,9 @@
|
||||
#include "UnaryFunction1D/BPy_UnaryFunction1DVec3f.h"
|
||||
#include "UnaryFunction1D/BPy_UnaryFunction1DVectorViewShape.h"
|
||||
|
||||
|
||||
// BinaryPredicate0D: __call__
|
||||
int Director_BPy_BinaryPredicate0D___call__( BinaryPredicate0D *bp0D, Interface0D& i1, Interface0D& i2 ) {
|
||||
// BinaryPredicate0D: __call__
|
||||
int Director_BPy_BinaryPredicate0D___call__(BinaryPredicate0D *bp0D, Interface0D& i1, Interface0D& i2)
|
||||
{
|
||||
if (!bp0D->py_bp0D) { // internal error
|
||||
PyErr_SetString(PyExc_RuntimeError, "Reference to Python object (py_bp0D) not initialized");
|
||||
return -1;
|
||||
@ -81,7 +81,7 @@ int Director_BPy_BinaryPredicate0D___call__( BinaryPredicate0D *bp0D, Interface0
|
||||
Py_XDECREF(arg2);
|
||||
return -1;
|
||||
}
|
||||
PyObject *result = PyObject_CallMethod( bp0D->py_bp0D, (char*)"__call__", (char*)"OO", arg1, arg2 );
|
||||
PyObject *result = PyObject_CallMethod(bp0D->py_bp0D, (char *)"__call__", (char *)"OO", arg1, arg2);
|
||||
Py_DECREF(arg1);
|
||||
Py_DECREF(arg2);
|
||||
if (!result)
|
||||
@ -94,9 +94,9 @@ int Director_BPy_BinaryPredicate0D___call__( BinaryPredicate0D *bp0D, Interface0
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// BinaryPredicate1D: __call__
|
||||
int Director_BPy_BinaryPredicate1D___call__( BinaryPredicate1D *bp1D, Interface1D& i1, Interface1D& i2 ) {
|
||||
// BinaryPredicate1D: __call__
|
||||
int Director_BPy_BinaryPredicate1D___call__(BinaryPredicate1D *bp1D, Interface1D& i1, Interface1D& i2)
|
||||
{
|
||||
if (!bp1D->py_bp1D) { // internal error
|
||||
PyErr_SetString(PyExc_RuntimeError, "Reference to Python object (py_bp1D) not initialized");
|
||||
return -1;
|
||||
@ -108,7 +108,7 @@ int Director_BPy_BinaryPredicate1D___call__( BinaryPredicate1D *bp1D, Interface1
|
||||
Py_XDECREF(arg2);
|
||||
return -1;
|
||||
}
|
||||
PyObject *result = PyObject_CallMethod( bp1D->py_bp1D, (char*)"__call__", (char*)"OO", arg1, arg2 );
|
||||
PyObject *result = PyObject_CallMethod(bp1D->py_bp1D, (char *)"__call__", (char *)"OO", arg1, arg2);
|
||||
Py_DECREF(arg1);
|
||||
Py_DECREF(arg2);
|
||||
if (!result)
|
||||
@ -121,9 +121,9 @@ int Director_BPy_BinaryPredicate1D___call__( BinaryPredicate1D *bp1D, Interface1
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// UnaryPredicate0D: __call__
|
||||
int Director_BPy_UnaryPredicate0D___call__( UnaryPredicate0D *up0D, Interface0DIterator& if0D_it ) {
|
||||
// UnaryPredicate0D: __call__
|
||||
int Director_BPy_UnaryPredicate0D___call__(UnaryPredicate0D *up0D, Interface0DIterator& if0D_it)
|
||||
{
|
||||
if (!up0D->py_up0D) { // internal error
|
||||
PyErr_SetString(PyExc_RuntimeError, "Reference to Python object (py_up0D) not initialized");
|
||||
return -1;
|
||||
@ -131,7 +131,7 @@ int Director_BPy_UnaryPredicate0D___call__( UnaryPredicate0D *up0D, Interface0DI
|
||||
PyObject *arg = BPy_Interface0DIterator_from_Interface0DIterator(if0D_it, 0);
|
||||
if (!arg)
|
||||
return -1;
|
||||
PyObject *result = PyObject_CallMethod( up0D->py_up0D, (char*)"__call__", (char*)"O", arg );
|
||||
PyObject *result = PyObject_CallMethod(up0D->py_up0D, (char *)"__call__", (char *)"O", arg);
|
||||
Py_DECREF(arg);
|
||||
if (!result)
|
||||
return -1;
|
||||
@ -143,9 +143,9 @@ int Director_BPy_UnaryPredicate0D___call__( UnaryPredicate0D *up0D, Interface0DI
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// UnaryPredicate1D: __call__
|
||||
int Director_BPy_UnaryPredicate1D___call__( UnaryPredicate1D *up1D, Interface1D& if1D ) {
|
||||
// UnaryPredicate1D: __call__
|
||||
int Director_BPy_UnaryPredicate1D___call__(UnaryPredicate1D *up1D, Interface1D& if1D)
|
||||
{
|
||||
if (!up1D->py_up1D) { // internal error
|
||||
PyErr_SetString(PyExc_RuntimeError, "Reference to Python object (py_up1D) not initialized");
|
||||
return -1;
|
||||
@ -153,7 +153,7 @@ int Director_BPy_UnaryPredicate1D___call__( UnaryPredicate1D *up1D, Interface1D&
|
||||
PyObject *arg = Any_BPy_Interface1D_from_Interface1D(if1D);
|
||||
if (!arg)
|
||||
return -1;
|
||||
PyObject *result = PyObject_CallMethod( up1D->py_up1D, (char*)"__call__", (char*)"O", arg );
|
||||
PyObject *result = PyObject_CallMethod(up1D->py_up1D, (char *)"__call__", (char *)"O", arg);
|
||||
Py_DECREF(arg);
|
||||
if (!result)
|
||||
return -1;
|
||||
@ -165,9 +165,9 @@ int Director_BPy_UnaryPredicate1D___call__( UnaryPredicate1D *up1D, Interface1D&
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// StrokeShader: shade
|
||||
int Director_BPy_StrokeShader_shade( StrokeShader *ss, Stroke& s ) {
|
||||
// StrokeShader: shade
|
||||
int Director_BPy_StrokeShader_shade(StrokeShader *ss, Stroke& s)
|
||||
{
|
||||
if (!ss->py_ss) { // internal error
|
||||
PyErr_SetString(PyExc_RuntimeError, "Reference to Python object (py_ss) not initialized");
|
||||
return -1;
|
||||
@ -175,7 +175,7 @@ int Director_BPy_StrokeShader_shade( StrokeShader *ss, Stroke& s ) {
|
||||
PyObject *arg = BPy_Stroke_from_Stroke(s);
|
||||
if (!arg)
|
||||
return -1;
|
||||
PyObject *result = PyObject_CallMethod( ss->py_ss, (char*)"shade", (char*)"O", arg );
|
||||
PyObject *result = PyObject_CallMethod(ss->py_ss, (char *)"shade", (char *)"O", arg);
|
||||
Py_DECREF(arg);
|
||||
if (!result)
|
||||
return -1;
|
||||
@ -183,20 +183,22 @@ int Director_BPy_StrokeShader_shade( StrokeShader *ss, Stroke& s ) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// ChainingIterator: init, traverse
|
||||
int Director_BPy_ChainingIterator_init( ChainingIterator *c_it ) {
|
||||
// ChainingIterator: init, traverse
|
||||
int Director_BPy_ChainingIterator_init(ChainingIterator *c_it)
|
||||
{
|
||||
if (!c_it->py_c_it) { // internal error
|
||||
PyErr_SetString(PyExc_RuntimeError, "Reference to Python object (py_c_it) not initialized");
|
||||
return -1;
|
||||
}
|
||||
PyObject *result = PyObject_CallMethod( c_it->py_c_it, (char*)"init", NULL);
|
||||
PyObject *result = PyObject_CallMethod(c_it->py_c_it, (char *)"init", NULL);
|
||||
if (!result)
|
||||
return -1;
|
||||
Py_DECREF(result);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Director_BPy_ChainingIterator_traverse( ChainingIterator *c_it, AdjacencyIterator& a_it ) {
|
||||
int Director_BPy_ChainingIterator_traverse(ChainingIterator *c_it, AdjacencyIterator& a_it)
|
||||
{
|
||||
if (!c_it->py_c_it) { // internal error
|
||||
PyErr_SetString(PyExc_RuntimeError, "Reference to Python object (py_c_it) not initialized");
|
||||
return -1;
|
||||
@ -204,12 +206,12 @@ int Director_BPy_ChainingIterator_traverse( ChainingIterator *c_it, AdjacencyIte
|
||||
PyObject *arg = BPy_AdjacencyIterator_from_AdjacencyIterator(a_it);
|
||||
if (!arg)
|
||||
return -1;
|
||||
PyObject *result = PyObject_CallMethod( c_it->py_c_it, (char*)"traverse", (char*)"O", arg );
|
||||
PyObject *result = PyObject_CallMethod(c_it->py_c_it, (char *)"traverse", (char *)"O", arg);
|
||||
Py_DECREF(arg);
|
||||
if (!result)
|
||||
return -1;
|
||||
if (BPy_ViewEdge_Check(result)) {
|
||||
c_it->result = ((BPy_ViewEdge *) result)->ve;
|
||||
c_it->result = ((BPy_ViewEdge *)result)->ve;
|
||||
} else if (result == Py_None) {
|
||||
c_it->result = NULL;
|
||||
} else {
|
||||
@ -221,10 +223,9 @@ int Director_BPy_ChainingIterator_traverse( ChainingIterator *c_it, AdjacencyIte
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// BPy_UnaryFunction{0D,1D}: __call__
|
||||
int Director_BPy_UnaryFunction0D___call__( void *uf0D, PyObject *obj, Interface0DIterator& if0D_it) {
|
||||
|
||||
int Director_BPy_UnaryFunction0D___call__(void *uf0D, PyObject *obj, Interface0DIterator& if0D_it)
|
||||
{
|
||||
if (!obj) { // internal error
|
||||
PyErr_SetString(PyExc_RuntimeError, "Reference to Python object (py_uf0D) not initialized");
|
||||
return -1;
|
||||
@ -232,59 +233,55 @@ int Director_BPy_UnaryFunction0D___call__( void *uf0D, PyObject *obj, Interface0
|
||||
PyObject *arg = BPy_Interface0DIterator_from_Interface0DIterator(if0D_it, 0);
|
||||
if (!arg)
|
||||
return -1;
|
||||
PyObject *result = PyObject_CallMethod( obj, (char*)"__call__", (char*)"O", arg );
|
||||
PyObject *result = PyObject_CallMethod(obj, (char *)"__call__", (char *)"O", arg);
|
||||
Py_DECREF(arg);
|
||||
if (!result)
|
||||
return -1;
|
||||
|
||||
if( BPy_UnaryFunction0DDouble_Check(obj) ) {
|
||||
((UnaryFunction0D<double> *) uf0D)->result = PyFloat_AsDouble(result);
|
||||
|
||||
} else if ( BPy_UnaryFunction0DEdgeNature_Check(obj) ) {
|
||||
((UnaryFunction0D<Nature::EdgeNature> *) uf0D)->result = EdgeNature_from_BPy_Nature(result);
|
||||
|
||||
} else if ( BPy_UnaryFunction0DFloat_Check(obj) ) {
|
||||
((UnaryFunction0D<float> *) uf0D)->result = PyFloat_AsDouble(result);
|
||||
|
||||
} else if ( BPy_UnaryFunction0DId_Check(obj) ) {
|
||||
((UnaryFunction0D<Id> *) uf0D)->result = *( ((BPy_Id *) result)->id );
|
||||
|
||||
} else if ( BPy_UnaryFunction0DMaterial_Check(obj) ) {
|
||||
((UnaryFunction0D<FrsMaterial> *) uf0D)->result = *( ((BPy_FrsMaterial *) result)->m );
|
||||
|
||||
} else if ( BPy_UnaryFunction0DUnsigned_Check(obj) ) {
|
||||
((UnaryFunction0D<unsigned> *) uf0D)->result = PyLong_AsLong(result);
|
||||
|
||||
} else if ( BPy_UnaryFunction0DVec2f_Check(obj) ) {
|
||||
Vec2f *v = Vec2f_ptr_from_Vector( result );
|
||||
((UnaryFunction0D<Vec2f> *) uf0D)->result = *v;
|
||||
if (BPy_UnaryFunction0DDouble_Check(obj)) {
|
||||
((UnaryFunction0D<double> *)uf0D)->result = PyFloat_AsDouble(result);
|
||||
}
|
||||
else if (BPy_UnaryFunction0DEdgeNature_Check(obj)) {
|
||||
((UnaryFunction0D<Nature::EdgeNature> *)uf0D)->result = EdgeNature_from_BPy_Nature(result);
|
||||
}
|
||||
else if (BPy_UnaryFunction0DFloat_Check(obj)) {
|
||||
((UnaryFunction0D<float> *)uf0D)->result = PyFloat_AsDouble(result);
|
||||
}
|
||||
else if (BPy_UnaryFunction0DId_Check(obj)) {
|
||||
((UnaryFunction0D<Id> *)uf0D)->result = *(((BPy_Id *)result)->id);
|
||||
}
|
||||
else if (BPy_UnaryFunction0DMaterial_Check(obj)) {
|
||||
((UnaryFunction0D<FrsMaterial> *)uf0D)->result = *(((BPy_FrsMaterial *)result)->m);
|
||||
}
|
||||
else if (BPy_UnaryFunction0DUnsigned_Check(obj)) {
|
||||
((UnaryFunction0D<unsigned> *)uf0D)->result = PyLong_AsLong(result);
|
||||
}
|
||||
else if (BPy_UnaryFunction0DVec2f_Check(obj)) {
|
||||
Vec2f *v = Vec2f_ptr_from_Vector(result);
|
||||
((UnaryFunction0D<Vec2f> *)uf0D)->result = *v;
|
||||
delete v;
|
||||
|
||||
} else if ( BPy_UnaryFunction0DVec3f_Check(obj) ) {
|
||||
Vec3f *v = Vec3f_ptr_from_Vector( result );
|
||||
((UnaryFunction0D<Vec3f> *) uf0D)->result = *v;
|
||||
}
|
||||
else if (BPy_UnaryFunction0DVec3f_Check(obj)) {
|
||||
Vec3f *v = Vec3f_ptr_from_Vector(result);
|
||||
((UnaryFunction0D<Vec3f> *)uf0D)->result = *v;
|
||||
delete v;
|
||||
|
||||
} else if ( BPy_UnaryFunction0DVectorViewShape_Check(obj) ) {
|
||||
}
|
||||
else if (BPy_UnaryFunction0DVectorViewShape_Check(obj)) {
|
||||
vector<ViewShape*> vec;
|
||||
for( int i = 0; i < PyList_Size(result); i++) {
|
||||
ViewShape *b = ( (BPy_ViewShape *) PyList_GetItem(result, i) )->vs;
|
||||
vec.push_back( b );
|
||||
for(int i = 0; i < PyList_Size(result); i++) {
|
||||
ViewShape *b = ((BPy_ViewShape *)PyList_GetItem(result, i))->vs;
|
||||
vec.push_back(b);
|
||||
}
|
||||
|
||||
((UnaryFunction0D< vector<ViewShape*> > *) uf0D)->result = vec;
|
||||
|
||||
} else if ( BPy_UnaryFunction0DViewShape_Check(obj) ) {
|
||||
((UnaryFunction0D<ViewShape*> *) uf0D)->result = ((BPy_ViewShape *) result)->vs;
|
||||
|
||||
}
|
||||
|
||||
((UnaryFunction0D< vector<ViewShape*> > *)uf0D)->result = vec;
|
||||
}
|
||||
else if (BPy_UnaryFunction0DViewShape_Check(obj)) {
|
||||
((UnaryFunction0D<ViewShape*> *)uf0D)->result = ((BPy_ViewShape *)result)->vs;
|
||||
}
|
||||
Py_DECREF(result);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Director_BPy_UnaryFunction1D___call__( void *uf1D, PyObject *obj, Interface1D& if1D) {
|
||||
|
||||
int Director_BPy_UnaryFunction1D___call__(void *uf1D, PyObject *obj, Interface1D& if1D)
|
||||
{
|
||||
if (!obj) { // internal error
|
||||
PyErr_SetString(PyExc_RuntimeError, "Reference to Python object (py_uf1D) not initialized");
|
||||
return -1;
|
||||
@ -292,44 +289,40 @@ int Director_BPy_UnaryFunction1D___call__( void *uf1D, PyObject *obj, Interface1
|
||||
PyObject *arg = Any_BPy_Interface1D_from_Interface1D(if1D);
|
||||
if (!arg)
|
||||
return -1;
|
||||
PyObject *result = PyObject_CallMethod( obj, (char*)"__call__", (char*)"O", arg );
|
||||
PyObject *result = PyObject_CallMethod(obj, (char *)"__call__", (char *)"O", arg);
|
||||
Py_DECREF(arg);
|
||||
if (!result)
|
||||
return -1;
|
||||
|
||||
if( BPy_UnaryFunction1DDouble_Check(obj) ) {
|
||||
((UnaryFunction1D<double> *) uf1D)->result = PyFloat_AsDouble(result);
|
||||
|
||||
} else if ( BPy_UnaryFunction1DEdgeNature_Check(obj) ) {
|
||||
((UnaryFunction1D<Nature::EdgeNature> *) uf1D)->result = EdgeNature_from_BPy_Nature(result);
|
||||
|
||||
} else if ( BPy_UnaryFunction1DFloat_Check(obj) ) {
|
||||
((UnaryFunction1D<float> *) uf1D)->result = PyFloat_AsDouble(result);
|
||||
|
||||
} else if ( BPy_UnaryFunction1DUnsigned_Check(obj) ) {
|
||||
((UnaryFunction1D<unsigned> *) uf1D)->result = PyLong_AsLong(result);
|
||||
|
||||
} else if ( BPy_UnaryFunction1DVec2f_Check(obj) ) {
|
||||
Vec2f *v = Vec2f_ptr_from_Vector( result );
|
||||
((UnaryFunction1D<Vec2f> *) uf1D)->result = *v;
|
||||
if (BPy_UnaryFunction1DDouble_Check(obj)) {
|
||||
((UnaryFunction1D<double> *)uf1D)->result = PyFloat_AsDouble(result);
|
||||
}
|
||||
else if (BPy_UnaryFunction1DEdgeNature_Check(obj)) {
|
||||
((UnaryFunction1D<Nature::EdgeNature> *)uf1D)->result = EdgeNature_from_BPy_Nature(result);
|
||||
}
|
||||
else if (BPy_UnaryFunction1DFloat_Check(obj)) {
|
||||
((UnaryFunction1D<float> *)uf1D)->result = PyFloat_AsDouble(result);
|
||||
}
|
||||
else if (BPy_UnaryFunction1DUnsigned_Check(obj)) {
|
||||
((UnaryFunction1D<unsigned> *)uf1D)->result = PyLong_AsLong(result);
|
||||
}
|
||||
else if (BPy_UnaryFunction1DVec2f_Check(obj)) {
|
||||
Vec2f *v = Vec2f_ptr_from_Vector(result);
|
||||
((UnaryFunction1D<Vec2f> *)uf1D)->result = *v;
|
||||
delete v;
|
||||
|
||||
} else if ( BPy_UnaryFunction1DVec3f_Check(obj) ) {
|
||||
Vec3f *v = Vec3f_ptr_from_Vector( result );
|
||||
((UnaryFunction1D<Vec3f> *) uf1D)->result = *v;
|
||||
}
|
||||
else if (BPy_UnaryFunction1DVec3f_Check(obj)) {
|
||||
Vec3f *v = Vec3f_ptr_from_Vector(result);
|
||||
((UnaryFunction1D<Vec3f> *)uf1D)->result = *v;
|
||||
delete v;
|
||||
|
||||
} else if ( BPy_UnaryFunction1DVectorViewShape_Check(obj) ) {
|
||||
}
|
||||
else if (BPy_UnaryFunction1DVectorViewShape_Check(obj)) {
|
||||
vector<ViewShape*> vec;
|
||||
for( int i = 1; i < PyList_Size(result); i++) {
|
||||
ViewShape *b = ( (BPy_ViewShape *) PyList_GetItem(result, i) )->vs;
|
||||
vec.push_back( b );
|
||||
for(int i = 1; i < PyList_Size(result); i++) {
|
||||
ViewShape *b = ((BPy_ViewShape *)PyList_GetItem(result, i))->vs;
|
||||
vec.push_back(b);
|
||||
}
|
||||
|
||||
((UnaryFunction1D< vector<ViewShape*> > *) uf1D)->result = vec;
|
||||
|
||||
((UnaryFunction1D< vector<ViewShape*> > *)uf1D)->result = vec;
|
||||
}
|
||||
|
||||
Py_DECREF(result);
|
||||
return 0;
|
||||
}
|
||||
|
@ -29,8 +29,8 @@
|
||||
* \ingroup freestyle
|
||||
*/
|
||||
|
||||
#ifndef __FREESTYLE_PYTHON_DIRECTOR
|
||||
# define __FREESTYLE_PYTHON_DIRECTOR
|
||||
#ifndef __FREESTYLE_PYTHON_DIRECTOR_H__
|
||||
#define __FREESTYLE_PYTHON_DIRECTOR_H__
|
||||
|
||||
class UnaryPredicate0D;
|
||||
class UnaryPredicate1D;
|
||||
@ -54,27 +54,27 @@ extern "C" {
|
||||
}
|
||||
#endif
|
||||
|
||||
// BinaryPredicate0D: __call__
|
||||
// BinaryPredicate0D: __call__
|
||||
int Director_BPy_BinaryPredicate0D___call__(BinaryPredicate0D *bp0D, Interface0D& i1, Interface0D& i2);
|
||||
|
||||
// BinaryPredicate1D: __call__
|
||||
// BinaryPredicate1D: __call__
|
||||
int Director_BPy_BinaryPredicate1D___call__(BinaryPredicate1D *bp1D, Interface1D& i1, Interface1D& i2);
|
||||
|
||||
// UnaryFunction{0D,1D}: __call__
|
||||
// UnaryFunction{0D,1D}: __call__
|
||||
int Director_BPy_UnaryFunction0D___call__(void *uf0D, PyObject *obj, Interface0DIterator& if0D_it);
|
||||
int Director_BPy_UnaryFunction1D___call__(void *uf1D, PyObject *obj, Interface1D& if1D);
|
||||
|
||||
// UnaryPredicate0D: __call__
|
||||
// UnaryPredicate0D: __call__
|
||||
int Director_BPy_UnaryPredicate0D___call__(UnaryPredicate0D *up0D, Interface0DIterator& if0D_it);
|
||||
|
||||
// UnaryPredicate1D: __call__
|
||||
// UnaryPredicate1D: __call__
|
||||
int Director_BPy_UnaryPredicate1D___call__(UnaryPredicate1D *up1D, Interface1D& if1D);
|
||||
|
||||
// StrokeShader: shade
|
||||
// StrokeShader: shade
|
||||
int Director_BPy_StrokeShader_shade(StrokeShader *ss, Stroke& s);
|
||||
|
||||
// ChainingIterator: init, traverse
|
||||
// ChainingIterator: init, traverse
|
||||
int Director_BPy_ChainingIterator_init(ChainingIterator *c_it);
|
||||
int Director_BPy_ChainingIterator_traverse(ChainingIterator *c_it, AdjacencyIterator& a_it);
|
||||
|
||||
#endif // __FREESTYLE_PYTHON_DIRECTOR
|
||||
#endif // __FREESTYLE_PYTHON_DIRECTOR_H__
|
||||
|
@ -137,10 +137,6 @@ static int CurvePoint_init(BPy_CurvePoint *self, PyObject *args, PyObject *kwds)
|
||||
|
||||
///bool operator== (const CurvePoint &b)
|
||||
|
||||
static PyMethodDef BPy_CurvePoint_methods[] = {
|
||||
{NULL, NULL, 0, NULL}
|
||||
};
|
||||
|
||||
/*----------------------CurvePoint get/setters ----------------------------*/
|
||||
|
||||
PyDoc_STRVAR(CurvePoint_first_svertex_doc,
|
||||
@ -259,7 +255,7 @@ PyTypeObject CurvePoint_Type = {
|
||||
0, /* tp_weaklistoffset */
|
||||
0, /* tp_iter */
|
||||
0, /* tp_iternext */
|
||||
BPy_CurvePoint_methods, /* tp_methods */
|
||||
0, /* tp_methods */
|
||||
0, /* tp_members */
|
||||
BPy_CurvePoint_getseters, /* tp_getset */
|
||||
&Interface0D_Type, /* tp_base */
|
||||
|
@ -107,7 +107,8 @@ static int StrokeVertex_init(BPy_StrokeVertex *self, PyObject *args, PyObject *k
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "|O!", (char **)kwlist_1, &StrokeVertex_Type, &obj1)) {
|
||||
if (!obj1) {
|
||||
self->sv = new StrokeVertex();
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
if (!((BPy_StrokeVertex *)obj1)->sv) {
|
||||
PyErr_SetString(PyExc_TypeError, "argument 1 is an invalid StrokeVertex object");
|
||||
return -1;
|
||||
@ -163,11 +164,6 @@ static int StrokeVertex_init(BPy_StrokeVertex *self, PyObject *args, PyObject *k
|
||||
// real operator[] (const int i) const
|
||||
// real & operator[] (const int i)
|
||||
|
||||
/*----------------------StrokeVertex instance definitions ----------------------------*/
|
||||
static PyMethodDef BPy_StrokeVertex_methods[] = {
|
||||
{NULL, NULL, 0, NULL}
|
||||
};
|
||||
|
||||
/*----------------------mathutils callbacks ----------------------------*/
|
||||
|
||||
static int StrokeVertex_mathutils_check(BaseMathObject *bmo)
|
||||
@ -367,7 +363,7 @@ PyTypeObject StrokeVertex_Type = {
|
||||
0, /* tp_weaklistoffset */
|
||||
0, /* tp_iter */
|
||||
0, /* tp_iternext */
|
||||
BPy_StrokeVertex_methods, /* tp_methods */
|
||||
0, /* tp_methods */
|
||||
0, /* tp_members */
|
||||
BPy_StrokeVertex_getseters, /* tp_getset */
|
||||
&CurvePoint_Type, /* tp_base */
|
||||
|
@ -78,10 +78,6 @@ static int NonTVertex_init(BPy_NonTVertex *self, PyObject *args, PyObject *kwds)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static PyMethodDef BPy_NonTVertex_methods[] = {
|
||||
{NULL, NULL, 0, NULL}
|
||||
};
|
||||
|
||||
/*----------------------NonTVertex get/setters ----------------------------*/
|
||||
|
||||
PyDoc_STRVAR(NonTVertex_svertex_doc,
|
||||
@ -141,7 +137,7 @@ PyTypeObject NonTVertex_Type = {
|
||||
0, /* tp_weaklistoffset */
|
||||
0, /* tp_iter */
|
||||
0, /* tp_iternext */
|
||||
BPy_NonTVertex_methods, /* tp_methods */
|
||||
0, /* tp_methods */
|
||||
0, /* tp_members */
|
||||
BPy_NonTVertex_getseters, /* tp_getset */
|
||||
&ViewVertex_Type, /* tp_base */
|
||||
|
@ -105,10 +105,6 @@ static int FEdge_init(BPy_FEdge *self, PyObject *args, PyObject *kwds)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static PyMethodDef BPy_FEdge_methods[] = {
|
||||
{NULL, NULL, 0, NULL}
|
||||
};
|
||||
|
||||
/*----------------------FEdge sequence protocol ----------------------------*/
|
||||
|
||||
static Py_ssize_t FEdge_sq_length(BPy_FEdge *self)
|
||||
@ -365,7 +361,7 @@ PyTypeObject FEdge_Type = {
|
||||
0, /* tp_weaklistoffset */
|
||||
0, /* tp_iter */
|
||||
0, /* tp_iternext */
|
||||
BPy_FEdge_methods, /* tp_methods */
|
||||
0, /* tp_methods */
|
||||
0, /* tp_members */
|
||||
BPy_FEdge_getseters, /* tp_getset */
|
||||
&Interface1D_Type, /* tp_base */
|
||||
|
@ -100,10 +100,6 @@ static int FEdgeSharp_init(BPy_FEdgeSharp *self, PyObject *args, PyObject *kwds)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static PyMethodDef BPy_FEdgeSharp_methods[] = {
|
||||
{NULL, NULL, 0, NULL}
|
||||
};
|
||||
|
||||
/*----------------------mathutils callbacks ----------------------------*/
|
||||
|
||||
/* subtype */
|
||||
@ -414,7 +410,7 @@ PyTypeObject FEdgeSharp_Type = {
|
||||
0, /* tp_weaklistoffset */
|
||||
0, /* tp_iter */
|
||||
0, /* tp_iternext */
|
||||
BPy_FEdgeSharp_methods, /* tp_methods */
|
||||
0, /* tp_methods */
|
||||
0, /* tp_members */
|
||||
BPy_FEdgeSharp_getseters, /* tp_getset */
|
||||
&FEdge_Type, /* tp_base */
|
||||
|
@ -97,10 +97,6 @@ static int FEdgeSmooth_init(BPy_FEdgeSmooth *self, PyObject *args, PyObject *kwd
|
||||
return 0;
|
||||
}
|
||||
|
||||
static PyMethodDef BPy_FEdgeSmooth_methods[] = {
|
||||
{NULL, NULL, 0, NULL}
|
||||
};
|
||||
|
||||
/*----------------------mathutils callbacks ----------------------------*/
|
||||
|
||||
static int FEdgeSmooth_mathutils_check(BaseMathObject *bmo)
|
||||
@ -269,7 +265,7 @@ PyTypeObject FEdgeSmooth_Type = {
|
||||
0, /* tp_weaklistoffset */
|
||||
0, /* tp_iter */
|
||||
0, /* tp_iternext */
|
||||
BPy_FEdgeSmooth_methods, /* tp_methods */
|
||||
0, /* tp_methods */
|
||||
0, /* tp_members */
|
||||
BPy_FEdgeSmooth_getseters, /* tp_getset */
|
||||
&FEdge_Type, /* tp_base */
|
||||
|
@ -113,10 +113,6 @@ static PyObject * AdjacencyIterator_iternext(BPy_AdjacencyIterator *self)
|
||||
return BPy_ViewEdge_from_ViewEdge(*ve);
|
||||
}
|
||||
|
||||
static PyMethodDef BPy_AdjacencyIterator_methods[] = {
|
||||
{NULL, NULL, 0, NULL}
|
||||
};
|
||||
|
||||
/*----------------------AdjacencyIterator get/setters ----------------------------*/
|
||||
|
||||
PyDoc_STRVAR(AdjacencyIterator_object_doc,
|
||||
@ -129,7 +125,6 @@ static PyObject *AdjacencyIterator_object_get(BPy_AdjacencyIterator *self, void
|
||||
ViewEdge *ve = self->a_it->operator*();
|
||||
if (ve)
|
||||
return BPy_ViewEdge_from_ViewEdge(*ve);
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
@ -180,7 +175,7 @@ PyTypeObject AdjacencyIterator_Type = {
|
||||
0, /* tp_weaklistoffset */
|
||||
PyObject_SelfIter, /* tp_iter */
|
||||
(iternextfunc)AdjacencyIterator_iternext, /* tp_iternext */
|
||||
BPy_AdjacencyIterator_methods, /* tp_methods */
|
||||
0, /* tp_methods */
|
||||
0, /* tp_members */
|
||||
BPy_AdjacencyIterator_getseters, /* tp_getset */
|
||||
&Iterator_Type, /* tp_base */
|
||||
|
@ -67,8 +67,7 @@ PyDoc_STRVAR(CurvePointIterator_doc,
|
||||
" :arg step: A resampling resolution with which the curve is resampled.\n"
|
||||
" If zero, no resampling is done (i.e., the iterator iterates over\n"
|
||||
" initial vertices).\n"
|
||||
" :type step: float\n"
|
||||
);
|
||||
" :type step: float");
|
||||
|
||||
static int CurvePointIterator_init(BPy_CurvePointIterator *self, PyObject *args, PyObject *kwds)
|
||||
{
|
||||
@ -96,10 +95,6 @@ static int CurvePointIterator_init(BPy_CurvePointIterator *self, PyObject *args,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static PyMethodDef BPy_CurvePointIterator_methods[] = {
|
||||
{NULL, NULL, 0, NULL}
|
||||
};
|
||||
|
||||
/*----------------------CurvePointIterator get/setters ----------------------------*/
|
||||
|
||||
PyDoc_STRVAR(CurvePointIterator_object_doc,
|
||||
@ -169,7 +164,7 @@ PyTypeObject CurvePointIterator_Type = {
|
||||
0, /* tp_weaklistoffset */
|
||||
0, /* tp_iter */
|
||||
0, /* tp_iternext */
|
||||
BPy_CurvePointIterator_methods, /* tp_methods */
|
||||
0, /* tp_methods */
|
||||
0, /* tp_members */
|
||||
BPy_CurvePointIterator_getseters, /* tp_getset */
|
||||
&Iterator_Type, /* tp_base */
|
||||
|
@ -109,7 +109,8 @@ static PyObject * Interface0DIterator_iternext(BPy_Interface0DIterator *self)
|
||||
}
|
||||
self->if0D_it->decrement();
|
||||
if0D = self->if0D_it->operator->();
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
if (self->if0D_it->isEnd()) {
|
||||
PyErr_SetNone(PyExc_StopIteration);
|
||||
return NULL;
|
||||
@ -120,10 +121,6 @@ static PyObject * Interface0DIterator_iternext(BPy_Interface0DIterator *self)
|
||||
return Any_BPy_Interface0D_from_Interface0D(*if0D);
|
||||
}
|
||||
|
||||
static PyMethodDef BPy_Interface0DIterator_methods[] = {
|
||||
{NULL, NULL, 0, NULL}
|
||||
};
|
||||
|
||||
/*----------------------Interface0DIterator get/setters ----------------------------*/
|
||||
|
||||
PyDoc_STRVAR(Interface0DIterator_object_doc,
|
||||
@ -193,7 +190,7 @@ PyTypeObject Interface0DIterator_Type = {
|
||||
0, /* tp_weaklistoffset */
|
||||
PyObject_SelfIter, /* tp_iter */
|
||||
(iternextfunc)Interface0DIterator_iternext, /* tp_iternext */
|
||||
BPy_Interface0DIterator_methods, /* tp_methods */
|
||||
0, /* tp_methods */
|
||||
0, /* tp_members */
|
||||
BPy_Interface0DIterator_getseters, /* tp_getset */
|
||||
&Iterator_Type, /* tp_base */
|
||||
|
@ -113,10 +113,6 @@ static int SVertexIterator_init(BPy_SVertexIterator *self, PyObject *args, PyObj
|
||||
return 0;
|
||||
}
|
||||
|
||||
static PyMethodDef BPy_SVertexIterator_methods[] = {
|
||||
{NULL, NULL, 0, NULL}
|
||||
};
|
||||
|
||||
/*----------------------SVertexIterator get/setters ----------------------------*/
|
||||
|
||||
PyDoc_STRVAR(SVertexIterator_object_doc,
|
||||
@ -127,10 +123,8 @@ PyDoc_STRVAR(SVertexIterator_object_doc,
|
||||
static PyObject *SVertexIterator_object_get(BPy_SVertexIterator *self, void *UNUSED(closure))
|
||||
{
|
||||
SVertex *sv = self->sv_it->operator->();
|
||||
|
||||
if (sv)
|
||||
return BPy_SVertex_from_SVertex(*sv);
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
@ -191,7 +185,7 @@ PyTypeObject SVertexIterator_Type = {
|
||||
0, /* tp_weaklistoffset */
|
||||
0, /* tp_iter */
|
||||
0, /* tp_iternext */
|
||||
BPy_SVertexIterator_methods, /* tp_methods */
|
||||
0, /* tp_methods */
|
||||
0, /* tp_members */
|
||||
BPy_SVertexIterator_getseters, /* tp_getset */
|
||||
&Iterator_Type, /* tp_base */
|
||||
|
@ -95,7 +95,8 @@ static PyObject * StrokeVertexIterator_iternext(BPy_StrokeVertexIterator *self)
|
||||
}
|
||||
self->sv_it->decrement();
|
||||
sv = self->sv_it->operator->();
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
if (self->sv_it->isEnd()) {
|
||||
PyErr_SetNone(PyExc_StopIteration);
|
||||
return NULL;
|
||||
@ -106,10 +107,6 @@ static PyObject * StrokeVertexIterator_iternext(BPy_StrokeVertexIterator *self)
|
||||
return BPy_StrokeVertex_from_StrokeVertex(*sv);
|
||||
}
|
||||
|
||||
static PyMethodDef BPy_StrokeVertexIterator_methods[] = {
|
||||
{NULL, NULL, 0, NULL}
|
||||
};
|
||||
|
||||
/*----------------------StrokeVertexIterator get/setters ----------------------------*/
|
||||
|
||||
PyDoc_STRVAR(StrokeVertexIterator_object_doc,
|
||||
@ -121,11 +118,9 @@ static PyObject *StrokeVertexIterator_object_get(BPy_StrokeVertexIterator *self,
|
||||
{
|
||||
if (!self->reversed && self->sv_it->isEnd())
|
||||
Py_RETURN_NONE;
|
||||
|
||||
StrokeVertex *sv = self->sv_it->operator->();
|
||||
if (sv)
|
||||
return BPy_StrokeVertex_from_StrokeVertex(*sv);
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
@ -186,7 +181,7 @@ PyTypeObject StrokeVertexIterator_Type = {
|
||||
0, /* tp_weaklistoffset */
|
||||
PyObject_SelfIter, /* tp_iter */
|
||||
(iternextfunc)StrokeVertexIterator_iternext, /* tp_iternext */
|
||||
BPy_StrokeVertexIterator_methods, /* tp_methods */
|
||||
0, /* tp_methods */
|
||||
0, /* tp_members */
|
||||
BPy_StrokeVertexIterator_getseters, /* tp_getset */
|
||||
&Iterator_Type, /* tp_base */
|
||||
|
@ -34,7 +34,6 @@
|
||||
#include "../BPy_Convert.h"
|
||||
#include "../Interface1D/BPy_ViewEdge.h"
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@ -112,7 +111,6 @@ PyDoc_STRVAR(ViewEdgeIterator_change_orientation_doc,
|
||||
static PyObject *ViewEdgeIterator_change_orientation(BPy_ViewEdgeIterator *self)
|
||||
{
|
||||
self->ve_it->changeOrientation();
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
@ -133,7 +131,6 @@ static PyObject *ViewEdgeIterator_object_get(BPy_ViewEdgeIterator *self, void *U
|
||||
ViewEdge *ve = self->ve_it->operator*();
|
||||
if (ve)
|
||||
return BPy_ViewEdge_from_ViewEdge(*ve);
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
@ -147,7 +144,6 @@ static PyObject *ViewEdgeIterator_current_edge_get(BPy_ViewEdgeIterator *self, v
|
||||
ViewEdge *ve = self->ve_it->getCurrentEdge();
|
||||
if (ve)
|
||||
return BPy_ViewEdge_from_ViewEdge(*ve);
|
||||
|
||||
Py_RETURN_NONE;}
|
||||
|
||||
static int ViewEdgeIterator_current_edge_set(BPy_ViewEdgeIterator *self, PyObject *value, void *UNUSED(closure))
|
||||
@ -194,7 +190,6 @@ static PyObject *ViewEdgeIterator_begin_get(BPy_ViewEdgeIterator *self, void *UN
|
||||
ViewEdge *ve = self->ve_it->getBegin();
|
||||
if (ve)
|
||||
return BPy_ViewEdge_from_ViewEdge(*ve);
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
|
@ -87,7 +87,8 @@ static PyObject * orientedViewEdgeIterator_iternext(BPy_orientedViewEdgeIterator
|
||||
}
|
||||
self->ove_it->decrement();
|
||||
dve = self->ove_it->operator->();
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
if (self->ove_it->isEnd()) {
|
||||
PyErr_SetNone(PyExc_StopIteration);
|
||||
return NULL;
|
||||
@ -98,10 +99,6 @@ static PyObject * orientedViewEdgeIterator_iternext(BPy_orientedViewEdgeIterator
|
||||
return BPy_directedViewEdge_from_directedViewEdge(*dve);
|
||||
}
|
||||
|
||||
static PyMethodDef BPy_orientedViewEdgeIterator_methods[] = {
|
||||
{NULL, NULL, 0, NULL}
|
||||
};
|
||||
|
||||
/*----------------------orientedViewEdgeIterator get/setters ----------------------------*/
|
||||
|
||||
PyDoc_STRVAR(orientedViewEdgeIterator_object_doc,
|
||||
@ -114,7 +111,6 @@ PyDoc_STRVAR(orientedViewEdgeIterator_object_doc,
|
||||
static PyObject *orientedViewEdgeIterator_object_get(BPy_orientedViewEdgeIterator *self, void *UNUSED(closure))
|
||||
{
|
||||
return BPy_directedViewEdge_from_directedViewEdge(self->ove_it->operator*());
|
||||
|
||||
}
|
||||
|
||||
static PyGetSetDef BPy_orientedViewEdgeIterator_getseters[] = {
|
||||
@ -145,14 +141,14 @@ PyTypeObject orientedViewEdgeIterator_Type = {
|
||||
0, /* tp_setattro */
|
||||
0, /* tp_as_buffer */
|
||||
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
|
||||
orientedViewEdgeIterator_doc, /* tp_doc */
|
||||
orientedViewEdgeIterator_doc, /* tp_doc */
|
||||
0, /* tp_traverse */
|
||||
0, /* tp_clear */
|
||||
0, /* tp_richcompare */
|
||||
0, /* tp_weaklistoffset */
|
||||
PyObject_SelfIter, /* tp_iter */
|
||||
(iternextfunc)orientedViewEdgeIterator_iternext, /* tp_iternext */
|
||||
BPy_orientedViewEdgeIterator_methods, /* tp_methods */
|
||||
0, /* tp_methods */
|
||||
0, /* tp_members */
|
||||
BPy_orientedViewEdgeIterator_getseters, /* tp_getset */
|
||||
&Iterator_Type, /* tp_base */
|
||||
|
@ -60,18 +60,18 @@ static char TextureAssignerShader___doc__[] =
|
||||
" texture and blending mode to use among a set of predefined\n"
|
||||
" textures. Here are the different presets:\n"
|
||||
"\n"
|
||||
" * 0: `/brushes/charcoalAlpha.bmp`, `MediumType.HUMID_MEDIUM`\n"
|
||||
" * 1: `/brushes/washbrushAlpha.bmp`, `MediumType.HUMID_MEDIUM`\n"
|
||||
" * 2: `/brushes/oil.bmp`, `MediumType.HUMID_MEDIUM`\n"
|
||||
" * 3: `/brushes/oilnoblend.bmp`, `MediumType.HUMID_MEDIUM`\n"
|
||||
" * 4: `/brushes/charcoalAlpha.bmp`, `MediumType.DRY_MEDIUM`\n"
|
||||
" * 5: `/brushes/washbrushAlpha.bmp`, `MediumType.DRY_MEDIUM`\n"
|
||||
" * 6: `/brushes/opaqueDryBrushAlpha.bmp`, `MediumType.OPAQUE_MEDIUM`\n"
|
||||
" * 7: `/brushes/opaqueBrushAlpha.bmp`, `MediumType.OPAQUE_MEDIUM`\n"
|
||||
" * 0: `/brushes/charcoalAlpha.bmp`, `Stroke.HUMID_MEDIUM`\n"
|
||||
" * 1: `/brushes/washbrushAlpha.bmp`, `Stroke.HUMID_MEDIUM`\n"
|
||||
" * 2: `/brushes/oil.bmp`, `Stroke.HUMID_MEDIUM`\n"
|
||||
" * 3: `/brushes/oilnoblend.bmp`, `Stroke.HUMID_MEDIUM`\n"
|
||||
" * 4: `/brushes/charcoalAlpha.bmp`, `Stroke.DRY_MEDIUM`\n"
|
||||
" * 5: `/brushes/washbrushAlpha.bmp`, `Stroke.DRY_MEDIUM`\n"
|
||||
" * 6: `/brushes/opaqueDryBrushAlpha.bmp`, `Stroke.OPAQUE_MEDIUM`\n"
|
||||
" * 7: `/brushes/opaqueBrushAlpha.bmp`, `Stroke.OPAQUE_MEDIUM`\n"
|
||||
"\n"
|
||||
" Any other value will lead to the following preset:\n"
|
||||
"\n"
|
||||
" * Default: `/brushes/smoothAlpha.bmp`, `MediumType.OPAQUE_MEDIUM`\n"
|
||||
" * Default: `/brushes/smoothAlpha.bmp`, `Stroke.OPAQUE_MEDIUM`\n"
|
||||
"\n"
|
||||
" :arg stroke: A Stroke object.\n"
|
||||
" :type stroke: :class:`Stroke`\n";
|
||||
|
@ -64,52 +64,52 @@ int UnaryFunction0DDouble_Init(PyObject *module)
|
||||
return -1;
|
||||
Py_INCREF(&UnaryFunction0DDouble_Type);
|
||||
PyModule_AddObject(module, "UnaryFunction0DDouble", (PyObject *)&UnaryFunction0DDouble_Type);
|
||||
|
||||
|
||||
if (PyType_Ready(&DensityF0D_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&DensityF0D_Type);
|
||||
PyModule_AddObject(module, "DensityF0D", (PyObject *)&DensityF0D_Type);
|
||||
|
||||
|
||||
if (PyType_Ready(&LocalAverageDepthF0D_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&LocalAverageDepthF0D_Type);
|
||||
PyModule_AddObject(module, "LocalAverageDepthF0D", (PyObject *)&LocalAverageDepthF0D_Type);
|
||||
|
||||
|
||||
if (PyType_Ready(&Curvature2DAngleF0D_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&Curvature2DAngleF0D_Type);
|
||||
PyModule_AddObject(module, "Curvature2DAngleF0D", (PyObject *)&Curvature2DAngleF0D_Type);
|
||||
|
||||
|
||||
if (PyType_Ready(&GetProjectedXF0D_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&GetProjectedXF0D_Type);
|
||||
PyModule_AddObject(module, "GetProjectedXF0D", (PyObject *)&GetProjectedXF0D_Type);
|
||||
|
||||
|
||||
if (PyType_Ready(&GetProjectedYF0D_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&GetProjectedYF0D_Type);
|
||||
PyModule_AddObject(module, "GetProjectedYF0D", (PyObject *)&GetProjectedYF0D_Type);
|
||||
|
||||
|
||||
if (PyType_Ready(&GetProjectedZF0D_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&GetProjectedZF0D_Type);
|
||||
PyModule_AddObject(module, "GetProjectedZF0D", (PyObject *)&GetProjectedZF0D_Type);
|
||||
|
||||
|
||||
if (PyType_Ready(&GetXF0D_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&GetXF0D_Type);
|
||||
PyModule_AddObject(module, "GetXF0D", (PyObject *)&GetXF0D_Type);
|
||||
|
||||
|
||||
if (PyType_Ready(&GetYF0D_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&GetYF0D_Type);
|
||||
PyModule_AddObject(module, "GetYF0D", (PyObject *)&GetYF0D_Type);
|
||||
|
||||
|
||||
if (PyType_Ready(&GetZF0D_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&GetZF0D_Type);
|
||||
PyModule_AddObject(module, "GetZF0D", (PyObject *)&GetZF0D_Type);
|
||||
|
||||
|
||||
if (PyType_Ready(&ZDiscontinuityF0D_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&ZDiscontinuityF0D_Type);
|
||||
|
@ -53,7 +53,7 @@ int UnaryFunction0DEdgeNature_Init(PyObject *module)
|
||||
return -1;
|
||||
Py_INCREF(&UnaryFunction0DEdgeNature_Type);
|
||||
PyModule_AddObject(module, "UnaryFunction0DEdgeNature", (PyObject *)&UnaryFunction0DEdgeNature_Type);
|
||||
|
||||
|
||||
if (PyType_Ready(&CurveNatureF0D_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&CurveNatureF0D_Type);
|
||||
|
@ -58,32 +58,32 @@ int UnaryFunction0DFloat_Init(PyObject *module)
|
||||
return -1;
|
||||
Py_INCREF(&UnaryFunction0DFloat_Type);
|
||||
PyModule_AddObject(module, "UnaryFunction0DFloat", (PyObject *)&UnaryFunction0DFloat_Type);
|
||||
|
||||
|
||||
if (PyType_Ready(&GetCurvilinearAbscissaF0D_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&GetCurvilinearAbscissaF0D_Type);
|
||||
PyModule_AddObject(module, "GetCurvilinearAbscissaF0D", (PyObject *)&GetCurvilinearAbscissaF0D_Type);
|
||||
|
||||
|
||||
if (PyType_Ready(&GetParameterF0D_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&GetParameterF0D_Type);
|
||||
PyModule_AddObject(module, "GetParameterF0D", (PyObject *)&GetParameterF0D_Type);
|
||||
|
||||
|
||||
if (PyType_Ready(&GetViewMapGradientNormF0D_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&GetViewMapGradientNormF0D_Type);
|
||||
PyModule_AddObject(module, "GetViewMapGradientNormF0D", (PyObject *)&GetViewMapGradientNormF0D_Type);
|
||||
|
||||
|
||||
if (PyType_Ready(&ReadCompleteViewMapPixelF0D_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&ReadCompleteViewMapPixelF0D_Type);
|
||||
PyModule_AddObject(module, "ReadCompleteViewMapPixelF0D", (PyObject *)&ReadCompleteViewMapPixelF0D_Type);
|
||||
|
||||
|
||||
if (PyType_Ready(&ReadMapPixelF0D_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&ReadMapPixelF0D_Type);
|
||||
PyModule_AddObject(module, "ReadMapPixelF0D", (PyObject *)&ReadMapPixelF0D_Type);
|
||||
|
||||
|
||||
if (PyType_Ready(&ReadSteerableViewMapPixelF0D_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&ReadSteerableViewMapPixelF0D_Type);
|
||||
|
@ -53,7 +53,7 @@ int UnaryFunction0DId_Init(PyObject *module)
|
||||
return -1;
|
||||
Py_INCREF(&UnaryFunction0DId_Type);
|
||||
PyModule_AddObject(module, "UnaryFunction0DId", (PyObject *)&UnaryFunction0DId_Type);
|
||||
|
||||
|
||||
if (PyType_Ready(&ShapeIdF0D_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&ShapeIdF0D_Type);
|
||||
|
@ -53,7 +53,7 @@ int UnaryFunction0DMaterial_Init(PyObject *module)
|
||||
return -1;
|
||||
Py_INCREF(&UnaryFunction0DMaterial_Type);
|
||||
PyModule_AddObject(module, "UnaryFunction0DMaterial", (PyObject *)&UnaryFunction0DMaterial_Type);
|
||||
|
||||
|
||||
if (PyType_Ready(&MaterialF0D_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&MaterialF0D_Type);
|
||||
|
@ -53,7 +53,7 @@ int UnaryFunction0DUnsigned_Init(PyObject *module)
|
||||
return -1;
|
||||
Py_INCREF(&UnaryFunction0DUnsigned_Type);
|
||||
PyModule_AddObject(module, "UnaryFunction0DUnsigned", (PyObject *)&UnaryFunction0DUnsigned_Type);
|
||||
|
||||
|
||||
if (PyType_Ready(&QuantitativeInvisibilityF0D_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&QuantitativeInvisibilityF0D_Type);
|
||||
|
@ -45,8 +45,8 @@ extern "C" {
|
||||
|
||||
//-------------------MODULE INITIALIZATION--------------------------------
|
||||
|
||||
int UnaryFunction0DVec2f_Init(PyObject *module) {
|
||||
|
||||
int UnaryFunction0DVec2f_Init(PyObject *module)
|
||||
{
|
||||
if (module == NULL)
|
||||
return -1;
|
||||
|
||||
@ -54,12 +54,12 @@ int UnaryFunction0DVec2f_Init(PyObject *module) {
|
||||
return -1;
|
||||
Py_INCREF(&UnaryFunction0DVec2f_Type);
|
||||
PyModule_AddObject(module, "UnaryFunction0DVec2f", (PyObject *)&UnaryFunction0DVec2f_Type);
|
||||
|
||||
|
||||
if (PyType_Ready(&Normal2DF0D_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&Normal2DF0D_Type);
|
||||
PyModule_AddObject(module, "Normal2DF0D", (PyObject *)&Normal2DF0D_Type);
|
||||
|
||||
|
||||
if (PyType_Ready(&VertexOrientation2DF0D_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&VertexOrientation2DF0D_Type);
|
||||
|
@ -44,8 +44,8 @@ extern "C" {
|
||||
|
||||
//-------------------MODULE INITIALIZATION--------------------------------
|
||||
|
||||
int UnaryFunction0DVec3f_Init(PyObject *module) {
|
||||
|
||||
int UnaryFunction0DVec3f_Init(PyObject *module)
|
||||
{
|
||||
if (module == NULL)
|
||||
return -1;
|
||||
|
||||
@ -53,7 +53,7 @@ int UnaryFunction0DVec3f_Init(PyObject *module) {
|
||||
return -1;
|
||||
Py_INCREF(&UnaryFunction0DVec3f_Type);
|
||||
PyModule_AddObject(module, "UnaryFunction0DVec3f", (PyObject *)&UnaryFunction0DVec3f_Type);
|
||||
|
||||
|
||||
if (PyType_Ready(&VertexOrientation3DF0D_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&VertexOrientation3DF0D_Type);
|
||||
|
@ -44,8 +44,8 @@ extern "C" {
|
||||
|
||||
//-------------------MODULE INITIALIZATION--------------------------------
|
||||
|
||||
int UnaryFunction0DVectorViewShape_Init(PyObject *module) {
|
||||
|
||||
int UnaryFunction0DVectorViewShape_Init(PyObject *module)
|
||||
{
|
||||
if (module == NULL)
|
||||
return -1;
|
||||
|
||||
@ -53,7 +53,7 @@ int UnaryFunction0DVectorViewShape_Init(PyObject *module) {
|
||||
return -1;
|
||||
Py_INCREF(&UnaryFunction0DVectorViewShape_Type);
|
||||
PyModule_AddObject(module, "UnaryFunction0DVectorViewShape", (PyObject *)&UnaryFunction0DVectorViewShape_Type);
|
||||
|
||||
|
||||
if (PyType_Ready(&GetOccludersF0D_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&GetOccludersF0D_Type);
|
||||
|
@ -45,8 +45,8 @@ extern "C" {
|
||||
|
||||
//-------------------MODULE INITIALIZATION--------------------------------
|
||||
|
||||
int UnaryFunction0DViewShape_Init(PyObject *module) {
|
||||
|
||||
int UnaryFunction0DViewShape_Init(PyObject *module)
|
||||
{
|
||||
if (module == NULL)
|
||||
return -1;
|
||||
|
||||
@ -59,7 +59,7 @@ int UnaryFunction0DViewShape_Init(PyObject *module) {
|
||||
return -1;
|
||||
Py_INCREF(&GetOccludeeF0D_Type);
|
||||
PyModule_AddObject(module, "GetOccludeeF0D", (PyObject *)&GetOccludeeF0D_Type);
|
||||
|
||||
|
||||
if (PyType_Ready(&GetShapeF0D_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&GetShapeF0D_Type);
|
||||
|
@ -50,7 +50,6 @@
|
||||
#include "UnaryFunction1D_double/BPy_LocalAverageDepthF1D.h"
|
||||
#include "UnaryFunction1D_double/BPy_ZDiscontinuityF1D.h"
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@ -98,7 +97,7 @@ int UnaryFunction1DDouble_Init(PyObject *module)
|
||||
return -1;
|
||||
Py_INCREF(&GetProjectedYF1D_Type);
|
||||
PyModule_AddObject(module, "GetProjectedYF1D", (PyObject *)&GetProjectedYF1D_Type);
|
||||
|
||||
|
||||
if (PyType_Ready(&GetProjectedZF1D_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&GetProjectedZF1D_Type);
|
||||
|
@ -54,7 +54,7 @@ int UnaryFunction1DEdgeNature_Init(PyObject *module)
|
||||
return -1;
|
||||
Py_INCREF(&UnaryFunction1DEdgeNature_Type);
|
||||
PyModule_AddObject(module, "UnaryFunction1DEdgeNature", (PyObject *)&UnaryFunction1DEdgeNature_Type);
|
||||
|
||||
|
||||
if (PyType_Ready(&CurveNatureF1D_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&CurveNatureF1D_Type);
|
||||
|
@ -54,7 +54,7 @@ int UnaryFunction1DUnsigned_Init(PyObject *module)
|
||||
return -1;
|
||||
Py_INCREF(&UnaryFunction1DUnsigned_Type);
|
||||
PyModule_AddObject(module, "UnaryFunction1DUnsigned", (PyObject *)&UnaryFunction1DUnsigned_Type);
|
||||
|
||||
|
||||
if (PyType_Ready(&QuantitativeInvisibilityF1D_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&QuantitativeInvisibilityF1D_Type);
|
||||
|
@ -55,12 +55,12 @@ int UnaryFunction1DVec2f_Init(PyObject *module)
|
||||
return -1;
|
||||
Py_INCREF(&UnaryFunction1DVec2f_Type);
|
||||
PyModule_AddObject(module, "UnaryFunction1DVec2f", (PyObject *)&UnaryFunction1DVec2f_Type);
|
||||
|
||||
|
||||
if (PyType_Ready(&Normal2DF1D_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&Normal2DF1D_Type);
|
||||
PyModule_AddObject(module, "Normal2DF1D", (PyObject *)&Normal2DF1D_Type);
|
||||
|
||||
|
||||
if (PyType_Ready(&Orientation2DF1D_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&Orientation2DF1D_Type);
|
||||
|
@ -54,7 +54,7 @@ int UnaryFunction1DVec3f_Init(PyObject *module)
|
||||
return -1;
|
||||
Py_INCREF(&UnaryFunction1DVec3f_Type);
|
||||
PyModule_AddObject(module, "UnaryFunction1DVec3f", (PyObject *)&UnaryFunction1DVec3f_Type);
|
||||
|
||||
|
||||
if (PyType_Ready(&Orientation3DF1D_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&Orientation3DF1D_Type);
|
||||
@ -109,7 +109,6 @@ static void UnaryFunction1DVec3f___dealloc__(BPy_UnaryFunction1DVec3f* self)
|
||||
UnaryFunction1D_Type.tp_dealloc((PyObject*)self);
|
||||
}
|
||||
|
||||
|
||||
static PyObject * UnaryFunction1DVec3f___repr__(BPy_UnaryFunction1DVec3f* self)
|
||||
{
|
||||
return PyUnicode_FromFormat("type: %s - address: %p", Py_TYPE(self)->tp_name, self->uf1D_vec3f);
|
||||
|
@ -56,7 +56,7 @@ int UnaryFunction1DVectorViewShape_Init(PyObject *module)
|
||||
return -1;
|
||||
Py_INCREF(&UnaryFunction1DVectorViewShape_Type);
|
||||
PyModule_AddObject(module, "UnaryFunction1DVectorViewShape", (PyObject *)&UnaryFunction1DVectorViewShape_Type);
|
||||
|
||||
|
||||
if (PyType_Ready(&GetOccludeeF1D_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&GetOccludeeF1D_Type);
|
||||
@ -66,7 +66,7 @@ int UnaryFunction1DVectorViewShape_Init(PyObject *module)
|
||||
return -1;
|
||||
Py_INCREF(&GetOccludersF1D_Type);
|
||||
PyModule_AddObject(module, "GetOccludersF1D", (PyObject *)&GetOccludersF1D_Type);
|
||||
|
||||
|
||||
if (PyType_Ready(&GetShapeF1D_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&GetShapeF1D_Type);
|
||||
|
@ -57,17 +57,17 @@ int UnaryFunction1DVoid_Init(PyObject *module)
|
||||
return -1;
|
||||
Py_INCREF(&UnaryFunction1DVoid_Type);
|
||||
PyModule_AddObject(module, "UnaryFunction1DVoid", (PyObject *)&UnaryFunction1DVoid_Type);
|
||||
|
||||
|
||||
if (PyType_Ready(&ChainingTimeStampF1D_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&ChainingTimeStampF1D_Type);
|
||||
PyModule_AddObject(module, "ChainingTimeStampF1D", (PyObject *)&ChainingTimeStampF1D_Type);
|
||||
|
||||
|
||||
if (PyType_Ready(&IncrementChainingTimeStampF1D_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&IncrementChainingTimeStampF1D_Type);
|
||||
PyModule_AddObject(module, "IncrementChainingTimeStampF1D", (PyObject *)&IncrementChainingTimeStampF1D_Type);
|
||||
|
||||
|
||||
if (PyType_Ready(&TimeStampF1D_Type) < 0)
|
||||
return -1;
|
||||
Py_INCREF(&TimeStampF1D_Type);
|
||||
|
@ -87,7 +87,6 @@ static int DensityF1D___init__(BPy_DensityF1D* self, PyObject *args, PyObject *k
|
||||
IntegrationType t = (obj) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN;
|
||||
self->py_uf1D_double.uf1D_double = new Functions1D::DensityF1D(d,t,f);
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
/*-----------------------BPy_DensityF1D type definition ------------------------------*/
|
||||
|
@ -75,7 +75,6 @@ static int GetProjectedXF1D___init__(BPy_GetProjectedXF1D* self, PyObject *args,
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*-----------------------BPy_GetProjectedXF1D type definition ------------------------------*/
|
||||
|
||||
PyTypeObject GetProjectedXF1D_Type = {
|
||||
|
@ -75,7 +75,6 @@ static int GetXF1D___init__(BPy_GetXF1D* self, PyObject *args, PyObject *kwds)
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*-----------------------BPy_GetXF1D type definition ------------------------------*/
|
||||
|
||||
PyTypeObject GetXF1D_Type = {
|
||||
|
@ -79,7 +79,6 @@ static int ZDiscontinuityF1D___init__(BPy_ZDiscontinuityF1D* self, PyObject *arg
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*-----------------------BPy_ZDiscontinuityF1D type definition ------------------------------*/
|
||||
|
||||
PyTypeObject ZDiscontinuityF1D_Type = {
|
||||
|
@ -66,8 +66,8 @@ static int ContourUP1D___init__(BPy_ContourUP1D* self, PyObject *args, PyObject
|
||||
|
||||
PyTypeObject ContourUP1D_Type = {
|
||||
PyVarObject_HEAD_INIT(NULL, 0)
|
||||
"ContourUP1D", /* tp_name */
|
||||
sizeof(BPy_ContourUP1D), /* tp_basicsize */
|
||||
"ContourUP1D", /* tp_name */
|
||||
sizeof(BPy_ContourUP1D), /* tp_basicsize */
|
||||
0, /* tp_itemsize */
|
||||
0, /* tp_dealloc */
|
||||
0, /* tp_print */
|
||||
|
Loading…
Reference in New Issue
Block a user