Gui::DocumentPy Class Reference

The python export class for Document. More...

#include <DocumentPy.h>

Inheritance diagram for Gui::DocumentPy:
Base::PersistencePy Base::BaseClassPy Base::PyObjectBase

List of all members.

Public Types

typedef DocumentPointerType

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.
 DocumentPy (Document *pcObject, PyTypeObject *T=&Type)
PyObjectgetCustomAttributes (const char *attr) const
 getter method for special attributes (e.g. dynamic ones)
DocumentgetDocumentPtr (void) const
 getter for the object handled by this class
virtual PyParentObjectGetParents (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)
 ~DocumentPy ()

Static Public Member Functions

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

Static Public Attributes

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

callbacks and implementers for the python object methods



PyObjectactiveObject (PyObject *args)
 implementer for the activeObject() method
PyObjectactiveView (PyObject *args)
 implementer for the activeView() method
PyObjectaddAnnotation (PyObject *args)
 implementer for the addAnnotation() method
PyObjectgetObject (PyObject *args)
 implementer for the getObject() method
PyObjecthide (PyObject *args)
 implementer for the hide() method
PyObjectresetEdit (PyObject *args)
 implementer for the resetEdit() method
PyObjectsetEdit (PyObject *args)
 implementer for the setEdit() method
PyObjectsetPos (PyObject *args)
 implementer for the setPos() method
PyObjectshow (PyObject *args)
 implementer for the show() method
PyObjectupdate (PyObject *args)
 implementer for the update() method
static PyObjectstaticCallback_activeObject (PyObject *self, PyObject *args)
 callback for the activeObject() method
static PyObjectstaticCallback_activeView (PyObject *self, PyObject *args)
 callback for the activeView() method
static PyObjectstaticCallback_addAnnotation (PyObject *self, PyObject *args)
 callback for the addAnnotation() method
static PyObjectstaticCallback_getObject (PyObject *self, PyObject *args)
 callback for the getObject() method
static PyObjectstaticCallback_hide (PyObject *self, PyObject *args)
 callback for the hide() method
static PyObjectstaticCallback_resetEdit (PyObject *self, PyObject *args)
 callback for the resetEdit() method
static PyObjectstaticCallback_setEdit (PyObject *self, PyObject *args)
 callback for the setEdit() method
static PyObjectstaticCallback_setPos (PyObject *self, PyObject *args)
 callback for the setPos() method
static PyObjectstaticCallback_show (PyObject *self, PyObject *args)
 callback for the show() method
static PyObjectstaticCallback_update (PyObject *self, PyObject *args)
 callback for the update() method

callbacks and implementers for the python object attributes



Py::Object getActiveObject (void) const
 getter for the ActiveObject attribute
Py::Object getActiveView (void) const
 getter for the ActiveView attribute
Py::Object getDocument (void) const
 getter for the Document attribute
void setActiveObject (Py::Object arg)
 setter for the ActiveObject attribute
void setActiveView (Py::Object arg)
 setter for the ActiveView attribute
static PyObjectstaticCallback_getActiveObject (PyObject *self, void *closure)
 getter callback for the ActiveObject attribute
static PyObjectstaticCallback_getActiveView (PyObject *self, void *closure)
 getter callback for the ActiveView attribute
static PyObjectstaticCallback_getDocument (PyObject *self, void *closure)
 getter callback for the Document attribute
static int staticCallback_setActiveObject (PyObject *self, PyObject *value, void *closure)
 setter callback for the ActiveObject attribute
static int staticCallback_setActiveView (PyObject *self, PyObject *value, void *closure)
 setter callback for the ActiveView attribute
static int staticCallback_setDocument (PyObject *self, PyObject *value, void *closure)
 setter callback for the Document attribute

Detailed Description

The python export class for Document.

Definition at line 20 of file Gui/DocumentPy.h.


Member Typedef Documentation

Reimplemented from Base::PersistencePy.

Definition at line 36 of file Gui/DocumentPy.h.


Constructor & Destructor Documentation

DocumentPy::DocumentPy ( Document pcObject,
PyTypeObject *  T = &Type 
)

Definition at line 1043 of file Gui/DocumentPy.cpp.

DocumentPy::~DocumentPy (  ) 

Definition at line 1064 of file Gui/DocumentPy.cpp.


Member Function Documentation

PyObject * DocumentPy::_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::PersistencePy.

Definition at line 1079 of file Gui/DocumentPy.cpp.

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

