Base::VectorPy Class Reference

The python export class for Vector. More...

#include <VectorPy.h>

Inheritance diagram for Base::VectorPy:
Base::PyObjectBase

List of all members.

Public Types

typedef Vector3dPointerType

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)
virtual PyTypeObject * GetType (void)
Vector3dgetVectorPtr (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)
 VectorPy (Vector3d *pcObject, PyTypeObject *T=&Type)
 ~VectorPy ()
additional declarations and methods for the wrapper class



Vector3d value () const
 VectorPy (const Vector3f &vec, PyTypeObject *T=&Type)
 VectorPy (const Vector3d &vec, PyTypeObject *T=&Type)

Static Public Member Functions

static PyObjectPyMake (struct _typeobject *, PyObject *, PyObject *)
static PyObjectrichCompare (PyObject *v, PyObject *w, int op)
callbacks and implementers for the python object number protocol



static PyObjectnumber_add_handler (PyObject *self, PyObject *other)
 callback for the number_add_handler
static PyObjectnumber_multiply_handler (PyObject *self, PyObject *other)
 callback for the number_multiply_handler
static PyObjectnumber_subtract_handler (PyObject *self, PyObject *other)
 callback for the number_subtract_handler
callbacks and implementers for the python object sequence protocol



static int sequence_ass_item (PyObject *, Py_ssize_t, PyObject *)
static PyObjectsequence_item (PyObject *, Py_ssize_t)
static Py_ssize_t sequence_length (PyObject *)

Static Public Attributes

static PyGetSetDef GetterSetter []
 Attribute structure of VectorPy.
static PyMethodDef Methods []
 Methods structure of VectorPy.
static PyNumberMethods Number []
static PyParentObject Parents [] = { PARENTSBaseVectorPy }
static PySequenceMethods Sequence []
static PyTypeObject Type
 Type structure of VectorPy.

callbacks and implementers for the python object methods



static PyObjectstaticCallback_add (PyObject *self, PyObject *args)
 callback for the add() method
static PyObjectstaticCallback_cross (PyObject *self, PyObject *args)
 callback for the cross() method
static PyObjectstaticCallback_distanceToLine (PyObject *self, PyObject *args)
 callback for the distanceToLine() method
static PyObjectstaticCallback_distanceToPlane (PyObject *self, PyObject *args)
 callback for the distanceToPlane() method
static PyObjectstaticCallback_dot (PyObject *self, PyObject *args)
 callback for the dot() method
static PyObjectstaticCallback_getAngle (PyObject *self, PyObject *args)
 callback for the getAngle() method
static PyObjectstaticCallback_multiply (PyObject *self, PyObject *args)
 callback for the multiply() method
static PyObjectstaticCallback_normalize (PyObject *self, PyObject *args)
 callback for the normalize() method
static PyObjectstaticCallback_projectToLine (PyObject *self, PyObject *args)
 callback for the projectToLine() method
static PyObjectstaticCallback_projectToPlane (PyObject *self, PyObject *args)
 callback for the projectToPlane() method
static PyObjectstaticCallback_scale (PyObject *self, PyObject *args)
 callback for the scale() method
static PyObjectstaticCallback_sub (PyObject *self, PyObject *args)
 callback for the sub() method
PyObjectadd (PyObject *args)
 implementer for the add() method
PyObjectcross (PyObject *args)
 implementer for the cross() method
PyObjectdistanceToLine (PyObject *args)
 implementer for the distanceToLine() method
PyObjectdistanceToPlane (PyObject *args)
 implementer for the distanceToPlane() method
PyObjectdot (PyObject *args)
 implementer for the dot() method
PyObjectgetAngle (PyObject *args)
 implementer for the getAngle() method
PyObjectmultiply (PyObject *args)
 implementer for the multiply() method
PyObjectnormalize (PyObject *args)
 implementer for the normalize() method
PyObjectprojectToLine (PyObject *args)
 implementer for the projectToLine() method
PyObjectprojectToPlane (PyObject *args)
 implementer for the projectToPlane() method
PyObjectscale (PyObject *args)
 implementer for the scale() method
PyObjectsub (PyObject *args)
 implementer for the sub() method

callbacks and implementers for the python object attributes



static PyObjectstaticCallback_getLength (PyObject *self, void *closure)
 getter callback for the Length attribute
static PyObjectstaticCallback_getx (PyObject *self, void *closure)
 getter callback for the x attribute
