The python export class for FeaturePython. More...
#include <FeaturePythonPy.h>
Public Types | |
typedef FeaturePython * | PointerType |
Public Member Functions | |
PyObject * | _getattr (char *attr) |
GetAttribute implementation This method implements the retriavel of object attributes. | |
virtual PyObject * | _repr (void) |
_repr method Overide this method to return a string object with some invormation about the object. | |
int | _setattr (char *attr, PyObject *value) |
SetAttribute implementation This method implements the seting of object attributes. | |
FeaturePythonPy (FeaturePython *pcObject, PyTypeObject *T=&Type) | |
PyObject * | getCustomAttributes (const char *attr) const |
getter method for special attributes (e.g. dynamic ones) | |
FeaturePython * | getFeaturePythonPtr (void) const |
getter for the object handled by this class | |
virtual PyParentObject * | GetParents (void) |
virtual PyTypeObject * | GetType (void) |
virtual int | PyInit (PyObject *args, PyObject *k) |
PyInit method Overide this method to initialize a newly created instance of the class (Constuctor). | |
std::string | representation (void) const |
int | setCustomAttributes (const char *attr, PyObject *obj) |
setter for special attributes (e.g. dynamic ones) | |
~FeaturePythonPy () | |
Static Public Member Functions | |
static PyObject * | PyMake (struct _typeobject *, PyObject *, PyObject *) |
Static Public Attributes | |
static PyGetSetDef | GetterSetter [] |
Attribute structure of FeaturePythonPy. | |
static PyMethodDef | Methods [] |
Methods structure of FeaturePythonPy. | |
static PyParentObject | Parents [] = { PARENTSPartFeaturePythonPy } |
static PyTypeObject | Type |
Type structure of FeaturePythonPy. | |
callbacks and implementers for the python object methods | |
| |
PyObject * | addProperty (PyObject *args) |
implementer for the addProperty() method | |
PyObject * | supportedProperties (PyObject *args) |
implementer for the supportedProperties() method | |
static PyObject * | staticCallback_addProperty (PyObject *self, PyObject *args) |
callback for the addProperty() method | |
static PyObject * | staticCallback_supportedProperties (PyObject *self, PyObject *args) |
callback for the supportedProperties() method |
The python export class for FeaturePython.
Definition at line 20 of file Mod/Part/App/FeaturePythonPy.h.
Reimplemented from Part::PartFeaturePy.
Definition at line 36 of file Mod/Part/App/FeaturePythonPy.h.
FeaturePythonPy::FeaturePythonPy | ( | FeaturePython * | pcObject, | |
PyTypeObject * | T = &Type | |||
) |
Definition at line 257 of file Mod/Part/App/FeaturePythonPy.cpp.
FeaturePythonPy::~FeaturePythonPy | ( | ) |
Definition at line 278 of file Mod/Part/App/FeaturePythonPy.cpp.
PyObject * FeaturePythonPy::_getattr | ( | char * | attr | ) | [virtual] |
GetAttribute implementation This method implements the retriavel of object attributes.
If you want to implement attributes in your class, reimplement this method. You have to call the method of the base class. Note: if you reimplement _gettattr() in a inheriting class you need to call the method of the base class! Otherwise even the methods of the object will disapiear!
Reimplemented from Part::PartFeaturePy.
Definition at line 293 of file Mod/Part/App/FeaturePythonPy.cpp.
References Base::Console(), getCustomAttributes(), Methods, Base::Exception::ReportException(), and Base::Exception::what().
PyObject * FeaturePythonPy::_repr | ( | void | ) | [virtual] |
_repr method Overide this method to return a string object with some invormation about the object.
PyObject *MeshFeaturePy::_repr(void) { std::stringstream a; a << "MeshFeature: [ "; a << "some realy important info about the object!"; a << "]" << std::endl; return Py_BuildValue("s", a.str().c_str()); }
Reimplemented from Part::PartFeaturePy.
Definition at line 285 of file Mod/Part/App/FeaturePythonPy.cpp.
References representation().
int FeaturePythonPy::_setattr | ( | char * | attr, | |
PyObject * | value | |||
) | [virtual] |
SetAttribute implementation This method implements the seting of object attributes.
If you want to implement attributes in your class, reimplement this method. You have to call the method of the base class.
Reimplemented from Part::PartFeaturePy.
Definition at line 361 of file Mod/Part/App/FeaturePythonPy.cpp.
References Base::Console(), Base::Exception::ReportException(), setCustomAttributes(), and Base::Exception::what().
implementer for the addProperty() method
Definition at line 40 of file Mod/Part/App/FeaturePythonPyImp.cpp.
References App::FeaturePythonT< FeatureT >::addDynamicProperty(), getFeaturePythonPtr(), and Py::new_reference_to().
PyObject * FeaturePythonPy::getCustomAttributes | ( | const char * | attr | ) | const |
getter method for special attributes (e.g. dynamic ones)
Reimplemented from Part::PartFeaturePy.
Definition at line 79 of file Mod/Part/App/FeaturePythonPyImp.cpp.
References App::FeaturePythonT< FeatureT >::getDynamicPropertyByName(), App::FeaturePythonT< FeatureT >::getDynamicPropertyNames(), getFeaturePythonPtr(), Base::BaseClass::getPyObject(), PY_CATCH, PY_TRY, and Base::streq().
Referenced by _getattr().
FeaturePython * FeaturePythonPy::getFeaturePythonPtr | ( | void | ) | const |
getter for the object handled by this class
Definition at line 420 of file Mod/Part/App/FeaturePythonPy.cpp.
References Base::PyObjectBase::_pcTwinPointer.
Referenced by addProperty(), getCustomAttributes(), and setCustomAttributes().
virtual PyParentObject* Part::FeaturePythonPy::GetParents | ( | void | ) | [inline, virtual] |
Reimplemented from Part::PartFeaturePy.
Definition at line 28 of file Mod/Part/App/FeaturePythonPy.h.
virtual PyTypeObject* Part::FeaturePythonPy::GetType | ( | void | ) | [inline, virtual] |
Reimplemented from Part::PartFeaturePy.
Definition at line 27 of file Mod/Part/App/FeaturePythonPy.h.
PyInit method Overide this method to initialize a newly created instance of the class (Constuctor).
Reimplemented from Part::PartFeaturePy.
Definition at line 270 of file Mod/Part/App/FeaturePythonPy.cpp.
Reimplemented from Part::PartFeaturePy.
Definition at line 262 of file Mod/Part/App/FeaturePythonPy.cpp.
std::string FeaturePythonPy::representation | ( | void | ) | const |
Reimplemented from Part::PartFeaturePy.
Definition at line 35 of file Mod/Part/App/FeaturePythonPyImp.cpp.
Referenced by _repr().
int FeaturePythonPy::setCustomAttributes | ( | const char * | attr, | |
PyObject * | obj | |||
) |
setter for special attributes (e.g. dynamic ones)
Reimplemented from Part::PartFeaturePy.
Definition at line 100 of file Mod/Part/App/FeaturePythonPyImp.cpp.
References App::FeaturePythonT< FeatureT >::getDynamicPropertyByName(), getFeaturePythonPtr(), Base::BaseClass::setPyObject(), and Base::Exception::what().
Referenced by _setattr().
PyObject * FeaturePythonPy::staticCallback_addProperty | ( | PyObject * | self, | |
PyObject * | args | |||
) | [static] |
callback for the addProperty() method
Definition at line 98 of file Mod/Part/App/FeaturePythonPy.cpp.
References Base::Console(), Base::PyObjectBase::isConst(), Base::PyObjectBase::isValid(), Base::PyObjectBase::PyObjectBase(), Base::Exception::ReportException(), and Base::Exception::what().
PyObject * FeaturePythonPy::staticCallback_supportedProperties | ( | PyObject * | self, | |
PyObject * | args | |||
) | [static] |
callback for the supportedProperties() method
Definition at line 174 of file Mod/Part/App/FeaturePythonPy.cpp.
References Base::Console(), Base::PyObjectBase::isConst(), Base::PyObjectBase::isValid(), Base::PyObjectBase::PyObjectBase(), Base::Exception::ReportException(), and Base::Exception::what().
implementer for the supportedProperties() method
Definition at line 61 of file Mod/Part/App/FeaturePythonPyImp.cpp.
References Py::List::append(), Base::BaseClassPy::getAllDerivedFrom(), App::Property::getClassTypeId(), and Py::new_reference_to().
PyGetSetDef FeaturePythonPy::GetterSetter [static] |
{ {NULL, NULL, NULL, NULL, NULL} }
Attribute structure of FeaturePythonPy.
Reimplemented from Part::PartFeaturePy.
Definition at line 25 of file Mod/Part/App/FeaturePythonPy.h.
PyMethodDef FeaturePythonPy::Methods [static] |
{ {"addProperty", (PyCFunction) staticCallback_addProperty, METH_VARARGS, "addProperty(string, string) -- Add a generic property.\nThe first argument specifies the type, the second the\nname of the property.\n " }, {"supportedProperties", (PyCFunction) staticCallback_supportedProperties, METH_VARARGS, "A list of supported property types" }, {NULL, NULL, 0, NULL} }
Methods structure of FeaturePythonPy.
Reimplemented from Part::PartFeaturePy.
Definition at line 24 of file Mod/Part/App/FeaturePythonPy.h.
Referenced by _getattr().
PyParentObject FeaturePythonPy::Parents = { PARENTSPartFeaturePythonPy } [static] |
Reimplemented from Part::PartFeaturePy.
Definition at line 26 of file Mod/Part/App/FeaturePythonPy.h.
PyTypeObject FeaturePythonPy::Type [static] |
Type structure of FeaturePythonPy.
Reimplemented from Part::PartFeaturePy.
Definition at line 23 of file Mod/Part/App/FeaturePythonPy.h.