PyObject * DocumentPy::_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::PersistencePy.

Definition at line 1071 of file Gui/DocumentPy.cpp.

References representation().

int DocumentPy::_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::PersistencePy.

Definition at line 1147 of file Gui/DocumentPy.cpp.

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

PyObject * DocumentPy::activeObject ( PyObject args  ) 
PyObject * DocumentPy::activeView ( PyObject args  ) 
PyObject * DocumentPy::addAnnotation ( PyObject args  ) 
Py::Object DocumentPy::getActiveObject ( void   )  const
Py::Object DocumentPy::getActiveView ( void   )  const

getter for the ActiveView attribute

Definition at line 220 of file Gui/DocumentPyImp.cpp.

References Gui::Document::getActiveView(), getDocumentPtr(), Base::BaseClass::getPyObject(), and Sketcher::None.

Referenced by staticCallback_getActiveView().

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

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

Reimplemented from Base::PersistencePy.

Definition at line 247 of file Gui/DocumentPyImp.cpp.

References getDocumentPtr(), Gui::ViewProvider::getPyObject(), and Gui::Document::getViewProviderByName().

Referenced by _getattr().

Py::Object DocumentPy::getDocument ( void   )  const
Document * DocumentPy::getDocumentPtr ( void   )  const
PyObject * DocumentPy::getObject ( PyObject args  ) 
virtual PyParentObject* Gui::DocumentPy::GetParents ( void   )  [inline, virtual]

Reimplemented from Base::PersistencePy.

Definition at line 28 of file Gui/DocumentPy.h.

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

Reimplemented from Base::PersistencePy.

Definition at line 27 of file Gui/DocumentPy.h.

PyObject * DocumentPy::hide ( PyObject args  ) 

implementer for the hide() method

Definition at line 65 of file Gui/DocumentPyImp.cpp.

References getDocumentPtr(), PY_CATCH, Py_Return, PY_TRY, and Gui::Document::setHide().

int DocumentPy::PyInit ( PyObject ,
PyObject  
) [virtual]

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

Reimplemented from Base::PersistencePy.

Definition at line 1056 of file Gui/DocumentPy.cpp.

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

Reimplemented from Base::PersistencePy.

Definition at line 1048 of file Gui/DocumentPy.cpp.

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

Reimplemented from Base::PersistencePy.

Definition at line 44 of file Gui/DocumentPyImp.cpp.

References getDocumentPtr().

Referenced by _repr().

PyObject * DocumentPy::resetEdit ( PyObject args  ) 

implementer for the resetEdit() method

Definition at line 117 of file Gui/DocumentPyImp.cpp.

References getDocumentPtr(), Py_Return, and Gui::Document::resetEdit().

void DocumentPy::setActiveObject ( Py::Object  arg  ) 

setter for the ActiveObject attribute

Definition at line 215 of file Gui/DocumentPyImp.cpp.

void DocumentPy::setActiveView ( Py::Object  arg  ) 

setter for the ActiveView attribute

Definition at line 231 of file Gui/DocumentPyImp.cpp.

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

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

Reimplemented from Base::PersistencePy.

Definition at line 265 of file Gui/DocumentPyImp.cpp.

References getDocumentPtr(), and Gui::Document::getViewProviderByName().

Referenced by _setattr().

PyObject * DocumentPy::setEdit ( PyObject args  ) 
PyObject * DocumentPy::setPos ( PyObject args  ) 

implementer for the setPos() method

Definition at line 77 of file Gui/DocumentPyImp.cpp.

References getDocumentPtr(), PY_CATCH, Py_Return, PY_TRY, Gui::Document::setPos(), Base::MatrixPy::Type, and Py::value().

PyObject * DocumentPy::show ( PyObject args  ) 

implementer for the show() method

Definition at line 53 of file Gui/DocumentPyImp.cpp.

References getDocumentPtr(), PY_CATCH, Py_Return, PY_TRY, and Gui::Document::setShow().

PyObject * DocumentPy::staticCallback_activeObject ( PyObject self,
PyObject args 
) [static]
PyObject * DocumentPy::staticCallback_activeView ( PyObject self,
PyObject args 
) [static]
PyObject * DocumentPy::staticCallback_addAnnotation ( PyObject self,
PyObject args 
) [static]
PyObject * DocumentPy::staticCallback_getActiveObject ( PyObject self,
void *  closure 
) [static]