static PyObjectstaticCallback_gety (PyObject *self, void *closure)
 getter callback for the y attribute
static PyObjectstaticCallback_getz (PyObject *self, void *closure)
 getter callback for the z attribute
static int staticCallback_setLength (PyObject *self, PyObject *value, void *closure)
 setter callback for the Length attribute
static int staticCallback_setx (PyObject *self, PyObject *value, void *closure)
 setter callback for the x attribute
static int staticCallback_sety (PyObject *self, PyObject *value, void *closure)
 setter callback for the y attribute
static int staticCallback_setz (PyObject *self, PyObject *value, void *closure)
 setter callback for the z attribute
Py::Float getLength (void) const
 getter for the Length attribute
Py::Float getx (void) const
 getter for the x attribute
Py::Float gety (void) const
 getter for the y attribute
Py::Float getz (void) const
 getter for the z attribute
void setLength (Py::Float arg)
 setter for the Length attribute
void setx (Py::Float arg)
 setter for the x attribute
void sety (Py::Float arg)
 setter for the y attribute
void setz (Py::Float arg)
 setter for the z attribute

Detailed Description

The python export class for Vector.

Definition at line 20 of file VectorPy.h.


Member Typedef Documentation

Reimplemented from Base::PyObjectBase.

Definition at line 39 of file VectorPy.h.


Constructor & Destructor Documentation

VectorPy::VectorPy ( Vector3d pcObject,
PyTypeObject *  T = &Type 
)
VectorPy::~VectorPy (  ) 

Definition at line 1245 of file VectorPy.cpp.

References Base::PyObjectBase::_pcTwinPointer.

Base::VectorPy::VectorPy ( const Vector3d vec,
PyTypeObject *  T = &Type 
) [inline]

Definition at line 161 of file VectorPy.h.

Base::VectorPy::VectorPy ( const Vector3f vec,
PyTypeObject *  T = &Type 
) [inline]

Definition at line 163 of file VectorPy.h.


Member Function Documentation

PyObject * VectorPy::_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 1263 of file VectorPy.cpp.

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

PyObject * VectorPy::_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 1255 of file VectorPy.cpp.

References representation().

int VectorPy::_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 1331 of file VectorPy.cpp.

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

PyObject * VectorPy::add ( PyObject args  ) 

implementer for the add() method

Definition at line 185 of file VectorPyImp.cpp.

References Base::PyObjectBase::_pcTwinPointer, Type, draftlibs::fcgeo::vec(), and VectorPy().

PyObject * VectorPy::cross ( PyObject args  ) 

implementer for the cross() method

Definition at line 282 of file VectorPyImp.cpp.

References Base::PyObjectBase::_pcTwinPointer, Type, draftlibs::fcgeo::vec(), and VectorPy().

PyObject * VectorPy::distanceToLine ( PyObject args  ) 
PyObject * VectorPy::distanceToPlane ( PyObject args  ) 
PyObject * VectorPy::dot ( PyObject args  ) 

implementer for the dot() method

Definition at line 267 of file VectorPyImp.cpp.

References Base::PyObjectBase::_pcTwinPointer, Py::new_reference_to(), Type, and draftlibs::fcgeo::vec().

PyObject * VectorPy::getAngle ( PyObject args  ) 
PyObject * VectorPy::getCustomAttributes ( const char *  attr  )  const

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

Definition at line 485 of file VectorPyImp.cpp.

Referenced by _getattr().

Py::Float VectorPy::getLength ( void   )  const

getter for the Length attribute

Definition at line 429 of file VectorPyImp.cpp.

References Base::PyObjectBase::_pcTwinPointer, and Base::Vector3< _Precision >::Length().

Referenced by staticCallback_getLength().

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

Reimplemented from Base::PyObjectBase.

Definition at line 31 of file VectorPy.h.

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

Reimplemented from Base::PyObjectBase.

Definition at line 30 of file VectorPy.h.

Vector3d * VectorPy::getVectorPtr ( void   )  const
Py::Float VectorPy::getx ( void   )  const

getter for the x attribute

Definition at line 449 of file VectorPyImp.cpp.

References Base::PyObjectBase::_pcTwinPointer, and Base::Vector3< _Precision >::x.

Referenced by staticCallback_getx().

Py::Float VectorPy::gety ( void   )  const

getter for the y attribute

Definition at line 461 of file VectorPyImp.cpp.

References Base::PyObjectBase::_pcTwinPointer, and Base::Vector3< _Precision >::y.

