Base::RotationPy Class Reference

The python export class for Rotation. More...

#include <RotationPy.h>

Inheritance diagram for Base::RotationPy:
Base::PyObjectBase

List of all members.

Public Types

typedef RotationPointerType

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.
PyObjectgetCustomAttributes (const char *attr) const
 getter method for special attributes (e.g. dynamic ones)
virtual PyParentObjectGetParents (void)
RotationgetRotationPtr (void) const
 getter for the object handled by this class
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
 RotationPy (Rotation *pcObject, PyTypeObject *T=&Type)
int setCustomAttributes (const char *attr, PyObject *obj)
 setter for special attributes (e.g. dynamic ones)
 ~RotationPy ()
additional declarations and methods for the wrapper class



 RotationPy (const Rotation &mat, PyTypeObject *T=&Type)
Rotation value () const

Static Public Member Functions

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

Static Public Attributes

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

callbacks and implementers for the python object attributes



Py::Float getAngle (void) const
 getter for the Angle attribute
Py::Object getAxis (void) const
 getter for the Axis attribute
Py::Tuple getQ (void) const
 getter for the Q attribute
void setQ (Py::Tuple arg)
 setter for the Q attribute
static PyObjectstaticCallback_getAngle (PyObject *self, void *closure)
 getter callback for the Angle attribute
static PyObjectstaticCallback_getAxis (PyObject *self, void *closure)
 getter callback for the Axis attribute
static PyObjectstaticCallback_getQ (PyObject *self, void *closure)
 getter callback for the Q attribute
static int staticCallback_setAngle (PyObject *self, PyObject *value, void *closure)
 setter callback for the Angle attribute
static int staticCallback_setAxis (PyObject *self, PyObject *value, void *closure)
 setter callback for the Axis attribute
static int staticCallback_setQ (PyObject *self, PyObject *value, void *closure)
 setter callback for the Q attribute

callbacks and implementers for the python object methods



PyObjectinvert (PyObject *args)
 implementer for the invert() method
PyObjectmultiply (PyObject *args)
 implementer for the multiply() method
PyObjectmultVec (PyObject *args)
 implementer for the multVec() method
PyObjecttoEuler (PyObject *args)
 implementer for the toEuler() method
static PyObjectstaticCallback_invert (PyObject *self, PyObject *args)
 callback for the invert() method
static PyObjectstaticCallback_multiply (PyObject *self, PyObject *args)
 callback for the multiply() method
static PyObjectstaticCallback_multVec (PyObject *self, PyObject *args)
 callback for the multVec() method
static PyObjectstaticCallback_toEuler (PyObject *self, PyObject *args)
 callback for the toEuler() method

Detailed Description

The python export class for Rotation.

Definition at line 20 of file RotationPy.h.


Member Typedef Documentation

Reimplemented from Base::PyObjectBase.

Definition at line 36 of file RotationPy.h.


Constructor & Destructor Documentation

RotationPy::RotationPy ( Rotation pcObject,
PyTypeObject *  T = &Type 
)

Definition at line 545 of file RotationPy.cpp.

Referenced by multiply(), and PyMake().

RotationPy::~RotationPy (  ) 

Definition at line 554 of file RotationPy.cpp.

References Base::PyObjectBase::_pcTwinPointer.

Base::RotationPy::RotationPy ( const Rotation mat,
PyTypeObject *  T = &Type 
) [inline]

Definition at line 102 of file RotationPy.h.


Member Function Documentation

PyObject * RotationPy::_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::PyObjectBase.

Definition at line 572 of file RotationPy.cpp.

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

PyObject * RotationPy::_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::PyObjectBase.

Definition at line 564 of file RotationPy.cpp.

References representation().

int RotationPy::_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::PyObjectBase.

Definition at line 640 of file RotationPy.cpp.

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

Py::Float RotationPy::getAngle ( void   )  const

getter for the Angle attribute

Definition at line 176 of file RotationPyImp.cpp.

