SpherePy.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 SpherePyImp.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 Part;
00018 
00020 PyTypeObject SpherePy::Type = {
00021     PyObject_HEAD_INIT(&PyType_Type)
00022     0,                                                /*ob_size*/
00023     "Part.GeomSphere",     /*tp_name*/
00024     sizeof(SpherePy),                       /*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     "Describes a sphere in 3D space",           /*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     Part::SpherePy::Methods,                     /*tp_methods */
00053     0,                                                /*tp_members */
00054     Part::SpherePy::GetterSetter,                     /*tp_getset */
00055     &Part::GeometrySurfacePy::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     Part::SpherePy::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 SpherePy::Methods[] = {
00075     {"uIso",
00076         (PyCFunction) staticCallback_uIso,
00077         METH_VARARGS,
00078         "\n                                     Builds the U isoparametric circle of this sphere\n                              "
00079     },
00080     {"vIso",
00081         (PyCFunction) staticCallback_vIso,
00082         METH_VARARGS,
00083         "Builds the V isoparametric circle of this sphere \nwhere V must be in the range [-Pi/2,Pi/2]"
00084     },
00085     {NULL, NULL, 0, NULL}               /* Sentinel */
00086 };
00087 
00088 
00089 
00091 PyGetSetDef SpherePy::GetterSetter[] = {
00092     {"Radius",
00093         (getter) staticCallback_getRadius,
00094         (setter) staticCallback_setRadius, 
00095         "The radius of the sphere.",
00096         NULL
00097     },
00098     {"Area",
00099         (getter) staticCallback_getArea,
00100         (setter) staticCallback_setArea, 
00101         "Compute the area of the sphere.",
00102         NULL
00103     },
00104     {"Volume",
00105         (getter) staticCallback_getVolume,
00106         (setter) staticCallback_setVolume, 
00107         "Compute the volume of the sphere.",
00108         NULL
00109     },
00110     {"Center",
00111         (getter) staticCallback_getCenter,
00112         (setter) staticCallback_setCenter, 
00113         "Center of the sphere.",
00114         NULL
00115     },
00116     {"Axis",
00117         (getter) staticCallback_getAxis,
00118         (setter) staticCallback_setAxis, 
00119         "The axis direction of the circle",
00120         NULL
00121     },
00122     {NULL, NULL, NULL, NULL, NULL}              /* Sentinel */
00123 };
00124 
00125 // uIso() callback and implementer
00126 // PyObject*  SpherePy::uIso(PyObject *args){};
00127 // has to be implemented in SpherePyImp.cpp
00128 PyObject * SpherePy::staticCallback_uIso (PyObject *self, PyObject *args)
00129 {
00130     // test if twin object not allready deleted
00131     if (!((PyObjectBase*) self)->isValid()){
00132         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00133         return NULL;
00134     }
00135 
00136     // test if object is set Const
00137     if (((PyObjectBase*) self)->isConst()){
00138         PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
00139         return NULL;
00140     }
00141 
00142     try { // catches all exceptions coming up from c++ and generate a python exception
00143         PyObject* ret = ((SpherePy*)self)->uIso(args);
00144         if (ret != 0)
00145             ((SpherePy*)self)->startNotify();
00146         return ret;
00147     }
00148     catch(const Base::Exception& e) // catch the FreeCAD exceptions
00149     {
00150         std::string str;
00151         str += "FreeCAD exception thrown (";
00152         str += e.what();
00153         str += ")";
00154         e.ReportException();
00155         PyErr_SetString(PyExc_Exception,str.c_str());
00156         return NULL;
00157     }
00158     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
00159     {
00160         std::string str;
00161         str += "File system exception thrown (";
00162         //str += e.who();
00163         //str += ", ";
00164         str += e.what();
00165         str += ")\n";
00166         Base::Console().Error(str.c_str());
00167         PyErr_SetString(PyExc_Exception,str.c_str());
00168         return NULL;
00169     }
00170     catch(const Py::Exception&)
00171     {
00172         // The exception text is already set
00173         return NULL;
00174     }
00175     catch(const char* e) // catch simple string exceptions
00176     {
00177         Base::Console().Error(e);
00178         PyErr_SetString(PyExc_Exception,e);
00179         return NULL;
00180     }
00181     // in debug not all exceptions will be catched to get the attention of the developer!
00182 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
00183     catch(const std::exception& e) // catch other c++ exceptions
00184     {
00185         std::string str;
00186         str += "FC++ exception thrown (";
00187         str += e.what();
00188         str += ")";
00189         Base::Console().Error(str.c_str());
00190         PyErr_SetString(PyExc_Exception,str.c_str());
00191         return NULL;
00192     }
00193     catch(...)  // catch the rest!
00194     {
00195         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
00196         return NULL;
00197     }
00198 #endif
00199 }
00200 
00201 // vIso() callback and implementer
00202 // PyObject*  SpherePy::vIso(PyObject *args){};
00203 // has to be implemented in SpherePyImp.cpp
00204 PyObject * SpherePy::staticCallback_vIso (PyObject *self, PyObject *args)
00205 {
00206     // test if twin object not allready deleted
00207     if (!((PyObjectBase*) self)->isValid()){
00208         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00209         return NULL;
00210     }
00211 
00212     // test if object is set Const
00213     if (((PyObjectBase*) self)->isConst()){
00214         PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
00215         return NULL;
00216     }
00217 
00218     try { // catches all exceptions coming up from c++ and generate a python exception
00219         PyObject* ret = ((SpherePy*)self)->vIso(args);
00220         if (ret != 0)
00221             ((SpherePy*)self)->startNotify();
00222         return ret;
00223     }
00224     catch(const Base::Exception& e) // catch the FreeCAD exceptions
00225     {
00226         std::string str;
00227         str += "FreeCAD exception thrown (";
00228         str += e.what();
00229         str += ")";
00230         e.ReportException();
00231         PyErr_SetString(PyExc_Exception,str.c_str());
00232         return NULL;
00233     }
00234     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
00235     {
00236         std::string str;
00237         str += "File system exception thrown (";
00238         //str += e.who();
00239         //str += ", ";
00240         str += e.what();
00241         str += ")\n";
00242         Base::Console().Error(str.c_str());
00243         PyErr_SetString(PyExc_Exception,str.c_str());
00244         return NULL;
00245     }
00246     catch(const Py::Exception&)
00247     {
00248         // The exception text is already set
00249         return NULL;
00250     }
00251     catch(const char* e) // catch simple string exceptions
00252     {
00253         Base::Console().Error(e);
00254         PyErr_SetString(PyExc_Exception,e);
00255         return NULL;
00256     }
00257     // in debug not all exceptions will be catched to get the attention of the developer!
00258 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
00259     catch(const std::exception& e) // catch other c++ exceptions
00260     {
00261         std::string str;
00262         str += "FC++ exception thrown (";
00263         str += e.what();
00264         str += ")";
00265         Base::Console().Error(str.c_str());
00266         PyErr_SetString(PyExc_Exception,str.c_str());
00267         return NULL;
00268     }
00269     catch(...)  // catch the rest!
00270     {
00271         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
00272         return NULL;
00273     }
00274 #endif
00275 }
00276 
00277 // Radius() callback and implementer
00278 // PyObject*  SpherePy::Radius(PyObject *args){};
00279 // has to be implemented in SpherePyImp.cpp
00280 PyObject * SpherePy::staticCallback_getRadius (PyObject *self, void * /*closure*/)
00281 {
00282     if (!((PyObjectBase*) self)->isValid()){
00283         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00284         return NULL;
00285     }
00286 
00287     try {
00288         return Py::new_reference_to(((SpherePy*)self)->getRadius());
00289     } catch (const Py::Exception&) {
00290         // The exception text is already set
00291         return NULL;
00292     } catch (...) {
00293         PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'Radius' of object 'GeomSphere'");
00294         return NULL;
00295     }
00296 }
00297 
00298 int SpherePy::staticCallback_setRadius (PyObject *self, PyObject *value, void * /*closure*/)
00299 {    
00300     if (!((PyObjectBase*) self)->isValid()){
00301         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00302         return -1;
00303     }
00304     if (((PyObjectBase*) self)->isConst()){
00305         PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a method");
00306         return -1;
00307     }
00308 
00309     try {
00310         ((SpherePy*)self)->setRadius(Py::Float(value,false));
00311         return 0;
00312     } catch (const Py::Exception&) {
00313         // The exception text is already set
00314         return -1;
00315     } catch (...) {
00316         PyErr_SetString(PyExc_Exception, "Unknown exception while writing attribute 'Radius' of object 'GeomSphere'");
00317         return -1;
00318     }
00319 }
00320 
00321 // Area() callback and implementer
00322 // PyObject*  SpherePy::Area(PyObject *args){};
00323 // has to be implemented in SpherePyImp.cpp
00324 PyObject * SpherePy::staticCallback_getArea (PyObject *self, void * /*closure*/)
00325 {
00326     if (!((PyObjectBase*) self)->isValid()){
00327         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00328         return NULL;
00329     }
00330 
00331     try {
00332         return Py::new_reference_to(((SpherePy*)self)->getArea());
00333     } catch (const Py::Exception&) {
00334         // The exception text is already set
00335         return NULL;
00336     } catch (...) {
00337         PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'Area' of object 'GeomSphere'");
00338         return NULL;
00339     }
00340 }
00341 
00342 int SpherePy::staticCallback_setArea (PyObject *self, PyObject * /*value*/, void * /*closure*/)
00343 {
00344     if (!((PyObjectBase*) self)->isValid()){
00345         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00346         return -1;
00347     }
00348 
00349     PyErr_SetString(PyExc_AttributeError, "Attribute 'Area' of object 'GeomSphere' is read-only");
00350     return -1;
00351 }
00352 
00353 // Volume() callback and implementer
00354 // PyObject*  SpherePy::Volume(PyObject *args){};
00355 // has to be implemented in SpherePyImp.cpp
00356 PyObject * SpherePy::staticCallback_getVolume (PyObject *self, void * /*closure*/)
00357 {
00358     if (!((PyObjectBase*) self)->isValid()){
00359         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00360         return NULL;
00361     }
00362 
00363     try {
00364         return Py::new_reference_to(((SpherePy*)self)->getVolume());
00365     } catch (const Py::Exception&) {
00366         // The exception text is already set
00367         return NULL;
00368     } catch (...) {
00369         PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'Volume' of object 'GeomSphere'");
00370         return NULL;
00371     }
00372 }
00373 
00374 int SpherePy::staticCallback_setVolume (PyObject *self, PyObject * /*value*/, void * /*closure*/)
00375 {
00376     if (!((PyObjectBase*) self)->isValid()){
00377         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00378         return -1;
00379     }
00380 
00381     PyErr_SetString(PyExc_AttributeError, "Attribute 'Volume' of object 'GeomSphere' is read-only");
00382     return -1;
00383 }
00384 
00385 // Center() callback and implementer
00386 // PyObject*  SpherePy::Center(PyObject *args){};
00387 // has to be implemented in SpherePyImp.cpp
00388 PyObject * SpherePy::staticCallback_getCenter (PyObject *self, void * /*closure*/)
00389 {
00390     if (!((PyObjectBase*) self)->isValid()){
00391         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00392         return NULL;
00393     }
00394 
00395     try {
00396         return Py::new_reference_to(((SpherePy*)self)->getCenter());
00397     } catch (const Py::Exception&) {
00398         // The exception text is already set
00399         return NULL;
00400     } catch (...) {
00401         PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'Center' of object 'GeomSphere'");
00402         return NULL;
00403     }
00404 }
00405 
00406 int SpherePy::staticCallback_setCenter (PyObject *self, PyObject *value, void * /*closure*/)
00407 {    
00408     if (!((PyObjectBase*) self)->isValid()){
00409         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00410         return -1;
00411     }
00412     if (((PyObjectBase*) self)->isConst()){
00413         PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a method");
00414         return -1;
00415     }
00416 
00417     try {
00418         ((SpherePy*)self)->setCenter(Py::Object(value,false));
00419         return 0;
00420     } catch (const Py::Exception&) {
00421         // The exception text is already set
00422         return -1;
00423     } catch (...) {
00424         PyErr_SetString(PyExc_Exception, "Unknown exception while writing attribute 'Center' of object 'GeomSphere'");
00425         return -1;
00426     }
00427 }
00428 
00429 // Axis() callback and implementer
00430 // PyObject*  SpherePy::Axis(PyObject *args){};
00431 // has to be implemented in SpherePyImp.cpp
00432 PyObject * SpherePy::staticCallback_getAxis (PyObject *self, void * /*closure*/)
00433 {
00434     if (!((PyObjectBase*) self)->isValid()){
00435         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00436         return NULL;
00437     }
00438 
00439     try {
00440         return Py::new_reference_to(((SpherePy*)self)->getAxis());
00441     } catch (const Py::Exception&) {
00442         // The exception text is already set
00443         return NULL;
00444     } catch (...) {
00445         PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'Axis' of object 'GeomSphere'");
00446         return NULL;
00447     }
00448 }
00449 
00450 int SpherePy::staticCallback_setAxis (PyObject *self, PyObject *value, void * /*closure*/)
00451 {    
00452     if (!((PyObjectBase*) self)->isValid()){
00453         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00454         return -1;
00455     }
00456     if (((PyObjectBase*) self)->isConst()){
00457         PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a method");
00458         return -1;
00459     }
00460 
00461     try {
00462         ((SpherePy*)self)->setAxis(Py::Object(value,false));
00463         return 0;
00464     } catch (const Py::Exception&) {
00465         // The exception text is already set
00466         return -1;
00467     } catch (...) {
00468         PyErr_SetString(PyExc_Exception, "Unknown exception while writing attribute 'Axis' of object 'GeomSphere'");
00469         return -1;
00470     }
00471 }
00472 
00473 
00474 
00475 //--------------------------------------------------------------------------
00476 // Parents structure
00477 //--------------------------------------------------------------------------
00478 PyParentObject SpherePy::Parents[] = { PARENTSPartSpherePy };
00479 
00480 //--------------------------------------------------------------------------
00481 // Constructor
00482 //--------------------------------------------------------------------------
00483 SpherePy::SpherePy(GeomSphere *pcObject, PyTypeObject *T)
00484     : GeometrySurfacePy(reinterpret_cast<GeometrySurfacePy::PointerType>(pcObject), T)
00485 {
00486 }
00487 
00488 
00489 //--------------------------------------------------------------------------
00490 // destructor
00491 //--------------------------------------------------------------------------
00492 SpherePy::~SpherePy()                                // Everything handled in parent
00493 {
00494 }
00495 
00496 //--------------------------------------------------------------------------
00497 // SpherePy representation
00498 //--------------------------------------------------------------------------
00499 PyObject *SpherePy::_repr(void)
00500 {
00501     return Py_BuildValue("s", representation().c_str());
00502 }
00503 
00504 //--------------------------------------------------------------------------
00505 // SpherePy Attributes
00506 //--------------------------------------------------------------------------
00507 PyObject *SpherePy::_getattr(char *attr)                                // __getattr__ function: note only need to handle new state
00508 {
00509     try {
00510         // getter method for special Attributes (e.g. dynamic ones)
00511         PyObject *r = getCustomAttributes(attr);
00512         if(r) return r;
00513     }
00514 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
00515     catch(const Base::Exception& e) // catch the FreeCAD exceptions
00516     {
00517         std::string str;
00518         str += "FreeCAD exception thrown (";
00519         str += e.what();
00520         str += ")";
00521         e.ReportException();
00522         PyErr_SetString(PyExc_Exception,str.c_str());
00523         return NULL;
00524     }
00525     catch(const std::exception& e) // catch other c++ exceptions
00526     {
00527         std::string str;
00528         str += "FC++ exception thrown (";
00529         str += e.what();
00530         str += ")";
00531         Base::Console().Error(str.c_str());
00532         PyErr_SetString(PyExc_Exception,str.c_str());
00533         return NULL;
00534     }
00535     catch(const Py::Exception&)
00536     {
00537         // The exception text is already set
00538         return NULL;
00539     }
00540     catch(...)  // catch the rest!
00541     {
00542         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
00543         return NULL;
00544     }
00545 #else  // DONT_CATCH_CXX_EXCEPTIONS  
00546     catch(const Base::Exception& e) // catch the FreeCAD exceptions
00547     {
00548         std::string str;
00549         str += "FreeCAD exception thrown (";
00550         str += e.what();
00551         str += ")";
00552         e.ReportException();
00553         PyErr_SetString(PyExc_Exception,str.c_str());
00554         return NULL;
00555     }
00556     catch(const Py::Exception&)
00557     {
00558         // The exception text is already set
00559         return NULL;
00560     }
00561 #endif  // DONT_CATCH_CXX_EXCEPTIONS
00562 
00563     PyObject *rvalue = Py_FindMethod(Methods, this, attr);
00564     if (rvalue == NULL)
00565     {
00566         PyErr_Clear();
00567         return GeometrySurfacePy::_getattr(attr);
00568     }
00569     else
00570     {
00571         return rvalue;
00572     }
00573 }
00574 
00575 int SpherePy::_setattr(char *attr, PyObject *value)     // __setattr__ function: note only need to handle new state
00576 {
00577     try {
00578         // setter for  special Attributes (e.g. dynamic ones)
00579         int r = setCustomAttributes(attr, value);
00580         if(r==1) return 0;
00581     }
00582 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
00583     catch(const Base::Exception& e) // catch the FreeCAD exceptions
00584     {
00585         std::string str;
00586         str += "FreeCAD exception thrown (";
00587         str += e.what();
00588         str += ")";
00589         e.ReportException();
00590         PyErr_SetString(PyExc_Exception,str.c_str());
00591         return -1;
00592     }
00593     catch(const std::exception& e) // catch other c++ exceptions
00594     {
00595         std::string str;
00596         str += "FC++ exception thrown (";
00597         str += e.what();
00598         str += ")";
00599         Base::Console().Error(str.c_str());
00600         PyErr_SetString(PyExc_Exception,str.c_str());
00601         return -1;
00602     }
00603     catch(const Py::Exception&)
00604     {
00605         // The exception text is already set
00606         return -1;
00607     }
00608     catch(...)  // catch the rest!
00609     {
00610         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
00611         return -1;
00612     }
00613 #else  // DONT_CATCH_CXX_EXCEPTIONS  
00614     catch(const Base::Exception& e) // catch the FreeCAD exceptions
00615     {
00616         std::string str;
00617         str += "FreeCAD exception thrown (";
00618         str += e.what();
00619         str += ")";
00620         e.ReportException();
00621         PyErr_SetString(PyExc_Exception,str.c_str());
00622         return -1;
00623     }
00624     catch(const Py::Exception&)
00625     {
00626         // The exception text is already set
00627         return -1;
00628     }
00629 #endif  // DONT_CATCH_CXX_EXCEPTIONS
00630 
00631     return GeometrySurfacePy::_setattr(attr, value);
00632 }
00633 
00634 GeomSphere *SpherePy::getGeomSpherePtr(void) const
00635 {
00636     return static_cast<GeomSphere *>(_pcTwinPointer);
00637 }
00638 
00639 #if 0
00640 /* From here on come the methods you have to implement, but NOT in this module. Implement in SpherePyImp.cpp! This prototypes 
00641  * are just for convenience when you add a new method.
00642  */
00643 
00644 PyObject *SpherePy::PyMake(struct _typeobject *, PyObject *, PyObject *)  // Python wrapper
00645 {
00646     // create a new instance of SpherePy and the Twin object 
00647     return new SpherePy(new GeomSphere);
00648 }
00649 
00650 // constructor method
00651 int SpherePy::PyInit(PyObject* /*args*/, PyObject* /*kwd*/)
00652 {
00653     return 0;
00654 }
00655 
00656 // returns a string which represents the object e.g. when printed in python
00657 std::string SpherePy::representation(void) const
00658 {
00659     return std::string("<GeomSphere object>");
00660 }
00661 
00662 PyObject* SpherePy::uIso(PyObject *args)
00663 {
00664     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
00665     return 0;
00666 }
00667 
00668 PyObject* SpherePy::vIso(PyObject *args)
00669 {
00670     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
00671     return 0;
00672 }
00673 
00674 
00675 
00676 Py::Float SpherePy::getRadius(void) const
00677 {
00678     //return Py::Float();
00679     throw Py::AttributeError("Not yet implemented");
00680 }
00681 
00682 void  SpherePy::setRadius(Py::Float arg)
00683 {
00684     throw Py::AttributeError("Not yet implemented");
00685 }
00686 
00687 Py::Float SpherePy::getArea(void) const
00688 {
00689     //return Py::Float();
00690     throw Py::AttributeError("Not yet implemented");
00691 }
00692 
00693 Py::Float SpherePy::getVolume(void) const
00694 {
00695     //return Py::Float();
00696     throw Py::AttributeError("Not yet implemented");
00697 }
00698 
00699 Py::Object SpherePy::getCenter(void) const
00700 {
00701     //return Py::Object();
00702     throw Py::AttributeError("Not yet implemented");
00703 }
00704 
00705 void  SpherePy::setCenter(Py::Object arg)
00706 {
00707     throw Py::AttributeError("Not yet implemented");
00708 }
00709 
00710 Py::Object SpherePy::getAxis(void) const
00711 {
00712     //return Py::Object();
00713     throw Py::AttributeError("Not yet implemented");
00714 }
00715 
00716 void  SpherePy::setAxis(Py::Object arg)
00717 {
00718     throw Py::AttributeError("Not yet implemented");
00719 }
00720 
00721 PyObject *SpherePy::getCustomAttributes(const char* attr) const
00722 {
00723     return 0;
00724 }
00725 
00726 int SpherePy::setCustomAttributes(const char* attr, PyObject *obj)
00727 {
00728     return 0; 
00729 }
00730 #endif
00731 
00732 
00733 

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