Referenced by staticCallback_gety().

Py::Float VectorPy::getz ( void   )  const

getter for the z attribute

Definition at line 473 of file VectorPyImp.cpp.

References Base::PyObjectBase::_pcTwinPointer, and Base::Vector3< _Precision >::z.

Referenced by staticCallback_getz().

PyObject * VectorPy::multiply ( PyObject args  ) 
PyObject * VectorPy::normalize ( PyObject args  ) 
PyObject * VectorPy::number_add_handler ( PyObject self,
PyObject other 
) [static]

callback for the number_add_handler

Definition at line 88 of file VectorPyImp.cpp.

References FemExample::b, Type, value(), and VectorPy().

PyObject * VectorPy::number_multiply_handler ( PyObject self,
PyObject other 
) [static]

callback for the number_multiply_handler

Definition at line 118 of file VectorPyImp.cpp.

References FemExample::b, Py::new_reference_to(), Type, value(), and VectorPy().

PyObject * VectorPy::number_subtract_handler ( PyObject self,
PyObject other 
) [static]

callback for the number_subtract_handler

Definition at line 103 of file VectorPyImp.cpp.

References FemExample::b, Type, value(), and VectorPy().

PyObject * VectorPy::projectToLine ( PyObject args  ) 
PyObject * VectorPy::projectToPlane ( PyObject args  ) 
int VectorPy::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 58 of file VectorPyImp.cpp.

References Base::PyObjectBase::_pcTwinPointer, getVectorPtr(), Base::Vector3< _Precision >::Set(), Type, MovieTool::x, and MovieTool::y.

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

Definition at line 51 of file VectorPyImp.cpp.

References VectorPy().

std::string VectorPy::representation ( void   )  const
PyObject * VectorPy::richCompare ( PyObject v,
PyObject w,
int  op 
) [static]

Definition at line 215 of file VectorPyImp.cpp.

References Type, draftlibs::fcgeo::v1(), and value().

PyObject * VectorPy::scale ( PyObject args  ) 

implementer for the scale() method

Definition at line 245 of file VectorPyImp.cpp.

References Base::PyObjectBase::_pcTwinPointer, Py::new_reference_to(), and Base::Vector3< _Precision >::Scale().

int VectorPy::sequence_ass_item ( PyObject self,
Py_ssize_t  index,
PyObject value 
) [static]

Definition at line 162 of file VectorPyImp.cpp.

References getVectorPtr(), and Type.

PyObject * VectorPy::sequence_item ( PyObject self,
Py_ssize_t  index 
) [static]

Definition at line 147 of file VectorPyImp.cpp.

References Type, and value().

Py_ssize_t VectorPy::sequence_length ( PyObject  )  [static]

Definition at line 142 of file VectorPyImp.cpp.

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

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

Definition at line 490 of file VectorPyImp.cpp.

Referenced by _setattr().

void VectorPy::setLength ( Py::Float  arg  ) 
void VectorPy::setx ( Py::Float  arg  ) 

setter for the x attribute

Definition at line 455 of file VectorPyImp.cpp.

References Base::PyObjectBase::_pcTwinPointer, and Base::Vector3< _Precision >::x.

void VectorPy::sety ( Py::Float  arg  ) 

setter for the y attribute

Definition at line 467 of file VectorPyImp.cpp.

References Base::PyObjectBase::_pcTwinPointer, and Base::Vector3< _Precision >::y.

void VectorPy::setz ( Py::Float  arg  ) 

setter for the z attribute

Definition at line 479 of file VectorPyImp.cpp.

References Base::PyObjectBase::_pcTwinPointer, and Base::Vector3< _Precision >::z.

PyObject * VectorPy::staticCallback_add ( PyObject self,
PyObject args 
) [static]
PyObject * VectorPy::staticCallback_cross ( PyObject self,
PyObject args 
) [static]
PyObject * VectorPy::staticCallback_distanceToLine ( PyObject self,
PyObject args 
) [static]
PyObject * VectorPy::staticCallback_distanceToPlane ( PyObject self,
PyObject args 
) [static]
PyObject * VectorPy::staticCallback_dot ( PyObject self,
PyObject args 
) [static]
PyObject * VectorPy::staticCallback_getAngle ( PyObject self,
PyObject args 
) [static]
PyObject * VectorPy::staticCallback_getLength ( PyObject self,
void *  closure 
) [static]

getter callback for the Length attribute