getter callback for the ActiveObject attribute

Definition at line 916 of file Gui/DocumentPy.cpp.

References getActiveObject(), Base::PyObjectBase::isValid(), Py::new_reference_to(), and Base::PyObjectBase::PyObjectBase().

PyObject * DocumentPy::staticCallback_getActiveView ( PyObject self,
void *  closure 
) [static]

getter callback for the ActiveView attribute

Definition at line 960 of file Gui/DocumentPy.cpp.

References getActiveView(), Base::PyObjectBase::isValid(), Py::new_reference_to(), and Base::PyObjectBase::PyObjectBase().

PyObject * DocumentPy::staticCallback_getDocument ( PyObject self,
void *  closure 
) [static]

getter callback for the Document attribute

Definition at line 1004 of file Gui/DocumentPy.cpp.

References getDocument(), Base::PyObjectBase::isValid(), Py::new_reference_to(), and Base::PyObjectBase::PyObjectBase().

PyObject * DocumentPy::staticCallback_getObject ( PyObject self,
PyObject args 
) [static]
PyObject * DocumentPy::staticCallback_hide ( PyObject self,
PyObject args 
) [static]
PyObject * DocumentPy::staticCallback_resetEdit ( PyObject self,
PyObject args 
) [static]
int DocumentPy::staticCallback_setActiveObject ( PyObject self,
PyObject value,
void *  closure 
) [static]

setter callback for the ActiveObject attribute

Definition at line 934 of file Gui/DocumentPy.cpp.

References Base::PyObjectBase::isConst(), Base::PyObjectBase::isValid(), and Base::PyObjectBase::PyObjectBase().

int DocumentPy::staticCallback_setActiveView ( PyObject self,
PyObject value,
void *  closure 
) [static]

setter callback for the ActiveView attribute

Definition at line 978 of file Gui/DocumentPy.cpp.

References Base::PyObjectBase::isConst(), Base::PyObjectBase::isValid(), and Base::PyObjectBase::PyObjectBase().

int DocumentPy::staticCallback_setDocument ( PyObject self,
PyObject value,
void *  closure 
) [static]

setter callback for the Document attribute

Definition at line 1022 of file Gui/DocumentPy.cpp.

References Base::PyObjectBase::isValid(), and Base::PyObjectBase::PyObjectBase().

PyObject * DocumentPy::staticCallback_setEdit ( PyObject self,
PyObject args 
) [static]
PyObject * DocumentPy::staticCallback_setPos ( PyObject self,
PyObject args 
) [static]
PyObject * DocumentPy::staticCallback_show ( PyObject self,
PyObject args 
) [static]
PyObject * DocumentPy::staticCallback_update ( PyObject self,
PyObject args 
) [static]
PyObject * DocumentPy::update ( PyObject args  ) 

implementer for the update() method

Definition at line 145 of file Gui/DocumentPyImp.cpp.

References getDocumentPtr(), Gui::Document::onUpdate(), PY_CATCH, Py_Return, and PY_TRY.


Member Data Documentation

PyGetSetDef DocumentPy::GetterSetter [static]
Initial value:
 {
    {"ActiveObject",
        (getter) staticCallback_getActiveObject,
        (setter) staticCallback_setActiveObject, 
        "The active object of the document",
        NULL
    },
    {"ActiveView",
        (getter) staticCallback_getActiveView,
        (setter) staticCallback_setActiveView, 
        "The active view of the document",
        NULL
    },
    {"Document",
        (getter) staticCallback_getDocument,
        (setter) staticCallback_setDocument, 
        "The related App document to this Gui document",
        NULL
    },
    {NULL, NULL, NULL, NULL, NULL}              
}

Attribute structure of DocumentPy.

Reimplemented from Base::PersistencePy.

Definition at line 25 of file Gui/DocumentPy.h.

PyMethodDef DocumentPy::Methods [static]

Methods structure of DocumentPy.

Reimplemented from Base::PersistencePy.

Definition at line 24 of file Gui/DocumentPy.h.

Referenced by _getattr().

PyParentObject DocumentPy::Parents = { PARENTSGuiDocumentPy } [static]

Reimplemented from Base::PersistencePy.

Definition at line 26 of file Gui/DocumentPy.h.

PyTypeObject DocumentPy::Type [static]

Type structure of DocumentPy.

Reimplemented from Base::PersistencePy.

Definition at line 23 of file Gui/DocumentPy.h.


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

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