Robot6AxisPy.cpp

Go to the documentation of this file.
00001 
00002 // This file is generated by src/Tools/generateTemaplates/templateClassPyExport.py out of the .XML file
00003 // Every change you make here get lost at the next full rebuild!
00004 // This File is normaly build as an include in Robot6AxisPyImp.cpp! Its not intended to be in a project!
00005 
00006 #include <boost/filesystem/path.hpp>
00007 #include <boost/filesystem/operations.hpp>
00008 #include <boost/filesystem/exception.hpp>
00009 #include <Base/PyObjectBase.h>
00010 #include <Base/Console.h>
00011 #include <Base/Exception.h>
00012 #include <CXX/Objects.hxx>
00013 
00014 #define new DEBUG_CLIENTBLOCK
00015 
00016 using Base::streq;
00017 using namespace Robot;
00018 
00020 PyTypeObject Robot6AxisPy::Type = {
00021     PyObject_HEAD_INIT(&PyType_Type)
00022     0,                                                /*ob_size*/
00023     "Robot.Robot6Axis",     /*tp_name*/
00024     sizeof(Robot6AxisPy),                       /*tp_basicsize*/
00025     0,                                                /*tp_itemsize*/
00026     /* methods */
00027     PyDestructor,                                     /*tp_dealloc*/
00028     0,                                                /*tp_print*/
00029     __getattr,                                        /*tp_getattr*/
00030     __setattr,                                        /*tp_setattr*/
00031     0,                                                /*tp_compare*/
00032     __repr,                                           /*tp_repr*/
00033     0,                                                /*tp_as_number*/
00034     0,                                                /*tp_as_sequence*/
00035     0,                                                /*tp_as_mapping*/
00036     0,                                                /*tp_hash*/
00037     0,                                                /*tp_call */
00038     0,                                                /*tp_str  */
00039     0,                                                /*tp_getattro*/
00040     0,                                                /*tp_setattro*/
00041     /* --- Functions to access object as input/output buffer ---------*/
00042     0,                                                /* tp_as_buffer */
00043     /* --- Flags to define presence of optional/expanded features */
00044     Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_CLASS,        /*tp_flags */
00045     "Robot6Axis class",           /*tp_doc */
00046     0,                                                /*tp_traverse */
00047     0,                                                /*tp_clear */
00048     0,                                                /*tp_richcompare */
00049     0,                                                /*tp_weaklistoffset */
00050     0,                                                /*tp_iter */
00051     0,                                                /*tp_iternext */
00052     Robot::Robot6AxisPy::Methods,                     /*tp_methods */
00053     0,                                                /*tp_members */
00054     Robot::Robot6AxisPy::GetterSetter,                     /*tp_getset */
00055     &Base::PersistencePy::Type,                        /*tp_base */
00056     0,                                                /*tp_dict */
00057     0,                                                /*tp_descr_get */
00058     0,                                                /*tp_descr_set */
00059     0,                                                /*tp_dictoffset */
00060     __PyInit,                                         /*tp_init */
00061     0,                                                /*tp_alloc */
00062     Robot::Robot6AxisPy::PyMake,/*tp_new */
00063     0,                                                /*tp_free   Low-level free-memory routine */
00064     0,                                                /*tp_is_gc  For PyObject_IS_GC */
00065     0,                                                /*tp_bases */
00066     0,                                                /*tp_mro    method resolution order */
00067     0,                                                /*tp_cache */
00068     0,                                                /*tp_subclasses */
00069     0,                                                /*tp_weaklist */
00070     0                                                 /*tp_del */
00071 };
00072 
00074 PyMethodDef Robot6AxisPy::Methods[] = {
00075     {"check",
00076         (PyCFunction) staticCallback_check,
00077         METH_VARARGS,
00078         "Checks the shape and report errors in the shape structure.\nThis is a more detailed check as done in isValid()."
00079     },
00080     {NULL, NULL, 0, NULL}               /* Sentinel */
00081 };
00082 
00083 
00084 
00086 PyGetSetDef Robot6AxisPy::GetterSetter[] = {
00087     {"Axis1",
00088         (getter) staticCallback_getAxis1,
00089         (setter) staticCallback_setAxis1, 
00090         "Pose of Axis 1 in degrees",
00091         NULL
00092     },
00093     {"Axis2",
00094         (getter) staticCallback_getAxis2,
00095         (setter) staticCallback_setAxis2, 
00096         "Pose of Axis 2 in degrees",
00097         NULL
00098     },
00099     {"Axis3",
00100         (getter) staticCallback_getAxis3,
00101         (setter) staticCallback_setAxis3, 
00102         "Pose of Axis 3 in degrees",
00103         NULL
00104     },
00105     {"Axis4",
00106         (getter) staticCallback_getAxis4,
00107         (setter) staticCallback_setAxis4, 
00108         "Pose of Axis 4 in degrees",
00109         NULL
00110     },
00111     {"Axis5",
00112         (getter) staticCallback_getAxis5,
00113         (setter) staticCallback_setAxis5, 
00114         "Pose of Axis 5 in degrees",
00115         NULL
00116     },
00117     {"Axis6",
00118         (getter) staticCallback_getAxis6,
00119         (setter) staticCallback_setAxis6, 
00120         "Pose of Axis 6 in degrees",
00121         NULL
00122     },
00123     {"Tcp",
00124         (getter) staticCallback_getTcp,
00125         (setter) staticCallback_setTcp, 
00126         "Tool center point frame. Where the tool of the robot is",
00127         NULL
00128     },
00129     {"Base",
00130         (getter) staticCallback_getBase,
00131         (setter) staticCallback_setBase, 
00132         "Actual Base system in respect to the robot world system",
00133         NULL
00134     },
00135     {NULL, NULL, NULL, NULL, NULL}              /* Sentinel */
00136 };
00137 
00138 // check() callback and implementer
00139 // PyObject*  Robot6AxisPy::check(PyObject *args){};
00140 // has to be implemented in Robot6AxisPyImp.cpp
00141 PyObject * Robot6AxisPy::staticCallback_check (PyObject *self, PyObject *args)
00142 {
00143     // test if twin object not allready deleted
00144     if (!((PyObjectBase*) self)->isValid()){
00145         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00146         return NULL;
00147     }
00148 
00149     // test if object is set Const
00150     if (((PyObjectBase*) self)->isConst()){
00151         PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
00152         return NULL;
00153     }
00154 
00155     try { // catches all exceptions coming up from c++ and generate a python exception
00156         PyObject* ret = ((Robot6AxisPy*)self)->check(args);
00157         if (ret != 0)
00158             ((Robot6AxisPy*)self)->startNotify();
00159         return ret;
00160     }
00161     catch(const Base::Exception& e) // catch the FreeCAD exceptions
00162     {
00163         std::string str;
00164         str += "FreeCAD exception thrown (";
00165         str += e.what();
00166         str += ")";
00167         e.ReportException();
00168         PyErr_SetString(PyExc_Exception,str.c_str());
00169         return NULL;
00170     }
00171     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
00172     {
00173         std::string str;
00174         str += "File system exception thrown (";
00175         //str += e.who();
00176         //str += ", ";
00177         str += e.what();
00178         str += ")\n";
00179         Base::Console().Error(str.c_str());
00180         PyErr_SetString(PyExc_Exception,str.c_str());
00181         return NULL;
00182     }
00183     catch(const Py::Exception&)
00184     {
00185         // The exception text is already set
00186         return NULL;
00187     }
00188     catch(const char* e) // catch simple string exceptions
00189     {
00190         Base::Console().Error(e);
00191         PyErr_SetString(PyExc_Exception,e);
00192         return NULL;
00193     }
00194     // in debug not all exceptions will be catched to get the attention of the developer!
00195 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
00196     catch(const std::exception& e) // catch other c++ exceptions
00197     {
00198         std::string str;
00199         str += "FC++ exception thrown (";
00200         str += e.what();
00201         str += ")";
00202         Base::Console().Error(str.c_str());
00203         PyErr_SetString(PyExc_Exception,str.c_str());
00204         return NULL;
00205     }
00206     catch(...)  // catch the rest!
00207     {
00208         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
00209         return NULL;
00210     }
00211 #endif
00212 }
00213 
00214 // Axis1() callback and implementer
00215 // PyObject*  Robot6AxisPy::Axis1(PyObject *args){};
00216 // has to be implemented in Robot6AxisPyImp.cpp
00217 PyObject * Robot6AxisPy::staticCallback_getAxis1 (PyObject *self, void * /*closure*/)
00218 {
00219     if (!((PyObjectBase*) self)->isValid()){
00220         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00221         return NULL;
00222     }
00223 
00224     try {
00225         return Py::new_reference_to(((Robot6AxisPy*)self)->getAxis1());
00226     } catch (const Py::Exception&) {
00227         // The exception text is already set
00228         return NULL;
00229     } catch (...) {
00230         PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'Axis1' of object 'Robot6Axis'");
00231         return NULL;
00232     }
00233 }
00234 
00235 int Robot6AxisPy::staticCallback_setAxis1 (PyObject *self, PyObject *value, void * /*closure*/)
00236 {    
00237     if (!((PyObjectBase*) self)->isValid()){
00238         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00239         return -1;
00240     }
00241     if (((PyObjectBase*) self)->isConst()){
00242         PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a method");
00243         return -1;
00244     }
00245 
00246     try {
00247         ((Robot6AxisPy*)self)->setAxis1(Py::Float(value,false));
00248         return 0;
00249     } catch (const Py::Exception&) {
00250         // The exception text is already set
00251         return -1;
00252     } catch (...) {
00253         PyErr_SetString(PyExc_Exception, "Unknown exception while writing attribute 'Axis1' of object 'Robot6Axis'");
00254         return -1;
00255     }
00256 }
00257 
00258 // Axis2() callback and implementer
00259 // PyObject*  Robot6AxisPy::Axis2(PyObject *args){};
00260 // has to be implemented in Robot6AxisPyImp.cpp
00261 PyObject * Robot6AxisPy::staticCallback_getAxis2 (PyObject *self, void * /*closure*/)
00262 {
00263     if (!((PyObjectBase*) self)->isValid()){
00264         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00265         return NULL;
00266     }
00267 
00268     try {
00269         return Py::new_reference_to(((Robot6AxisPy*)self)->getAxis2());
00270     } catch (const Py::Exception&) {
00271         // The exception text is already set
00272         return NULL;
00273     } catch (...) {
00274         PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'Axis2' of object 'Robot6Axis'");
00275         return NULL;
00276     }
00277 }
00278 
00279 int Robot6AxisPy::staticCallback_setAxis2 (PyObject *self, PyObject *value, void * /*closure*/)
00280 {    
00281     if (!((PyObjectBase*) self)->isValid()){
00282         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00283         return -1;
00284     }
00285     if (((PyObjectBase*) self)->isConst()){
00286         PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a method");
00287         return -1;
00288     }
00289 
00290     try {
00291         ((Robot6AxisPy*)self)->setAxis2(Py::Float(value,false));
00292         return 0;
00293     } catch (const Py::Exception&) {
00294         // The exception text is already set
00295         return -1;
00296     } catch (...) {
00297         PyErr_SetString(PyExc_Exception, "Unknown exception while writing attribute 'Axis2' of object 'Robot6Axis'");
00298         return -1;
00299     }
00300 }
00301 
00302 // Axis3() callback and implementer
00303 // PyObject*  Robot6AxisPy::Axis3(PyObject *args){};
00304 // has to be implemented in Robot6AxisPyImp.cpp
00305 PyObject * Robot6AxisPy::staticCallback_getAxis3 (PyObject *self, void * /*closure*/)
00306 {
00307     if (!((PyObjectBase*) self)->isValid()){
00308         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00309         return NULL;
00310     }
00311 
00312     try {
00313         return Py::new_reference_to(((Robot6AxisPy*)self)->getAxis3());
00314     } catch (const Py::Exception&) {
00315         // The exception text is already set
00316         return NULL;
00317     } catch (...) {
00318         PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'Axis3' of object 'Robot6Axis'");
00319         return NULL;
00320     }
00321 }
00322 
00323 int Robot6AxisPy::staticCallback_setAxis3 (PyObject *self, PyObject *value, void * /*closure*/)
00324 {    
00325     if (!((PyObjectBase*) self)->isValid()){
00326         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00327         return -1;
00328     }
00329     if (((PyObjectBase*) self)->isConst()){
00330         PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a method");
00331         return -1;
00332     }
00333 
00334     try {
00335         ((Robot6AxisPy*)self)->setAxis3(Py::Float(value,false));
00336         return 0;
00337     } catch (const Py::Exception&) {
00338         // The exception text is already set
00339         return -1;
00340     } catch (...) {
00341         PyErr_SetString(PyExc_Exception, "Unknown exception while writing attribute 'Axis3' of object 'Robot6Axis'");
00342         return -1;
00343     }
00344 }
00345 
00346 // Axis4() callback and implementer
00347 // PyObject*  Robot6AxisPy::Axis4(PyObject *args){};
00348 // has to be implemented in Robot6AxisPyImp.cpp
00349 PyObject * Robot6AxisPy::staticCallback_getAxis4 (PyObject *self, void * /*closure*/)
00350 {
00351     if (!((PyObjectBase*) self)->isValid()){
00352         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00353         return NULL;
00354     }
00355 
00356     try {
00357         return Py::new_reference_to(((Robot6AxisPy*)self)->getAxis4());
00358     } catch (const Py::Exception&) {
00359         // The exception text is already set
00360         return NULL;
00361     } catch (...) {
00362         PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'Axis4' of object 'Robot6Axis'");
00363         return NULL;
00364     }
00365 }
00366 
00367 int Robot6AxisPy::staticCallback_setAxis4 (PyObject *self, PyObject *value, void * /*closure*/)
00368 {    
00369     if (!((PyObjectBase*) self)->isValid()){
00370         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00371         return -1;
00372     }
00373     if (((PyObjectBase*) self)->isConst()){
00374         PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a method");
00375         return -1;
00376     }
00377 
00378     try {
00379         ((Robot6AxisPy*)self)->setAxis4(Py::Float(value,false));
00380         return 0;
00381     } catch (const Py::Exception&) {
00382         // The exception text is already set
00383         return -1;
00384     } catch (...) {
00385         PyErr_SetString(PyExc_Exception, "Unknown exception while writing attribute 'Axis4' of object 'Robot6Axis'");
00386         return -1;
00387     }
00388 }
00389 
00390 // Axis5() callback and implementer
00391 // PyObject*  Robot6AxisPy::Axis5(PyObject *args){};
00392 // has to be implemented in Robot6AxisPyImp.cpp
00393 PyObject * Robot6AxisPy::staticCallback_getAxis5 (PyObject *self, void * /*closure*/)
00394 {
00395     if (!((PyObjectBase*) self)->isValid()){
00396         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00397         return NULL;
00398     }
00399 
00400     try {
00401         return Py::new_reference_to(((Robot6AxisPy*)self)->getAxis5());
00402     } catch (const Py::Exception&) {
00403         // The exception text is already set
00404         return NULL;
00405     } catch (...) {
00406         PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'Axis5' of object 'Robot6Axis'");
00407         return NULL;
00408     }
00409 }
00410 
00411 int Robot6AxisPy::staticCallback_setAxis5 (PyObject *self, PyObject *value, void * /*closure*/)
00412 {    
00413     if (!((PyObjectBase*) self)->isValid()){
00414         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00415         return -1;
00416     }
00417     if (((PyObjectBase*) self)->isConst()){
00418         PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a method");
00419         return -1;
00420     }
00421 
00422     try {
00423         ((Robot6AxisPy*)self)->setAxis5(Py::Float(value,false));
00424         return 0;
00425     } catch (const Py::Exception&) {
00426         // The exception text is already set
00427         return -1;
00428     } catch (...) {
00429         PyErr_SetString(PyExc_Exception, "Unknown exception while writing attribute 'Axis5' of object 'Robot6Axis'");
00430         return -1;
00431     }
00432 }
00433 
00434 // Axis6() callback and implementer
00435 // PyObject*  Robot6AxisPy::Axis6(PyObject *args){};
00436 // has to be implemented in Robot6AxisPyImp.cpp
00437 PyObject * Robot6AxisPy::staticCallback_getAxis6 (PyObject *self, void * /*closure*/)
00438 {
00439     if (!((PyObjectBase*) self)->isValid()){
00440         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00441         return NULL;
00442     }
00443 
00444     try {
00445         return Py::new_reference_to(((Robot6AxisPy*)self)->getAxis6());
00446     } catch (const Py::Exception&) {
00447         // The exception text is already set
00448         return NULL;
00449     } catch (...) {
00450         PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'Axis6' of object 'Robot6Axis'");
00451         return NULL;
00452     }
00453 }
00454 
00455 int Robot6AxisPy::staticCallback_setAxis6 (PyObject *self, PyObject *value, void * /*closure*/)
00456 {    
00457     if (!((PyObjectBase*) self)->isValid()){
00458         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00459         return -1;
00460     }
00461     if (((PyObjectBase*) self)->isConst()){
00462         PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a method");
00463         return -1;
00464     }
00465 
00466     try {
00467         ((Robot6AxisPy*)self)->setAxis6(Py::Float(value,false));
00468         return 0;
00469     } catch (const Py::Exception&) {
00470         // The exception text is already set
00471         return -1;
00472     } catch (...) {
00473         PyErr_SetString(PyExc_Exception, "Unknown exception while writing attribute 'Axis6' of object 'Robot6Axis'");
00474         return -1;
00475     }
00476 }
00477 
00478 // Tcp() callback and implementer
00479 // PyObject*  Robot6AxisPy::Tcp(PyObject *args){};
00480 // has to be implemented in Robot6AxisPyImp.cpp
00481 PyObject * Robot6AxisPy::staticCallback_getTcp (PyObject *self, void * /*closure*/)
00482 {
00483     if (!((PyObjectBase*) self)->isValid()){
00484         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00485         return NULL;
00486     }
00487 
00488     try {
00489         return Py::new_reference_to(((Robot6AxisPy*)self)->getTcp());
00490     } catch (const Py::Exception&) {
00491         // The exception text is already set
00492         return NULL;
00493     } catch (...) {
00494         PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'Tcp' of object 'Robot6Axis'");
00495         return NULL;
00496     }
00497 }
00498 
00499 int Robot6AxisPy::staticCallback_setTcp (PyObject *self, PyObject *value, void * /*closure*/)
00500 {    
00501     if (!((PyObjectBase*) self)->isValid()){
00502         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00503         return -1;
00504     }
00505     if (((PyObjectBase*) self)->isConst()){
00506         PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a method");
00507         return -1;
00508     }
00509 
00510     try {
00511         ((Robot6AxisPy*)self)->setTcp(Py::Object(value,false));
00512         return 0;
00513     } catch (const Py::Exception&) {
00514         // The exception text is already set
00515         return -1;
00516     } catch (...) {
00517         PyErr_SetString(PyExc_Exception, "Unknown exception while writing attribute 'Tcp' of object 'Robot6Axis'");
00518         return -1;
00519     }
00520 }
00521 
00522 // Base() callback and implementer
00523 // PyObject*  Robot6AxisPy::Base(PyObject *args){};
00524 // has to be implemented in Robot6AxisPyImp.cpp
00525 PyObject * Robot6AxisPy::staticCallback_getBase (PyObject *self, void * /*closure*/)
00526 {
00527     if (!((PyObjectBase*) self)->isValid()){
00528         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00529         return NULL;
00530     }
00531 
00532     try {
00533         return Py::new_reference_to(((Robot6AxisPy*)self)->getBase());
00534     } catch (const Py::Exception&) {
00535         // The exception text is already set
00536         return NULL;
00537     } catch (...) {
00538         PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'Base' of object 'Robot6Axis'");
00539         return NULL;
00540     }
00541 }
00542 
00543 int Robot6AxisPy::staticCallback_setBase (PyObject *self, PyObject *value, void * /*closure*/)
00544 {    
00545     if (!((PyObjectBase*) self)->isValid()){
00546         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00547         return -1;
00548     }
00549     if (((PyObjectBase*) self)->isConst()){
00550         PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a method");
00551         return -1;
00552     }
00553 
00554     try {
00555         ((Robot6AxisPy*)self)->setBase(Py::Object(value,false));
00556         return 0;
00557     } catch (const Py::Exception&) {
00558         // The exception text is already set
00559         return -1;
00560     } catch (...) {
00561         PyErr_SetString(PyExc_Exception, "Unknown exception while writing attribute 'Base' of object 'Robot6Axis'");
00562         return -1;
00563     }
00564 }
00565 
00566 
00567 
00568 //--------------------------------------------------------------------------
00569 // Parents structure
00570 //--------------------------------------------------------------------------
00571 PyParentObject Robot6AxisPy::Parents[] = { PARENTSRobotRobot6AxisPy };
00572 
00573 //--------------------------------------------------------------------------
00574 // Constructor
00575 //--------------------------------------------------------------------------
00576 Robot6AxisPy::Robot6AxisPy(Robot6Axis *pcObject, PyTypeObject *T)
00577     : PersistencePy(reinterpret_cast<PersistencePy::PointerType>(pcObject), T)
00578 {
00579 }
00580 
00581 
00582 //--------------------------------------------------------------------------
00583 // destructor
00584 //--------------------------------------------------------------------------
00585 Robot6AxisPy::~Robot6AxisPy()                                // Everything handled in parent
00586 {
00587     // delete the handled object when the PyObject dies
00588     Robot6AxisPy::PointerType ptr = reinterpret_cast<Robot6AxisPy::PointerType>(_pcTwinPointer);
00589     delete ptr;
00590 }
00591 
00592 //--------------------------------------------------------------------------
00593 // Robot6AxisPy representation
00594 //--------------------------------------------------------------------------
00595 PyObject *Robot6AxisPy::_repr(void)
00596 {
00597     return Py_BuildValue("s", representation().c_str());
00598 }
00599 
00600 //--------------------------------------------------------------------------
00601 // Robot6AxisPy Attributes
00602 //--------------------------------------------------------------------------
00603 PyObject *Robot6AxisPy::_getattr(char *attr)                            // __getattr__ function: note only need to handle new state
00604 {
00605     try {
00606         // getter method for special Attributes (e.g. dynamic ones)
00607         PyObject *r = getCustomAttributes(attr);
00608         if(r) return r;
00609     }
00610 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
00611     catch(const Base::Exception& e) // catch the FreeCAD exceptions
00612     {
00613         std::string str;
00614         str += "FreeCAD exception thrown (";
00615         str += e.what();
00616         str += ")";
00617         e.ReportException();
00618         PyErr_SetString(PyExc_Exception,str.c_str());
00619         return NULL;
00620     }
00621     catch(const std::exception& e) // catch other c++ exceptions
00622     {
00623         std::string str;
00624         str += "FC++ exception thrown (";
00625         str += e.what();
00626         str += ")";
00627         Base::Console().Error(str.c_str());
00628         PyErr_SetString(PyExc_Exception,str.c_str());
00629         return NULL;
00630     }
00631     catch(const Py::Exception&)
00632     {
00633         // The exception text is already set
00634         return NULL;
00635     }
00636     catch(...)  // catch the rest!
00637     {
00638         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
00639         return NULL;
00640     }
00641 #else  // DONT_CATCH_CXX_EXCEPTIONS  
00642     catch(const Base::Exception& e) // catch the FreeCAD exceptions
00643     {
00644         std::string str;
00645         str += "FreeCAD exception thrown (";
00646         str += e.what();
00647         str += ")";
00648         e.ReportException();
00649         PyErr_SetString(PyExc_Exception,str.c_str());
00650         return NULL;
00651     }
00652     catch(const Py::Exception&)
00653     {
00654         // The exception text is already set
00655         return NULL;
00656     }
00657 #endif  // DONT_CATCH_CXX_EXCEPTIONS
00658 
00659     PyObject *rvalue = Py_FindMethod(Methods, this, attr);
00660     if (rvalue == NULL)
00661     {
00662         PyErr_Clear();
00663         return PersistencePy::_getattr(attr);
00664     }
00665     else
00666     {
00667         return rvalue;
00668     }
00669 }
00670 
00671 int Robot6AxisPy::_setattr(char *attr, PyObject *value)         // __setattr__ function: note only need to handle new state
00672 {
00673     try {
00674         // setter for  special Attributes (e.g. dynamic ones)
00675         int r = setCustomAttributes(attr, value);
00676         if(r==1) return 0;
00677     }
00678 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
00679     catch(const Base::Exception& e) // catch the FreeCAD exceptions
00680     {
00681         std::string str;
00682         str += "FreeCAD exception thrown (";
00683         str += e.what();
00684         str += ")";
00685         e.ReportException();
00686         PyErr_SetString(PyExc_Exception,str.c_str());
00687         return -1;
00688     }
00689     catch(const std::exception& e) // catch other c++ exceptions
00690     {
00691         std::string str;
00692         str += "FC++ exception thrown (";
00693         str += e.what();
00694         str += ")";
00695         Base::Console().Error(str.c_str());
00696         PyErr_SetString(PyExc_Exception,str.c_str());
00697         return -1;
00698     }
00699     catch(const Py::Exception&)
00700     {
00701         // The exception text is already set
00702         return -1;
00703     }
00704     catch(...)  // catch the rest!
00705     {
00706         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
00707         return -1;
00708     }
00709 #else  // DONT_CATCH_CXX_EXCEPTIONS  
00710     catch(const Base::Exception& e) // catch the FreeCAD exceptions
00711     {
00712         std::string str;
00713         str += "FreeCAD exception thrown (";
00714         str += e.what();
00715         str += ")";
00716         e.ReportException();
00717         PyErr_SetString(PyExc_Exception,str.c_str());
00718         return -1;
00719     }
00720     catch(const Py::Exception&)
00721     {
00722         // The exception text is already set
00723         return -1;
00724     }
00725 #endif  // DONT_CATCH_CXX_EXCEPTIONS
00726 
00727     return PersistencePy::_setattr(attr, value);
00728 }
00729 
00730 Robot6Axis *Robot6AxisPy::getRobot6AxisPtr(void) const
00731 {
00732     return static_cast<Robot6Axis *>(_pcTwinPointer);
00733 }
00734 
00735 #if 0
00736 /* From here on come the methods you have to implement, but NOT in this module. Implement in Robot6AxisPyImp.cpp! This prototypes 
00737  * are just for convenience when you add a new method.
00738  */
00739 
00740 PyObject *Robot6AxisPy::PyMake(struct _typeobject *, PyObject *, PyObject *)  // Python wrapper
00741 {
00742     // create a new instance of Robot6AxisPy and the Twin object 
00743     return new Robot6AxisPy(new Robot6Axis);
00744 }
00745 
00746 // constructor method
00747 int Robot6AxisPy::PyInit(PyObject* /*args*/, PyObject* /*kwd*/)
00748 {
00749     return 0;
00750 }
00751 
00752 // returns a string which represents the object e.g. when printed in python
00753 std::string Robot6AxisPy::representation(void) const
00754 {
00755     return std::string("<Robot6Axis object>");
00756 }
00757 
00758 PyObject* Robot6AxisPy::check(PyObject *args)
00759 {
00760     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
00761     return 0;
00762 }
00763 
00764 
00765 
00766 Py::Float Robot6AxisPy::getAxis1(void) const
00767 {
00768     //return Py::Float();
00769     throw Py::AttributeError("Not yet implemented");
00770 }
00771 
00772 void  Robot6AxisPy::setAxis1(Py::Float arg)
00773 {
00774     throw Py::AttributeError("Not yet implemented");
00775 }
00776 
00777 Py::Float Robot6AxisPy::getAxis2(void) const
00778 {
00779     //return Py::Float();
00780     throw Py::AttributeError("Not yet implemented");
00781 }
00782 
00783 void  Robot6AxisPy::setAxis2(Py::Float arg)
00784 {
00785     throw Py::AttributeError("Not yet implemented");
00786 }
00787 
00788 Py::Float Robot6AxisPy::getAxis3(void) const
00789 {
00790     //return Py::Float();
00791     throw Py::AttributeError("Not yet implemented");
00792 }
00793 
00794 void  Robot6AxisPy::setAxis3(Py::Float arg)
00795 {
00796     throw Py::AttributeError("Not yet implemented");
00797 }
00798 
00799 Py::Float Robot6AxisPy::getAxis4(void) const
00800 {
00801     //return Py::Float();
00802     throw Py::AttributeError("Not yet implemented");
00803 }
00804 
00805 void  Robot6AxisPy::setAxis4(Py::Float arg)
00806 {
00807     throw Py::AttributeError("Not yet implemented");
00808 }
00809 
00810 Py::Float Robot6AxisPy::getAxis5(void) const
00811 {
00812     //return Py::Float();
00813     throw Py::AttributeError("Not yet implemented");
00814 }
00815 
00816 void  Robot6AxisPy::setAxis5(Py::Float arg)
00817 {
00818     throw Py::AttributeError("Not yet implemented");
00819 }
00820 
00821 Py::Float Robot6AxisPy::getAxis6(void) const
00822 {
00823     //return Py::Float();
00824     throw Py::AttributeError("Not yet implemented");
00825 }
00826 
00827 void  Robot6AxisPy::setAxis6(Py::Float arg)
00828 {
00829     throw Py::AttributeError("Not yet implemented");
00830 }
00831 
00832 Py::Object Robot6AxisPy::getTcp(void) const
00833 {
00834     //return Py::Object();
00835     throw Py::AttributeError("Not yet implemented");
00836 }
00837 
00838 void  Robot6AxisPy::setTcp(Py::Object arg)
00839 {
00840     throw Py::AttributeError("Not yet implemented");
00841 }
00842 
00843 Py::Object Robot6AxisPy::getBase(void) const
00844 {
00845     //return Py::Object();
00846     throw Py::AttributeError("Not yet implemented");
00847 }
00848 
00849 void  Robot6AxisPy::setBase(Py::Object arg)
00850 {
00851     throw Py::AttributeError("Not yet implemented");
00852 }
00853 
00854 PyObject *Robot6AxisPy::getCustomAttributes(const char* attr) const
00855 {
00856     return 0;
00857 }
00858 
00859 int Robot6AxisPy::setCustomAttributes(const char* attr, PyObject *obj)
00860 {
00861     return 0; 
00862 }
00863 #endif
00864 
00865 
00866 

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