Definition at line 1053 of file VectorPy.cpp.

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

PyObject * VectorPy::staticCallback_getx ( PyObject self,
void *  closure 
) [static]

getter callback for the x attribute

Definition at line 1097 of file VectorPy.cpp.

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

PyObject * VectorPy::staticCallback_gety ( PyObject self,
void *  closure 
) [static]

getter callback for the y attribute

Definition at line 1141 of file VectorPy.cpp.

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

PyObject * VectorPy::staticCallback_getz ( PyObject self,
void *  closure 
) [static]

getter callback for the z attribute

Definition at line 1185 of file VectorPy.cpp.

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

PyObject * VectorPy::staticCallback_multiply ( PyObject self,
PyObject args 
) [static]
PyObject * VectorPy::staticCallback_normalize ( PyObject self,
PyObject args 
) [static]
PyObject * VectorPy::staticCallback_projectToLine ( PyObject self,
PyObject args 
) [static]
PyObject * VectorPy::staticCallback_projectToPlane ( PyObject self,
PyObject args 
) [static]
PyObject * VectorPy::staticCallback_scale ( PyObject self,
PyObject args 
) [static]
int VectorPy::staticCallback_setLength ( PyObject self,
PyObject value,
void *  closure 
) [static]

setter callback for the Length attribute

Definition at line 1071 of file VectorPy.cpp.

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

int VectorPy::staticCallback_setx ( PyObject self,
PyObject value,
void *  closure 
) [static]

setter callback for the x attribute

Definition at line 1115 of file VectorPy.cpp.

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

int VectorPy::staticCallback_sety ( PyObject self,
PyObject value,
void *  closure 
) [static]

setter callback for the y attribute

Definition at line 1159 of file VectorPy.cpp.

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

int VectorPy::staticCallback_setz ( PyObject self,
PyObject value,
void *  closure 
) [static]

setter callback for the z attribute

Definition at line 1203 of file VectorPy.cpp.

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

PyObject * VectorPy::staticCallback_sub ( PyObject self,
PyObject args 
) [static]
PyObject * VectorPy::sub ( PyObject args  ) 

implementer for the sub() method

Definition at line 200 of file VectorPyImp.cpp.

References Base::PyObjectBase::_pcTwinPointer, Type, draftlibs::fcgeo::vec(), and VectorPy().

Vector3d Base::VectorPy::value (  )  const [inline]

Member Data Documentation

PyGetSetDef VectorPy::GetterSetter [static]
Initial value:
 {
    {"Length",
        (getter) staticCallback_getLength,
        (setter) staticCallback_setLength, 
        "To read or modifiy the length of the vector",
        NULL
    },
    {"x",
        (getter) staticCallback_getx,
        (setter) staticCallback_setx, 
        "The X component of the vector",
        NULL
    },
    {"y",
        (getter) staticCallback_gety,
        (setter) staticCallback_sety, 
        "The Y component of the vector",
        NULL
    },
    {"z",
        (getter) staticCallback_getz,
        (setter) staticCallback_setz, 
        "The Z component of the vector",
        NULL
    },
    {NULL, NULL, NULL, NULL, NULL}              
}

Attribute structure of VectorPy.

Definition at line 28 of file VectorPy.h.

PyMethodDef VectorPy::Methods [static]

Methods structure of VectorPy.

Reimplemented from Base::PyObjectBase.

Definition at line 24 of file VectorPy.h.

Referenced by _getattr().

PyNumberMethods VectorPy::Number [static]
Initial value:

Definition at line 25 of file VectorPy.h.

PyParentObject VectorPy::Parents = { PARENTSBaseVectorPy } [static]

Reimplemented from Base::PyObjectBase.

Definition at line 29 of file VectorPy.h.

PySequenceMethods VectorPy::Sequence [static]
Initial value:
 { {
    sequence_length,
    0,
    0,
    sequence_item,
    0,
    sequence_ass_item,
    0,
    0,
    0,
    0
} }

Definition at line 26 of file VectorPy.h.

PyTypeObject VectorPy::Type [static]

Type structure of VectorPy.

Reimplemented from Base::PyObjectBase.

Definition at line 23 of file VectorPy.h.

