00001 
00002 
00003 
00004 
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 Fem;
00018 
00020 PyTypeObject FemMeshPy::Type = {
00021     PyObject_HEAD_INIT(&PyType_Type)
00022     0,                                                
00023     "Fem.FemMesh",     
00024     sizeof(FemMeshPy),                       
00025     0,                                                
00026     
00027     PyDestructor,                                     
00028     0,                                                
00029     __getattr,                                        
00030     __setattr,                                        
00031     0,                                                
00032     __repr,                                           
00033     0,                                                
00034     0,                                                
00035     0,                                                
00036     0,                                                
00037     0,                                                
00038     0,                                                
00039     0,                                                
00040     0,                                                
00041     
00042     0,                                                
00043     
00044     Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_CLASS,        
00045     "FemMesh class",           
00046     0,                                                
00047     0,                                                
00048     0,                                                
00049     0,                                                
00050     0,                                                
00051     0,                                                
00052     Fem::FemMeshPy::Methods,                     
00053     0,                                                
00054     Fem::FemMeshPy::GetterSetter,                     
00055     &Data::ComplexGeoDataPy::Type,                        
00056     0,                                                
00057     0,                                                
00058     0,                                                
00059     0,                                                
00060     __PyInit,                                         
00061     0,                                                
00062     Fem::FemMeshPy::PyMake,
00063     0,                                                
00064     0,                                                
00065     0,                                                
00066     0,                                                
00067     0,                                                
00068     0,                                                
00069     0,                                                
00070     0                                                 
00071 };
00072 
00074 PyMethodDef FemMeshPy::Methods[] = {
00075     {"setShape",
00076         (PyCFunction) staticCallback_setShape,
00077         METH_VARARGS,
00078         "set the Part shape to mesh"
00079     },
00080     {"compute",
00081         (PyCFunction) staticCallback_compute,
00082         METH_VARARGS,
00083         "Update the internal mesh structure"
00084     },
00085     {"addHypothesis",
00086         (PyCFunction) staticCallback_addHypothesis,
00087         METH_VARARGS,
00088         "Add hypothesis"
00089     },
00090     {"setStanardHypotheses",
00091         (PyCFunction) staticCallback_setStanardHypotheses,
00092         METH_VARARGS,
00093         "Set some standard hypotheses for the whole shape"
00094     },
00095     {"addNode",
00096         (PyCFunction) staticCallback_addNode,
00097         METH_VARARGS,
00098         "Add a node by setting (x,y,z)."
00099     },
00100     {"addEdge",
00101         (PyCFunction) staticCallback_addEdge,
00102         METH_VARARGS,
00103         "Add an edge by setting two node indices."
00104     },
00105     {"addFace",
00106         (PyCFunction) staticCallback_addFace,
00107         METH_VARARGS,
00108         "Add a face by setting three node indices."
00109     },
00110     {"addQuad",
00111         (PyCFunction) staticCallback_addQuad,
00112         METH_VARARGS,
00113         "Add a quad by setting four node indices."
00114     },
00115     {"addVolume",
00116         (PyCFunction) staticCallback_addVolume,
00117         METH_VARARGS,
00118         "Add a volume by setting an arbitrary number of node indices."
00119     },
00120     {"read",
00121         (PyCFunction) staticCallback_read,
00122         METH_VARARGS,
00123         "Read in an DAT, UNV, MED or STL file."
00124     },
00125     {"write",
00126         (PyCFunction) staticCallback_write,
00127         METH_VARARGS,
00128         "write out an DAT, UNV, MED or STL file."
00129     },
00130     {"writeABAQUS",
00131         (PyCFunction) staticCallback_writeABAQUS,
00132         METH_VARARGS,
00133         "write out as ABAQUS."
00134     },
00135     {"setTransform",
00136         (PyCFunction) staticCallback_setTransform,
00137         METH_VARARGS,
00138         "Use a Placement object to perform a translation or rotation"
00139     },
00140     {"copy",
00141         (PyCFunction) staticCallback_copy,
00142         METH_VARARGS,
00143         "Make a copy of this FEM mesh."
00144     },
00145     {NULL, NULL, 0, NULL}               
00146 };
00147 
00148 
00149 
00151 PyGetSetDef FemMeshPy::GetterSetter[] = {
00152     {"NodeCount",
00153         (getter) staticCallback_getNodeCount,
00154         (setter) staticCallback_setNodeCount, 
00155         "Number of nodes in the Mesh.",
00156         NULL
00157     },
00158     {"EdgeCount",
00159         (getter) staticCallback_getEdgeCount,
00160         (setter) staticCallback_setEdgeCount, 
00161         "Number of edges in the Mesh.",
00162         NULL
00163     },
00164     {"FacesCount",
00165         (getter) staticCallback_getFacesCount,
00166         (setter) staticCallback_setFacesCount, 
00167         "Number of Faces in the Mesh.",
00168         NULL
00169     },
00170     {"TriangleCount",
00171         (getter) staticCallback_getTriangleCount,
00172         (setter) staticCallback_setTriangleCount, 
00173         "Number of Triangles in the Mesh.",
00174         NULL
00175     },
00176     {"QuadrangleCount",
00177         (getter) staticCallback_getQuadrangleCount,
00178         (setter) staticCallback_setQuadrangleCount, 
00179         "Number of Quadrangles in the Mesh.",
00180         NULL
00181     },
00182     {"PolygonCount",
00183         (getter) staticCallback_getPolygonCount,
00184         (setter) staticCallback_setPolygonCount, 
00185         "Number of Quadrangles in the Mesh.",
00186         NULL
00187     },
00188     {"VolumeCount",
00189         (getter) staticCallback_getVolumeCount,
00190         (setter) staticCallback_setVolumeCount, 
00191         "Number of Volumes in the Mesh.",
00192         NULL
00193     },
00194     {"TetraCount",
00195         (getter) staticCallback_getTetraCount,
00196         (setter) staticCallback_setTetraCount, 
00197         "Number of Tetras in the Mesh.",
00198         NULL
00199     },
00200     {"HexaCount",
00201         (getter) staticCallback_getHexaCount,
00202         (setter) staticCallback_setHexaCount, 
00203         "Number of Hexas in the Mesh.",
00204         NULL
00205     },
00206     {"PyramidCount",
00207         (getter) staticCallback_getPyramidCount,
00208         (setter) staticCallback_setPyramidCount, 
00209         "Number of Pyramids in the Mesh.",
00210         NULL
00211     },
00212     {"PrismCount",
00213         (getter) staticCallback_getPrismCount,
00214         (setter) staticCallback_setPrismCount, 
00215         "Number of Prisms in the Mesh.",
00216         NULL
00217     },
00218     {"PolyhedronCount",
00219         (getter) staticCallback_getPolyhedronCount,
00220         (setter) staticCallback_setPolyhedronCount, 
00221         "Number of Polyhedrons in the Mesh.",
00222         NULL
00223     },
00224     {"SubMeshCount",
00225         (getter) staticCallback_getSubMeshCount,
00226         (setter) staticCallback_setSubMeshCount, 
00227         "Number of SubMeshs in the Mesh.",
00228         NULL
00229     },
00230     {"GroupCount",
00231         (getter) staticCallback_getGroupCount,
00232         (setter) staticCallback_setGroupCount, 
00233         "Number of Groups in the Mesh.",
00234         NULL
00235     },
00236     {NULL, NULL, NULL, NULL, NULL}              
00237 };
00238 
00239 
00240 
00241 
00242 PyObject * FemMeshPy::staticCallback_setShape (PyObject *self, PyObject *args)
00243 {
00244     
00245     if (!((PyObjectBase*) self)->isValid()){
00246         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00247         return NULL;
00248     }
00249 
00250     
00251     if (((PyObjectBase*) self)->isConst()){
00252         PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
00253         return NULL;
00254     }
00255 
00256     try { 
00257         PyObject* ret = ((FemMeshPy*)self)->setShape(args);
00258         if (ret != 0)
00259             ((FemMeshPy*)self)->startNotify();
00260         return ret;
00261     }
00262     catch(const Base::Exception& e) 
00263     {
00264         std::string str;
00265         str += "FreeCAD exception thrown (";
00266         str += e.what();
00267         str += ")";
00268         e.ReportException();
00269         PyErr_SetString(PyExc_Exception,str.c_str());
00270         return NULL;
00271     }
00272     catch(const boost::filesystem::filesystem_error& e) 
00273     {
00274         std::string str;
00275         str += "File system exception thrown (";
00276         
00277         
00278         str += e.what();
00279         str += ")\n";
00280         Base::Console().Error(str.c_str());
00281         PyErr_SetString(PyExc_Exception,str.c_str());
00282         return NULL;
00283     }
00284     catch(const Py::Exception&)
00285     {
00286         
00287         return NULL;
00288     }
00289     catch(const char* e) 
00290     {
00291         Base::Console().Error(e);
00292         PyErr_SetString(PyExc_Exception,e);
00293         return NULL;
00294     }
00295     
00296 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
00297     catch(const std::exception& e) 
00298     {
00299         std::string str;
00300         str += "FC++ exception thrown (";
00301         str += e.what();
00302         str += ")";
00303         Base::Console().Error(str.c_str());
00304         PyErr_SetString(PyExc_Exception,str.c_str());
00305         return NULL;
00306     }
00307     catch(...)  
00308     {
00309         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
00310         return NULL;
00311     }
00312 #endif
00313 }
00314 
00315 
00316 
00317 
00318 PyObject * FemMeshPy::staticCallback_compute (PyObject *self, PyObject *args)
00319 {
00320     
00321     if (!((PyObjectBase*) self)->isValid()){
00322         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00323         return NULL;
00324     }
00325 
00326     
00327     if (((PyObjectBase*) self)->isConst()){
00328         PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
00329         return NULL;
00330     }
00331 
00332     try { 
00333         PyObject* ret = ((FemMeshPy*)self)->compute(args);
00334         if (ret != 0)
00335             ((FemMeshPy*)self)->startNotify();
00336         return ret;
00337     }
00338     catch(const Base::Exception& e) 
00339     {
00340         std::string str;
00341         str += "FreeCAD exception thrown (";
00342         str += e.what();
00343         str += ")";
00344         e.ReportException();
00345         PyErr_SetString(PyExc_Exception,str.c_str());
00346         return NULL;
00347     }
00348     catch(const boost::filesystem::filesystem_error& e) 
00349     {
00350         std::string str;
00351         str += "File system exception thrown (";
00352         
00353         
00354         str += e.what();
00355         str += ")\n";
00356         Base::Console().Error(str.c_str());
00357         PyErr_SetString(PyExc_Exception,str.c_str());
00358         return NULL;
00359     }
00360     catch(const Py::Exception&)
00361     {
00362         
00363         return NULL;
00364     }
00365     catch(const char* e) 
00366     {
00367         Base::Console().Error(e);
00368         PyErr_SetString(PyExc_Exception,e);
00369         return NULL;
00370     }
00371     
00372 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
00373     catch(const std::exception& e) 
00374     {
00375         std::string str;
00376         str += "FC++ exception thrown (";
00377         str += e.what();
00378         str += ")";
00379         Base::Console().Error(str.c_str());
00380         PyErr_SetString(PyExc_Exception,str.c_str());
00381         return NULL;
00382     }
00383     catch(...)  
00384     {
00385         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
00386         return NULL;
00387     }
00388 #endif
00389 }
00390 
00391 
00392 
00393 
00394 PyObject * FemMeshPy::staticCallback_addHypothesis (PyObject *self, PyObject *args)
00395 {
00396     
00397     if (!((PyObjectBase*) self)->isValid()){
00398         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00399         return NULL;
00400     }
00401 
00402     
00403     if (((PyObjectBase*) self)->isConst()){
00404         PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
00405         return NULL;
00406     }
00407 
00408     try { 
00409         PyObject* ret = ((FemMeshPy*)self)->addHypothesis(args);
00410         if (ret != 0)
00411             ((FemMeshPy*)self)->startNotify();
00412         return ret;
00413     }
00414     catch(const Base::Exception& e) 
00415     {
00416         std::string str;
00417         str += "FreeCAD exception thrown (";
00418         str += e.what();
00419         str += ")";
00420         e.ReportException();
00421         PyErr_SetString(PyExc_Exception,str.c_str());
00422         return NULL;
00423     }
00424     catch(const boost::filesystem::filesystem_error& e) 
00425     {
00426         std::string str;
00427         str += "File system exception thrown (";
00428         
00429         
00430         str += e.what();
00431         str += ")\n";
00432         Base::Console().Error(str.c_str());
00433         PyErr_SetString(PyExc_Exception,str.c_str());
00434         return NULL;
00435     }
00436     catch(const Py::Exception&)
00437     {
00438         
00439         return NULL;
00440     }
00441     catch(const char* e) 
00442     {
00443         Base::Console().Error(e);
00444         PyErr_SetString(PyExc_Exception,e);
00445         return NULL;
00446     }
00447     
00448 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
00449     catch(const std::exception& e) 
00450     {
00451         std::string str;
00452         str += "FC++ exception thrown (";
00453         str += e.what();
00454         str += ")";
00455         Base::Console().Error(str.c_str());
00456         PyErr_SetString(PyExc_Exception,str.c_str());
00457         return NULL;
00458     }
00459     catch(...)  
00460     {
00461         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
00462         return NULL;
00463     }
00464 #endif
00465 }
00466 
00467 
00468 
00469 
00470 PyObject * FemMeshPy::staticCallback_setStanardHypotheses (PyObject *self, PyObject *args)
00471 {
00472     
00473     if (!((PyObjectBase*) self)->isValid()){
00474         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00475         return NULL;
00476     }
00477 
00478     
00479     if (((PyObjectBase*) self)->isConst()){
00480         PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
00481         return NULL;
00482     }
00483 
00484     try { 
00485         PyObject* ret = ((FemMeshPy*)self)->setStanardHypotheses(args);
00486         if (ret != 0)
00487             ((FemMeshPy*)self)->startNotify();
00488         return ret;
00489     }
00490     catch(const Base::Exception& e) 
00491     {
00492         std::string str;
00493         str += "FreeCAD exception thrown (";
00494         str += e.what();
00495         str += ")";
00496         e.ReportException();
00497         PyErr_SetString(PyExc_Exception,str.c_str());
00498         return NULL;
00499     }
00500     catch(const boost::filesystem::filesystem_error& e) 
00501     {
00502         std::string str;
00503         str += "File system exception thrown (";
00504         
00505         
00506         str += e.what();
00507         str += ")\n";
00508         Base::Console().Error(str.c_str());
00509         PyErr_SetString(PyExc_Exception,str.c_str());
00510         return NULL;
00511     }
00512     catch(const Py::Exception&)
00513     {
00514         
00515         return NULL;
00516     }
00517     catch(const char* e) 
00518     {
00519         Base::Console().Error(e);
00520         PyErr_SetString(PyExc_Exception,e);
00521         return NULL;
00522     }
00523     
00524 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
00525     catch(const std::exception& e) 
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(...)  
00536     {
00537         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
00538         return NULL;
00539     }
00540 #endif
00541 }
00542 
00543 
00544 
00545 
00546 PyObject * FemMeshPy::staticCallback_addNode (PyObject *self, PyObject *args)
00547 {
00548     
00549     if (!((PyObjectBase*) self)->isValid()){
00550         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00551         return NULL;
00552     }
00553 
00554     
00555     if (((PyObjectBase*) self)->isConst()){
00556         PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
00557         return NULL;
00558     }
00559 
00560     try { 
00561         PyObject* ret = ((FemMeshPy*)self)->addNode(args);
00562         if (ret != 0)
00563             ((FemMeshPy*)self)->startNotify();
00564         return ret;
00565     }
00566     catch(const Base::Exception& e) 
00567     {
00568         std::string str;
00569         str += "FreeCAD exception thrown (";
00570         str += e.what();
00571         str += ")";
00572         e.ReportException();
00573         PyErr_SetString(PyExc_Exception,str.c_str());
00574         return NULL;
00575     }
00576     catch(const boost::filesystem::filesystem_error& e) 
00577     {
00578         std::string str;
00579         str += "File system exception thrown (";
00580         
00581         
00582         str += e.what();
00583         str += ")\n";
00584         Base::Console().Error(str.c_str());
00585         PyErr_SetString(PyExc_Exception,str.c_str());
00586         return NULL;
00587     }
00588     catch(const Py::Exception&)
00589     {
00590         
00591         return NULL;
00592     }
00593     catch(const char* e) 
00594     {
00595         Base::Console().Error(e);
00596         PyErr_SetString(PyExc_Exception,e);
00597         return NULL;
00598     }
00599     
00600 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
00601     catch(const std::exception& e) 
00602     {
00603         std::string str;
00604         str += "FC++ exception thrown (";
00605         str += e.what();
00606         str += ")";
00607         Base::Console().Error(str.c_str());
00608         PyErr_SetString(PyExc_Exception,str.c_str());
00609         return NULL;
00610     }
00611     catch(...)  
00612     {
00613         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
00614         return NULL;
00615     }
00616 #endif
00617 }
00618 
00619 
00620 
00621 
00622 PyObject * FemMeshPy::staticCallback_addEdge (PyObject *self, PyObject *args)
00623 {
00624     
00625     if (!((PyObjectBase*) self)->isValid()){
00626         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00627         return NULL;
00628     }
00629 
00630     
00631     if (((PyObjectBase*) self)->isConst()){
00632         PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
00633         return NULL;
00634     }
00635 
00636     try { 
00637         PyObject* ret = ((FemMeshPy*)self)->addEdge(args);
00638         if (ret != 0)
00639             ((FemMeshPy*)self)->startNotify();
00640         return ret;
00641     }
00642     catch(const Base::Exception& e) 
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 boost::filesystem::filesystem_error& e) 
00653     {
00654         std::string str;
00655         str += "File system exception thrown (";
00656         
00657         
00658         str += e.what();
00659         str += ")\n";
00660         Base::Console().Error(str.c_str());
00661         PyErr_SetString(PyExc_Exception,str.c_str());
00662         return NULL;
00663     }
00664     catch(const Py::Exception&)
00665     {
00666         
00667         return NULL;
00668     }
00669     catch(const char* e) 
00670     {
00671         Base::Console().Error(e);
00672         PyErr_SetString(PyExc_Exception,e);
00673         return NULL;
00674     }
00675     
00676 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
00677     catch(const std::exception& e) 
00678     {
00679         std::string str;
00680         str += "FC++ exception thrown (";
00681         str += e.what();
00682         str += ")";
00683         Base::Console().Error(str.c_str());
00684         PyErr_SetString(PyExc_Exception,str.c_str());
00685         return NULL;
00686     }
00687     catch(...)  
00688     {
00689         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
00690         return NULL;
00691     }
00692 #endif
00693 }
00694 
00695 
00696 
00697 
00698 PyObject * FemMeshPy::staticCallback_addFace (PyObject *self, PyObject *args)
00699 {
00700     
00701     if (!((PyObjectBase*) self)->isValid()){
00702         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00703         return NULL;
00704     }
00705 
00706     
00707     if (((PyObjectBase*) self)->isConst()){
00708         PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
00709         return NULL;
00710     }
00711 
00712     try { 
00713         PyObject* ret = ((FemMeshPy*)self)->addFace(args);
00714         if (ret != 0)
00715             ((FemMeshPy*)self)->startNotify();
00716         return ret;
00717     }
00718     catch(const Base::Exception& e) 
00719     {
00720         std::string str;
00721         str += "FreeCAD exception thrown (";
00722         str += e.what();
00723         str += ")";
00724         e.ReportException();
00725         PyErr_SetString(PyExc_Exception,str.c_str());
00726         return NULL;
00727     }
00728     catch(const boost::filesystem::filesystem_error& e) 
00729     {
00730         std::string str;
00731         str += "File system exception thrown (";
00732         
00733         
00734         str += e.what();
00735         str += ")\n";
00736         Base::Console().Error(str.c_str());
00737         PyErr_SetString(PyExc_Exception,str.c_str());
00738         return NULL;
00739     }
00740     catch(const Py::Exception&)
00741     {
00742         
00743         return NULL;
00744     }
00745     catch(const char* e) 
00746     {
00747         Base::Console().Error(e);
00748         PyErr_SetString(PyExc_Exception,e);
00749         return NULL;
00750     }
00751     
00752 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
00753     catch(const std::exception& e) 
00754     {
00755         std::string str;
00756         str += "FC++ exception thrown (";
00757         str += e.what();
00758         str += ")";
00759         Base::Console().Error(str.c_str());
00760         PyErr_SetString(PyExc_Exception,str.c_str());
00761         return NULL;
00762     }
00763     catch(...)  
00764     {
00765         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
00766         return NULL;
00767     }
00768 #endif
00769 }
00770 
00771 
00772 
00773 
00774 PyObject * FemMeshPy::staticCallback_addQuad (PyObject *self, PyObject *args)
00775 {
00776     
00777     if (!((PyObjectBase*) self)->isValid()){
00778         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00779         return NULL;
00780     }
00781 
00782     
00783     if (((PyObjectBase*) self)->isConst()){
00784         PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
00785         return NULL;
00786     }
00787 
00788     try { 
00789         PyObject* ret = ((FemMeshPy*)self)->addQuad(args);
00790         if (ret != 0)
00791             ((FemMeshPy*)self)->startNotify();
00792         return ret;
00793     }
00794     catch(const Base::Exception& e) 
00795     {
00796         std::string str;
00797         str += "FreeCAD exception thrown (";
00798         str += e.what();
00799         str += ")";
00800         e.ReportException();
00801         PyErr_SetString(PyExc_Exception,str.c_str());
00802         return NULL;
00803     }
00804     catch(const boost::filesystem::filesystem_error& e) 
00805     {
00806         std::string str;
00807         str += "File system exception thrown (";
00808         
00809         
00810         str += e.what();
00811         str += ")\n";
00812         Base::Console().Error(str.c_str());
00813         PyErr_SetString(PyExc_Exception,str.c_str());
00814         return NULL;
00815     }
00816     catch(const Py::Exception&)
00817     {
00818         
00819         return NULL;
00820     }
00821     catch(const char* e) 
00822     {
00823         Base::Console().Error(e);
00824         PyErr_SetString(PyExc_Exception,e);
00825         return NULL;
00826     }
00827     
00828 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
00829     catch(const std::exception& e) 
00830     {
00831         std::string str;
00832         str += "FC++ exception thrown (";
00833         str += e.what();
00834         str += ")";
00835         Base::Console().Error(str.c_str());
00836         PyErr_SetString(PyExc_Exception,str.c_str());
00837         return NULL;
00838     }
00839     catch(...)  
00840     {
00841         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
00842         return NULL;
00843     }
00844 #endif
00845 }
00846 
00847 
00848 
00849 
00850 PyObject * FemMeshPy::staticCallback_addVolume (PyObject *self, PyObject *args)
00851 {
00852     
00853     if (!((PyObjectBase*) self)->isValid()){
00854         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00855         return NULL;
00856     }
00857 
00858     
00859     if (((PyObjectBase*) self)->isConst()){
00860         PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
00861         return NULL;
00862     }
00863 
00864     try { 
00865         PyObject* ret = ((FemMeshPy*)self)->addVolume(args);
00866         if (ret != 0)
00867             ((FemMeshPy*)self)->startNotify();
00868         return ret;
00869     }
00870     catch(const Base::Exception& e) 
00871     {
00872         std::string str;
00873         str += "FreeCAD exception thrown (";
00874         str += e.what();
00875         str += ")";
00876         e.ReportException();
00877         PyErr_SetString(PyExc_Exception,str.c_str());
00878         return NULL;
00879     }
00880     catch(const boost::filesystem::filesystem_error& e) 
00881     {
00882         std::string str;
00883         str += "File system exception thrown (";
00884         
00885         
00886         str += e.what();
00887         str += ")\n";
00888         Base::Console().Error(str.c_str());
00889         PyErr_SetString(PyExc_Exception,str.c_str());
00890         return NULL;
00891     }
00892     catch(const Py::Exception&)
00893     {
00894         
00895         return NULL;
00896     }
00897     catch(const char* e) 
00898     {
00899         Base::Console().Error(e);
00900         PyErr_SetString(PyExc_Exception,e);
00901         return NULL;
00902     }
00903     
00904 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
00905     catch(const std::exception& e) 
00906     {
00907         std::string str;
00908         str += "FC++ exception thrown (";
00909         str += e.what();
00910         str += ")";
00911         Base::Console().Error(str.c_str());
00912         PyErr_SetString(PyExc_Exception,str.c_str());
00913         return NULL;
00914     }
00915     catch(...)  
00916     {
00917         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
00918         return NULL;
00919     }
00920 #endif
00921 }
00922 
00923 
00924 
00925 
00926 PyObject * FemMeshPy::staticCallback_read (PyObject *self, PyObject *args)
00927 {
00928     
00929     if (!((PyObjectBase*) self)->isValid()){
00930         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00931         return NULL;
00932     }
00933 
00934     
00935     if (((PyObjectBase*) self)->isConst()){
00936         PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
00937         return NULL;
00938     }
00939 
00940     try { 
00941         PyObject* ret = ((FemMeshPy*)self)->read(args);
00942         if (ret != 0)
00943             ((FemMeshPy*)self)->startNotify();
00944         return ret;
00945     }
00946     catch(const Base::Exception& e) 
00947     {
00948         std::string str;
00949         str += "FreeCAD exception thrown (";
00950         str += e.what();
00951         str += ")";
00952         e.ReportException();
00953         PyErr_SetString(PyExc_Exception,str.c_str());
00954         return NULL;
00955     }
00956     catch(const boost::filesystem::filesystem_error& e) 
00957     {
00958         std::string str;
00959         str += "File system exception thrown (";
00960         
00961         
00962         str += e.what();
00963         str += ")\n";
00964         Base::Console().Error(str.c_str());
00965         PyErr_SetString(PyExc_Exception,str.c_str());
00966         return NULL;
00967     }
00968     catch(const Py::Exception&)
00969     {
00970         
00971         return NULL;
00972     }
00973     catch(const char* e) 
00974     {
00975         Base::Console().Error(e);
00976         PyErr_SetString(PyExc_Exception,e);
00977         return NULL;
00978     }
00979     
00980 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
00981     catch(const std::exception& e) 
00982     {
00983         std::string str;
00984         str += "FC++ exception thrown (";
00985         str += e.what();
00986         str += ")";
00987         Base::Console().Error(str.c_str());
00988         PyErr_SetString(PyExc_Exception,str.c_str());
00989         return NULL;
00990     }
00991     catch(...)  
00992     {
00993         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
00994         return NULL;
00995     }
00996 #endif
00997 }
00998 
00999 
01000 
01001 
01002 PyObject * FemMeshPy::staticCallback_write (PyObject *self, PyObject *args)
01003 {
01004     
01005     if (!((PyObjectBase*) self)->isValid()){
01006         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01007         return NULL;
01008     }
01009 
01010 
01011     try { 
01012         PyObject* ret = ((FemMeshPy*)self)->write(args);
01013         return ret;
01014     }
01015     catch(const Base::Exception& e) 
01016     {
01017         std::string str;
01018         str += "FreeCAD exception thrown (";
01019         str += e.what();
01020         str += ")";
01021         e.ReportException();
01022         PyErr_SetString(PyExc_Exception,str.c_str());
01023         return NULL;
01024     }
01025     catch(const boost::filesystem::filesystem_error& e) 
01026     {
01027         std::string str;
01028         str += "File system exception thrown (";
01029         
01030         
01031         str += e.what();
01032         str += ")\n";
01033         Base::Console().Error(str.c_str());
01034         PyErr_SetString(PyExc_Exception,str.c_str());
01035         return NULL;
01036     }
01037     catch(const Py::Exception&)
01038     {
01039         
01040         return NULL;
01041     }
01042     catch(const char* e) 
01043     {
01044         Base::Console().Error(e);
01045         PyErr_SetString(PyExc_Exception,e);
01046         return NULL;
01047     }
01048     
01049 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
01050     catch(const std::exception& e) 
01051     {
01052         std::string str;
01053         str += "FC++ exception thrown (";
01054         str += e.what();
01055         str += ")";
01056         Base::Console().Error(str.c_str());
01057         PyErr_SetString(PyExc_Exception,str.c_str());
01058         return NULL;
01059     }
01060     catch(...)  
01061     {
01062         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
01063         return NULL;
01064     }
01065 #endif
01066 }
01067 
01068 
01069 
01070 
01071 PyObject * FemMeshPy::staticCallback_writeABAQUS (PyObject *self, PyObject *args)
01072 {
01073     
01074     if (!((PyObjectBase*) self)->isValid()){
01075         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01076         return NULL;
01077     }
01078 
01079 
01080     try { 
01081         PyObject* ret = ((FemMeshPy*)self)->writeABAQUS(args);
01082         return ret;
01083     }
01084     catch(const Base::Exception& e) 
01085     {
01086         std::string str;
01087         str += "FreeCAD exception thrown (";
01088         str += e.what();
01089         str += ")";
01090         e.ReportException();
01091         PyErr_SetString(PyExc_Exception,str.c_str());
01092         return NULL;
01093     }
01094     catch(const boost::filesystem::filesystem_error& e) 
01095     {
01096         std::string str;
01097         str += "File system exception thrown (";
01098         
01099         
01100         str += e.what();
01101         str += ")\n";
01102         Base::Console().Error(str.c_str());
01103         PyErr_SetString(PyExc_Exception,str.c_str());
01104         return NULL;
01105     }
01106     catch(const Py::Exception&)
01107     {
01108         
01109         return NULL;
01110     }
01111     catch(const char* e) 
01112     {
01113         Base::Console().Error(e);
01114         PyErr_SetString(PyExc_Exception,e);
01115         return NULL;
01116     }
01117     
01118 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
01119     catch(const std::exception& e) 
01120     {
01121         std::string str;
01122         str += "FC++ exception thrown (";
01123         str += e.what();
01124         str += ")";
01125         Base::Console().Error(str.c_str());
01126         PyErr_SetString(PyExc_Exception,str.c_str());
01127         return NULL;
01128     }
01129     catch(...)  
01130     {
01131         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
01132         return NULL;
01133     }
01134 #endif
01135 }
01136 
01137 
01138 
01139 
01140 PyObject * FemMeshPy::staticCallback_setTransform (PyObject *self, PyObject *args)
01141 {
01142     
01143     if (!((PyObjectBase*) self)->isValid()){
01144         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01145         return NULL;
01146     }
01147 
01148     
01149     if (((PyObjectBase*) self)->isConst()){
01150         PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
01151         return NULL;
01152     }
01153 
01154     try { 
01155         PyObject* ret = ((FemMeshPy*)self)->setTransform(args);
01156         if (ret != 0)
01157             ((FemMeshPy*)self)->startNotify();
01158         return ret;
01159     }
01160     catch(const Base::Exception& e) 
01161     {
01162         std::string str;
01163         str += "FreeCAD exception thrown (";
01164         str += e.what();
01165         str += ")";
01166         e.ReportException();
01167         PyErr_SetString(PyExc_Exception,str.c_str());
01168         return NULL;
01169     }
01170     catch(const boost::filesystem::filesystem_error& e) 
01171     {
01172         std::string str;
01173         str += "File system exception thrown (";
01174         
01175         
01176         str += e.what();
01177         str += ")\n";
01178         Base::Console().Error(str.c_str());
01179         PyErr_SetString(PyExc_Exception,str.c_str());
01180         return NULL;
01181     }
01182     catch(const Py::Exception&)
01183     {
01184         
01185         return NULL;
01186     }
01187     catch(const char* e) 
01188     {
01189         Base::Console().Error(e);
01190         PyErr_SetString(PyExc_Exception,e);
01191         return NULL;
01192     }
01193     
01194 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
01195     catch(const std::exception& e) 
01196     {
01197         std::string str;
01198         str += "FC++ exception thrown (";
01199         str += e.what();
01200         str += ")";
01201         Base::Console().Error(str.c_str());
01202         PyErr_SetString(PyExc_Exception,str.c_str());
01203         return NULL;
01204     }
01205     catch(...)  
01206     {
01207         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
01208         return NULL;
01209     }
01210 #endif
01211 }
01212 
01213 
01214 
01215 
01216 PyObject * FemMeshPy::staticCallback_copy (PyObject *self, PyObject *args)
01217 {
01218     
01219     if (!((PyObjectBase*) self)->isValid()){
01220         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01221         return NULL;
01222     }
01223 
01224     
01225     if (((PyObjectBase*) self)->isConst()){
01226         PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
01227         return NULL;
01228     }
01229 
01230     try { 
01231         PyObject* ret = ((FemMeshPy*)self)->copy(args);
01232         if (ret != 0)
01233             ((FemMeshPy*)self)->startNotify();
01234         return ret;
01235     }
01236     catch(const Base::Exception& e) 
01237     {
01238         std::string str;
01239         str += "FreeCAD exception thrown (";
01240         str += e.what();
01241         str += ")";
01242         e.ReportException();
01243         PyErr_SetString(PyExc_Exception,str.c_str());
01244         return NULL;
01245     }
01246     catch(const boost::filesystem::filesystem_error& e) 
01247     {
01248         std::string str;
01249         str += "File system exception thrown (";
01250         
01251         
01252         str += e.what();
01253         str += ")\n";
01254         Base::Console().Error(str.c_str());
01255         PyErr_SetString(PyExc_Exception,str.c_str());
01256         return NULL;
01257     }
01258     catch(const Py::Exception&)
01259     {
01260         
01261         return NULL;
01262     }
01263     catch(const char* e) 
01264     {
01265         Base::Console().Error(e);
01266         PyErr_SetString(PyExc_Exception,e);
01267         return NULL;
01268     }
01269     
01270 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
01271     catch(const std::exception& e) 
01272     {
01273         std::string str;
01274         str += "FC++ exception thrown (";
01275         str += e.what();
01276         str += ")";
01277         Base::Console().Error(str.c_str());
01278         PyErr_SetString(PyExc_Exception,str.c_str());
01279         return NULL;
01280     }
01281     catch(...)  
01282     {
01283         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
01284         return NULL;
01285     }
01286 #endif
01287 }
01288 
01289 
01290 
01291 
01292 PyObject * FemMeshPy::staticCallback_getNodeCount (PyObject *self, void * )
01293 {
01294     if (!((PyObjectBase*) self)->isValid()){
01295         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01296         return NULL;
01297     }
01298 
01299     try {
01300         return Py::new_reference_to(((FemMeshPy*)self)->getNodeCount());
01301     } catch (const Py::Exception&) {
01302         
01303         return NULL;
01304     } catch (...) {
01305         PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'NodeCount' of object 'FemMesh'");
01306         return NULL;
01307     }
01308 }
01309 
01310 int FemMeshPy::staticCallback_setNodeCount (PyObject *self, PyObject * , void * )
01311 {
01312     if (!((PyObjectBase*) self)->isValid()){
01313         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01314         return -1;
01315     }
01316 
01317     PyErr_SetString(PyExc_AttributeError, "Attribute 'NodeCount' of object 'FemMesh' is read-only");
01318     return -1;
01319 }
01320 
01321 
01322 
01323 
01324 PyObject * FemMeshPy::staticCallback_getEdgeCount (PyObject *self, void * )
01325 {
01326     if (!((PyObjectBase*) self)->isValid()){
01327         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01328         return NULL;
01329     }
01330 
01331     try {
01332         return Py::new_reference_to(((FemMeshPy*)self)->getEdgeCount());
01333     } catch (const Py::Exception&) {
01334         
01335         return NULL;
01336     } catch (...) {
01337         PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'EdgeCount' of object 'FemMesh'");
01338         return NULL;
01339     }
01340 }
01341 
01342 int FemMeshPy::staticCallback_setEdgeCount (PyObject *self, PyObject * , void * )
01343 {
01344     if (!((PyObjectBase*) self)->isValid()){
01345         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01346         return -1;
01347     }
01348 
01349     PyErr_SetString(PyExc_AttributeError, "Attribute 'EdgeCount' of object 'FemMesh' is read-only");
01350     return -1;
01351 }
01352 
01353 
01354 
01355 
01356 PyObject * FemMeshPy::staticCallback_getFacesCount (PyObject *self, void * )
01357 {
01358     if (!((PyObjectBase*) self)->isValid()){
01359         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01360         return NULL;
01361     }
01362 
01363     try {
01364         return Py::new_reference_to(((FemMeshPy*)self)->getFacesCount());
01365     } catch (const Py::Exception&) {
01366         
01367         return NULL;
01368     } catch (...) {
01369         PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'FacesCount' of object 'FemMesh'");
01370         return NULL;
01371     }
01372 }
01373 
01374 int FemMeshPy::staticCallback_setFacesCount (PyObject *self, PyObject * , void * )
01375 {
01376     if (!((PyObjectBase*) self)->isValid()){
01377         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01378         return -1;
01379     }
01380 
01381     PyErr_SetString(PyExc_AttributeError, "Attribute 'FacesCount' of object 'FemMesh' is read-only");
01382     return -1;
01383 }
01384 
01385 
01386 
01387 
01388 PyObject * FemMeshPy::staticCallback_getTriangleCount (PyObject *self, void * )
01389 {
01390     if (!((PyObjectBase*) self)->isValid()){
01391         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01392         return NULL;
01393     }
01394 
01395     try {
01396         return Py::new_reference_to(((FemMeshPy*)self)->getTriangleCount());
01397     } catch (const Py::Exception&) {
01398         
01399         return NULL;
01400     } catch (...) {
01401         PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'TriangleCount' of object 'FemMesh'");
01402         return NULL;
01403     }
01404 }
01405 
01406 int FemMeshPy::staticCallback_setTriangleCount (PyObject *self, PyObject * , void * )
01407 {
01408     if (!((PyObjectBase*) self)->isValid()){
01409         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01410         return -1;
01411     }
01412 
01413     PyErr_SetString(PyExc_AttributeError, "Attribute 'TriangleCount' of object 'FemMesh' is read-only");
01414     return -1;
01415 }
01416 
01417 
01418 
01419 
01420 PyObject * FemMeshPy::staticCallback_getQuadrangleCount (PyObject *self, void * )
01421 {
01422     if (!((PyObjectBase*) self)->isValid()){
01423         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01424         return NULL;
01425     }
01426 
01427     try {
01428         return Py::new_reference_to(((FemMeshPy*)self)->getQuadrangleCount());
01429     } catch (const Py::Exception&) {
01430         
01431         return NULL;
01432     } catch (...) {
01433         PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'QuadrangleCount' of object 'FemMesh'");
01434         return NULL;
01435     }
01436 }
01437 
01438 int FemMeshPy::staticCallback_setQuadrangleCount (PyObject *self, PyObject * , void * )
01439 {
01440     if (!((PyObjectBase*) self)->isValid()){
01441         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01442         return -1;
01443     }
01444 
01445     PyErr_SetString(PyExc_AttributeError, "Attribute 'QuadrangleCount' of object 'FemMesh' is read-only");
01446     return -1;
01447 }
01448 
01449 
01450 
01451 
01452 PyObject * FemMeshPy::staticCallback_getPolygonCount (PyObject *self, void * )
01453 {
01454     if (!((PyObjectBase*) self)->isValid()){
01455         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01456         return NULL;
01457     }
01458 
01459     try {
01460         return Py::new_reference_to(((FemMeshPy*)self)->getPolygonCount());
01461     } catch (const Py::Exception&) {
01462         
01463         return NULL;
01464     } catch (...) {
01465         PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'PolygonCount' of object 'FemMesh'");
01466         return NULL;
01467     }
01468 }
01469 
01470 int FemMeshPy::staticCallback_setPolygonCount (PyObject *self, PyObject * , void * )
01471 {
01472     if (!((PyObjectBase*) self)->isValid()){
01473         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01474         return -1;
01475     }
01476 
01477     PyErr_SetString(PyExc_AttributeError, "Attribute 'PolygonCount' of object 'FemMesh' is read-only");
01478     return -1;
01479 }
01480 
01481 
01482 
01483 
01484 PyObject * FemMeshPy::staticCallback_getVolumeCount (PyObject *self, void * )
01485 {
01486     if (!((PyObjectBase*) self)->isValid()){
01487         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01488         return NULL;
01489     }
01490 
01491     try {
01492         return Py::new_reference_to(((FemMeshPy*)self)->getVolumeCount());
01493     } catch (const Py::Exception&) {
01494         
01495         return NULL;
01496     } catch (...) {
01497         PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'VolumeCount' of object 'FemMesh'");
01498         return NULL;
01499     }
01500 }
01501 
01502 int FemMeshPy::staticCallback_setVolumeCount (PyObject *self, PyObject * , void * )
01503 {
01504     if (!((PyObjectBase*) self)->isValid()){
01505         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01506         return -1;
01507     }
01508 
01509     PyErr_SetString(PyExc_AttributeError, "Attribute 'VolumeCount' of object 'FemMesh' is read-only");
01510     return -1;
01511 }
01512 
01513 
01514 
01515 
01516 PyObject * FemMeshPy::staticCallback_getTetraCount (PyObject *self, void * )
01517 {
01518     if (!((PyObjectBase*) self)->isValid()){
01519         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01520         return NULL;
01521     }
01522 
01523     try {
01524         return Py::new_reference_to(((FemMeshPy*)self)->getTetraCount());
01525     } catch (const Py::Exception&) {
01526         
01527         return NULL;
01528     } catch (...) {
01529         PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'TetraCount' of object 'FemMesh'");
01530         return NULL;
01531     }
01532 }
01533 
01534 int FemMeshPy::staticCallback_setTetraCount (PyObject *self, PyObject * , void * )
01535 {
01536     if (!((PyObjectBase*) self)->isValid()){
01537         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01538         return -1;
01539     }
01540 
01541     PyErr_SetString(PyExc_AttributeError, "Attribute 'TetraCount' of object 'FemMesh' is read-only");
01542     return -1;
01543 }
01544 
01545 
01546 
01547 
01548 PyObject * FemMeshPy::staticCallback_getHexaCount (PyObject *self, void * )
01549 {
01550     if (!((PyObjectBase*) self)->isValid()){
01551         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01552         return NULL;
01553     }
01554 
01555     try {
01556         return Py::new_reference_to(((FemMeshPy*)self)->getHexaCount());
01557     } catch (const Py::Exception&) {
01558         
01559         return NULL;
01560     } catch (...) {
01561         PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'HexaCount' of object 'FemMesh'");
01562         return NULL;
01563     }
01564 }
01565 
01566 int FemMeshPy::staticCallback_setHexaCount (PyObject *self, PyObject * , void * )
01567 {
01568     if (!((PyObjectBase*) self)->isValid()){
01569         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01570         return -1;
01571     }
01572 
01573     PyErr_SetString(PyExc_AttributeError, "Attribute 'HexaCount' of object 'FemMesh' is read-only");
01574     return -1;
01575 }
01576 
01577 
01578 
01579 
01580 PyObject * FemMeshPy::staticCallback_getPyramidCount (PyObject *self, void * )
01581 {
01582     if (!((PyObjectBase*) self)->isValid()){
01583         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01584         return NULL;
01585     }
01586 
01587     try {
01588         return Py::new_reference_to(((FemMeshPy*)self)->getPyramidCount());
01589     } catch (const Py::Exception&) {
01590         
01591         return NULL;
01592     } catch (...) {
01593         PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'PyramidCount' of object 'FemMesh'");
01594         return NULL;
01595     }
01596 }
01597 
01598 int FemMeshPy::staticCallback_setPyramidCount (PyObject *self, PyObject * , void * )
01599 {
01600     if (!((PyObjectBase*) self)->isValid()){
01601         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01602         return -1;
01603     }
01604 
01605     PyErr_SetString(PyExc_AttributeError, "Attribute 'PyramidCount' of object 'FemMesh' is read-only");
01606     return -1;
01607 }
01608 
01609 
01610 
01611 
01612 PyObject * FemMeshPy::staticCallback_getPrismCount (PyObject *self, void * )
01613 {
01614     if (!((PyObjectBase*) self)->isValid()){
01615         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01616         return NULL;
01617     }
01618 
01619     try {
01620         return Py::new_reference_to(((FemMeshPy*)self)->getPrismCount());
01621     } catch (const Py::Exception&) {
01622         
01623         return NULL;
01624     } catch (...) {
01625         PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'PrismCount' of object 'FemMesh'");
01626         return NULL;
01627     }
01628 }
01629 
01630 int FemMeshPy::staticCallback_setPrismCount (PyObject *self, PyObject * , void * )
01631 {
01632     if (!((PyObjectBase*) self)->isValid()){
01633         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01634         return -1;
01635     }
01636 
01637     PyErr_SetString(PyExc_AttributeError, "Attribute 'PrismCount' of object 'FemMesh' is read-only");
01638     return -1;
01639 }
01640 
01641 
01642 
01643 
01644 PyObject * FemMeshPy::staticCallback_getPolyhedronCount (PyObject *self, void * )
01645 {
01646     if (!((PyObjectBase*) self)->isValid()){
01647         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01648         return NULL;
01649     }
01650 
01651     try {
01652         return Py::new_reference_to(((FemMeshPy*)self)->getPolyhedronCount());
01653     } catch (const Py::Exception&) {
01654         
01655         return NULL;
01656     } catch (...) {
01657         PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'PolyhedronCount' of object 'FemMesh'");
01658         return NULL;
01659     }
01660 }
01661 
01662 int FemMeshPy::staticCallback_setPolyhedronCount (PyObject *self, PyObject * , void * )
01663 {
01664     if (!((PyObjectBase*) self)->isValid()){
01665         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01666         return -1;
01667     }
01668 
01669     PyErr_SetString(PyExc_AttributeError, "Attribute 'PolyhedronCount' of object 'FemMesh' is read-only");
01670     return -1;
01671 }
01672 
01673 
01674 
01675 
01676 PyObject * FemMeshPy::staticCallback_getSubMeshCount (PyObject *self, void * )
01677 {
01678     if (!((PyObjectBase*) self)->isValid()){
01679         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01680         return NULL;
01681     }
01682 
01683     try {
01684         return Py::new_reference_to(((FemMeshPy*)self)->getSubMeshCount());
01685     } catch (const Py::Exception&) {
01686         
01687         return NULL;
01688     } catch (...) {
01689         PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'SubMeshCount' of object 'FemMesh'");
01690         return NULL;
01691     }
01692 }
01693 
01694 int FemMeshPy::staticCallback_setSubMeshCount (PyObject *self, PyObject * , void * )
01695 {
01696     if (!((PyObjectBase*) self)->isValid()){
01697         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01698         return -1;
01699     }
01700 
01701     PyErr_SetString(PyExc_AttributeError, "Attribute 'SubMeshCount' of object 'FemMesh' is read-only");
01702     return -1;
01703 }
01704 
01705 
01706 
01707 
01708 PyObject * FemMeshPy::staticCallback_getGroupCount (PyObject *self, void * )
01709 {
01710     if (!((PyObjectBase*) self)->isValid()){
01711         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01712         return NULL;
01713     }
01714 
01715     try {
01716         return Py::new_reference_to(((FemMeshPy*)self)->getGroupCount());
01717     } catch (const Py::Exception&) {
01718         
01719         return NULL;
01720     } catch (...) {
01721         PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'GroupCount' of object 'FemMesh'");
01722         return NULL;
01723     }
01724 }
01725 
01726 int FemMeshPy::staticCallback_setGroupCount (PyObject *self, PyObject * , void * )
01727 {
01728     if (!((PyObjectBase*) self)->isValid()){
01729         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01730         return -1;
01731     }
01732 
01733     PyErr_SetString(PyExc_AttributeError, "Attribute 'GroupCount' of object 'FemMesh' is read-only");
01734     return -1;
01735 }
01736 
01737 
01738 
01739 
01740 
01741 
01742 PyParentObject FemMeshPy::Parents[] = { PARENTSFemFemMeshPy };
01743 
01744 
01745 
01746 
01747 FemMeshPy::FemMeshPy(FemMesh *pcObject, PyTypeObject *T)
01748     : ComplexGeoDataPy(reinterpret_cast<ComplexGeoDataPy::PointerType>(pcObject), T)
01749 {
01750 }
01751 
01752 
01753 
01754 
01755 
01756 FemMeshPy::~FemMeshPy()                                
01757 {
01758 }
01759 
01760 
01761 
01762 
01763 PyObject *FemMeshPy::_repr(void)
01764 {
01765     return Py_BuildValue("s", representation().c_str());
01766 }
01767 
01768 
01769 
01770 
01771 PyObject *FemMeshPy::_getattr(char *attr)                               
01772 {
01773     try {
01774         
01775         PyObject *r = getCustomAttributes(attr);
01776         if(r) return r;
01777     }
01778 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
01779     catch(const Base::Exception& e) 
01780     {
01781         std::string str;
01782         str += "FreeCAD exception thrown (";
01783         str += e.what();
01784         str += ")";
01785         e.ReportException();
01786         PyErr_SetString(PyExc_Exception,str.c_str());
01787         return NULL;
01788     }
01789     catch(const std::exception& e) 
01790     {
01791         std::string str;
01792         str += "FC++ exception thrown (";
01793         str += e.what();
01794         str += ")";
01795         Base::Console().Error(str.c_str());
01796         PyErr_SetString(PyExc_Exception,str.c_str());
01797         return NULL;
01798     }
01799     catch(const Py::Exception&)
01800     {
01801         
01802         return NULL;
01803     }
01804     catch(...)  
01805     {
01806         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
01807         return NULL;
01808     }
01809 #else  // DONT_CATCH_CXX_EXCEPTIONS  
01810     catch(const Base::Exception& e) 
01811     {
01812         std::string str;
01813         str += "FreeCAD exception thrown (";
01814         str += e.what();
01815         str += ")";
01816         e.ReportException();
01817         PyErr_SetString(PyExc_Exception,str.c_str());
01818         return NULL;
01819     }
01820     catch(const Py::Exception&)
01821     {
01822         
01823         return NULL;
01824     }
01825 #endif  // DONT_CATCH_CXX_EXCEPTIONS
01826 
01827     PyObject *rvalue = Py_FindMethod(Methods, this, attr);
01828     if (rvalue == NULL)
01829     {
01830         PyErr_Clear();
01831         return ComplexGeoDataPy::_getattr(attr);
01832     }
01833     else
01834     {
01835         return rvalue;
01836     }
01837 }
01838 
01839 int FemMeshPy::_setattr(char *attr, PyObject *value)    
01840 {
01841     try {
01842         
01843         int r = setCustomAttributes(attr, value);
01844         if(r==1) return 0;
01845     }
01846 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
01847     catch(const Base::Exception& e) 
01848     {
01849         std::string str;
01850         str += "FreeCAD exception thrown (";
01851         str += e.what();
01852         str += ")";
01853         e.ReportException();
01854         PyErr_SetString(PyExc_Exception,str.c_str());
01855         return -1;
01856     }
01857     catch(const std::exception& e) 
01858     {
01859         std::string str;
01860         str += "FC++ exception thrown (";
01861         str += e.what();
01862         str += ")";
01863         Base::Console().Error(str.c_str());
01864         PyErr_SetString(PyExc_Exception,str.c_str());
01865         return -1;
01866     }
01867     catch(const Py::Exception&)
01868     {
01869         
01870         return -1;
01871     }
01872     catch(...)  
01873     {
01874         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
01875         return -1;
01876     }
01877 #else  // DONT_CATCH_CXX_EXCEPTIONS  
01878     catch(const Base::Exception& e) 
01879     {
01880         std::string str;
01881         str += "FreeCAD exception thrown (";
01882         str += e.what();
01883         str += ")";
01884         e.ReportException();
01885         PyErr_SetString(PyExc_Exception,str.c_str());
01886         return -1;
01887     }
01888     catch(const Py::Exception&)
01889     {
01890         
01891         return -1;
01892     }
01893 #endif  // DONT_CATCH_CXX_EXCEPTIONS
01894 
01895     return ComplexGeoDataPy::_setattr(attr, value);
01896 }
01897 
01898 FemMesh *FemMeshPy::getFemMeshPtr(void) const
01899 {
01900     return static_cast<FemMesh *>(_pcTwinPointer);
01901 }
01902 
01903 #if 0
01904 
01905 
01906 
01907 
01908 PyObject *FemMeshPy::PyMake(struct _typeobject *, PyObject *, PyObject *)  
01909 {
01910     
01911     return new FemMeshPy(new FemMesh);
01912 }
01913 
01914 
01915 int FemMeshPy::PyInit(PyObject* , PyObject* )
01916 {
01917     return 0;
01918 }
01919 
01920 
01921 std::string FemMeshPy::representation(void) const
01922 {
01923     return std::string("<FemMesh object>");
01924 }
01925 
01926 PyObject* FemMeshPy::setShape(PyObject *args)
01927 {
01928     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
01929     return 0;
01930 }
01931 
01932 PyObject* FemMeshPy::compute(PyObject *args)
01933 {
01934     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
01935     return 0;
01936 }
01937 
01938 PyObject* FemMeshPy::addHypothesis(PyObject *args)
01939 {
01940     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
01941     return 0;
01942 }
01943 
01944 PyObject* FemMeshPy::setStanardHypotheses(PyObject *args)
01945 {
01946     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
01947     return 0;
01948 }
01949 
01950 PyObject* FemMeshPy::addNode(PyObject *args)
01951 {
01952     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
01953     return 0;
01954 }
01955 
01956 PyObject* FemMeshPy::addEdge(PyObject *args)
01957 {
01958     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
01959     return 0;
01960 }
01961 
01962 PyObject* FemMeshPy::addFace(PyObject *args)
01963 {
01964     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
01965     return 0;
01966 }
01967 
01968 PyObject* FemMeshPy::addQuad(PyObject *args)
01969 {
01970     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
01971     return 0;
01972 }
01973 
01974 PyObject* FemMeshPy::addVolume(PyObject *args)
01975 {
01976     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
01977     return 0;
01978 }
01979 
01980 PyObject* FemMeshPy::read(PyObject *args)
01981 {
01982     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
01983     return 0;
01984 }
01985 
01986 PyObject* FemMeshPy::write(PyObject *args)
01987 {
01988     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
01989     return 0;
01990 }
01991 
01992 PyObject* FemMeshPy::writeABAQUS(PyObject *args)
01993 {
01994     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
01995     return 0;
01996 }
01997 
01998 PyObject* FemMeshPy::setTransform(PyObject *args)
01999 {
02000     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
02001     return 0;
02002 }
02003 
02004 PyObject* FemMeshPy::copy(PyObject *args)
02005 {
02006     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
02007     return 0;
02008 }
02009 
02010 
02011 
02012 Py::Int FemMeshPy::getNodeCount(void) const
02013 {
02014     
02015     throw Py::AttributeError("Not yet implemented");
02016 }
02017 
02018 Py::Int FemMeshPy::getEdgeCount(void) const
02019 {
02020     
02021     throw Py::AttributeError("Not yet implemented");
02022 }
02023 
02024 Py::Int FemMeshPy::getFacesCount(void) const
02025 {
02026     
02027     throw Py::AttributeError("Not yet implemented");
02028 }
02029 
02030 Py::Int FemMeshPy::getTriangleCount(void) const
02031 {
02032     
02033     throw Py::AttributeError("Not yet implemented");
02034 }
02035 
02036 Py::Int FemMeshPy::getQuadrangleCount(void) const
02037 {
02038     
02039     throw Py::AttributeError("Not yet implemented");
02040 }
02041 
02042 Py::Int FemMeshPy::getPolygonCount(void) const
02043 {
02044     
02045     throw Py::AttributeError("Not yet implemented");
02046 }
02047 
02048 Py::Int FemMeshPy::getVolumeCount(void) const
02049 {
02050     
02051     throw Py::AttributeError("Not yet implemented");
02052 }
02053 
02054 Py::Int FemMeshPy::getTetraCount(void) const
02055 {
02056     
02057     throw Py::AttributeError("Not yet implemented");
02058 }
02059 
02060 Py::Int FemMeshPy::getHexaCount(void) const
02061 {
02062     
02063     throw Py::AttributeError("Not yet implemented");
02064 }
02065 
02066 Py::Int FemMeshPy::getPyramidCount(void) const
02067 {
02068     
02069     throw Py::AttributeError("Not yet implemented");
02070 }
02071 
02072 Py::Int FemMeshPy::getPrismCount(void) const
02073 {
02074     
02075     throw Py::AttributeError("Not yet implemented");
02076 }
02077 
02078 Py::Int FemMeshPy::getPolyhedronCount(void) const
02079 {
02080     
02081     throw Py::AttributeError("Not yet implemented");
02082 }
02083 
02084 Py::Int FemMeshPy::getSubMeshCount(void) const
02085 {
02086     
02087     throw Py::AttributeError("Not yet implemented");
02088 }
02089 
02090 Py::Int FemMeshPy::getGroupCount(void) const
02091 {
02092     
02093     throw Py::AttributeError("Not yet implemented");
02094 }
02095 
02096 PyObject *FemMeshPy::getCustomAttributes(const char* attr) const
02097 {
02098     return 0;
02099 }
02100 
02101 int FemMeshPy::setCustomAttributes(const char* attr, PyObject *obj)
02102 {
02103     return 0; 
02104 }
02105 #endif
02106 
02107 
02108