diff options
author | Maxime Curioni <maxime.curioni@gmail.com> | 2008-08-02 01:55:58 +0400 |
---|---|---|
committer | Maxime Curioni <maxime.curioni@gmail.com> | 2008-08-02 01:55:58 +0400 |
commit | 7565990db264dbb7771744cea0a1c87b3e11fc3f (patch) | |
tree | db4795f8c46b8cde474112e775708f57a13ccf9e /source/blender/freestyle/intern/python/BPy_Interface1D.cpp | |
parent | c324f0cbc72b47182ba3d7fd1bbd280fcebe3283 (diff) |
soc-2008-mxcurioni: made considerable changes to support cross-language polymorphism for UnaryFunction0D, Interface0D, Interface1D. Add to change UnaryFunction1D<void> to static UnaryFunction1D_void. Resolved namespace collision on the Image class (changed to FrsImage). There is greater support for style modules but somehow, some do not show anything yet (japanese_bigbrush being an example).
Diffstat (limited to 'source/blender/freestyle/intern/python/BPy_Interface1D.cpp')
-rw-r--r-- | source/blender/freestyle/intern/python/BPy_Interface1D.cpp | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/source/blender/freestyle/intern/python/BPy_Interface1D.cpp b/source/blender/freestyle/intern/python/BPy_Interface1D.cpp index 3db9531da4b..8d2549ebf2c 100644 --- a/source/blender/freestyle/intern/python/BPy_Interface1D.cpp +++ b/source/blender/freestyle/intern/python/BPy_Interface1D.cpp @@ -30,6 +30,10 @@ static PyObject *Interface1D_getId( BPy_Interface1D *self ); static PyObject *Interface1D_getNature( BPy_Interface1D *self ); static PyObject *Interface1D_getTimeStamp( BPy_Interface1D *self ); static PyObject *Interface1D_setTimeStamp( BPy_Interface1D *self, PyObject *args); +static PyObject * Interface1D_verticesBegin( BPy_Interface1D *self ); +static PyObject * Interface1D_verticesEnd( BPy_Interface1D *self ); +static PyObject * Interface1D_pointsBegin( BPy_Interface1D *self, PyObject *args ); +static PyObject * Interface1D_pointsEnd( BPy_Interface1D *self, PyObject *args ); /*----------------------Interface1D instance definitions ----------------------------*/ static PyMethodDef BPy_Interface1D_methods[] = { @@ -41,6 +45,11 @@ static PyMethodDef BPy_Interface1D_methods[] = { {"getNature", ( PyCFunction ) Interface1D_getNature, METH_NOARGS, "Returns the nature of the 1D element"}, {"getTimeStamp", ( PyCFunction ) Interface1D_getTimeStamp, METH_NOARGS, "Returns the time stamp of the 1D element. Mainly used for selection"}, {"setTimeStamp", ( PyCFunction ) Interface1D_setTimeStamp, METH_VARARGS, "Sets the time stamp for the 1D element"}, + {"verticesBegin", ( PyCFunction ) Interface1D_verticesBegin, METH_NOARGS, ""}, + {"verticesEnd", ( PyCFunction ) Interface1D_verticesEnd, METH_NOARGS, ""}, + {"pointsBegin", ( PyCFunction ) Interface1D_pointsBegin, METH_VARARGS, ""}, + {"pointsEnd", ( PyCFunction ) Interface1D_pointsEnd, METH_VARARGS, ""}, + {NULL, NULL, 0, NULL} }; @@ -189,6 +198,7 @@ PyMODINIT_FUNC Interface1D_Init( PyObject *module ) int Interface1D___init__(BPy_Interface1D *self, PyObject *args, PyObject *kwds) { self->if1D = new Interface1D(); + self->if1D->py_if1D = (PyObject *) self; return 0; } @@ -245,6 +255,41 @@ PyObject *Interface1D_setTimeStamp( BPy_Interface1D *self, PyObject *args) { Py_RETURN_NONE; } +PyObject * Interface1D_verticesBegin( BPy_Interface1D *self ) { + Interface0DIterator if0D_it( self->if1D->verticesBegin() ); + return BPy_Interface0DIterator_from_Interface0DIterator( if0D_it ); +} + +PyObject * Interface1D_verticesEnd( BPy_Interface1D *self ) { + Interface0DIterator if0D_it( self->if1D->verticesEnd() ); + return BPy_Interface0DIterator_from_Interface0DIterator( if0D_it ); +} + + +PyObject * Interface1D_pointsBegin( BPy_Interface1D *self, PyObject *args ) { + float f = 0; + + if(!( PyArg_ParseTuple(args, "|f", &f) )) { + cout << "ERROR: Interface1D_pointsBegin" << endl; + Py_RETURN_NONE; + } + + Interface0DIterator if0D_it( self->if1D->pointsBegin(f) ); + return BPy_Interface0DIterator_from_Interface0DIterator( if0D_it ); +} + +PyObject * Interface1D_pointsEnd( BPy_Interface1D *self, PyObject *args ) { + float f = 0; + + if(!( PyArg_ParseTuple(args, "|f", &f) )) { + cout << "ERROR: Interface1D_pointsEnd" << endl; + Py_RETURN_NONE; + } + + Interface0DIterator if0D_it( self->if1D->pointsEnd(f) ); + return BPy_Interface0DIterator_from_Interface0DIterator( if0D_it ); +} + /////////////////////////////////////////////////////////////////////////////////////////// #ifdef __cplusplus |