References draftlibs::fcvec::angle(), getRotationPtr(), and Base::Rotation::getValue().

Referenced by staticCallback_getAngle().

Py::Object RotationPy::getAxis ( void   )  const

getter for the Axis attribute

Definition at line 169 of file RotationPyImp.cpp.

References draftlibs::fcvec::angle(), getRotationPtr(), and Base::Rotation::getValue().

Referenced by staticCallback_getAxis().

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

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

Definition at line 183 of file RotationPyImp.cpp.

Referenced by _getattr().

virtual PyParentObject* Base::RotationPy::GetParents ( void   )  [inline, virtual]

Reimplemented from Base::PyObjectBase.

Definition at line 28 of file RotationPy.h.

Py::Tuple RotationPy::getQ ( void   )  const

getter for the Q attribute

Definition at line 147 of file RotationPyImp.cpp.

References getRotationPtr(), Base::Rotation::getValue(), and Py::Tuple::setItem().

Referenced by staticCallback_getQ().

Rotation * RotationPy::getRotationPtr ( void   )  const

getter for the object handled by this class

Definition at line 699 of file RotationPy.cpp.

References Base::PyObjectBase::_pcTwinPointer.

Referenced by getAngle(), getAxis(), getQ(), invert(), multiply(), multVec(), PyInit(), setQ(), and toEuler().

virtual PyTypeObject* Base::RotationPy::GetType ( void   )  [inline, virtual]

Reimplemented from Base::PyObjectBase.

Definition at line 27 of file RotationPy.h.

PyObject * RotationPy::invert ( PyObject args  ) 

implementer for the invert() method

Definition at line 106 of file RotationPyImp.cpp.

References getRotationPtr(), Base::Rotation::invert(), and Py_Return.

PyObject * RotationPy::multiply ( PyObject args  ) 

implementer for the multiply() method

Definition at line 114 of file RotationPyImp.cpp.

References getRotationPtr(), RotationPy(), and Type.

PyObject * RotationPy::multVec ( PyObject args  ) 

implementer for the multVec() method

Definition at line 123 of file RotationPyImp.cpp.

References getRotationPtr(), Base::Rotation::multVec(), Base::VectorPy::Type, value(), and draftlibs::fcgeo::vec().

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

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

Reimplemented from Base::PyObjectBase.

Definition at line 56 of file RotationPyImp.cpp.

References draftlibs::fcvec::angle(), getRotationPtr(), Base::Rotation::getValue(), draftTools::p, Base::Rotation::setValue(), Base::Rotation::setYawPitchRoll(), Py::Vector::toVector(), Base::VectorPy::Type, Type, draftlibs::fcgeo::v1(), value(), and MovieTool::y.

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

Definition at line 49 of file RotationPyImp.cpp.

References RotationPy().

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

Definition at line 38 of file RotationPyImp.cpp.

References Base::PyObjectBase::_pcTwinPointer, and Base::Rotation::getValue().

Referenced by _repr().

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

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

Definition at line 188 of file RotationPyImp.cpp.

Referenced by _setattr().

void RotationPy::setQ ( Py::Tuple  arg  ) 

setter for the Q attribute

Definition at line 160 of file RotationPyImp.cpp.

References Py::SeqBase< T >::getItem(), getRotationPtr(), and Base::Rotation::setValue().

PyObject * RotationPy::staticCallback_getAngle ( PyObject self,
void *  closure 
) [static]

getter callback for the Angle attribute

Definition at line 506 of file RotationPy.cpp.

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

PyObject * RotationPy::staticCallback_getAxis ( PyObject self,
void *  closure 
) [static]

getter callback for the Axis attribute

Definition at line 474 of file RotationPy.cpp.

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

PyObject * RotationPy::staticCallback_getQ ( PyObject self,
void *  closure 
) [static]

getter callback for the Q attribute

Definition at line 430 of file RotationPy.cpp.

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

