Gui::WorkbenchPy Class Reference

The python export class for Workbench. More...

#include <WorkbenchPy.h>

Inheritance diagram for Gui::WorkbenchPy:
Base::BaseClassPy Base::PyObjectBase Gui::PythonWorkbenchPy

List of all members.

Public Types

typedef Workbench * 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.
PyObject * getCustomAttributes (const char *attr) const
 getter method for special attributes (e.g. dynamic ones)
virtual PyParentObject * GetParents (void)
virtual PyTypeObject * GetType (void)
Workbench * getWorkbenchPtr (void) const
 getter for the object handled by this class
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)
 WorkbenchPy (Workbench *pcObject, PyTypeObject *T=&Type)
 ~WorkbenchPy ()

Static Public Member Functions

static PyObject * PyMake (struct _typeobject *, PyObject *, PyObject *)

Static Public Attributes

static PyGetSetDef GetterSetter []
 Attribute structure of WorkbenchPy.
static PyMethodDef Methods []
 Methods structure of WorkbenchPy.
static PyParentObject Parents [] = { PARENTSGuiWorkbenchPy }
static PyTypeObject Type
 Type structure of WorkbenchPy.

callbacks and implementers for the python object methods



PyObject * activate (PyObject *args)
 implementer for the activate() method
PyObject * name (PyObject *args)
 implementer for the name() method
static PyObject * staticCallback_activate (PyObject *self, PyObject *args)
 callback for the activate() method
static PyObject * staticCallback_name (PyObject *self, PyObject *args)
 callback for the name() method

Detailed Description

The python export class for Workbench.

Definition at line 20 of file WorkbenchPy.h.


Member Typedef Documentation

Reimplemented from Base::BaseClassPy.

Reimplemented in Gui::PythonWorkbenchPy.

Definition at line 36 of file WorkbenchPy.h.


Constructor & Destructor Documentation

WorkbenchPy::WorkbenchPy ( Workbench *  pcObject,
PyTypeObject *  T = &Type 
)

Definition at line 257 of file WorkbenchPy.cpp.

WorkbenchPy::~WorkbenchPy (  ) 

Definition at line 278 of file WorkbenchPy.cpp.


Member Function Documentation

PyObject * WorkbenchPy::_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 Base::BaseClassPy.

Reimplemented in Gui::PythonWorkbenchPy.

Definition at line 293 of file WorkbenchPy.cpp.

References Base::Console(), getCustomAttributes(), Methods, Base::Exception::ReportException(), and Base::Exception::what().

PyObject * WorkbenchPy::_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 Base::BaseClassPy.

Reimplemented in Gui::PythonWorkbenchPy.

Definition at line 285 of file WorkbenchPy.cpp.

References representation().

int WorkbenchPy::_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 Base::BaseClassPy.

Reimplemented in Gui::PythonWorkbenchPy.

Definition at line 361 of file WorkbenchPy.cpp.

References Base::Console(), Base::Exception::ReportException(), setCustomAttributes(), and Base::Exception::what().

PyObject * WorkbenchPy::activate ( PyObject *  args  ) 

implementer for the activate() method

Activates the workbench object.

Definition at line 62 of file WorkbenchPyImp.cpp.

References Gui::WorkbenchManager::activate(), getWorkbenchPtr(), Gui::WorkbenchManager::instance(), Gui::Workbench::name(), name(), PY_CATCH, Py_Return, and PY_TRY.

PyObject * WorkbenchPy::getCustomAttributes ( const char *  attr  )  const

getter method for special attributes (e.g. dynamic ones)

Reimplemented from Base::BaseClassPy.

Reimplemented in Gui::PythonWorkbenchPy.

Definition at line 71 of file WorkbenchPyImp.cpp.

Referenced by _getattr().

virtual PyParentObject* Gui::WorkbenchPy::GetParents ( void   )  [inline, virtual]

Reimplemented from Base::BaseClassPy.

Reimplemented in Gui::PythonWorkbenchPy.

Definition at line 28 of file WorkbenchPy.h.