Referenced by add(), Base::BoundBoxPy::add(), Mesh::MeshPy::addFacet(), Mesh::MeshPy::addFacets(), Points::PointsPy::addPoints(), cross(), Mesh::MeshPy::crossSections(), distanceToLine(), distanceToPlane(), dot(), Part::TopoShapePy::extrude(), Sketcher::SketchObjectPy::fillet(), getAngle(), Base::BoundBoxPy::getIntersectionPoint(), Part::BezierCurvePy::insertPoleAfter(), Part::BezierCurvePy::insertPoleBefore(), Mesh::MeshPy::insertVertex(), Part::BSplineCurvePy::interpolate(), Base::BoundBoxPy::isCutPlane(), Part::TopoShapePy::isInside(), Base::BoundBoxPy::isInside(), Base::BoundBoxPy::isIntersection(), makeBox(), makeCircle(), makeCone(), makeCylinder(), makeFilletArc(), Part::TopoShapeShellPy::makeHalfSpace(), Part::TopoShapeFacePy::makeHalfSpace(), makeLine(), makePlane(), makePolygon(), makeRevolution(), makeSphere(), makeTorus(), makeWedge(), Part::TopoShapePy::mirror(), Part::GeometryPy::mirror(), Base::PlacementPy::move(), Mesh::MeshPointPy::move(), Base::MatrixPy::move(), Base::BoundBoxPy::move(), Sketcher::SketchPy::movePoint(), Sketcher::SketchObjectPy::movePoint(), Part::BSplineSurfacePy::movePoint(), Part::BSplineCurvePy::movePoint(), Base::MatrixPy::multiply(), Base::RotationPy::multVec(), Base::PlacementPy::multVec(), number_add_handler(), number_multiply_handler(), number_subtract_handler(), Part::GeometrySurfacePy::parameter(), Part::GeometryCurvePy::parameter(), project(), projectEx(), projectToDXF(), projectToLine(), projectToPlane(), projectToSVG(), PyInit(), Part::TopoShapeVertexPy::PyInit(), Part::SurfaceOfRevolutionPy::PyInit(), Part::SurfaceOfExtrusionPy::PyInit(), Base::RotationPy::PyInit(), Part::PlanePy::PyInit(), Base::PlacementPy::PyInit(), Part::OffsetCurvePy::PyInit(), Part::LinePy::PyInit(), Part::HyperbolaPy::PyInit(), Part::EllipsePy::PyInit(), Part::CylinderPy::PyInit(), Part::ConePy::PyInit(), Part::CirclePy::PyInit(), Base::BoundBoxPy::PyInit(), Part::ArcPy::PyInit(), Part::ArcOfCirclePy::PyInit(), Part::TopoShapePy::revolve(), richCompare(), Part::TopoShapePy::scale(), Base::MatrixPy::scale(), Part::GeometryPy::scale(), sequence_ass_item(), sequence_item(), Part::ToroidPy::setAxis(), Part::SpherePy::setAxis(), Part::PlanePy::setAxis(), Part::ParabolaPy::setAxis(), Part::HyperbolaPy::setAxis(), Part::EllipsePy::setAxis(), Part::CylinderPy::setAxis(), Part::ConePy::setAxis(), Part::CirclePy::setAxis(), Part::ArcOfCirclePy::setAxis(), Part::ToroidPy::setCenter(), Part::SpherePy::setCenter(), Part::EllipsePy::setCenter(), Part::CylinderPy::setCenter(), Part::ConePy::setCenter(), Part::CirclePy::setCenter(), Part::ArcOfCirclePy::setCenter(), Part::SurfaceOfRevolutionPy::setDirection(), Part::SurfaceOfExtrusionPy::setDirection(), Part::LinePy::setEndPoint(), Part::SurfaceOfRevolutionPy::setLocation(), Part::ParabolaPy::setLocation(), Part::HyperbolaPy::setLocation(), Part::OffsetCurvePy::setOffsetDirection(), Mesh::MeshPy::setPoint(), Part::BSplineSurfacePy::setPole(), Part::BSplineCurvePy::setPole(), Part::BezierSurfacePy::setPole(), Part::BezierCurvePy::setPole(), Part::PlanePy::setPosition(), App::PropertyVector::setPyObject(), Part::LinePy::setStartPoint(), Part::TopoShapePy::slice(), Part::TopoShapePy::slices(), Mesh::MeshPy::snapVertex(), Mesh::MeshPy::splitEdge(), Mesh::MeshPy::splitFacet(), sub(), Base::MatrixPy::transform(), Part::TopoShapePy::translate(), Part::GeometryPy::translate(), and Sketcher::SketchObjectPy::trim().


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