PyObject * RotationPy::staticCallback_invert ( PyObject self,
PyObject args 
) [static]
PyObject * RotationPy::staticCallback_multiply ( PyObject self,
PyObject args 
) [static]
PyObject * RotationPy::staticCallback_multVec ( PyObject self,
PyObject args 
) [static]
int RotationPy::staticCallback_setAngle ( PyObject self,
PyObject value,
void *  closure 
) [static]

setter callback for the Angle attribute

Definition at line 524 of file RotationPy.cpp.

References Base::PyObjectBase::isValid().

int RotationPy::staticCallback_setAxis ( PyObject self,
PyObject value,
void *  closure 
) [static]

setter callback for the Axis attribute

Definition at line 492 of file RotationPy.cpp.

References Base::PyObjectBase::isValid().

int RotationPy::staticCallback_setQ ( PyObject self,
PyObject value,
void *  closure 
) [static]

setter callback for the Q attribute

Definition at line 448 of file RotationPy.cpp.

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

PyObject * RotationPy::staticCallback_toEuler ( PyObject self,
PyObject args 
) [static]
PyObject * RotationPy::toEuler ( PyObject args  ) 

implementer for the toEuler() method

Definition at line 133 of file RotationPyImp.cpp.

References getRotationPtr(), Base::Rotation::getYawPitchRoll(), Py::new_reference_to(), and Py::Tuple::setItem().

Rotation Base::RotationPy::value (  )  const [inline]

Definition at line 104 of file RotationPy.h.

Referenced by multVec(), and PyInit().


Member Data Documentation

PyGetSetDef RotationPy::GetterSetter [static]
Initial value:
 {
    {"Q",
        (getter) staticCallback_getQ,
        (setter) staticCallback_setQ, 
        "The rotation elements (as quaternion)",
        NULL
    },
    {"Axis",
        (getter) staticCallback_getAxis,
        (setter) staticCallback_setAxis, 
        "The rotation axis of the quaternion",
        NULL
    },
    {"Angle",
        (getter) staticCallback_getAngle,
        (setter) staticCallback_setAngle, 
        "The rotation angle of the quaternion",
        NULL
    },
    {NULL, NULL, NULL, NULL, NULL}              
}

Attribute structure of RotationPy.

Definition at line 25 of file RotationPy.h.

PyMethodDef RotationPy::Methods [static]
Initial value:
 {
    {"invert",
        (PyCFunction) staticCallback_invert,
        METH_VARARGS,
        "\n                                     move(Vector)\n                                  Move the matrix along the vector\n                              "
    },
    {"multiply",
        (PyCFunction) staticCallback_multiply,
        METH_VARARGS,
        "\n                                     multiply(Rotation)\n                                    Multiply this quaternion with another quaternion\n                              "
    },
    {"multVec",
        (PyCFunction) staticCallback_multVec,
        METH_VARARGS,
        "\n                                     multVec(Vector) -> Vector\n                                     Compute the transformed vector using the rotation\n                             "
    },
    {"toEuler",
        (PyCFunction) staticCallback_toEuler,
        METH_VARARGS,
        "\n                                     toEuler(Vector) -> list\n                                       Get the Euler angles of this rotation\n                         "
    },
    {NULL, NULL, 0, NULL}               
}

Methods structure of RotationPy.

Reimplemented from Base::PyObjectBase.

Definition at line 24 of file RotationPy.h.

Referenced by _getattr().

PyParentObject RotationPy::Parents = { PARENTSBaseRotationPy } [static]

Reimplemented from Base::PyObjectBase.

Definition at line 26 of file RotationPy.h.

PyTypeObject RotationPy::Type [static]

Type structure of RotationPy.

Reimplemented from Base::PyObjectBase.

Definition at line 23 of file RotationPy.h.

Referenced by multiply(), PyInit(), and Base::PlacementPy::PyInit().


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

Generated on Wed Nov 23 19:01:48 2011 for FreeCAD by  doxygen 1.6.1