virtual PyTypeObject* Gui::WorkbenchPy::GetType ( void   )  [inline, virtual]

Reimplemented from Base::BaseClassPy.

Reimplemented in Gui::PythonWorkbenchPy.

Definition at line 27 of file WorkbenchPy.h.

Workbench * WorkbenchPy::getWorkbenchPtr ( void   )  const

getter for the object handled by this class

Definition at line 420 of file WorkbenchPy.cpp.

References Base::PyObjectBase::_pcTwinPointer.

Referenced by activate(), and name().

PyObject * WorkbenchPy::name ( PyObject *  args  ) 

implementer for the name() method

Retrieves the workbench name.

Definition at line 52 of file WorkbenchPyImp.cpp.

References getWorkbenchPtr(), Gui::Workbench::name(), PY_CATCH, and PY_TRY.

Referenced by activate().

int WorkbenchPy::PyInit ( PyObject *  ,
PyObject *   
) [virtual]

PyInit method Overide this method to initialize a newly created instance of the class (Constuctor).

Reimplemented from Base::BaseClassPy.

Reimplemented in Gui::PythonWorkbenchPy.

Definition at line 270 of file WorkbenchPy.cpp.

PyObject * WorkbenchPy::PyMake ( struct _typeobject *  ,
PyObject *  ,
PyObject *   
) [static]

Reimplemented from Base::BaseClassPy.

Reimplemented in Gui::PythonWorkbenchPy.

Definition at line 262 of file WorkbenchPy.cpp.

std::string WorkbenchPy::representation ( void   )  const

Reimplemented from Base::BaseClassPy.

Reimplemented in Gui::PythonWorkbenchPy.

Definition at line 46 of file WorkbenchPyImp.cpp.

Referenced by _repr().

int WorkbenchPy::setCustomAttributes ( const char *  attr,
PyObject *  obj 
)

setter for special attributes (e.g. dynamic ones)

Reimplemented from Base::BaseClassPy.

Reimplemented in Gui::PythonWorkbenchPy.

Definition at line 76 of file WorkbenchPyImp.cpp.

Referenced by _setattr().

PyObject * WorkbenchPy::staticCallback_activate ( PyObject *  self,
PyObject *  args 
) [static]
PyObject * WorkbenchPy::staticCallback_name ( PyObject *  self,
PyObject *  args 
) [static]

Member Data Documentation

PyGetSetDef WorkbenchPy::GetterSetter [static]
Initial value:
 {
    {NULL, NULL, NULL, NULL, NULL}              
}

Attribute structure of WorkbenchPy.

Reimplemented from Base::BaseClassPy.

Reimplemented in Gui::PythonWorkbenchPy.

Definition at line 25 of file WorkbenchPy.h.

PyMethodDef WorkbenchPy::Methods [static]
Initial value:
 {
    {"name",
        (PyCFunction) staticCallback_name,
        METH_VARARGS,
        "Return the workbench name"
    },
    {"activate",
        (PyCFunction) staticCallback_activate,
        METH_VARARGS,
        "Activate this workbench"
    },
    {NULL, NULL, 0, NULL}               
}

Methods structure of WorkbenchPy.

Reimplemented from Base::BaseClassPy.

Reimplemented in Gui::PythonWorkbenchPy.

Definition at line 24 of file WorkbenchPy.h.

Referenced by _getattr().

PyParentObject WorkbenchPy::Parents = { PARENTSGuiWorkbenchPy } [static]

Reimplemented from Base::BaseClassPy.

Reimplemented in Gui::PythonWorkbenchPy.

Definition at line 26 of file WorkbenchPy.h.

PyTypeObject WorkbenchPy::Type [static]

Type structure of WorkbenchPy.

Reimplemented from Base::BaseClassPy.

Reimplemented in Gui::PythonWorkbenchPy.

Definition at line 23 of file WorkbenchPy.h.


The documentation for this class was generated from the following files:

Generated on Wed Nov 23 19:02:05 2011 for FreeCAD by  doxygen 1.6.1