MeshPy.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 MeshPyImp.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 Mesh;
00018 
00020 PyTypeObject MeshPy::Type = {
00021     PyObject_HEAD_INIT(&PyType_Type)
00022     0,                                                /*ob_size*/
00023     "Mesh.MeshObject",     /*tp_name*/
00024     sizeof(MeshPy),                       /*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     "Mesh() -- Create an empty mesh object.\n"
00046     "\n"
00047     "This class allows one to manipulate the mesh object by adding new facets, deleting facets, importing from an STL file,\n"
00048     "transforming the mesh and much more.\n"
00049     "For a complete overview of what can be done see also the documentation of mesh.\n"
00050     "A mesh object cannot be added to an existing document directly. Therefore the document must create an object\n"
00051     "with a property class that supports meshes.\n"
00052     "Example:\n"
00053     "  m = Mesh.Mesh()\n"
00054     "  ... # Manipulate the mesh\n"
00055     "  d = FreeCAD.activeDocument() # Get a reference to the actie document\n"
00056     "  f = d.addObject(\"Mesh::Feature\", \"Mesh\") # Create a mesh feature\n"
00057     "  f.Mesh = m # Assign the mesh object to the internal property\n"
00058     "  d.recompute()",           /*tp_doc */
00059     0,                                                /*tp_traverse */
00060     0,                                                /*tp_clear */
00061     0,                                                /*tp_richcompare */
00062     0,                                                /*tp_weaklistoffset */
00063     0,                                                /*tp_iter */
00064     0,                                                /*tp_iternext */
00065     Mesh::MeshPy::Methods,                     /*tp_methods */
00066     0,                                                /*tp_members */
00067     Mesh::MeshPy::GetterSetter,                     /*tp_getset */
00068     &Data::ComplexGeoDataPy::Type,                        /*tp_base */
00069     0,                                                /*tp_dict */
00070     0,                                                /*tp_descr_get */
00071     0,                                                /*tp_descr_set */
00072     0,                                                /*tp_dictoffset */
00073     __PyInit,                                         /*tp_init */
00074     0,                                                /*tp_alloc */
00075     Mesh::MeshPy::PyMake,/*tp_new */
00076     0,                                                /*tp_free   Low-level free-memory routine */
00077     0,                                                /*tp_is_gc  For PyObject_IS_GC */
00078     0,                                                /*tp_bases */
00079     0,                                                /*tp_mro    method resolution order */
00080     0,                                                /*tp_cache */
00081     0,                                                /*tp_subclasses */
00082     0,                                                /*tp_weaklist */
00083     0                                                 /*tp_del */
00084 };
00085 
00087 PyMethodDef MeshPy::Methods[] = {
00088     {"read",
00089         (PyCFunction) staticCallback_read,
00090         METH_VARARGS,
00091         "Read in a mesh object from file."
00092     },
00093     {"write",
00094         (PyCFunction) staticCallback_write,
00095         METH_VARARGS,
00096         "Write the mesh object into file."
00097     },
00098     {"writeInventor",
00099         (PyCFunction) staticCallback_writeInventor,
00100         METH_VARARGS,
00101         "Write the mesh in OpenInventor format to a string."
00102     },
00103     {"copy",
00104         (PyCFunction) staticCallback_copy,
00105         METH_VARARGS,
00106         "Create a copy of this mesh"
00107     },
00108     {"offset",
00109         (PyCFunction) staticCallback_offset,
00110         METH_VARARGS,
00111         "Move the point along their normals"
00112     },
00113     {"offsetSpecial",
00114         (PyCFunction) staticCallback_offsetSpecial,
00115         METH_VARARGS,
00116         "Move the point along their normals"
00117     },
00118     {"crossSections",
00119         (PyCFunction) staticCallback_crossSections,
00120         METH_VARARGS,
00121         "Get cross-sections of the mesh through several planes"
00122     },
00123     {"unite",
00124         (PyCFunction) staticCallback_unite,
00125         METH_VARARGS,
00126         "Union of this and the given mesh object."
00127     },
00128     {"intersect",
00129         (PyCFunction) staticCallback_intersect,
00130         METH_VARARGS,
00131         "Intersection of this and the given mesh object."
00132     },
00133     {"difference",
00134         (PyCFunction) staticCallback_difference,
00135         METH_VARARGS,
00136         "Difference of this and the given mesh object."
00137     },
00138     {"inner",
00139         (PyCFunction) staticCallback_inner,
00140         METH_VARARGS,
00141         "Get the part inside of the intersection"
00142     },
00143     {"outer",
00144         (PyCFunction) staticCallback_outer,
00145         METH_VARARGS,
00146         "Get the part outside the intersection"
00147     },
00148     {"coarsen",
00149         (PyCFunction) staticCallback_coarsen,
00150         METH_VARARGS,
00151         "Coarse the mesh"
00152     },
00153     {"translate",
00154         (PyCFunction) staticCallback_translate,
00155         METH_VARARGS,
00156         "Apply a translation to the mesh"
00157     },
00158     {"rotate",
00159         (PyCFunction) staticCallback_rotate,
00160         METH_VARARGS,
00161         "Apply a rotation to the mesh"
00162     },
00163     {"transform",
00164         (PyCFunction) staticCallback_transform,
00165         METH_VARARGS,
00166         "Apply a transformation to the mesh"
00167     },
00168     {"transformToEigen",
00169         (PyCFunction) staticCallback_transformToEigen,
00170         METH_VARARGS,
00171         "Transform the mesh to its eigenbase"
00172     },
00173     {"addFacet",
00174         (PyCFunction) staticCallback_addFacet,
00175         METH_VARARGS,
00176         "Add a facet to the mesh"
00177     },
00178     {"addFacets",
00179         (PyCFunction) staticCallback_addFacets,
00180         METH_VARARGS,
00181         "Add a list of facets to the mesh"
00182     },
00183     {"removeFacets",
00184         (PyCFunction) staticCallback_removeFacets,
00185         METH_VARARGS,
00186         "Remove a list of facet indices from the mesh"
00187     },
00188     {"addMesh",
00189         (PyCFunction) staticCallback_addMesh,
00190         METH_VARARGS,
00191         "Combine this mesh with another mesh."
00192     },
00193     {"setPoint",
00194         (PyCFunction) staticCallback_setPoint,
00195         METH_VARARGS,
00196         "\n                                     setPoint(int, Vector)\n                                 Sets the point at index.\n                              "
00197     },
00198     {"countSegments",
00199         (PyCFunction) staticCallback_countSegments,
00200         METH_VARARGS,
00201         "Get the number of segments which may also be 0"
00202     },
00203     {"getSegment",
00204         (PyCFunction) staticCallback_getSegment,
00205         METH_VARARGS,
00206         "Get a list of facet indices that describes a segment"
00207     },
00208     {"getSeparateComponents",
00209         (PyCFunction) staticCallback_getSeparateComponents,
00210         METH_VARARGS,
00211         "Returns a list containing the different\ncomponents (separated areas) of the mesh as separate meshes\n\nimport Mesh\nfor c in mesh.getSeparatecomponents():\n  Mesh.show(c)\n\n                                "
00212     },
00213     {"getFacetSelection",
00214         (PyCFunction) staticCallback_getFacetSelection,
00215         METH_VARARGS,
00216         "Get a list of the indices of selected facets"
00217     },
00218     {"getPointSelection",
00219         (PyCFunction) staticCallback_getPointSelection,
00220         METH_VARARGS,
00221         "Get a list of the indices of selected points"
00222     },
00223     {"meshFromSegment",
00224         (PyCFunction) staticCallback_meshFromSegment,
00225         METH_VARARGS,
00226         "Create a mesh from segment"
00227     },
00228     {"clear",
00229         (PyCFunction) staticCallback_clear,
00230         METH_VARARGS,
00231         "Clear the mesh"
00232     },
00233     {"isSolid",
00234         (PyCFunction) staticCallback_isSolid,
00235         METH_VARARGS,
00236         "Check if the mesh is a solid"
00237     },
00238     {"hasNonManifolds",
00239         (PyCFunction) staticCallback_hasNonManifolds,
00240         METH_VARARGS,
00241         "Check if the mesh has non-manifolds"
00242     },
00243     {"removeNonManifolds",
00244         (PyCFunction) staticCallback_removeNonManifolds,
00245         METH_VARARGS,
00246         "Remove non-manifolds"
00247     },
00248     {"hasSelfIntersections",
00249         (PyCFunction) staticCallback_hasSelfIntersections,
00250         METH_VARARGS,
00251         "Check if the mesh intersects itself"
00252     },
00253     {"fixSelfIntersections",
00254         (PyCFunction) staticCallback_fixSelfIntersections,
00255         METH_VARARGS,
00256         "Repair self-intersections"
00257     },
00258     {"removeFoldsOnSurface",
00259         (PyCFunction) staticCallback_removeFoldsOnSurface,
00260         METH_VARARGS,
00261         "Remove folds on surfaces"
00262     },
00263     {"hasNonUniformOrientedFacets",
00264         (PyCFunction) staticCallback_hasNonUniformOrientedFacets,
00265         METH_VARARGS,
00266         "Check if the mesh has facets with inconsistent orientation"
00267     },
00268     {"countNonUniformOrientedFacets",
00269         (PyCFunction) staticCallback_countNonUniformOrientedFacets,
00270         METH_VARARGS,
00271         "Get the number of wrong oriented facets"
00272     },
00273     {"countComponents",
00274         (PyCFunction) staticCallback_countComponents,
00275         METH_VARARGS,
00276         "Get the number of topologic independent areas"
00277     },
00278     {"removeComponents",
00279         (PyCFunction) staticCallback_removeComponents,
00280         METH_VARARGS,
00281         "Remove components with less or equal to number of given facets"
00282     },
00283     {"fixIndices",
00284         (PyCFunction) staticCallback_fixIndices,
00285         METH_VARARGS,
00286         "Repair any invalid indices"
00287     },
00288     {"fixDeformations",
00289         (PyCFunction) staticCallback_fixDeformations,
00290         METH_VARARGS,
00291         "Repair deformed facets"
00292     },
00293     {"fixDegenerations",
00294         (PyCFunction) staticCallback_fixDegenerations,
00295         METH_VARARGS,
00296         "Remove degenerated facets"
00297     },
00298     {"removeDuplicatedPoints",
00299         (PyCFunction) staticCallback_removeDuplicatedPoints,
00300         METH_VARARGS,
00301         "Remove duplicated points"
00302     },
00303     {"removeDuplicatedFacets",
00304         (PyCFunction) staticCallback_removeDuplicatedFacets,
00305         METH_VARARGS,
00306         "Remove duplicated facets"
00307     },
00308     {"refine",
00309         (PyCFunction) staticCallback_refine,
00310         METH_VARARGS,
00311         "Refine the mesh"
00312     },
00313     {"splitEdges",
00314         (PyCFunction) staticCallback_splitEdges,
00315         METH_VARARGS,
00316         "Split all edges"
00317     },
00318     {"splitEdge",
00319         (PyCFunction) staticCallback_splitEdge,
00320         METH_VARARGS,
00321         "Split edge"
00322     },
00323     {"splitFacet",
00324         (PyCFunction) staticCallback_splitFacet,
00325         METH_VARARGS,
00326         "Split facet"
00327     },
00328     {"swapEdge",
00329         (PyCFunction) staticCallback_swapEdge,
00330         METH_VARARGS,
00331         "Swap the common edge with the neighbour"
00332     },
00333     {"collapseEdge",
00334         (PyCFunction) staticCallback_collapseEdge,
00335         METH_VARARGS,
00336         "Remove an edge and both facets that share this edge"
00337     },
00338     {"collapseFacet",
00339         (PyCFunction) staticCallback_collapseFacet,
00340         METH_VARARGS,
00341         "Remove a facet"
00342     },
00343     {"collapseFacets",
00344         (PyCFunction) staticCallback_collapseFacets,
00345         METH_VARARGS,
00346         "Remove a list of facets"
00347     },
00348     {"insertVertex",
00349         (PyCFunction) staticCallback_insertVertex,
00350         METH_VARARGS,
00351         "Insert a vertex into a facet"
00352     },
00353     {"snapVertex",
00354         (PyCFunction) staticCallback_snapVertex,
00355         METH_VARARGS,
00356         "Insert a new facet at the border"
00357     },
00358     {"printInfo",
00359         (PyCFunction) staticCallback_printInfo,
00360         METH_VARARGS,
00361         "Get detailed information about the mesh"
00362     },
00363     {"foraminate",
00364         (PyCFunction) staticCallback_foraminate,
00365         METH_VARARGS,
00366         "Get a list of facet indices and intersection points"
00367     },
00368     {"harmonizeNormals",
00369         (PyCFunction) staticCallback_harmonizeNormals,
00370         METH_VARARGS,
00371         "Adjust wrong oriented facets"
00372     },
00373     {"flipNormals",
00374         (PyCFunction) staticCallback_flipNormals,
00375         METH_VARARGS,
00376         "Flip the mesh normals"
00377     },
00378     {"fillupHoles",
00379         (PyCFunction) staticCallback_fillupHoles,
00380         METH_VARARGS,
00381         "Fillup holes"
00382     },
00383     {"smooth",
00384         (PyCFunction) staticCallback_smooth,
00385         METH_VARARGS,
00386         "Smooth the mesh"
00387     },
00388     {"optimizeTopology",
00389         (PyCFunction) staticCallback_optimizeTopology,
00390         METH_VARARGS,
00391         "Optimize the edges to get nicer facets"
00392     },
00393     {"optimizeEdges",
00394         (PyCFunction) staticCallback_optimizeEdges,
00395         METH_VARARGS,
00396         "Optimize the edges to get nicer facets"
00397     },
00398     {"nearestFacetOnRay",
00399         (PyCFunction) staticCallback_nearestFacetOnRay,
00400         METH_VARARGS,
00401         "nearestFacetOnRay(tuple, tuple) -> dict\nGet the index and intersection point of the nearest facet to a ray.\nThe first parameter is a tuple of three floats the base point of the ray,\nthe second parameter is ut uple of three floats for the direction.\nThe result is a dictionary with an index and the intersection point or\nan empty dictionary if there is no intersection.\n"
00402     },
00403     {"getPlanes",
00404         (PyCFunction) staticCallback_getPlanes,
00405         METH_VARARGS,
00406         "Get all planes of the mesh as segment.\nIn the worst case each triangle can be regarded as single\nplane if none of its neighours is coplanar."
00407     },
00408     {NULL, NULL, 0, NULL}               /* Sentinel */
00409 };
00410 
00411 
00412 
00414 PyGetSetDef MeshPy::GetterSetter[] = {
00415     {"Points",
00416         (getter) staticCallback_getPoints,
00417         (setter) staticCallback_setPoints, 
00418         "A collection of the mesh points\nWith this attribute it is possible to get access to the points of the mesh\nfor p in mesh.Points:\n   print p.x, p.y, p.z",
00419         NULL
00420     },
00421     {"CountPoints",
00422         (getter) staticCallback_getCountPoints,
00423         (setter) staticCallback_setCountPoints, 
00424         "Return the number of vertices of the mesh object.",
00425         NULL
00426     },
00427     {"Facets",
00428         (getter) staticCallback_getFacets,
00429         (setter) staticCallback_setFacets, 
00430         "A collection of facets\nWith this attribute it is possible to get access to the facets of the mesh\nfor p in mesh.Facets:\n    print p",
00431         NULL
00432     },
00433     {"CountFacets",
00434         (getter) staticCallback_getCountFacets,
00435         (setter) staticCallback_setCountFacets, 
00436         "Return the number of facets of the mesh object.",
00437         NULL
00438     },
00439     {"Topology",
00440         (getter) staticCallback_getTopology,
00441         (setter) staticCallback_setTopology, 
00442         "Return the points and face indices as tuple.",
00443         NULL
00444     },
00445     {"Area",
00446         (getter) staticCallback_getArea,
00447         (setter) staticCallback_setArea, 
00448         "Return the area of the mesh object.",
00449         NULL
00450     },
00451     {"Volume",
00452         (getter) staticCallback_getVolume,
00453         (setter) staticCallback_setVolume, 
00454         "Return the volume of the mesh object.",
00455         NULL
00456     },
00457     {NULL, NULL, NULL, NULL, NULL}              /* Sentinel */
00458 };
00459 
00460 // read() callback and implementer
00461 // PyObject*  MeshPy::read(PyObject *args){};
00462 // has to be implemented in MeshPyImp.cpp
00463 PyObject * MeshPy::staticCallback_read (PyObject *self, PyObject *args)
00464 {
00465     // test if twin object not allready deleted
00466     if (!((PyObjectBase*) self)->isValid()){
00467         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00468         return NULL;
00469     }
00470 
00471     // test if object is set Const
00472     if (((PyObjectBase*) self)->isConst()){
00473         PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
00474         return NULL;
00475     }
00476 
00477     try { // catches all exceptions coming up from c++ and generate a python exception
00478         PyObject* ret = ((MeshPy*)self)->read(args);
00479         if (ret != 0)
00480             ((MeshPy*)self)->startNotify();
00481         return ret;
00482     }
00483     catch(const Base::Exception& e) // catch the FreeCAD exceptions
00484     {
00485         std::string str;
00486         str += "FreeCAD exception thrown (";
00487         str += e.what();
00488         str += ")";
00489         e.ReportException();
00490         PyErr_SetString(PyExc_Exception,str.c_str());
00491         return NULL;
00492     }
00493     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
00494     {
00495         std::string str;
00496         str += "File system exception thrown (";
00497         //str += e.who();
00498         //str += ", ";
00499         str += e.what();
00500         str += ")\n";
00501         Base::Console().Error(str.c_str());
00502         PyErr_SetString(PyExc_Exception,str.c_str());
00503         return NULL;
00504     }
00505     catch(const Py::Exception&)
00506     {
00507         // The exception text is already set
00508         return NULL;
00509     }
00510     catch(const char* e) // catch simple string exceptions
00511     {
00512         Base::Console().Error(e);
00513         PyErr_SetString(PyExc_Exception,e);
00514         return NULL;
00515     }
00516     // in debug not all exceptions will be catched to get the attention of the developer!
00517 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
00518     catch(const std::exception& e) // catch other c++ exceptions
00519     {
00520         std::string str;
00521         str += "FC++ exception thrown (";
00522         str += e.what();
00523         str += ")";
00524         Base::Console().Error(str.c_str());
00525         PyErr_SetString(PyExc_Exception,str.c_str());
00526         return NULL;
00527     }
00528     catch(...)  // catch the rest!
00529     {
00530         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
00531         return NULL;
00532     }
00533 #endif
00534 }
00535 
00536 // write() callback and implementer
00537 // PyObject*  MeshPy::write(PyObject *args){};
00538 // has to be implemented in MeshPyImp.cpp
00539 PyObject * MeshPy::staticCallback_write (PyObject *self, PyObject *args)
00540 {
00541     // test if twin object not allready deleted
00542     if (!((PyObjectBase*) self)->isValid()){
00543         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00544         return NULL;
00545     }
00546 
00547 
00548     try { // catches all exceptions coming up from c++ and generate a python exception
00549         PyObject* ret = ((MeshPy*)self)->write(args);
00550         return ret;
00551     }
00552     catch(const Base::Exception& e) // catch the FreeCAD exceptions
00553     {
00554         std::string str;
00555         str += "FreeCAD exception thrown (";
00556         str += e.what();
00557         str += ")";
00558         e.ReportException();
00559         PyErr_SetString(PyExc_Exception,str.c_str());
00560         return NULL;
00561     }
00562     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
00563     {
00564         std::string str;
00565         str += "File system exception thrown (";
00566         //str += e.who();
00567         //str += ", ";
00568         str += e.what();
00569         str += ")\n";
00570         Base::Console().Error(str.c_str());
00571         PyErr_SetString(PyExc_Exception,str.c_str());
00572         return NULL;
00573     }
00574     catch(const Py::Exception&)
00575     {
00576         // The exception text is already set
00577         return NULL;
00578     }
00579     catch(const char* e) // catch simple string exceptions
00580     {
00581         Base::Console().Error(e);
00582         PyErr_SetString(PyExc_Exception,e);
00583         return NULL;
00584     }
00585     // in debug not all exceptions will be catched to get the attention of the developer!
00586 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
00587     catch(const std::exception& e) // catch other c++ exceptions
00588     {
00589         std::string str;
00590         str += "FC++ exception thrown (";
00591         str += e.what();
00592         str += ")";
00593         Base::Console().Error(str.c_str());
00594         PyErr_SetString(PyExc_Exception,str.c_str());
00595         return NULL;
00596     }
00597     catch(...)  // catch the rest!
00598     {
00599         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
00600         return NULL;
00601     }
00602 #endif
00603 }
00604 
00605 // writeInventor() callback and implementer
00606 // PyObject*  MeshPy::writeInventor(PyObject *args){};
00607 // has to be implemented in MeshPyImp.cpp
00608 PyObject * MeshPy::staticCallback_writeInventor (PyObject *self, PyObject *args)
00609 {
00610     // test if twin object not allready deleted
00611     if (!((PyObjectBase*) self)->isValid()){
00612         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00613         return NULL;
00614     }
00615 
00616 
00617     try { // catches all exceptions coming up from c++ and generate a python exception
00618         PyObject* ret = ((MeshPy*)self)->writeInventor(args);
00619         return ret;
00620     }
00621     catch(const Base::Exception& e) // catch the FreeCAD exceptions
00622     {
00623         std::string str;
00624         str += "FreeCAD exception thrown (";
00625         str += e.what();
00626         str += ")";
00627         e.ReportException();
00628         PyErr_SetString(PyExc_Exception,str.c_str());
00629         return NULL;
00630     }
00631     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
00632     {
00633         std::string str;
00634         str += "File system exception thrown (";
00635         //str += e.who();
00636         //str += ", ";
00637         str += e.what();
00638         str += ")\n";
00639         Base::Console().Error(str.c_str());
00640         PyErr_SetString(PyExc_Exception,str.c_str());
00641         return NULL;
00642     }
00643     catch(const Py::Exception&)
00644     {
00645         // The exception text is already set
00646         return NULL;
00647     }
00648     catch(const char* e) // catch simple string exceptions
00649     {
00650         Base::Console().Error(e);
00651         PyErr_SetString(PyExc_Exception,e);
00652         return NULL;
00653     }
00654     // in debug not all exceptions will be catched to get the attention of the developer!
00655 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
00656     catch(const std::exception& e) // catch other c++ exceptions
00657     {
00658         std::string str;
00659         str += "FC++ exception thrown (";
00660         str += e.what();
00661         str += ")";
00662         Base::Console().Error(str.c_str());
00663         PyErr_SetString(PyExc_Exception,str.c_str());
00664         return NULL;
00665     }
00666     catch(...)  // catch the rest!
00667     {
00668         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
00669         return NULL;
00670     }
00671 #endif
00672 }
00673 
00674 // copy() callback and implementer
00675 // PyObject*  MeshPy::copy(PyObject *args){};
00676 // has to be implemented in MeshPyImp.cpp
00677 PyObject * MeshPy::staticCallback_copy (PyObject *self, PyObject *args)
00678 {
00679     // test if twin object not allready deleted
00680     if (!((PyObjectBase*) self)->isValid()){
00681         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00682         return NULL;
00683     }
00684 
00685 
00686     try { // catches all exceptions coming up from c++ and generate a python exception
00687         PyObject* ret = ((MeshPy*)self)->copy(args);
00688         return ret;
00689     }
00690     catch(const Base::Exception& e) // catch the FreeCAD exceptions
00691     {
00692         std::string str;
00693         str += "FreeCAD exception thrown (";
00694         str += e.what();
00695         str += ")";
00696         e.ReportException();
00697         PyErr_SetString(PyExc_Exception,str.c_str());
00698         return NULL;
00699     }
00700     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
00701     {
00702         std::string str;
00703         str += "File system exception thrown (";
00704         //str += e.who();
00705         //str += ", ";
00706         str += e.what();
00707         str += ")\n";
00708         Base::Console().Error(str.c_str());
00709         PyErr_SetString(PyExc_Exception,str.c_str());
00710         return NULL;
00711     }
00712     catch(const Py::Exception&)
00713     {
00714         // The exception text is already set
00715         return NULL;
00716     }
00717     catch(const char* e) // catch simple string exceptions
00718     {
00719         Base::Console().Error(e);
00720         PyErr_SetString(PyExc_Exception,e);
00721         return NULL;
00722     }
00723     // in debug not all exceptions will be catched to get the attention of the developer!
00724 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
00725     catch(const std::exception& e) // catch other c++ exceptions
00726     {
00727         std::string str;
00728         str += "FC++ exception thrown (";
00729         str += e.what();
00730         str += ")";
00731         Base::Console().Error(str.c_str());
00732         PyErr_SetString(PyExc_Exception,str.c_str());
00733         return NULL;
00734     }
00735     catch(...)  // catch the rest!
00736     {
00737         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
00738         return NULL;
00739     }
00740 #endif
00741 }
00742 
00743 // offset() callback and implementer
00744 // PyObject*  MeshPy::offset(PyObject *args){};
00745 // has to be implemented in MeshPyImp.cpp
00746 PyObject * MeshPy::staticCallback_offset (PyObject *self, PyObject *args)
00747 {
00748     // test if twin object not allready deleted
00749     if (!((PyObjectBase*) self)->isValid()){
00750         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00751         return NULL;
00752     }
00753 
00754     // test if object is set Const
00755     if (((PyObjectBase*) self)->isConst()){
00756         PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
00757         return NULL;
00758     }
00759 
00760     try { // catches all exceptions coming up from c++ and generate a python exception
00761         PyObject* ret = ((MeshPy*)self)->offset(args);
00762         if (ret != 0)
00763             ((MeshPy*)self)->startNotify();
00764         return ret;
00765     }
00766     catch(const Base::Exception& e) // catch the FreeCAD exceptions
00767     {
00768         std::string str;
00769         str += "FreeCAD exception thrown (";
00770         str += e.what();
00771         str += ")";
00772         e.ReportException();
00773         PyErr_SetString(PyExc_Exception,str.c_str());
00774         return NULL;
00775     }
00776     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
00777     {
00778         std::string str;
00779         str += "File system exception thrown (";
00780         //str += e.who();
00781         //str += ", ";
00782         str += e.what();
00783         str += ")\n";
00784         Base::Console().Error(str.c_str());
00785         PyErr_SetString(PyExc_Exception,str.c_str());
00786         return NULL;
00787     }
00788     catch(const Py::Exception&)
00789     {
00790         // The exception text is already set
00791         return NULL;
00792     }
00793     catch(const char* e) // catch simple string exceptions
00794     {
00795         Base::Console().Error(e);
00796         PyErr_SetString(PyExc_Exception,e);
00797         return NULL;
00798     }
00799     // in debug not all exceptions will be catched to get the attention of the developer!
00800 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
00801     catch(const std::exception& e) // catch other c++ exceptions
00802     {
00803         std::string str;
00804         str += "FC++ exception thrown (";
00805         str += e.what();
00806         str += ")";
00807         Base::Console().Error(str.c_str());
00808         PyErr_SetString(PyExc_Exception,str.c_str());
00809         return NULL;
00810     }
00811     catch(...)  // catch the rest!
00812     {
00813         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
00814         return NULL;
00815     }
00816 #endif
00817 }
00818 
00819 // offsetSpecial() callback and implementer
00820 // PyObject*  MeshPy::offsetSpecial(PyObject *args){};
00821 // has to be implemented in MeshPyImp.cpp
00822 PyObject * MeshPy::staticCallback_offsetSpecial (PyObject *self, PyObject *args)
00823 {
00824     // test if twin object not allready deleted
00825     if (!((PyObjectBase*) self)->isValid()){
00826         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00827         return NULL;
00828     }
00829 
00830     // test if object is set Const
00831     if (((PyObjectBase*) self)->isConst()){
00832         PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
00833         return NULL;
00834     }
00835 
00836     try { // catches all exceptions coming up from c++ and generate a python exception
00837         PyObject* ret = ((MeshPy*)self)->offsetSpecial(args);
00838         if (ret != 0)
00839             ((MeshPy*)self)->startNotify();
00840         return ret;
00841     }
00842     catch(const Base::Exception& e) // catch the FreeCAD exceptions
00843     {
00844         std::string str;
00845         str += "FreeCAD exception thrown (";
00846         str += e.what();
00847         str += ")";
00848         e.ReportException();
00849         PyErr_SetString(PyExc_Exception,str.c_str());
00850         return NULL;
00851     }
00852     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
00853     {
00854         std::string str;
00855         str += "File system exception thrown (";
00856         //str += e.who();
00857         //str += ", ";
00858         str += e.what();
00859         str += ")\n";
00860         Base::Console().Error(str.c_str());
00861         PyErr_SetString(PyExc_Exception,str.c_str());
00862         return NULL;
00863     }
00864     catch(const Py::Exception&)
00865     {
00866         // The exception text is already set
00867         return NULL;
00868     }
00869     catch(const char* e) // catch simple string exceptions
00870     {
00871         Base::Console().Error(e);
00872         PyErr_SetString(PyExc_Exception,e);
00873         return NULL;
00874     }
00875     // in debug not all exceptions will be catched to get the attention of the developer!
00876 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
00877     catch(const std::exception& e) // catch other c++ exceptions
00878     {
00879         std::string str;
00880         str += "FC++ exception thrown (";
00881         str += e.what();
00882         str += ")";
00883         Base::Console().Error(str.c_str());
00884         PyErr_SetString(PyExc_Exception,str.c_str());
00885         return NULL;
00886     }
00887     catch(...)  // catch the rest!
00888     {
00889         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
00890         return NULL;
00891     }
00892 #endif
00893 }
00894 
00895 // crossSections() callback and implementer
00896 // PyObject*  MeshPy::crossSections(PyObject *args){};
00897 // has to be implemented in MeshPyImp.cpp
00898 PyObject * MeshPy::staticCallback_crossSections (PyObject *self, PyObject *args)
00899 {
00900     // test if twin object not allready deleted
00901     if (!((PyObjectBase*) self)->isValid()){
00902         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00903         return NULL;
00904     }
00905 
00906 
00907     try { // catches all exceptions coming up from c++ and generate a python exception
00908         PyObject* ret = ((MeshPy*)self)->crossSections(args);
00909         return ret;
00910     }
00911     catch(const Base::Exception& e) // catch the FreeCAD exceptions
00912     {
00913         std::string str;
00914         str += "FreeCAD exception thrown (";
00915         str += e.what();
00916         str += ")";
00917         e.ReportException();
00918         PyErr_SetString(PyExc_Exception,str.c_str());
00919         return NULL;
00920     }
00921     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
00922     {
00923         std::string str;
00924         str += "File system exception thrown (";
00925         //str += e.who();
00926         //str += ", ";
00927         str += e.what();
00928         str += ")\n";
00929         Base::Console().Error(str.c_str());
00930         PyErr_SetString(PyExc_Exception,str.c_str());
00931         return NULL;
00932     }
00933     catch(const Py::Exception&)
00934     {
00935         // The exception text is already set
00936         return NULL;
00937     }
00938     catch(const char* e) // catch simple string exceptions
00939     {
00940         Base::Console().Error(e);
00941         PyErr_SetString(PyExc_Exception,e);
00942         return NULL;
00943     }
00944     // in debug not all exceptions will be catched to get the attention of the developer!
00945 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
00946     catch(const std::exception& e) // catch other c++ exceptions
00947     {
00948         std::string str;
00949         str += "FC++ exception thrown (";
00950         str += e.what();
00951         str += ")";
00952         Base::Console().Error(str.c_str());
00953         PyErr_SetString(PyExc_Exception,str.c_str());
00954         return NULL;
00955     }
00956     catch(...)  // catch the rest!
00957     {
00958         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
00959         return NULL;
00960     }
00961 #endif
00962 }
00963 
00964 // unite() callback and implementer
00965 // PyObject*  MeshPy::unite(PyObject *args){};
00966 // has to be implemented in MeshPyImp.cpp
00967 PyObject * MeshPy::staticCallback_unite (PyObject *self, PyObject *args)
00968 {
00969     // test if twin object not allready deleted
00970     if (!((PyObjectBase*) self)->isValid()){
00971         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00972         return NULL;
00973     }
00974 
00975 
00976     try { // catches all exceptions coming up from c++ and generate a python exception
00977         PyObject* ret = ((MeshPy*)self)->unite(args);
00978         return ret;
00979     }
00980     catch(const Base::Exception& e) // catch the FreeCAD exceptions
00981     {
00982         std::string str;
00983         str += "FreeCAD exception thrown (";
00984         str += e.what();
00985         str += ")";
00986         e.ReportException();
00987         PyErr_SetString(PyExc_Exception,str.c_str());
00988         return NULL;
00989     }
00990     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
00991     {
00992         std::string str;
00993         str += "File system exception thrown (";
00994         //str += e.who();
00995         //str += ", ";
00996         str += e.what();
00997         str += ")\n";
00998         Base::Console().Error(str.c_str());
00999         PyErr_SetString(PyExc_Exception,str.c_str());
01000         return NULL;
01001     }
01002     catch(const Py::Exception&)
01003     {
01004         // The exception text is already set
01005         return NULL;
01006     }
01007     catch(const char* e) // catch simple string exceptions
01008     {
01009         Base::Console().Error(e);
01010         PyErr_SetString(PyExc_Exception,e);
01011         return NULL;
01012     }
01013     // in debug not all exceptions will be catched to get the attention of the developer!
01014 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
01015     catch(const std::exception& e) // catch other c++ exceptions
01016     {
01017         std::string str;
01018         str += "FC++ exception thrown (";
01019         str += e.what();
01020         str += ")";
01021         Base::Console().Error(str.c_str());
01022         PyErr_SetString(PyExc_Exception,str.c_str());
01023         return NULL;
01024     }
01025     catch(...)  // catch the rest!
01026     {
01027         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
01028         return NULL;
01029     }
01030 #endif
01031 }
01032 
01033 // intersect() callback and implementer
01034 // PyObject*  MeshPy::intersect(PyObject *args){};
01035 // has to be implemented in MeshPyImp.cpp
01036 PyObject * MeshPy::staticCallback_intersect (PyObject *self, PyObject *args)
01037 {
01038     // test if twin object not allready deleted
01039     if (!((PyObjectBase*) self)->isValid()){
01040         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01041         return NULL;
01042     }
01043 
01044 
01045     try { // catches all exceptions coming up from c++ and generate a python exception
01046         PyObject* ret = ((MeshPy*)self)->intersect(args);
01047         return ret;
01048     }
01049     catch(const Base::Exception& e) // catch the FreeCAD exceptions
01050     {
01051         std::string str;
01052         str += "FreeCAD exception thrown (";
01053         str += e.what();
01054         str += ")";
01055         e.ReportException();
01056         PyErr_SetString(PyExc_Exception,str.c_str());
01057         return NULL;
01058     }
01059     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
01060     {
01061         std::string str;
01062         str += "File system exception thrown (";
01063         //str += e.who();
01064         //str += ", ";
01065         str += e.what();
01066         str += ")\n";
01067         Base::Console().Error(str.c_str());
01068         PyErr_SetString(PyExc_Exception,str.c_str());
01069         return NULL;
01070     }
01071     catch(const Py::Exception&)
01072     {
01073         // The exception text is already set
01074         return NULL;
01075     }
01076     catch(const char* e) // catch simple string exceptions
01077     {
01078         Base::Console().Error(e);
01079         PyErr_SetString(PyExc_Exception,e);
01080         return NULL;
01081     }
01082     // in debug not all exceptions will be catched to get the attention of the developer!
01083 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
01084     catch(const std::exception& e) // catch other c++ exceptions
01085     {
01086         std::string str;
01087         str += "FC++ exception thrown (";
01088         str += e.what();
01089         str += ")";
01090         Base::Console().Error(str.c_str());
01091         PyErr_SetString(PyExc_Exception,str.c_str());
01092         return NULL;
01093     }
01094     catch(...)  // catch the rest!
01095     {
01096         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
01097         return NULL;
01098     }
01099 #endif
01100 }
01101 
01102 // difference() callback and implementer
01103 // PyObject*  MeshPy::difference(PyObject *args){};
01104 // has to be implemented in MeshPyImp.cpp
01105 PyObject * MeshPy::staticCallback_difference (PyObject *self, PyObject *args)
01106 {
01107     // test if twin object not allready deleted
01108     if (!((PyObjectBase*) self)->isValid()){
01109         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01110         return NULL;
01111     }
01112 
01113 
01114     try { // catches all exceptions coming up from c++ and generate a python exception
01115         PyObject* ret = ((MeshPy*)self)->difference(args);
01116         return ret;
01117     }
01118     catch(const Base::Exception& e) // catch the FreeCAD exceptions
01119     {
01120         std::string str;
01121         str += "FreeCAD exception thrown (";
01122         str += e.what();
01123         str += ")";
01124         e.ReportException();
01125         PyErr_SetString(PyExc_Exception,str.c_str());
01126         return NULL;
01127     }
01128     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
01129     {
01130         std::string str;
01131         str += "File system exception thrown (";
01132         //str += e.who();
01133         //str += ", ";
01134         str += e.what();
01135         str += ")\n";
01136         Base::Console().Error(str.c_str());
01137         PyErr_SetString(PyExc_Exception,str.c_str());
01138         return NULL;
01139     }
01140     catch(const Py::Exception&)
01141     {
01142         // The exception text is already set
01143         return NULL;
01144     }
01145     catch(const char* e) // catch simple string exceptions
01146     {
01147         Base::Console().Error(e);
01148         PyErr_SetString(PyExc_Exception,e);
01149         return NULL;
01150     }
01151     // in debug not all exceptions will be catched to get the attention of the developer!
01152 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
01153     catch(const std::exception& e) // catch other c++ exceptions
01154     {
01155         std::string str;
01156         str += "FC++ exception thrown (";
01157         str += e.what();
01158         str += ")";
01159         Base::Console().Error(str.c_str());
01160         PyErr_SetString(PyExc_Exception,str.c_str());
01161         return NULL;
01162     }
01163     catch(...)  // catch the rest!
01164     {
01165         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
01166         return NULL;
01167     }
01168 #endif
01169 }
01170 
01171 // inner() callback and implementer
01172 // PyObject*  MeshPy::inner(PyObject *args){};
01173 // has to be implemented in MeshPyImp.cpp
01174 PyObject * MeshPy::staticCallback_inner (PyObject *self, PyObject *args)
01175 {
01176     // test if twin object not allready deleted
01177     if (!((PyObjectBase*) self)->isValid()){
01178         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01179         return NULL;
01180     }
01181 
01182 
01183     try { // catches all exceptions coming up from c++ and generate a python exception
01184         PyObject* ret = ((MeshPy*)self)->inner(args);
01185         return ret;
01186     }
01187     catch(const Base::Exception& e) // catch the FreeCAD exceptions
01188     {
01189         std::string str;
01190         str += "FreeCAD exception thrown (";
01191         str += e.what();
01192         str += ")";
01193         e.ReportException();
01194         PyErr_SetString(PyExc_Exception,str.c_str());
01195         return NULL;
01196     }
01197     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
01198     {
01199         std::string str;
01200         str += "File system exception thrown (";
01201         //str += e.who();
01202         //str += ", ";
01203         str += e.what();
01204         str += ")\n";
01205         Base::Console().Error(str.c_str());
01206         PyErr_SetString(PyExc_Exception,str.c_str());
01207         return NULL;
01208     }
01209     catch(const Py::Exception&)
01210     {
01211         // The exception text is already set
01212         return NULL;
01213     }
01214     catch(const char* e) // catch simple string exceptions
01215     {
01216         Base::Console().Error(e);
01217         PyErr_SetString(PyExc_Exception,e);
01218         return NULL;
01219     }
01220     // in debug not all exceptions will be catched to get the attention of the developer!
01221 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
01222     catch(const std::exception& e) // catch other c++ exceptions
01223     {
01224         std::string str;
01225         str += "FC++ exception thrown (";
01226         str += e.what();
01227         str += ")";
01228         Base::Console().Error(str.c_str());
01229         PyErr_SetString(PyExc_Exception,str.c_str());
01230         return NULL;
01231     }
01232     catch(...)  // catch the rest!
01233     {
01234         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
01235         return NULL;
01236     }
01237 #endif
01238 }
01239 
01240 // outer() callback and implementer
01241 // PyObject*  MeshPy::outer(PyObject *args){};
01242 // has to be implemented in MeshPyImp.cpp
01243 PyObject * MeshPy::staticCallback_outer (PyObject *self, PyObject *args)
01244 {
01245     // test if twin object not allready deleted
01246     if (!((PyObjectBase*) self)->isValid()){
01247         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01248         return NULL;
01249     }
01250 
01251 
01252     try { // catches all exceptions coming up from c++ and generate a python exception
01253         PyObject* ret = ((MeshPy*)self)->outer(args);
01254         return ret;
01255     }
01256     catch(const Base::Exception& e) // catch the FreeCAD exceptions
01257     {
01258         std::string str;
01259         str += "FreeCAD exception thrown (";
01260         str += e.what();
01261         str += ")";
01262         e.ReportException();
01263         PyErr_SetString(PyExc_Exception,str.c_str());
01264         return NULL;
01265     }
01266     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
01267     {
01268         std::string str;
01269         str += "File system exception thrown (";
01270         //str += e.who();
01271         //str += ", ";
01272         str += e.what();
01273         str += ")\n";
01274         Base::Console().Error(str.c_str());
01275         PyErr_SetString(PyExc_Exception,str.c_str());
01276         return NULL;
01277     }
01278     catch(const Py::Exception&)
01279     {
01280         // The exception text is already set
01281         return NULL;
01282     }
01283     catch(const char* e) // catch simple string exceptions
01284     {
01285         Base::Console().Error(e);
01286         PyErr_SetString(PyExc_Exception,e);
01287         return NULL;
01288     }
01289     // in debug not all exceptions will be catched to get the attention of the developer!
01290 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
01291     catch(const std::exception& e) // catch other c++ exceptions
01292     {
01293         std::string str;
01294         str += "FC++ exception thrown (";
01295         str += e.what();
01296         str += ")";
01297         Base::Console().Error(str.c_str());
01298         PyErr_SetString(PyExc_Exception,str.c_str());
01299         return NULL;
01300     }
01301     catch(...)  // catch the rest!
01302     {
01303         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
01304         return NULL;
01305     }
01306 #endif
01307 }
01308 
01309 // coarsen() callback and implementer
01310 // PyObject*  MeshPy::coarsen(PyObject *args){};
01311 // has to be implemented in MeshPyImp.cpp
01312 PyObject * MeshPy::staticCallback_coarsen (PyObject *self, PyObject *args)
01313 {
01314     // test if twin object not allready deleted
01315     if (!((PyObjectBase*) self)->isValid()){
01316         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01317         return NULL;
01318     }
01319 
01320     // test if object is set Const
01321     if (((PyObjectBase*) self)->isConst()){
01322         PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
01323         return NULL;
01324     }
01325 
01326     try { // catches all exceptions coming up from c++ and generate a python exception
01327         PyObject* ret = ((MeshPy*)self)->coarsen(args);
01328         if (ret != 0)
01329             ((MeshPy*)self)->startNotify();
01330         return ret;
01331     }
01332     catch(const Base::Exception& e) // catch the FreeCAD exceptions
01333     {
01334         std::string str;
01335         str += "FreeCAD exception thrown (";
01336         str += e.what();
01337         str += ")";
01338         e.ReportException();
01339         PyErr_SetString(PyExc_Exception,str.c_str());
01340         return NULL;
01341     }
01342     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
01343     {
01344         std::string str;
01345         str += "File system exception thrown (";
01346         //str += e.who();
01347         //str += ", ";
01348         str += e.what();
01349         str += ")\n";
01350         Base::Console().Error(str.c_str());
01351         PyErr_SetString(PyExc_Exception,str.c_str());
01352         return NULL;
01353     }
01354     catch(const Py::Exception&)
01355     {
01356         // The exception text is already set
01357         return NULL;
01358     }
01359     catch(const char* e) // catch simple string exceptions
01360     {
01361         Base::Console().Error(e);
01362         PyErr_SetString(PyExc_Exception,e);
01363         return NULL;
01364     }
01365     // in debug not all exceptions will be catched to get the attention of the developer!
01366 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
01367     catch(const std::exception& e) // catch other c++ exceptions
01368     {
01369         std::string str;
01370         str += "FC++ exception thrown (";
01371         str += e.what();
01372         str += ")";
01373         Base::Console().Error(str.c_str());
01374         PyErr_SetString(PyExc_Exception,str.c_str());
01375         return NULL;
01376     }
01377     catch(...)  // catch the rest!
01378     {
01379         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
01380         return NULL;
01381     }
01382 #endif
01383 }
01384 
01385 // translate() callback and implementer
01386 // PyObject*  MeshPy::translate(PyObject *args){};
01387 // has to be implemented in MeshPyImp.cpp
01388 PyObject * MeshPy::staticCallback_translate (PyObject *self, PyObject *args)
01389 {
01390     // test if twin object not allready deleted
01391     if (!((PyObjectBase*) self)->isValid()){
01392         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01393         return NULL;
01394     }
01395 
01396     // test if object is set Const
01397     if (((PyObjectBase*) self)->isConst()){
01398         PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
01399         return NULL;
01400     }
01401 
01402     try { // catches all exceptions coming up from c++ and generate a python exception
01403         PyObject* ret = ((MeshPy*)self)->translate(args);
01404         if (ret != 0)
01405             ((MeshPy*)self)->startNotify();
01406         return ret;
01407     }
01408     catch(const Base::Exception& e) // catch the FreeCAD exceptions
01409     {
01410         std::string str;
01411         str += "FreeCAD exception thrown (";
01412         str += e.what();
01413         str += ")";
01414         e.ReportException();
01415         PyErr_SetString(PyExc_Exception,str.c_str());
01416         return NULL;
01417     }
01418     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
01419     {
01420         std::string str;
01421         str += "File system exception thrown (";
01422         //str += e.who();
01423         //str += ", ";
01424         str += e.what();
01425         str += ")\n";
01426         Base::Console().Error(str.c_str());
01427         PyErr_SetString(PyExc_Exception,str.c_str());
01428         return NULL;
01429     }
01430     catch(const Py::Exception&)
01431     {
01432         // The exception text is already set
01433         return NULL;
01434     }
01435     catch(const char* e) // catch simple string exceptions
01436     {
01437         Base::Console().Error(e);
01438         PyErr_SetString(PyExc_Exception,e);
01439         return NULL;
01440     }
01441     // in debug not all exceptions will be catched to get the attention of the developer!
01442 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
01443     catch(const std::exception& e) // catch other c++ exceptions
01444     {
01445         std::string str;
01446         str += "FC++ exception thrown (";
01447         str += e.what();
01448         str += ")";
01449         Base::Console().Error(str.c_str());
01450         PyErr_SetString(PyExc_Exception,str.c_str());
01451         return NULL;
01452     }
01453     catch(...)  // catch the rest!
01454     {
01455         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
01456         return NULL;
01457     }
01458 #endif
01459 }
01460 
01461 // rotate() callback and implementer
01462 // PyObject*  MeshPy::rotate(PyObject *args){};
01463 // has to be implemented in MeshPyImp.cpp
01464 PyObject * MeshPy::staticCallback_rotate (PyObject *self, PyObject *args)
01465 {
01466     // test if twin object not allready deleted
01467     if (!((PyObjectBase*) self)->isValid()){
01468         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01469         return NULL;
01470     }
01471 
01472     // test if object is set Const
01473     if (((PyObjectBase*) self)->isConst()){
01474         PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
01475         return NULL;
01476     }
01477 
01478     try { // catches all exceptions coming up from c++ and generate a python exception
01479         PyObject* ret = ((MeshPy*)self)->rotate(args);
01480         if (ret != 0)
01481             ((MeshPy*)self)->startNotify();
01482         return ret;
01483     }
01484     catch(const Base::Exception& e) // catch the FreeCAD exceptions
01485     {
01486         std::string str;
01487         str += "FreeCAD exception thrown (";
01488         str += e.what();
01489         str += ")";
01490         e.ReportException();
01491         PyErr_SetString(PyExc_Exception,str.c_str());
01492         return NULL;
01493     }
01494     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
01495     {
01496         std::string str;
01497         str += "File system exception thrown (";
01498         //str += e.who();
01499         //str += ", ";
01500         str += e.what();
01501         str += ")\n";
01502         Base::Console().Error(str.c_str());
01503         PyErr_SetString(PyExc_Exception,str.c_str());
01504         return NULL;
01505     }
01506     catch(const Py::Exception&)
01507     {
01508         // The exception text is already set
01509         return NULL;
01510     }
01511     catch(const char* e) // catch simple string exceptions
01512     {
01513         Base::Console().Error(e);
01514         PyErr_SetString(PyExc_Exception,e);
01515         return NULL;
01516     }
01517     // in debug not all exceptions will be catched to get the attention of the developer!
01518 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
01519     catch(const std::exception& e) // catch other c++ exceptions
01520     {
01521         std::string str;
01522         str += "FC++ exception thrown (";
01523         str += e.what();
01524         str += ")";
01525         Base::Console().Error(str.c_str());
01526         PyErr_SetString(PyExc_Exception,str.c_str());
01527         return NULL;
01528     }
01529     catch(...)  // catch the rest!
01530     {
01531         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
01532         return NULL;
01533     }
01534 #endif
01535 }
01536 
01537 // transform() callback and implementer
01538 // PyObject*  MeshPy::transform(PyObject *args){};
01539 // has to be implemented in MeshPyImp.cpp
01540 PyObject * MeshPy::staticCallback_transform (PyObject *self, PyObject *args)
01541 {
01542     // test if twin object not allready deleted
01543     if (!((PyObjectBase*) self)->isValid()){
01544         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01545         return NULL;
01546     }
01547 
01548     // test if object is set Const
01549     if (((PyObjectBase*) self)->isConst()){
01550         PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
01551         return NULL;
01552     }
01553 
01554     try { // catches all exceptions coming up from c++ and generate a python exception
01555         PyObject* ret = ((MeshPy*)self)->transform(args);
01556         if (ret != 0)
01557             ((MeshPy*)self)->startNotify();
01558         return ret;
01559     }
01560     catch(const Base::Exception& e) // catch the FreeCAD exceptions
01561     {
01562         std::string str;
01563         str += "FreeCAD exception thrown (";
01564         str += e.what();
01565         str += ")";
01566         e.ReportException();
01567         PyErr_SetString(PyExc_Exception,str.c_str());
01568         return NULL;
01569     }
01570     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
01571     {
01572         std::string str;
01573         str += "File system exception thrown (";
01574         //str += e.who();
01575         //str += ", ";
01576         str += e.what();
01577         str += ")\n";
01578         Base::Console().Error(str.c_str());
01579         PyErr_SetString(PyExc_Exception,str.c_str());
01580         return NULL;
01581     }
01582     catch(const Py::Exception&)
01583     {
01584         // The exception text is already set
01585         return NULL;
01586     }
01587     catch(const char* e) // catch simple string exceptions
01588     {
01589         Base::Console().Error(e);
01590         PyErr_SetString(PyExc_Exception,e);
01591         return NULL;
01592     }
01593     // in debug not all exceptions will be catched to get the attention of the developer!
01594 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
01595     catch(const std::exception& e) // catch other c++ exceptions
01596     {
01597         std::string str;
01598         str += "FC++ exception thrown (";
01599         str += e.what();
01600         str += ")";
01601         Base::Console().Error(str.c_str());
01602         PyErr_SetString(PyExc_Exception,str.c_str());
01603         return NULL;
01604     }
01605     catch(...)  // catch the rest!
01606     {
01607         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
01608         return NULL;
01609     }
01610 #endif
01611 }
01612 
01613 // transformToEigen() callback and implementer
01614 // PyObject*  MeshPy::transformToEigen(PyObject *args){};
01615 // has to be implemented in MeshPyImp.cpp
01616 PyObject * MeshPy::staticCallback_transformToEigen (PyObject *self, PyObject *args)
01617 {
01618     // test if twin object not allready deleted
01619     if (!((PyObjectBase*) self)->isValid()){
01620         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01621         return NULL;
01622     }
01623 
01624     // test if object is set Const
01625     if (((PyObjectBase*) self)->isConst()){
01626         PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
01627         return NULL;
01628     }
01629 
01630     try { // catches all exceptions coming up from c++ and generate a python exception
01631         PyObject* ret = ((MeshPy*)self)->transformToEigen(args);
01632         if (ret != 0)
01633             ((MeshPy*)self)->startNotify();
01634         return ret;
01635     }
01636     catch(const Base::Exception& e) // catch the FreeCAD exceptions
01637     {
01638         std::string str;
01639         str += "FreeCAD exception thrown (";
01640         str += e.what();
01641         str += ")";
01642         e.ReportException();
01643         PyErr_SetString(PyExc_Exception,str.c_str());
01644         return NULL;
01645     }
01646     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
01647     {
01648         std::string str;
01649         str += "File system exception thrown (";
01650         //str += e.who();
01651         //str += ", ";
01652         str += e.what();
01653         str += ")\n";
01654         Base::Console().Error(str.c_str());
01655         PyErr_SetString(PyExc_Exception,str.c_str());
01656         return NULL;
01657     }
01658     catch(const Py::Exception&)
01659     {
01660         // The exception text is already set
01661         return NULL;
01662     }
01663     catch(const char* e) // catch simple string exceptions
01664     {
01665         Base::Console().Error(e);
01666         PyErr_SetString(PyExc_Exception,e);
01667         return NULL;
01668     }
01669     // in debug not all exceptions will be catched to get the attention of the developer!
01670 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
01671     catch(const std::exception& e) // catch other c++ exceptions
01672     {
01673         std::string str;
01674         str += "FC++ exception thrown (";
01675         str += e.what();
01676         str += ")";
01677         Base::Console().Error(str.c_str());
01678         PyErr_SetString(PyExc_Exception,str.c_str());
01679         return NULL;
01680     }
01681     catch(...)  // catch the rest!
01682     {
01683         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
01684         return NULL;
01685     }
01686 #endif
01687 }
01688 
01689 // addFacet() callback and implementer
01690 // PyObject*  MeshPy::addFacet(PyObject *args){};
01691 // has to be implemented in MeshPyImp.cpp
01692 PyObject * MeshPy::staticCallback_addFacet (PyObject *self, PyObject *args)
01693 {
01694     // test if twin object not allready deleted
01695     if (!((PyObjectBase*) self)->isValid()){
01696         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01697         return NULL;
01698     }
01699 
01700     // test if object is set Const
01701     if (((PyObjectBase*) self)->isConst()){
01702         PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
01703         return NULL;
01704     }
01705 
01706     try { // catches all exceptions coming up from c++ and generate a python exception
01707         PyObject* ret = ((MeshPy*)self)->addFacet(args);
01708         if (ret != 0)
01709             ((MeshPy*)self)->startNotify();
01710         return ret;
01711     }
01712     catch(const Base::Exception& e) // catch the FreeCAD exceptions
01713     {
01714         std::string str;
01715         str += "FreeCAD exception thrown (";
01716         str += e.what();
01717         str += ")";
01718         e.ReportException();
01719         PyErr_SetString(PyExc_Exception,str.c_str());
01720         return NULL;
01721     }
01722     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
01723     {
01724         std::string str;
01725         str += "File system exception thrown (";
01726         //str += e.who();
01727         //str += ", ";
01728         str += e.what();
01729         str += ")\n";
01730         Base::Console().Error(str.c_str());
01731         PyErr_SetString(PyExc_Exception,str.c_str());
01732         return NULL;
01733     }
01734     catch(const Py::Exception&)
01735     {
01736         // The exception text is already set
01737         return NULL;
01738     }
01739     catch(const char* e) // catch simple string exceptions
01740     {
01741         Base::Console().Error(e);
01742         PyErr_SetString(PyExc_Exception,e);
01743         return NULL;
01744     }
01745     // in debug not all exceptions will be catched to get the attention of the developer!
01746 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
01747     catch(const std::exception& e) // catch other c++ exceptions
01748     {
01749         std::string str;
01750         str += "FC++ exception thrown (";
01751         str += e.what();
01752         str += ")";
01753         Base::Console().Error(str.c_str());
01754         PyErr_SetString(PyExc_Exception,str.c_str());
01755         return NULL;
01756     }
01757     catch(...)  // catch the rest!
01758     {
01759         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
01760         return NULL;
01761     }
01762 #endif
01763 }
01764 
01765 // addFacets() callback and implementer
01766 // PyObject*  MeshPy::addFacets(PyObject *args){};
01767 // has to be implemented in MeshPyImp.cpp
01768 PyObject * MeshPy::staticCallback_addFacets (PyObject *self, PyObject *args)
01769 {
01770     // test if twin object not allready deleted
01771     if (!((PyObjectBase*) self)->isValid()){
01772         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01773         return NULL;
01774     }
01775 
01776     // test if object is set Const
01777     if (((PyObjectBase*) self)->isConst()){
01778         PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
01779         return NULL;
01780     }
01781 
01782     try { // catches all exceptions coming up from c++ and generate a python exception
01783         PyObject* ret = ((MeshPy*)self)->addFacets(args);
01784         if (ret != 0)
01785             ((MeshPy*)self)->startNotify();
01786         return ret;
01787     }
01788     catch(const Base::Exception& e) // catch the FreeCAD exceptions
01789     {
01790         std::string str;
01791         str += "FreeCAD exception thrown (";
01792         str += e.what();
01793         str += ")";
01794         e.ReportException();
01795         PyErr_SetString(PyExc_Exception,str.c_str());
01796         return NULL;
01797     }
01798     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
01799     {
01800         std::string str;
01801         str += "File system exception thrown (";
01802         //str += e.who();
01803         //str += ", ";
01804         str += e.what();
01805         str += ")\n";
01806         Base::Console().Error(str.c_str());
01807         PyErr_SetString(PyExc_Exception,str.c_str());
01808         return NULL;
01809     }
01810     catch(const Py::Exception&)
01811     {
01812         // The exception text is already set
01813         return NULL;
01814     }
01815     catch(const char* e) // catch simple string exceptions
01816     {
01817         Base::Console().Error(e);
01818         PyErr_SetString(PyExc_Exception,e);
01819         return NULL;
01820     }
01821     // in debug not all exceptions will be catched to get the attention of the developer!
01822 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
01823     catch(const std::exception& e) // catch other c++ exceptions
01824     {
01825         std::string str;
01826         str += "FC++ exception thrown (";
01827         str += e.what();
01828         str += ")";
01829         Base::Console().Error(str.c_str());
01830         PyErr_SetString(PyExc_Exception,str.c_str());
01831         return NULL;
01832     }
01833     catch(...)  // catch the rest!
01834     {
01835         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
01836         return NULL;
01837     }
01838 #endif
01839 }
01840 
01841 // removeFacets() callback and implementer
01842 // PyObject*  MeshPy::removeFacets(PyObject *args){};
01843 // has to be implemented in MeshPyImp.cpp
01844 PyObject * MeshPy::staticCallback_removeFacets (PyObject *self, PyObject *args)
01845 {
01846     // test if twin object not allready deleted
01847     if (!((PyObjectBase*) self)->isValid()){
01848         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01849         return NULL;
01850     }
01851 
01852     // test if object is set Const
01853     if (((PyObjectBase*) self)->isConst()){
01854         PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
01855         return NULL;
01856     }
01857 
01858     try { // catches all exceptions coming up from c++ and generate a python exception
01859         PyObject* ret = ((MeshPy*)self)->removeFacets(args);
01860         if (ret != 0)
01861             ((MeshPy*)self)->startNotify();
01862         return ret;
01863     }
01864     catch(const Base::Exception& e) // catch the FreeCAD exceptions
01865     {
01866         std::string str;
01867         str += "FreeCAD exception thrown (";
01868         str += e.what();
01869         str += ")";
01870         e.ReportException();
01871         PyErr_SetString(PyExc_Exception,str.c_str());
01872         return NULL;
01873     }
01874     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
01875     {
01876         std::string str;
01877         str += "File system exception thrown (";
01878         //str += e.who();
01879         //str += ", ";
01880         str += e.what();
01881         str += ")\n";
01882         Base::Console().Error(str.c_str());
01883         PyErr_SetString(PyExc_Exception,str.c_str());
01884         return NULL;
01885     }
01886     catch(const Py::Exception&)
01887     {
01888         // The exception text is already set
01889         return NULL;
01890     }
01891     catch(const char* e) // catch simple string exceptions
01892     {
01893         Base::Console().Error(e);
01894         PyErr_SetString(PyExc_Exception,e);
01895         return NULL;
01896     }
01897     // in debug not all exceptions will be catched to get the attention of the developer!
01898 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
01899     catch(const std::exception& e) // catch other c++ exceptions
01900     {
01901         std::string str;
01902         str += "FC++ exception thrown (";
01903         str += e.what();
01904         str += ")";
01905         Base::Console().Error(str.c_str());
01906         PyErr_SetString(PyExc_Exception,str.c_str());
01907         return NULL;
01908     }
01909     catch(...)  // catch the rest!
01910     {
01911         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
01912         return NULL;
01913     }
01914 #endif
01915 }
01916 
01917 // addMesh() callback and implementer
01918 // PyObject*  MeshPy::addMesh(PyObject *args){};
01919 // has to be implemented in MeshPyImp.cpp
01920 PyObject * MeshPy::staticCallback_addMesh (PyObject *self, PyObject *args)
01921 {
01922     // test if twin object not allready deleted
01923     if (!((PyObjectBase*) self)->isValid()){
01924         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01925         return NULL;
01926     }
01927 
01928     // test if object is set Const
01929     if (((PyObjectBase*) self)->isConst()){
01930         PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
01931         return NULL;
01932     }
01933 
01934     try { // catches all exceptions coming up from c++ and generate a python exception
01935         PyObject* ret = ((MeshPy*)self)->addMesh(args);
01936         if (ret != 0)
01937             ((MeshPy*)self)->startNotify();
01938         return ret;
01939     }
01940     catch(const Base::Exception& e) // catch the FreeCAD exceptions
01941     {
01942         std::string str;
01943         str += "FreeCAD exception thrown (";
01944         str += e.what();
01945         str += ")";
01946         e.ReportException();
01947         PyErr_SetString(PyExc_Exception,str.c_str());
01948         return NULL;
01949     }
01950     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
01951     {
01952         std::string str;
01953         str += "File system exception thrown (";
01954         //str += e.who();
01955         //str += ", ";
01956         str += e.what();
01957         str += ")\n";
01958         Base::Console().Error(str.c_str());
01959         PyErr_SetString(PyExc_Exception,str.c_str());
01960         return NULL;
01961     }
01962     catch(const Py::Exception&)
01963     {
01964         // The exception text is already set
01965         return NULL;
01966     }
01967     catch(const char* e) // catch simple string exceptions
01968     {
01969         Base::Console().Error(e);
01970         PyErr_SetString(PyExc_Exception,e);
01971         return NULL;
01972     }
01973     // in debug not all exceptions will be catched to get the attention of the developer!
01974 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
01975     catch(const std::exception& e) // catch other c++ exceptions
01976     {
01977         std::string str;
01978         str += "FC++ exception thrown (";
01979         str += e.what();
01980         str += ")";
01981         Base::Console().Error(str.c_str());
01982         PyErr_SetString(PyExc_Exception,str.c_str());
01983         return NULL;
01984     }
01985     catch(...)  // catch the rest!
01986     {
01987         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
01988         return NULL;
01989     }
01990 #endif
01991 }
01992 
01993 // setPoint() callback and implementer
01994 // PyObject*  MeshPy::setPoint(PyObject *args){};
01995 // has to be implemented in MeshPyImp.cpp
01996 PyObject * MeshPy::staticCallback_setPoint (PyObject *self, PyObject *args)
01997 {
01998     // test if twin object not allready deleted
01999     if (!((PyObjectBase*) self)->isValid()){
02000         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
02001         return NULL;
02002     }
02003 
02004     // test if object is set Const
02005     if (((PyObjectBase*) self)->isConst()){
02006         PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
02007         return NULL;
02008     }
02009 
02010     try { // catches all exceptions coming up from c++ and generate a python exception
02011         PyObject* ret = ((MeshPy*)self)->setPoint(args);
02012         if (ret != 0)
02013             ((MeshPy*)self)->startNotify();
02014         return ret;
02015     }
02016     catch(const Base::Exception& e) // catch the FreeCAD exceptions
02017     {
02018         std::string str;
02019         str += "FreeCAD exception thrown (";
02020         str += e.what();
02021         str += ")";
02022         e.ReportException();
02023         PyErr_SetString(PyExc_Exception,str.c_str());
02024         return NULL;
02025     }
02026     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
02027     {
02028         std::string str;
02029         str += "File system exception thrown (";
02030         //str += e.who();
02031         //str += ", ";
02032         str += e.what();
02033         str += ")\n";
02034         Base::Console().Error(str.c_str());
02035         PyErr_SetString(PyExc_Exception,str.c_str());
02036         return NULL;
02037     }
02038     catch(const Py::Exception&)
02039     {
02040         // The exception text is already set
02041         return NULL;
02042     }
02043     catch(const char* e) // catch simple string exceptions
02044     {
02045         Base::Console().Error(e);
02046         PyErr_SetString(PyExc_Exception,e);
02047         return NULL;
02048     }
02049     // in debug not all exceptions will be catched to get the attention of the developer!
02050 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
02051     catch(const std::exception& e) // catch other c++ exceptions
02052     {
02053         std::string str;
02054         str += "FC++ exception thrown (";
02055         str += e.what();
02056         str += ")";
02057         Base::Console().Error(str.c_str());
02058         PyErr_SetString(PyExc_Exception,str.c_str());
02059         return NULL;
02060     }
02061     catch(...)  // catch the rest!
02062     {
02063         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
02064         return NULL;
02065     }
02066 #endif
02067 }
02068 
02069 // countSegments() callback and implementer
02070 // PyObject*  MeshPy::countSegments(PyObject *args){};
02071 // has to be implemented in MeshPyImp.cpp
02072 PyObject * MeshPy::staticCallback_countSegments (PyObject *self, PyObject *args)
02073 {
02074     // test if twin object not allready deleted
02075     if (!((PyObjectBase*) self)->isValid()){
02076         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
02077         return NULL;
02078     }
02079 
02080 
02081     try { // catches all exceptions coming up from c++ and generate a python exception
02082         PyObject* ret = ((MeshPy*)self)->countSegments(args);
02083         return ret;
02084     }
02085     catch(const Base::Exception& e) // catch the FreeCAD exceptions
02086     {
02087         std::string str;
02088         str += "FreeCAD exception thrown (";
02089         str += e.what();
02090         str += ")";
02091         e.ReportException();
02092         PyErr_SetString(PyExc_Exception,str.c_str());
02093         return NULL;
02094     }
02095     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
02096     {
02097         std::string str;
02098         str += "File system exception thrown (";
02099         //str += e.who();
02100         //str += ", ";
02101         str += e.what();
02102         str += ")\n";
02103         Base::Console().Error(str.c_str());
02104         PyErr_SetString(PyExc_Exception,str.c_str());
02105         return NULL;
02106     }
02107     catch(const Py::Exception&)
02108     {
02109         // The exception text is already set
02110         return NULL;
02111     }
02112     catch(const char* e) // catch simple string exceptions
02113     {
02114         Base::Console().Error(e);
02115         PyErr_SetString(PyExc_Exception,e);
02116         return NULL;
02117     }
02118     // in debug not all exceptions will be catched to get the attention of the developer!
02119 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
02120     catch(const std::exception& e) // catch other c++ exceptions
02121     {
02122         std::string str;
02123         str += "FC++ exception thrown (";
02124         str += e.what();
02125         str += ")";
02126         Base::Console().Error(str.c_str());
02127         PyErr_SetString(PyExc_Exception,str.c_str());
02128         return NULL;
02129     }
02130     catch(...)  // catch the rest!
02131     {
02132         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
02133         return NULL;
02134     }
02135 #endif
02136 }
02137 
02138 // getSegment() callback and implementer
02139 // PyObject*  MeshPy::getSegment(PyObject *args){};
02140 // has to be implemented in MeshPyImp.cpp
02141 PyObject * MeshPy::staticCallback_getSegment (PyObject *self, PyObject *args)
02142 {
02143     // test if twin object not allready deleted
02144     if (!((PyObjectBase*) self)->isValid()){
02145         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
02146         return NULL;
02147     }
02148 
02149 
02150     try { // catches all exceptions coming up from c++ and generate a python exception
02151         PyObject* ret = ((MeshPy*)self)->getSegment(args);
02152         return ret;
02153     }
02154     catch(const Base::Exception& e) // catch the FreeCAD exceptions
02155     {
02156         std::string str;
02157         str += "FreeCAD exception thrown (";
02158         str += e.what();
02159         str += ")";
02160         e.ReportException();
02161         PyErr_SetString(PyExc_Exception,str.c_str());
02162         return NULL;
02163     }
02164     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
02165     {
02166         std::string str;
02167         str += "File system exception thrown (";
02168         //str += e.who();
02169         //str += ", ";
02170         str += e.what();
02171         str += ")\n";
02172         Base::Console().Error(str.c_str());
02173         PyErr_SetString(PyExc_Exception,str.c_str());
02174         return NULL;
02175     }
02176     catch(const Py::Exception&)
02177     {
02178         // The exception text is already set
02179         return NULL;
02180     }
02181     catch(const char* e) // catch simple string exceptions
02182     {
02183         Base::Console().Error(e);
02184         PyErr_SetString(PyExc_Exception,e);
02185         return NULL;
02186     }
02187     // in debug not all exceptions will be catched to get the attention of the developer!
02188 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
02189     catch(const std::exception& e) // catch other c++ exceptions
02190     {
02191         std::string str;
02192         str += "FC++ exception thrown (";
02193         str += e.what();
02194         str += ")";
02195         Base::Console().Error(str.c_str());
02196         PyErr_SetString(PyExc_Exception,str.c_str());
02197         return NULL;
02198     }
02199     catch(...)  // catch the rest!
02200     {
02201         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
02202         return NULL;
02203     }
02204 #endif
02205 }
02206 
02207 // getSeparateComponents() callback and implementer
02208 // PyObject*  MeshPy::getSeparateComponents(PyObject *args){};
02209 // has to be implemented in MeshPyImp.cpp
02210 PyObject * MeshPy::staticCallback_getSeparateComponents (PyObject *self, PyObject *args)
02211 {
02212     // test if twin object not allready deleted
02213     if (!((PyObjectBase*) self)->isValid()){
02214         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
02215         return NULL;
02216     }
02217 
02218 
02219     try { // catches all exceptions coming up from c++ and generate a python exception
02220         PyObject* ret = ((MeshPy*)self)->getSeparateComponents(args);
02221         return ret;
02222     }
02223     catch(const Base::Exception& e) // catch the FreeCAD exceptions
02224     {
02225         std::string str;
02226         str += "FreeCAD exception thrown (";
02227         str += e.what();
02228         str += ")";
02229         e.ReportException();
02230         PyErr_SetString(PyExc_Exception,str.c_str());
02231         return NULL;
02232     }
02233     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
02234     {
02235         std::string str;
02236         str += "File system exception thrown (";
02237         //str += e.who();
02238         //str += ", ";
02239         str += e.what();
02240         str += ")\n";
02241         Base::Console().Error(str.c_str());
02242         PyErr_SetString(PyExc_Exception,str.c_str());
02243         return NULL;
02244     }
02245     catch(const Py::Exception&)
02246     {
02247         // The exception text is already set
02248         return NULL;
02249     }
02250     catch(const char* e) // catch simple string exceptions
02251     {
02252         Base::Console().Error(e);
02253         PyErr_SetString(PyExc_Exception,e);
02254         return NULL;
02255     }
02256     // in debug not all exceptions will be catched to get the attention of the developer!
02257 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
02258     catch(const std::exception& e) // catch other c++ exceptions
02259     {
02260         std::string str;
02261         str += "FC++ exception thrown (";
02262         str += e.what();
02263         str += ")";
02264         Base::Console().Error(str.c_str());
02265         PyErr_SetString(PyExc_Exception,str.c_str());
02266         return NULL;
02267     }
02268     catch(...)  // catch the rest!
02269     {
02270         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
02271         return NULL;
02272     }
02273 #endif
02274 }
02275 
02276 // getFacetSelection() callback and implementer
02277 // PyObject*  MeshPy::getFacetSelection(PyObject *args){};
02278 // has to be implemented in MeshPyImp.cpp
02279 PyObject * MeshPy::staticCallback_getFacetSelection (PyObject *self, PyObject *args)
02280 {
02281     // test if twin object not allready deleted
02282     if (!((PyObjectBase*) self)->isValid()){
02283         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
02284         return NULL;
02285     }
02286 
02287 
02288     try { // catches all exceptions coming up from c++ and generate a python exception
02289         PyObject* ret = ((MeshPy*)self)->getFacetSelection(args);
02290         return ret;
02291     }
02292     catch(const Base::Exception& e) // catch the FreeCAD exceptions
02293     {
02294         std::string str;
02295         str += "FreeCAD exception thrown (";
02296         str += e.what();
02297         str += ")";
02298         e.ReportException();
02299         PyErr_SetString(PyExc_Exception,str.c_str());
02300         return NULL;
02301     }
02302     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
02303     {
02304         std::string str;
02305         str += "File system exception thrown (";
02306         //str += e.who();
02307         //str += ", ";
02308         str += e.what();
02309         str += ")\n";
02310         Base::Console().Error(str.c_str());
02311         PyErr_SetString(PyExc_Exception,str.c_str());
02312         return NULL;
02313     }
02314     catch(const Py::Exception&)
02315     {
02316         // The exception text is already set
02317         return NULL;
02318     }
02319     catch(const char* e) // catch simple string exceptions
02320     {
02321         Base::Console().Error(e);
02322         PyErr_SetString(PyExc_Exception,e);
02323         return NULL;
02324     }
02325     // in debug not all exceptions will be catched to get the attention of the developer!
02326 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
02327     catch(const std::exception& e) // catch other c++ exceptions
02328     {
02329         std::string str;
02330         str += "FC++ exception thrown (";
02331         str += e.what();
02332         str += ")";
02333         Base::Console().Error(str.c_str());
02334         PyErr_SetString(PyExc_Exception,str.c_str());
02335         return NULL;
02336     }
02337     catch(...)  // catch the rest!
02338     {
02339         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
02340         return NULL;
02341     }
02342 #endif
02343 }
02344 
02345 // getPointSelection() callback and implementer
02346 // PyObject*  MeshPy::getPointSelection(PyObject *args){};
02347 // has to be implemented in MeshPyImp.cpp
02348 PyObject * MeshPy::staticCallback_getPointSelection (PyObject *self, PyObject *args)
02349 {
02350     // test if twin object not allready deleted
02351     if (!((PyObjectBase*) self)->isValid()){
02352         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
02353         return NULL;
02354     }
02355 
02356 
02357     try { // catches all exceptions coming up from c++ and generate a python exception
02358         PyObject* ret = ((MeshPy*)self)->getPointSelection(args);
02359         return ret;
02360     }
02361     catch(const Base::Exception& e) // catch the FreeCAD exceptions
02362     {
02363         std::string str;
02364         str += "FreeCAD exception thrown (";
02365         str += e.what();
02366         str += ")";
02367         e.ReportException();
02368         PyErr_SetString(PyExc_Exception,str.c_str());
02369         return NULL;
02370     }
02371     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
02372     {
02373         std::string str;
02374         str += "File system exception thrown (";
02375         //str += e.who();
02376         //str += ", ";
02377         str += e.what();
02378         str += ")\n";
02379         Base::Console().Error(str.c_str());
02380         PyErr_SetString(PyExc_Exception,str.c_str());
02381         return NULL;
02382     }
02383     catch(const Py::Exception&)
02384     {
02385         // The exception text is already set
02386         return NULL;
02387     }
02388     catch(const char* e) // catch simple string exceptions
02389     {
02390         Base::Console().Error(e);
02391         PyErr_SetString(PyExc_Exception,e);
02392         return NULL;
02393     }
02394     // in debug not all exceptions will be catched to get the attention of the developer!
02395 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
02396     catch(const std::exception& e) // catch other c++ exceptions
02397     {
02398         std::string str;
02399         str += "FC++ exception thrown (";
02400         str += e.what();
02401         str += ")";
02402         Base::Console().Error(str.c_str());
02403         PyErr_SetString(PyExc_Exception,str.c_str());
02404         return NULL;
02405     }
02406     catch(...)  // catch the rest!
02407     {
02408         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
02409         return NULL;
02410     }
02411 #endif
02412 }
02413 
02414 // meshFromSegment() callback and implementer
02415 // PyObject*  MeshPy::meshFromSegment(PyObject *args){};
02416 // has to be implemented in MeshPyImp.cpp
02417 PyObject * MeshPy::staticCallback_meshFromSegment (PyObject *self, PyObject *args)
02418 {
02419     // test if twin object not allready deleted
02420     if (!((PyObjectBase*) self)->isValid()){
02421         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
02422         return NULL;
02423     }
02424 
02425 
02426     try { // catches all exceptions coming up from c++ and generate a python exception
02427         PyObject* ret = ((MeshPy*)self)->meshFromSegment(args);
02428         return ret;
02429     }
02430     catch(const Base::Exception& e) // catch the FreeCAD exceptions
02431     {
02432         std::string str;
02433         str += "FreeCAD exception thrown (";
02434         str += e.what();
02435         str += ")";
02436         e.ReportException();
02437         PyErr_SetString(PyExc_Exception,str.c_str());
02438         return NULL;
02439     }
02440     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
02441     {
02442         std::string str;
02443         str += "File system exception thrown (";
02444         //str += e.who();
02445         //str += ", ";
02446         str += e.what();
02447         str += ")\n";
02448         Base::Console().Error(str.c_str());
02449         PyErr_SetString(PyExc_Exception,str.c_str());
02450         return NULL;
02451     }
02452     catch(const Py::Exception&)
02453     {
02454         // The exception text is already set
02455         return NULL;
02456     }
02457     catch(const char* e) // catch simple string exceptions
02458     {
02459         Base::Console().Error(e);
02460         PyErr_SetString(PyExc_Exception,e);
02461         return NULL;
02462     }
02463     // in debug not all exceptions will be catched to get the attention of the developer!
02464 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
02465     catch(const std::exception& e) // catch other c++ exceptions
02466     {
02467         std::string str;
02468         str += "FC++ exception thrown (";
02469         str += e.what();
02470         str += ")";
02471         Base::Console().Error(str.c_str());
02472         PyErr_SetString(PyExc_Exception,str.c_str());
02473         return NULL;
02474     }
02475     catch(...)  // catch the rest!
02476     {
02477         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
02478         return NULL;
02479     }
02480 #endif
02481 }
02482 
02483 // clear() callback and implementer
02484 // PyObject*  MeshPy::clear(PyObject *args){};
02485 // has to be implemented in MeshPyImp.cpp
02486 PyObject * MeshPy::staticCallback_clear (PyObject *self, PyObject *args)
02487 {
02488     // test if twin object not allready deleted
02489     if (!((PyObjectBase*) self)->isValid()){
02490         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
02491         return NULL;
02492     }
02493 
02494     // test if object is set Const
02495     if (((PyObjectBase*) self)->isConst()){
02496         PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
02497         return NULL;
02498     }
02499 
02500     try { // catches all exceptions coming up from c++ and generate a python exception
02501         PyObject* ret = ((MeshPy*)self)->clear(args);
02502         if (ret != 0)
02503             ((MeshPy*)self)->startNotify();
02504         return ret;
02505     }
02506     catch(const Base::Exception& e) // catch the FreeCAD exceptions
02507     {
02508         std::string str;
02509         str += "FreeCAD exception thrown (";
02510         str += e.what();
02511         str += ")";
02512         e.ReportException();
02513         PyErr_SetString(PyExc_Exception,str.c_str());
02514         return NULL;
02515     }
02516     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
02517     {
02518         std::string str;
02519         str += "File system exception thrown (";
02520         //str += e.who();
02521         //str += ", ";
02522         str += e.what();
02523         str += ")\n";
02524         Base::Console().Error(str.c_str());
02525         PyErr_SetString(PyExc_Exception,str.c_str());
02526         return NULL;
02527     }
02528     catch(const Py::Exception&)
02529     {
02530         // The exception text is already set
02531         return NULL;
02532     }
02533     catch(const char* e) // catch simple string exceptions
02534     {
02535         Base::Console().Error(e);
02536         PyErr_SetString(PyExc_Exception,e);
02537         return NULL;
02538     }
02539     // in debug not all exceptions will be catched to get the attention of the developer!
02540 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
02541     catch(const std::exception& e) // catch other c++ exceptions
02542     {
02543         std::string str;
02544         str += "FC++ exception thrown (";
02545         str += e.what();
02546         str += ")";
02547         Base::Console().Error(str.c_str());
02548         PyErr_SetString(PyExc_Exception,str.c_str());
02549         return NULL;
02550     }
02551     catch(...)  // catch the rest!
02552     {
02553         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
02554         return NULL;
02555     }
02556 #endif
02557 }
02558 
02559 // isSolid() callback and implementer
02560 // PyObject*  MeshPy::isSolid(PyObject *args){};
02561 // has to be implemented in MeshPyImp.cpp
02562 PyObject * MeshPy::staticCallback_isSolid (PyObject *self, PyObject *args)
02563 {
02564     // test if twin object not allready deleted
02565     if (!((PyObjectBase*) self)->isValid()){
02566         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
02567         return NULL;
02568     }
02569 
02570 
02571     try { // catches all exceptions coming up from c++ and generate a python exception
02572         PyObject* ret = ((MeshPy*)self)->isSolid(args);
02573         return ret;
02574     }
02575     catch(const Base::Exception& e) // catch the FreeCAD exceptions
02576     {
02577         std::string str;
02578         str += "FreeCAD exception thrown (";
02579         str += e.what();
02580         str += ")";
02581         e.ReportException();
02582         PyErr_SetString(PyExc_Exception,str.c_str());
02583         return NULL;
02584     }
02585     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
02586     {
02587         std::string str;
02588         str += "File system exception thrown (";
02589         //str += e.who();
02590         //str += ", ";
02591         str += e.what();
02592         str += ")\n";
02593         Base::Console().Error(str.c_str());
02594         PyErr_SetString(PyExc_Exception,str.c_str());
02595         return NULL;
02596     }
02597     catch(const Py::Exception&)
02598     {
02599         // The exception text is already set
02600         return NULL;
02601     }
02602     catch(const char* e) // catch simple string exceptions
02603     {
02604         Base::Console().Error(e);
02605         PyErr_SetString(PyExc_Exception,e);
02606         return NULL;
02607     }
02608     // in debug not all exceptions will be catched to get the attention of the developer!
02609 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
02610     catch(const std::exception& e) // catch other c++ exceptions
02611     {
02612         std::string str;
02613         str += "FC++ exception thrown (";
02614         str += e.what();
02615         str += ")";
02616         Base::Console().Error(str.c_str());
02617         PyErr_SetString(PyExc_Exception,str.c_str());
02618         return NULL;
02619     }
02620     catch(...)  // catch the rest!
02621     {
02622         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
02623         return NULL;
02624     }
02625 #endif
02626 }
02627 
02628 // hasNonManifolds() callback and implementer
02629 // PyObject*  MeshPy::hasNonManifolds(PyObject *args){};
02630 // has to be implemented in MeshPyImp.cpp
02631 PyObject * MeshPy::staticCallback_hasNonManifolds (PyObject *self, PyObject *args)
02632 {
02633     // test if twin object not allready deleted
02634     if (!((PyObjectBase*) self)->isValid()){
02635         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
02636         return NULL;
02637     }
02638 
02639 
02640     try { // catches all exceptions coming up from c++ and generate a python exception
02641         PyObject* ret = ((MeshPy*)self)->hasNonManifolds(args);
02642         return ret;
02643     }
02644     catch(const Base::Exception& e) // catch the FreeCAD exceptions
02645     {
02646         std::string str;
02647         str += "FreeCAD exception thrown (";
02648         str += e.what();
02649         str += ")";
02650         e.ReportException();
02651         PyErr_SetString(PyExc_Exception,str.c_str());
02652         return NULL;
02653     }
02654     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
02655     {
02656         std::string str;
02657         str += "File system exception thrown (";
02658         //str += e.who();
02659         //str += ", ";
02660         str += e.what();
02661         str += ")\n";
02662         Base::Console().Error(str.c_str());
02663         PyErr_SetString(PyExc_Exception,str.c_str());
02664         return NULL;
02665     }
02666     catch(const Py::Exception&)
02667     {
02668         // The exception text is already set
02669         return NULL;
02670     }
02671     catch(const char* e) // catch simple string exceptions
02672     {
02673         Base::Console().Error(e);
02674         PyErr_SetString(PyExc_Exception,e);
02675         return NULL;
02676     }
02677     // in debug not all exceptions will be catched to get the attention of the developer!
02678 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
02679     catch(const std::exception& e) // catch other c++ exceptions
02680     {
02681         std::string str;
02682         str += "FC++ exception thrown (";
02683         str += e.what();
02684         str += ")";
02685         Base::Console().Error(str.c_str());
02686         PyErr_SetString(PyExc_Exception,str.c_str());
02687         return NULL;
02688     }
02689     catch(...)  // catch the rest!
02690     {
02691         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
02692         return NULL;
02693     }
02694 #endif
02695 }
02696 
02697 // removeNonManifolds() callback and implementer
02698 // PyObject*  MeshPy::removeNonManifolds(PyObject *args){};
02699 // has to be implemented in MeshPyImp.cpp
02700 PyObject * MeshPy::staticCallback_removeNonManifolds (PyObject *self, PyObject *args)
02701 {
02702     // test if twin object not allready deleted
02703     if (!((PyObjectBase*) self)->isValid()){
02704         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
02705         return NULL;
02706     }
02707 
02708     // test if object is set Const
02709     if (((PyObjectBase*) self)->isConst()){
02710         PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
02711         return NULL;
02712     }
02713 
02714     try { // catches all exceptions coming up from c++ and generate a python exception
02715         PyObject* ret = ((MeshPy*)self)->removeNonManifolds(args);
02716         if (ret != 0)
02717             ((MeshPy*)self)->startNotify();
02718         return ret;
02719     }
02720     catch(const Base::Exception& e) // catch the FreeCAD exceptions
02721     {
02722         std::string str;
02723         str += "FreeCAD exception thrown (";
02724         str += e.what();
02725         str += ")";
02726         e.ReportException();
02727         PyErr_SetString(PyExc_Exception,str.c_str());
02728         return NULL;
02729     }
02730     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
02731     {
02732         std::string str;
02733         str += "File system exception thrown (";
02734         //str += e.who();
02735         //str += ", ";
02736         str += e.what();
02737         str += ")\n";
02738         Base::Console().Error(str.c_str());
02739         PyErr_SetString(PyExc_Exception,str.c_str());
02740         return NULL;
02741     }
02742     catch(const Py::Exception&)
02743     {
02744         // The exception text is already set
02745         return NULL;
02746     }
02747     catch(const char* e) // catch simple string exceptions
02748     {
02749         Base::Console().Error(e);
02750         PyErr_SetString(PyExc_Exception,e);
02751         return NULL;
02752     }
02753     // in debug not all exceptions will be catched to get the attention of the developer!
02754 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
02755     catch(const std::exception& e) // catch other c++ exceptions
02756     {
02757         std::string str;
02758         str += "FC++ exception thrown (";
02759         str += e.what();
02760         str += ")";
02761         Base::Console().Error(str.c_str());
02762         PyErr_SetString(PyExc_Exception,str.c_str());
02763         return NULL;
02764     }
02765     catch(...)  // catch the rest!
02766     {
02767         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
02768         return NULL;
02769     }
02770 #endif
02771 }
02772 
02773 // hasSelfIntersections() callback and implementer
02774 // PyObject*  MeshPy::hasSelfIntersections(PyObject *args){};
02775 // has to be implemented in MeshPyImp.cpp
02776 PyObject * MeshPy::staticCallback_hasSelfIntersections (PyObject *self, PyObject *args)
02777 {
02778     // test if twin object not allready deleted
02779     if (!((PyObjectBase*) self)->isValid()){
02780         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
02781         return NULL;
02782     }
02783 
02784 
02785     try { // catches all exceptions coming up from c++ and generate a python exception
02786         PyObject* ret = ((MeshPy*)self)->hasSelfIntersections(args);
02787         return ret;
02788     }
02789     catch(const Base::Exception& e) // catch the FreeCAD exceptions
02790     {
02791         std::string str;
02792         str += "FreeCAD exception thrown (";
02793         str += e.what();
02794         str += ")";
02795         e.ReportException();
02796         PyErr_SetString(PyExc_Exception,str.c_str());
02797         return NULL;
02798     }
02799     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
02800     {
02801         std::string str;
02802         str += "File system exception thrown (";
02803         //str += e.who();
02804         //str += ", ";
02805         str += e.what();
02806         str += ")\n";
02807         Base::Console().Error(str.c_str());
02808         PyErr_SetString(PyExc_Exception,str.c_str());
02809         return NULL;
02810     }
02811     catch(const Py::Exception&)
02812     {
02813         // The exception text is already set
02814         return NULL;
02815     }
02816     catch(const char* e) // catch simple string exceptions
02817     {
02818         Base::Console().Error(e);
02819         PyErr_SetString(PyExc_Exception,e);
02820         return NULL;
02821     }
02822     // in debug not all exceptions will be catched to get the attention of the developer!
02823 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
02824     catch(const std::exception& e) // catch other c++ exceptions
02825     {
02826         std::string str;
02827         str += "FC++ exception thrown (";
02828         str += e.what();
02829         str += ")";
02830         Base::Console().Error(str.c_str());
02831         PyErr_SetString(PyExc_Exception,str.c_str());
02832         return NULL;
02833     }
02834     catch(...)  // catch the rest!
02835     {
02836         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
02837         return NULL;
02838     }
02839 #endif
02840 }
02841 
02842 // fixSelfIntersections() callback and implementer
02843 // PyObject*  MeshPy::fixSelfIntersections(PyObject *args){};
02844 // has to be implemented in MeshPyImp.cpp
02845 PyObject * MeshPy::staticCallback_fixSelfIntersections (PyObject *self, PyObject *args)
02846 {
02847     // test if twin object not allready deleted
02848     if (!((PyObjectBase*) self)->isValid()){
02849         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
02850         return NULL;
02851     }
02852 
02853     // test if object is set Const
02854     if (((PyObjectBase*) self)->isConst()){
02855         PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
02856         return NULL;
02857     }
02858 
02859     try { // catches all exceptions coming up from c++ and generate a python exception
02860         PyObject* ret = ((MeshPy*)self)->fixSelfIntersections(args);
02861         if (ret != 0)
02862             ((MeshPy*)self)->startNotify();
02863         return ret;
02864     }
02865     catch(const Base::Exception& e) // catch the FreeCAD exceptions
02866     {
02867         std::string str;
02868         str += "FreeCAD exception thrown (";
02869         str += e.what();
02870         str += ")";
02871         e.ReportException();
02872         PyErr_SetString(PyExc_Exception,str.c_str());
02873         return NULL;
02874     }
02875     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
02876     {
02877         std::string str;
02878         str += "File system exception thrown (";
02879         //str += e.who();
02880         //str += ", ";
02881         str += e.what();
02882         str += ")\n";
02883         Base::Console().Error(str.c_str());
02884         PyErr_SetString(PyExc_Exception,str.c_str());
02885         return NULL;
02886     }
02887     catch(const Py::Exception&)
02888     {
02889         // The exception text is already set
02890         return NULL;
02891     }
02892     catch(const char* e) // catch simple string exceptions
02893     {
02894         Base::Console().Error(e);
02895         PyErr_SetString(PyExc_Exception,e);
02896         return NULL;
02897     }
02898     // in debug not all exceptions will be catched to get the attention of the developer!
02899 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
02900     catch(const std::exception& e) // catch other c++ exceptions
02901     {
02902         std::string str;
02903         str += "FC++ exception thrown (";
02904         str += e.what();
02905         str += ")";
02906         Base::Console().Error(str.c_str());
02907         PyErr_SetString(PyExc_Exception,str.c_str());
02908         return NULL;
02909     }
02910     catch(...)  // catch the rest!
02911     {
02912         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
02913         return NULL;
02914     }
02915 #endif
02916 }
02917 
02918 // removeFoldsOnSurface() callback and implementer
02919 // PyObject*  MeshPy::removeFoldsOnSurface(PyObject *args){};
02920 // has to be implemented in MeshPyImp.cpp
02921 PyObject * MeshPy::staticCallback_removeFoldsOnSurface (PyObject *self, PyObject *args)
02922 {
02923     // test if twin object not allready deleted
02924     if (!((PyObjectBase*) self)->isValid()){
02925         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
02926         return NULL;
02927     }
02928 
02929     // test if object is set Const
02930     if (((PyObjectBase*) self)->isConst()){
02931         PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
02932         return NULL;
02933     }
02934 
02935     try { // catches all exceptions coming up from c++ and generate a python exception
02936         PyObject* ret = ((MeshPy*)self)->removeFoldsOnSurface(args);
02937         if (ret != 0)
02938             ((MeshPy*)self)->startNotify();
02939         return ret;
02940     }
02941     catch(const Base::Exception& e) // catch the FreeCAD exceptions
02942     {
02943         std::string str;
02944         str += "FreeCAD exception thrown (";
02945         str += e.what();
02946         str += ")";
02947         e.ReportException();
02948         PyErr_SetString(PyExc_Exception,str.c_str());
02949         return NULL;
02950     }
02951     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
02952     {
02953         std::string str;
02954         str += "File system exception thrown (";
02955         //str += e.who();
02956         //str += ", ";
02957         str += e.what();
02958         str += ")\n";
02959         Base::Console().Error(str.c_str());
02960         PyErr_SetString(PyExc_Exception,str.c_str());
02961         return NULL;
02962     }
02963     catch(const Py::Exception&)
02964     {
02965         // The exception text is already set
02966         return NULL;
02967     }
02968     catch(const char* e) // catch simple string exceptions
02969     {
02970         Base::Console().Error(e);
02971         PyErr_SetString(PyExc_Exception,e);
02972         return NULL;
02973     }
02974     // in debug not all exceptions will be catched to get the attention of the developer!
02975 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
02976     catch(const std::exception& e) // catch other c++ exceptions
02977     {
02978         std::string str;
02979         str += "FC++ exception thrown (";
02980         str += e.what();
02981         str += ")";
02982         Base::Console().Error(str.c_str());
02983         PyErr_SetString(PyExc_Exception,str.c_str());
02984         return NULL;
02985     }
02986     catch(...)  // catch the rest!
02987     {
02988         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
02989         return NULL;
02990     }
02991 #endif
02992 }
02993 
02994 // hasNonUniformOrientedFacets() callback and implementer
02995 // PyObject*  MeshPy::hasNonUniformOrientedFacets(PyObject *args){};
02996 // has to be implemented in MeshPyImp.cpp
02997 PyObject * MeshPy::staticCallback_hasNonUniformOrientedFacets (PyObject *self, PyObject *args)
02998 {
02999     // test if twin object not allready deleted
03000     if (!((PyObjectBase*) self)->isValid()){
03001         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
03002         return NULL;
03003     }
03004 
03005 
03006     try { // catches all exceptions coming up from c++ and generate a python exception
03007         PyObject* ret = ((MeshPy*)self)->hasNonUniformOrientedFacets(args);
03008         return ret;
03009     }
03010     catch(const Base::Exception& e) // catch the FreeCAD exceptions
03011     {
03012         std::string str;
03013         str += "FreeCAD exception thrown (";
03014         str += e.what();
03015         str += ")";
03016         e.ReportException();
03017         PyErr_SetString(PyExc_Exception,str.c_str());
03018         return NULL;
03019     }
03020     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
03021     {
03022         std::string str;
03023         str += "File system exception thrown (";
03024         //str += e.who();
03025         //str += ", ";
03026         str += e.what();
03027         str += ")\n";
03028         Base::Console().Error(str.c_str());
03029         PyErr_SetString(PyExc_Exception,str.c_str());
03030         return NULL;
03031     }
03032     catch(const Py::Exception&)
03033     {
03034         // The exception text is already set
03035         return NULL;
03036     }
03037     catch(const char* e) // catch simple string exceptions
03038     {
03039         Base::Console().Error(e);
03040         PyErr_SetString(PyExc_Exception,e);
03041         return NULL;
03042     }
03043     // in debug not all exceptions will be catched to get the attention of the developer!
03044 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
03045     catch(const std::exception& e) // catch other c++ exceptions
03046     {
03047         std::string str;
03048         str += "FC++ exception thrown (";
03049         str += e.what();
03050         str += ")";
03051         Base::Console().Error(str.c_str());
03052         PyErr_SetString(PyExc_Exception,str.c_str());
03053         return NULL;
03054     }
03055     catch(...)  // catch the rest!
03056     {
03057         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
03058         return NULL;
03059     }
03060 #endif
03061 }
03062 
03063 // countNonUniformOrientedFacets() callback and implementer
03064 // PyObject*  MeshPy::countNonUniformOrientedFacets(PyObject *args){};
03065 // has to be implemented in MeshPyImp.cpp
03066 PyObject * MeshPy::staticCallback_countNonUniformOrientedFacets (PyObject *self, PyObject *args)
03067 {
03068     // test if twin object not allready deleted
03069     if (!((PyObjectBase*) self)->isValid()){
03070         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
03071         return NULL;
03072     }
03073 
03074 
03075     try { // catches all exceptions coming up from c++ and generate a python exception
03076         PyObject* ret = ((MeshPy*)self)->countNonUniformOrientedFacets(args);
03077         return ret;
03078     }
03079     catch(const Base::Exception& e) // catch the FreeCAD exceptions
03080     {
03081         std::string str;
03082         str += "FreeCAD exception thrown (";
03083         str += e.what();
03084         str += ")";
03085         e.ReportException();
03086         PyErr_SetString(PyExc_Exception,str.c_str());
03087         return NULL;
03088     }
03089     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
03090     {
03091         std::string str;
03092         str += "File system exception thrown (";
03093         //str += e.who();
03094         //str += ", ";
03095         str += e.what();
03096         str += ")\n";
03097         Base::Console().Error(str.c_str());
03098         PyErr_SetString(PyExc_Exception,str.c_str());
03099         return NULL;
03100     }
03101     catch(const Py::Exception&)
03102     {
03103         // The exception text is already set
03104         return NULL;
03105     }
03106     catch(const char* e) // catch simple string exceptions
03107     {
03108         Base::Console().Error(e);
03109         PyErr_SetString(PyExc_Exception,e);
03110         return NULL;
03111     }
03112     // in debug not all exceptions will be catched to get the attention of the developer!
03113 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
03114     catch(const std::exception& e) // catch other c++ exceptions
03115     {
03116         std::string str;
03117         str += "FC++ exception thrown (";
03118         str += e.what();
03119         str += ")";
03120         Base::Console().Error(str.c_str());
03121         PyErr_SetString(PyExc_Exception,str.c_str());
03122         return NULL;
03123     }
03124     catch(...)  // catch the rest!
03125     {
03126         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
03127         return NULL;
03128     }
03129 #endif
03130 }
03131 
03132 // countComponents() callback and implementer
03133 // PyObject*  MeshPy::countComponents(PyObject *args){};
03134 // has to be implemented in MeshPyImp.cpp
03135 PyObject * MeshPy::staticCallback_countComponents (PyObject *self, PyObject *args)
03136 {
03137     // test if twin object not allready deleted
03138     if (!((PyObjectBase*) self)->isValid()){
03139         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
03140         return NULL;
03141     }
03142 
03143 
03144     try { // catches all exceptions coming up from c++ and generate a python exception
03145         PyObject* ret = ((MeshPy*)self)->countComponents(args);
03146         return ret;
03147     }
03148     catch(const Base::Exception& e) // catch the FreeCAD exceptions
03149     {
03150         std::string str;
03151         str += "FreeCAD exception thrown (";
03152         str += e.what();
03153         str += ")";
03154         e.ReportException();
03155         PyErr_SetString(PyExc_Exception,str.c_str());
03156         return NULL;
03157     }
03158     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
03159     {
03160         std::string str;
03161         str += "File system exception thrown (";
03162         //str += e.who();
03163         //str += ", ";
03164         str += e.what();
03165         str += ")\n";
03166         Base::Console().Error(str.c_str());
03167         PyErr_SetString(PyExc_Exception,str.c_str());
03168         return NULL;
03169     }
03170     catch(const Py::Exception&)
03171     {
03172         // The exception text is already set
03173         return NULL;
03174     }
03175     catch(const char* e) // catch simple string exceptions
03176     {
03177         Base::Console().Error(e);
03178         PyErr_SetString(PyExc_Exception,e);
03179         return NULL;
03180     }
03181     // in debug not all exceptions will be catched to get the attention of the developer!
03182 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
03183     catch(const std::exception& e) // catch other c++ exceptions
03184     {
03185         std::string str;
03186         str += "FC++ exception thrown (";
03187         str += e.what();
03188         str += ")";
03189         Base::Console().Error(str.c_str());
03190         PyErr_SetString(PyExc_Exception,str.c_str());
03191         return NULL;
03192     }
03193     catch(...)  // catch the rest!
03194     {
03195         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
03196         return NULL;
03197     }
03198 #endif
03199 }
03200 
03201 // removeComponents() callback and implementer
03202 // PyObject*  MeshPy::removeComponents(PyObject *args){};
03203 // has to be implemented in MeshPyImp.cpp
03204 PyObject * MeshPy::staticCallback_removeComponents (PyObject *self, PyObject *args)
03205 {
03206     // test if twin object not allready deleted
03207     if (!((PyObjectBase*) self)->isValid()){
03208         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
03209         return NULL;
03210     }
03211 
03212     // test if object is set Const
03213     if (((PyObjectBase*) self)->isConst()){
03214         PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
03215         return NULL;
03216     }
03217 
03218     try { // catches all exceptions coming up from c++ and generate a python exception
03219         PyObject* ret = ((MeshPy*)self)->removeComponents(args);
03220         if (ret != 0)
03221             ((MeshPy*)self)->startNotify();
03222         return ret;
03223     }
03224     catch(const Base::Exception& e) // catch the FreeCAD exceptions
03225     {
03226         std::string str;
03227         str += "FreeCAD exception thrown (";
03228         str += e.what();
03229         str += ")";
03230         e.ReportException();
03231         PyErr_SetString(PyExc_Exception,str.c_str());
03232         return NULL;
03233     }
03234     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
03235     {
03236         std::string str;
03237         str += "File system exception thrown (";
03238         //str += e.who();
03239         //str += ", ";
03240         str += e.what();
03241         str += ")\n";
03242         Base::Console().Error(str.c_str());
03243         PyErr_SetString(PyExc_Exception,str.c_str());
03244         return NULL;
03245     }
03246     catch(const Py::Exception&)
03247     {
03248         // The exception text is already set
03249         return NULL;
03250     }
03251     catch(const char* e) // catch simple string exceptions
03252     {
03253         Base::Console().Error(e);
03254         PyErr_SetString(PyExc_Exception,e);
03255         return NULL;
03256     }
03257     // in debug not all exceptions will be catched to get the attention of the developer!
03258 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
03259     catch(const std::exception& e) // catch other c++ exceptions
03260     {
03261         std::string str;
03262         str += "FC++ exception thrown (";
03263         str += e.what();
03264         str += ")";
03265         Base::Console().Error(str.c_str());
03266         PyErr_SetString(PyExc_Exception,str.c_str());
03267         return NULL;
03268     }
03269     catch(...)  // catch the rest!
03270     {
03271         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
03272         return NULL;
03273     }
03274 #endif
03275 }
03276 
03277 // fixIndices() callback and implementer
03278 // PyObject*  MeshPy::fixIndices(PyObject *args){};
03279 // has to be implemented in MeshPyImp.cpp
03280 PyObject * MeshPy::staticCallback_fixIndices (PyObject *self, PyObject *args)
03281 {
03282     // test if twin object not allready deleted
03283     if (!((PyObjectBase*) self)->isValid()){
03284         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
03285         return NULL;
03286     }
03287 
03288     // test if object is set Const
03289     if (((PyObjectBase*) self)->isConst()){
03290         PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
03291         return NULL;
03292     }
03293 
03294     try { // catches all exceptions coming up from c++ and generate a python exception
03295         PyObject* ret = ((MeshPy*)self)->fixIndices(args);
03296         if (ret != 0)
03297             ((MeshPy*)self)->startNotify();
03298         return ret;
03299     }
03300     catch(const Base::Exception& e) // catch the FreeCAD exceptions
03301     {
03302         std::string str;
03303         str += "FreeCAD exception thrown (";
03304         str += e.what();
03305         str += ")";
03306         e.ReportException();
03307         PyErr_SetString(PyExc_Exception,str.c_str());
03308         return NULL;
03309     }
03310     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
03311     {
03312         std::string str;
03313         str += "File system exception thrown (";
03314         //str += e.who();
03315         //str += ", ";
03316         str += e.what();
03317         str += ")\n";
03318         Base::Console().Error(str.c_str());
03319         PyErr_SetString(PyExc_Exception,str.c_str());
03320         return NULL;
03321     }
03322     catch(const Py::Exception&)
03323     {
03324         // The exception text is already set
03325         return NULL;
03326     }
03327     catch(const char* e) // catch simple string exceptions
03328     {
03329         Base::Console().Error(e);
03330         PyErr_SetString(PyExc_Exception,e);
03331         return NULL;
03332     }
03333     // in debug not all exceptions will be catched to get the attention of the developer!
03334 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
03335     catch(const std::exception& e) // catch other c++ exceptions
03336     {
03337         std::string str;
03338         str += "FC++ exception thrown (";
03339         str += e.what();
03340         str += ")";
03341         Base::Console().Error(str.c_str());
03342         PyErr_SetString(PyExc_Exception,str.c_str());
03343         return NULL;
03344     }
03345     catch(...)  // catch the rest!
03346     {
03347         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
03348         return NULL;
03349     }
03350 #endif
03351 }
03352 
03353 // fixDeformations() callback and implementer
03354 // PyObject*  MeshPy::fixDeformations(PyObject *args){};
03355 // has to be implemented in MeshPyImp.cpp
03356 PyObject * MeshPy::staticCallback_fixDeformations (PyObject *self, PyObject *args)
03357 {
03358     // test if twin object not allready deleted
03359     if (!((PyObjectBase*) self)->isValid()){
03360         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
03361         return NULL;
03362     }
03363 
03364     // test if object is set Const
03365     if (((PyObjectBase*) self)->isConst()){
03366         PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
03367         return NULL;
03368     }
03369 
03370     try { // catches all exceptions coming up from c++ and generate a python exception
03371         PyObject* ret = ((MeshPy*)self)->fixDeformations(args);
03372         if (ret != 0)
03373             ((MeshPy*)self)->startNotify();
03374         return ret;
03375     }
03376     catch(const Base::Exception& e) // catch the FreeCAD exceptions
03377     {
03378         std::string str;
03379         str += "FreeCAD exception thrown (";
03380         str += e.what();
03381         str += ")";
03382         e.ReportException();
03383         PyErr_SetString(PyExc_Exception,str.c_str());
03384         return NULL;
03385     }
03386     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
03387     {
03388         std::string str;
03389         str += "File system exception thrown (";
03390         //str += e.who();
03391         //str += ", ";
03392         str += e.what();
03393         str += ")\n";
03394         Base::Console().Error(str.c_str());
03395         PyErr_SetString(PyExc_Exception,str.c_str());
03396         return NULL;
03397     }
03398     catch(const Py::Exception&)
03399     {
03400         // The exception text is already set
03401         return NULL;
03402     }
03403     catch(const char* e) // catch simple string exceptions
03404     {
03405         Base::Console().Error(e);
03406         PyErr_SetString(PyExc_Exception,e);
03407         return NULL;
03408     }
03409     // in debug not all exceptions will be catched to get the attention of the developer!
03410 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
03411     catch(const std::exception& e) // catch other c++ exceptions
03412     {
03413         std::string str;
03414         str += "FC++ exception thrown (";
03415         str += e.what();
03416         str += ")";
03417         Base::Console().Error(str.c_str());
03418         PyErr_SetString(PyExc_Exception,str.c_str());
03419         return NULL;
03420     }
03421     catch(...)  // catch the rest!
03422     {
03423         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
03424         return NULL;
03425     }
03426 #endif
03427 }
03428 
03429 // fixDegenerations() callback and implementer
03430 // PyObject*  MeshPy::fixDegenerations(PyObject *args){};
03431 // has to be implemented in MeshPyImp.cpp
03432 PyObject * MeshPy::staticCallback_fixDegenerations (PyObject *self, PyObject *args)
03433 {
03434     // test if twin object not allready deleted
03435     if (!((PyObjectBase*) self)->isValid()){
03436         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
03437         return NULL;
03438     }
03439 
03440     // test if object is set Const
03441     if (((PyObjectBase*) self)->isConst()){
03442         PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
03443         return NULL;
03444     }
03445 
03446     try { // catches all exceptions coming up from c++ and generate a python exception
03447         PyObject* ret = ((MeshPy*)self)->fixDegenerations(args);
03448         if (ret != 0)
03449             ((MeshPy*)self)->startNotify();
03450         return ret;
03451     }
03452     catch(const Base::Exception& e) // catch the FreeCAD exceptions
03453     {
03454         std::string str;
03455         str += "FreeCAD exception thrown (";
03456         str += e.what();
03457         str += ")";
03458         e.ReportException();
03459         PyErr_SetString(PyExc_Exception,str.c_str());
03460         return NULL;
03461     }
03462     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
03463     {
03464         std::string str;
03465         str += "File system exception thrown (";
03466         //str += e.who();
03467         //str += ", ";
03468         str += e.what();
03469         str += ")\n";
03470         Base::Console().Error(str.c_str());
03471         PyErr_SetString(PyExc_Exception,str.c_str());
03472         return NULL;
03473     }
03474     catch(const Py::Exception&)
03475     {
03476         // The exception text is already set
03477         return NULL;
03478     }
03479     catch(const char* e) // catch simple string exceptions
03480     {
03481         Base::Console().Error(e);
03482         PyErr_SetString(PyExc_Exception,e);
03483         return NULL;
03484     }
03485     // in debug not all exceptions will be catched to get the attention of the developer!
03486 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
03487     catch(const std::exception& e) // catch other c++ exceptions
03488     {
03489         std::string str;
03490         str += "FC++ exception thrown (";
03491         str += e.what();
03492         str += ")";
03493         Base::Console().Error(str.c_str());
03494         PyErr_SetString(PyExc_Exception,str.c_str());
03495         return NULL;
03496     }
03497     catch(...)  // catch the rest!
03498     {
03499         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
03500         return NULL;
03501     }
03502 #endif
03503 }
03504 
03505 // removeDuplicatedPoints() callback and implementer
03506 // PyObject*  MeshPy::removeDuplicatedPoints(PyObject *args){};
03507 // has to be implemented in MeshPyImp.cpp
03508 PyObject * MeshPy::staticCallback_removeDuplicatedPoints (PyObject *self, PyObject *args)
03509 {
03510     // test if twin object not allready deleted
03511     if (!((PyObjectBase*) self)->isValid()){
03512         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
03513         return NULL;
03514     }
03515 
03516     // test if object is set Const
03517     if (((PyObjectBase*) self)->isConst()){
03518         PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
03519         return NULL;
03520     }
03521 
03522     try { // catches all exceptions coming up from c++ and generate a python exception
03523         PyObject* ret = ((MeshPy*)self)->removeDuplicatedPoints(args);
03524         if (ret != 0)
03525             ((MeshPy*)self)->startNotify();
03526         return ret;
03527     }
03528     catch(const Base::Exception& e) // catch the FreeCAD exceptions
03529     {
03530         std::string str;
03531         str += "FreeCAD exception thrown (";
03532         str += e.what();
03533         str += ")";
03534         e.ReportException();
03535         PyErr_SetString(PyExc_Exception,str.c_str());
03536         return NULL;
03537     }
03538     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
03539     {
03540         std::string str;
03541         str += "File system exception thrown (";
03542         //str += e.who();
03543         //str += ", ";
03544         str += e.what();
03545         str += ")\n";
03546         Base::Console().Error(str.c_str());
03547         PyErr_SetString(PyExc_Exception,str.c_str());
03548         return NULL;
03549     }
03550     catch(const Py::Exception&)
03551     {
03552         // The exception text is already set
03553         return NULL;
03554     }
03555     catch(const char* e) // catch simple string exceptions
03556     {
03557         Base::Console().Error(e);
03558         PyErr_SetString(PyExc_Exception,e);
03559         return NULL;
03560     }
03561     // in debug not all exceptions will be catched to get the attention of the developer!
03562 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
03563     catch(const std::exception& e) // catch other c++ exceptions
03564     {
03565         std::string str;
03566         str += "FC++ exception thrown (";
03567         str += e.what();
03568         str += ")";
03569         Base::Console().Error(str.c_str());
03570         PyErr_SetString(PyExc_Exception,str.c_str());
03571         return NULL;
03572     }
03573     catch(...)  // catch the rest!
03574     {
03575         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
03576         return NULL;
03577     }
03578 #endif
03579 }
03580 
03581 // removeDuplicatedFacets() callback and implementer
03582 // PyObject*  MeshPy::removeDuplicatedFacets(PyObject *args){};
03583 // has to be implemented in MeshPyImp.cpp
03584 PyObject * MeshPy::staticCallback_removeDuplicatedFacets (PyObject *self, PyObject *args)
03585 {
03586     // test if twin object not allready deleted
03587     if (!((PyObjectBase*) self)->isValid()){
03588         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
03589         return NULL;
03590     }
03591 
03592     // test if object is set Const
03593     if (((PyObjectBase*) self)->isConst()){
03594         PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
03595         return NULL;
03596     }
03597 
03598     try { // catches all exceptions coming up from c++ and generate a python exception
03599         PyObject* ret = ((MeshPy*)self)->removeDuplicatedFacets(args);
03600         if (ret != 0)
03601             ((MeshPy*)self)->startNotify();
03602         return ret;
03603     }
03604     catch(const Base::Exception& e) // catch the FreeCAD exceptions
03605     {
03606         std::string str;
03607         str += "FreeCAD exception thrown (";
03608         str += e.what();
03609         str += ")";
03610         e.ReportException();
03611         PyErr_SetString(PyExc_Exception,str.c_str());
03612         return NULL;
03613     }
03614     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
03615     {
03616         std::string str;
03617         str += "File system exception thrown (";
03618         //str += e.who();
03619         //str += ", ";
03620         str += e.what();
03621         str += ")\n";
03622         Base::Console().Error(str.c_str());
03623         PyErr_SetString(PyExc_Exception,str.c_str());
03624         return NULL;
03625     }
03626     catch(const Py::Exception&)
03627     {
03628         // The exception text is already set
03629         return NULL;
03630     }
03631     catch(const char* e) // catch simple string exceptions
03632     {
03633         Base::Console().Error(e);
03634         PyErr_SetString(PyExc_Exception,e);
03635         return NULL;
03636     }
03637     // in debug not all exceptions will be catched to get the attention of the developer!
03638 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
03639     catch(const std::exception& e) // catch other c++ exceptions
03640     {
03641         std::string str;
03642         str += "FC++ exception thrown (";
03643         str += e.what();
03644         str += ")";
03645         Base::Console().Error(str.c_str());
03646         PyErr_SetString(PyExc_Exception,str.c_str());
03647         return NULL;
03648     }
03649     catch(...)  // catch the rest!
03650     {
03651         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
03652         return NULL;
03653     }
03654 #endif
03655 }
03656 
03657 // refine() callback and implementer
03658 // PyObject*  MeshPy::refine(PyObject *args){};
03659 // has to be implemented in MeshPyImp.cpp
03660 PyObject * MeshPy::staticCallback_refine (PyObject *self, PyObject *args)
03661 {
03662     // test if twin object not allready deleted
03663     if (!((PyObjectBase*) self)->isValid()){
03664         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
03665         return NULL;
03666     }
03667 
03668     // test if object is set Const
03669     if (((PyObjectBase*) self)->isConst()){
03670         PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
03671         return NULL;
03672     }
03673 
03674     try { // catches all exceptions coming up from c++ and generate a python exception
03675         PyObject* ret = ((MeshPy*)self)->refine(args);
03676         if (ret != 0)
03677             ((MeshPy*)self)->startNotify();
03678         return ret;
03679     }
03680     catch(const Base::Exception& e) // catch the FreeCAD exceptions
03681     {
03682         std::string str;
03683         str += "FreeCAD exception thrown (";
03684         str += e.what();
03685         str += ")";
03686         e.ReportException();
03687         PyErr_SetString(PyExc_Exception,str.c_str());
03688         return NULL;
03689     }
03690     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
03691     {
03692         std::string str;
03693         str += "File system exception thrown (";
03694         //str += e.who();
03695         //str += ", ";
03696         str += e.what();
03697         str += ")\n";
03698         Base::Console().Error(str.c_str());
03699         PyErr_SetString(PyExc_Exception,str.c_str());
03700         return NULL;
03701     }
03702     catch(const Py::Exception&)
03703     {
03704         // The exception text is already set
03705         return NULL;
03706     }
03707     catch(const char* e) // catch simple string exceptions
03708     {
03709         Base::Console().Error(e);
03710         PyErr_SetString(PyExc_Exception,e);
03711         return NULL;
03712     }
03713     // in debug not all exceptions will be catched to get the attention of the developer!
03714 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
03715     catch(const std::exception& e) // catch other c++ exceptions
03716     {
03717         std::string str;
03718         str += "FC++ exception thrown (";
03719         str += e.what();
03720         str += ")";
03721         Base::Console().Error(str.c_str());
03722         PyErr_SetString(PyExc_Exception,str.c_str());
03723         return NULL;
03724     }
03725     catch(...)  // catch the rest!
03726     {
03727         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
03728         return NULL;
03729     }
03730 #endif
03731 }
03732 
03733 // splitEdges() callback and implementer
03734 // PyObject*  MeshPy::splitEdges(PyObject *args){};
03735 // has to be implemented in MeshPyImp.cpp
03736 PyObject * MeshPy::staticCallback_splitEdges (PyObject *self, PyObject *args)
03737 {
03738     // test if twin object not allready deleted
03739     if (!((PyObjectBase*) self)->isValid()){
03740         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
03741         return NULL;
03742     }
03743 
03744     // test if object is set Const
03745     if (((PyObjectBase*) self)->isConst()){
03746         PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
03747         return NULL;
03748     }
03749 
03750     try { // catches all exceptions coming up from c++ and generate a python exception
03751         PyObject* ret = ((MeshPy*)self)->splitEdges(args);
03752         if (ret != 0)
03753             ((MeshPy*)self)->startNotify();
03754         return ret;
03755     }
03756     catch(const Base::Exception& e) // catch the FreeCAD exceptions
03757     {
03758         std::string str;
03759         str += "FreeCAD exception thrown (";
03760         str += e.what();
03761         str += ")";
03762         e.ReportException();
03763         PyErr_SetString(PyExc_Exception,str.c_str());
03764         return NULL;
03765     }
03766     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
03767     {
03768         std::string str;
03769         str += "File system exception thrown (";
03770         //str += e.who();
03771         //str += ", ";
03772         str += e.what();
03773         str += ")\n";
03774         Base::Console().Error(str.c_str());
03775         PyErr_SetString(PyExc_Exception,str.c_str());
03776         return NULL;
03777     }
03778     catch(const Py::Exception&)
03779     {
03780         // The exception text is already set
03781         return NULL;
03782     }
03783     catch(const char* e) // catch simple string exceptions
03784     {
03785         Base::Console().Error(e);
03786         PyErr_SetString(PyExc_Exception,e);
03787         return NULL;
03788     }
03789     // in debug not all exceptions will be catched to get the attention of the developer!
03790 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
03791     catch(const std::exception& e) // catch other c++ exceptions
03792     {
03793         std::string str;
03794         str += "FC++ exception thrown (";
03795         str += e.what();
03796         str += ")";
03797         Base::Console().Error(str.c_str());
03798         PyErr_SetString(PyExc_Exception,str.c_str());
03799         return NULL;
03800     }
03801     catch(...)  // catch the rest!
03802     {
03803         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
03804         return NULL;
03805     }
03806 #endif
03807 }
03808 
03809 // splitEdge() callback and implementer
03810 // PyObject*  MeshPy::splitEdge(PyObject *args){};
03811 // has to be implemented in MeshPyImp.cpp
03812 PyObject * MeshPy::staticCallback_splitEdge (PyObject *self, PyObject *args)
03813 {
03814     // test if twin object not allready deleted
03815     if (!((PyObjectBase*) self)->isValid()){
03816         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
03817         return NULL;
03818     }
03819 
03820     // test if object is set Const
03821     if (((PyObjectBase*) self)->isConst()){
03822         PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
03823         return NULL;
03824     }
03825 
03826     try { // catches all exceptions coming up from c++ and generate a python exception
03827         PyObject* ret = ((MeshPy*)self)->splitEdge(args);
03828         if (ret != 0)
03829             ((MeshPy*)self)->startNotify();
03830         return ret;
03831     }
03832     catch(const Base::Exception& e) // catch the FreeCAD exceptions
03833     {
03834         std::string str;
03835         str += "FreeCAD exception thrown (";
03836         str += e.what();
03837         str += ")";
03838         e.ReportException();
03839         PyErr_SetString(PyExc_Exception,str.c_str());
03840         return NULL;
03841     }
03842     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
03843     {
03844         std::string str;
03845         str += "File system exception thrown (";
03846         //str += e.who();
03847         //str += ", ";
03848         str += e.what();
03849         str += ")\n";
03850         Base::Console().Error(str.c_str());
03851         PyErr_SetString(PyExc_Exception,str.c_str());
03852         return NULL;
03853     }
03854     catch(const Py::Exception&)
03855     {
03856         // The exception text is already set
03857         return NULL;
03858     }
03859     catch(const char* e) // catch simple string exceptions
03860     {
03861         Base::Console().Error(e);
03862         PyErr_SetString(PyExc_Exception,e);
03863         return NULL;
03864     }
03865     // in debug not all exceptions will be catched to get the attention of the developer!
03866 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
03867     catch(const std::exception& e) // catch other c++ exceptions
03868     {
03869         std::string str;
03870         str += "FC++ exception thrown (";
03871         str += e.what();
03872         str += ")";
03873         Base::Console().Error(str.c_str());
03874         PyErr_SetString(PyExc_Exception,str.c_str());
03875         return NULL;
03876     }
03877     catch(...)  // catch the rest!
03878     {
03879         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
03880         return NULL;
03881     }
03882 #endif
03883 }
03884 
03885 // splitFacet() callback and implementer
03886 // PyObject*  MeshPy::splitFacet(PyObject *args){};
03887 // has to be implemented in MeshPyImp.cpp
03888 PyObject * MeshPy::staticCallback_splitFacet (PyObject *self, PyObject *args)
03889 {
03890     // test if twin object not allready deleted
03891     if (!((PyObjectBase*) self)->isValid()){
03892         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
03893         return NULL;
03894     }
03895 
03896     // test if object is set Const
03897     if (((PyObjectBase*) self)->isConst()){
03898         PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
03899         return NULL;
03900     }
03901 
03902     try { // catches all exceptions coming up from c++ and generate a python exception
03903         PyObject* ret = ((MeshPy*)self)->splitFacet(args);
03904         if (ret != 0)
03905             ((MeshPy*)self)->startNotify();
03906         return ret;
03907     }
03908     catch(const Base::Exception& e) // catch the FreeCAD exceptions
03909     {
03910         std::string str;
03911         str += "FreeCAD exception thrown (";
03912         str += e.what();
03913         str += ")";
03914         e.ReportException();
03915         PyErr_SetString(PyExc_Exception,str.c_str());
03916         return NULL;
03917     }
03918     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
03919     {
03920         std::string str;
03921         str += "File system exception thrown (";
03922         //str += e.who();
03923         //str += ", ";
03924         str += e.what();
03925         str += ")\n";
03926         Base::Console().Error(str.c_str());
03927         PyErr_SetString(PyExc_Exception,str.c_str());
03928         return NULL;
03929     }
03930     catch(const Py::Exception&)
03931     {
03932         // The exception text is already set
03933         return NULL;
03934     }
03935     catch(const char* e) // catch simple string exceptions
03936     {
03937         Base::Console().Error(e);
03938         PyErr_SetString(PyExc_Exception,e);
03939         return NULL;
03940     }
03941     // in debug not all exceptions will be catched to get the attention of the developer!
03942 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
03943     catch(const std::exception& e) // catch other c++ exceptions
03944     {
03945         std::string str;
03946         str += "FC++ exception thrown (";
03947         str += e.what();
03948         str += ")";
03949         Base::Console().Error(str.c_str());
03950         PyErr_SetString(PyExc_Exception,str.c_str());
03951         return NULL;
03952     }
03953     catch(...)  // catch the rest!
03954     {
03955         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
03956         return NULL;
03957     }
03958 #endif
03959 }
03960 
03961 // swapEdge() callback and implementer
03962 // PyObject*  MeshPy::swapEdge(PyObject *args){};
03963 // has to be implemented in MeshPyImp.cpp
03964 PyObject * MeshPy::staticCallback_swapEdge (PyObject *self, PyObject *args)
03965 {
03966     // test if twin object not allready deleted
03967     if (!((PyObjectBase*) self)->isValid()){
03968         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
03969         return NULL;
03970     }
03971 
03972     // test if object is set Const
03973     if (((PyObjectBase*) self)->isConst()){
03974         PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
03975         return NULL;
03976     }
03977 
03978     try { // catches all exceptions coming up from c++ and generate a python exception
03979         PyObject* ret = ((MeshPy*)self)->swapEdge(args);
03980         if (ret != 0)
03981             ((MeshPy*)self)->startNotify();
03982         return ret;
03983     }
03984     catch(const Base::Exception& e) // catch the FreeCAD exceptions
03985     {
03986         std::string str;
03987         str += "FreeCAD exception thrown (";
03988         str += e.what();
03989         str += ")";
03990         e.ReportException();
03991         PyErr_SetString(PyExc_Exception,str.c_str());
03992         return NULL;
03993     }
03994     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
03995     {
03996         std::string str;
03997         str += "File system exception thrown (";
03998         //str += e.who();
03999         //str += ", ";
04000         str += e.what();
04001         str += ")\n";
04002         Base::Console().Error(str.c_str());
04003         PyErr_SetString(PyExc_Exception,str.c_str());
04004         return NULL;
04005     }
04006     catch(const Py::Exception&)
04007     {
04008         // The exception text is already set
04009         return NULL;
04010     }
04011     catch(const char* e) // catch simple string exceptions
04012     {
04013         Base::Console().Error(e);
04014         PyErr_SetString(PyExc_Exception,e);
04015         return NULL;
04016     }
04017     // in debug not all exceptions will be catched to get the attention of the developer!
04018 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
04019     catch(const std::exception& e) // catch other c++ exceptions
04020     {
04021         std::string str;
04022         str += "FC++ exception thrown (";
04023         str += e.what();
04024         str += ")";
04025         Base::Console().Error(str.c_str());
04026         PyErr_SetString(PyExc_Exception,str.c_str());
04027         return NULL;
04028     }
04029     catch(...)  // catch the rest!
04030     {
04031         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
04032         return NULL;
04033     }
04034 #endif
04035 }
04036 
04037 // collapseEdge() callback and implementer
04038 // PyObject*  MeshPy::collapseEdge(PyObject *args){};
04039 // has to be implemented in MeshPyImp.cpp
04040 PyObject * MeshPy::staticCallback_collapseEdge (PyObject *self, PyObject *args)
04041 {
04042     // test if twin object not allready deleted
04043     if (!((PyObjectBase*) self)->isValid()){
04044         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
04045         return NULL;
04046     }
04047 
04048     // test if object is set Const
04049     if (((PyObjectBase*) self)->isConst()){
04050         PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
04051         return NULL;
04052     }
04053 
04054     try { // catches all exceptions coming up from c++ and generate a python exception
04055         PyObject* ret = ((MeshPy*)self)->collapseEdge(args);
04056         if (ret != 0)
04057             ((MeshPy*)self)->startNotify();
04058         return ret;
04059     }
04060     catch(const Base::Exception& e) // catch the FreeCAD exceptions
04061     {
04062         std::string str;
04063         str += "FreeCAD exception thrown (";
04064         str += e.what();
04065         str += ")";
04066         e.ReportException();
04067         PyErr_SetString(PyExc_Exception,str.c_str());
04068         return NULL;
04069     }
04070     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
04071     {
04072         std::string str;
04073         str += "File system exception thrown (";
04074         //str += e.who();
04075         //str += ", ";
04076         str += e.what();
04077         str += ")\n";
04078         Base::Console().Error(str.c_str());
04079         PyErr_SetString(PyExc_Exception,str.c_str());
04080         return NULL;
04081     }
04082     catch(const Py::Exception&)
04083     {
04084         // The exception text is already set
04085         return NULL;
04086     }
04087     catch(const char* e) // catch simple string exceptions
04088     {
04089         Base::Console().Error(e);
04090         PyErr_SetString(PyExc_Exception,e);
04091         return NULL;
04092     }
04093     // in debug not all exceptions will be catched to get the attention of the developer!
04094 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
04095     catch(const std::exception& e) // catch other c++ exceptions
04096     {
04097         std::string str;
04098         str += "FC++ exception thrown (";
04099         str += e.what();
04100         str += ")";
04101         Base::Console().Error(str.c_str());
04102         PyErr_SetString(PyExc_Exception,str.c_str());
04103         return NULL;
04104     }
04105     catch(...)  // catch the rest!
04106     {
04107         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
04108         return NULL;
04109     }
04110 #endif
04111 }
04112 
04113 // collapseFacet() callback and implementer
04114 // PyObject*  MeshPy::collapseFacet(PyObject *args){};
04115 // has to be implemented in MeshPyImp.cpp
04116 PyObject * MeshPy::staticCallback_collapseFacet (PyObject *self, PyObject *args)
04117 {
04118     // test if twin object not allready deleted
04119     if (!((PyObjectBase*) self)->isValid()){
04120         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
04121         return NULL;
04122     }
04123 
04124     // test if object is set Const
04125     if (((PyObjectBase*) self)->isConst()){
04126         PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
04127         return NULL;
04128     }
04129 
04130     try { // catches all exceptions coming up from c++ and generate a python exception
04131         PyObject* ret = ((MeshPy*)self)->collapseFacet(args);
04132         if (ret != 0)
04133             ((MeshPy*)self)->startNotify();
04134         return ret;
04135     }
04136     catch(const Base::Exception& e) // catch the FreeCAD exceptions
04137     {
04138         std::string str;
04139         str += "FreeCAD exception thrown (";
04140         str += e.what();
04141         str += ")";
04142         e.ReportException();
04143         PyErr_SetString(PyExc_Exception,str.c_str());
04144         return NULL;
04145     }
04146     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
04147     {
04148         std::string str;
04149         str += "File system exception thrown (";
04150         //str += e.who();
04151         //str += ", ";
04152         str += e.what();
04153         str += ")\n";
04154         Base::Console().Error(str.c_str());
04155         PyErr_SetString(PyExc_Exception,str.c_str());
04156         return NULL;
04157     }
04158     catch(const Py::Exception&)
04159     {
04160         // The exception text is already set
04161         return NULL;
04162     }
04163     catch(const char* e) // catch simple string exceptions
04164     {
04165         Base::Console().Error(e);
04166         PyErr_SetString(PyExc_Exception,e);
04167         return NULL;
04168     }
04169     // in debug not all exceptions will be catched to get the attention of the developer!
04170 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
04171     catch(const std::exception& e) // catch other c++ exceptions
04172     {
04173         std::string str;
04174         str += "FC++ exception thrown (";
04175         str += e.what();
04176         str += ")";
04177         Base::Console().Error(str.c_str());
04178         PyErr_SetString(PyExc_Exception,str.c_str());
04179         return NULL;
04180     }
04181     catch(...)  // catch the rest!
04182     {
04183         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
04184         return NULL;
04185     }
04186 #endif
04187 }
04188 
04189 // collapseFacets() callback and implementer
04190 // PyObject*  MeshPy::collapseFacets(PyObject *args){};
04191 // has to be implemented in MeshPyImp.cpp
04192 PyObject * MeshPy::staticCallback_collapseFacets (PyObject *self, PyObject *args)
04193 {
04194     // test if twin object not allready deleted
04195     if (!((PyObjectBase*) self)->isValid()){
04196         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
04197         return NULL;
04198     }
04199 
04200     // test if object is set Const
04201     if (((PyObjectBase*) self)->isConst()){
04202         PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
04203         return NULL;
04204     }
04205 
04206     try { // catches all exceptions coming up from c++ and generate a python exception
04207         PyObject* ret = ((MeshPy*)self)->collapseFacets(args);
04208         if (ret != 0)
04209             ((MeshPy*)self)->startNotify();
04210         return ret;
04211     }
04212     catch(const Base::Exception& e) // catch the FreeCAD exceptions
04213     {
04214         std::string str;
04215         str += "FreeCAD exception thrown (";
04216         str += e.what();
04217         str += ")";
04218         e.ReportException();
04219         PyErr_SetString(PyExc_Exception,str.c_str());
04220         return NULL;
04221     }
04222     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
04223     {
04224         std::string str;
04225         str += "File system exception thrown (";
04226         //str += e.who();
04227         //str += ", ";
04228         str += e.what();
04229         str += ")\n";
04230         Base::Console().Error(str.c_str());
04231         PyErr_SetString(PyExc_Exception,str.c_str());
04232         return NULL;
04233     }
04234     catch(const Py::Exception&)
04235     {
04236         // The exception text is already set
04237         return NULL;
04238     }
04239     catch(const char* e) // catch simple string exceptions
04240     {
04241         Base::Console().Error(e);
04242         PyErr_SetString(PyExc_Exception,e);
04243         return NULL;
04244     }
04245     // in debug not all exceptions will be catched to get the attention of the developer!
04246 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
04247     catch(const std::exception& e) // catch other c++ exceptions
04248     {
04249         std::string str;
04250         str += "FC++ exception thrown (";
04251         str += e.what();
04252         str += ")";
04253         Base::Console().Error(str.c_str());
04254         PyErr_SetString(PyExc_Exception,str.c_str());
04255         return NULL;
04256     }
04257     catch(...)  // catch the rest!
04258     {
04259         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
04260         return NULL;
04261     }
04262 #endif
04263 }
04264 
04265 // insertVertex() callback and implementer
04266 // PyObject*  MeshPy::insertVertex(PyObject *args){};
04267 // has to be implemented in MeshPyImp.cpp
04268 PyObject * MeshPy::staticCallback_insertVertex (PyObject *self, PyObject *args)
04269 {
04270     // test if twin object not allready deleted
04271     if (!((PyObjectBase*) self)->isValid()){
04272         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
04273         return NULL;
04274     }
04275 
04276     // test if object is set Const
04277     if (((PyObjectBase*) self)->isConst()){
04278         PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
04279         return NULL;
04280     }
04281 
04282     try { // catches all exceptions coming up from c++ and generate a python exception
04283         PyObject* ret = ((MeshPy*)self)->insertVertex(args);
04284         if (ret != 0)
04285             ((MeshPy*)self)->startNotify();
04286         return ret;
04287     }
04288     catch(const Base::Exception& e) // catch the FreeCAD exceptions
04289     {
04290         std::string str;
04291         str += "FreeCAD exception thrown (";
04292         str += e.what();
04293         str += ")";
04294         e.ReportException();
04295         PyErr_SetString(PyExc_Exception,str.c_str());
04296         return NULL;
04297     }
04298     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
04299     {
04300         std::string str;
04301         str += "File system exception thrown (";
04302         //str += e.who();
04303         //str += ", ";
04304         str += e.what();
04305         str += ")\n";
04306         Base::Console().Error(str.c_str());
04307         PyErr_SetString(PyExc_Exception,str.c_str());
04308         return NULL;
04309     }
04310     catch(const Py::Exception&)
04311     {
04312         // The exception text is already set
04313         return NULL;
04314     }
04315     catch(const char* e) // catch simple string exceptions
04316     {
04317         Base::Console().Error(e);
04318         PyErr_SetString(PyExc_Exception,e);
04319         return NULL;
04320     }
04321     // in debug not all exceptions will be catched to get the attention of the developer!
04322 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
04323     catch(const std::exception& e) // catch other c++ exceptions
04324     {
04325         std::string str;
04326         str += "FC++ exception thrown (";
04327         str += e.what();
04328         str += ")";
04329         Base::Console().Error(str.c_str());
04330         PyErr_SetString(PyExc_Exception,str.c_str());
04331         return NULL;
04332     }
04333     catch(...)  // catch the rest!
04334     {
04335         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
04336         return NULL;
04337     }
04338 #endif
04339 }
04340 
04341 // snapVertex() callback and implementer
04342 // PyObject*  MeshPy::snapVertex(PyObject *args){};
04343 // has to be implemented in MeshPyImp.cpp
04344 PyObject * MeshPy::staticCallback_snapVertex (PyObject *self, PyObject *args)
04345 {
04346     // test if twin object not allready deleted
04347     if (!((PyObjectBase*) self)->isValid()){
04348         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
04349         return NULL;
04350     }
04351 
04352     // test if object is set Const
04353     if (((PyObjectBase*) self)->isConst()){
04354         PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
04355         return NULL;
04356     }
04357 
04358     try { // catches all exceptions coming up from c++ and generate a python exception
04359         PyObject* ret = ((MeshPy*)self)->snapVertex(args);
04360         if (ret != 0)
04361             ((MeshPy*)self)->startNotify();
04362         return ret;
04363     }
04364     catch(const Base::Exception& e) // catch the FreeCAD exceptions
04365     {
04366         std::string str;
04367         str += "FreeCAD exception thrown (";
04368         str += e.what();
04369         str += ")";
04370         e.ReportException();
04371         PyErr_SetString(PyExc_Exception,str.c_str());
04372         return NULL;
04373     }
04374     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
04375     {
04376         std::string str;
04377         str += "File system exception thrown (";
04378         //str += e.who();
04379         //str += ", ";
04380         str += e.what();
04381         str += ")\n";
04382         Base::Console().Error(str.c_str());
04383         PyErr_SetString(PyExc_Exception,str.c_str());
04384         return NULL;
04385     }
04386     catch(const Py::Exception&)
04387     {
04388         // The exception text is already set
04389         return NULL;
04390     }
04391     catch(const char* e) // catch simple string exceptions
04392     {
04393         Base::Console().Error(e);
04394         PyErr_SetString(PyExc_Exception,e);
04395         return NULL;
04396     }
04397     // in debug not all exceptions will be catched to get the attention of the developer!
04398 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
04399     catch(const std::exception& e) // catch other c++ exceptions
04400     {
04401         std::string str;
04402         str += "FC++ exception thrown (";
04403         str += e.what();
04404         str += ")";
04405         Base::Console().Error(str.c_str());
04406         PyErr_SetString(PyExc_Exception,str.c_str());
04407         return NULL;
04408     }
04409     catch(...)  // catch the rest!
04410     {
04411         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
04412         return NULL;
04413     }
04414 #endif
04415 }
04416 
04417 // printInfo() callback and implementer
04418 // PyObject*  MeshPy::printInfo(PyObject *args){};
04419 // has to be implemented in MeshPyImp.cpp
04420 PyObject * MeshPy::staticCallback_printInfo (PyObject *self, PyObject *args)
04421 {
04422     // test if twin object not allready deleted
04423     if (!((PyObjectBase*) self)->isValid()){
04424         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
04425         return NULL;
04426     }
04427 
04428 
04429     try { // catches all exceptions coming up from c++ and generate a python exception
04430         PyObject* ret = ((MeshPy*)self)->printInfo(args);
04431         return ret;
04432     }
04433     catch(const Base::Exception& e) // catch the FreeCAD exceptions
04434     {
04435         std::string str;
04436         str += "FreeCAD exception thrown (";
04437         str += e.what();
04438         str += ")";
04439         e.ReportException();
04440         PyErr_SetString(PyExc_Exception,str.c_str());
04441         return NULL;
04442     }
04443     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
04444     {
04445         std::string str;
04446         str += "File system exception thrown (";
04447         //str += e.who();
04448         //str += ", ";
04449         str += e.what();
04450         str += ")\n";
04451         Base::Console().Error(str.c_str());
04452         PyErr_SetString(PyExc_Exception,str.c_str());
04453         return NULL;
04454     }
04455     catch(const Py::Exception&)
04456     {
04457         // The exception text is already set
04458         return NULL;
04459     }
04460     catch(const char* e) // catch simple string exceptions
04461     {
04462         Base::Console().Error(e);
04463         PyErr_SetString(PyExc_Exception,e);
04464         return NULL;
04465     }
04466     // in debug not all exceptions will be catched to get the attention of the developer!
04467 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
04468     catch(const std::exception& e) // catch other c++ exceptions
04469     {
04470         std::string str;
04471         str += "FC++ exception thrown (";
04472         str += e.what();
04473         str += ")";
04474         Base::Console().Error(str.c_str());
04475         PyErr_SetString(PyExc_Exception,str.c_str());
04476         return NULL;
04477     }
04478     catch(...)  // catch the rest!
04479     {
04480         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
04481         return NULL;
04482     }
04483 #endif
04484 }
04485 
04486 // foraminate() callback and implementer
04487 // PyObject*  MeshPy::foraminate(PyObject *args){};
04488 // has to be implemented in MeshPyImp.cpp
04489 PyObject * MeshPy::staticCallback_foraminate (PyObject *self, PyObject *args)
04490 {
04491     // test if twin object not allready deleted
04492     if (!((PyObjectBase*) self)->isValid()){
04493         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
04494         return NULL;
04495     }
04496 
04497 
04498     try { // catches all exceptions coming up from c++ and generate a python exception
04499         PyObject* ret = ((MeshPy*)self)->foraminate(args);
04500         return ret;
04501     }
04502     catch(const Base::Exception& e) // catch the FreeCAD exceptions
04503     {
04504         std::string str;
04505         str += "FreeCAD exception thrown (";
04506         str += e.what();
04507         str += ")";
04508         e.ReportException();
04509         PyErr_SetString(PyExc_Exception,str.c_str());
04510         return NULL;
04511     }
04512     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
04513     {
04514         std::string str;
04515         str += "File system exception thrown (";
04516         //str += e.who();
04517         //str += ", ";
04518         str += e.what();
04519         str += ")\n";
04520         Base::Console().Error(str.c_str());
04521         PyErr_SetString(PyExc_Exception,str.c_str());
04522         return NULL;
04523     }
04524     catch(const Py::Exception&)
04525     {
04526         // The exception text is already set
04527         return NULL;
04528     }
04529     catch(const char* e) // catch simple string exceptions
04530     {
04531         Base::Console().Error(e);
04532         PyErr_SetString(PyExc_Exception,e);
04533         return NULL;
04534     }
04535     // in debug not all exceptions will be catched to get the attention of the developer!
04536 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
04537     catch(const std::exception& e) // catch other c++ exceptions
04538     {
04539         std::string str;
04540         str += "FC++ exception thrown (";
04541         str += e.what();
04542         str += ")";
04543         Base::Console().Error(str.c_str());
04544         PyErr_SetString(PyExc_Exception,str.c_str());
04545         return NULL;
04546     }
04547     catch(...)  // catch the rest!
04548     {
04549         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
04550         return NULL;
04551     }
04552 #endif
04553 }
04554 
04555 // harmonizeNormals() callback and implementer
04556 // PyObject*  MeshPy::harmonizeNormals(PyObject *args){};
04557 // has to be implemented in MeshPyImp.cpp
04558 PyObject * MeshPy::staticCallback_harmonizeNormals (PyObject *self, PyObject *args)
04559 {
04560     // test if twin object not allready deleted
04561     if (!((PyObjectBase*) self)->isValid()){
04562         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
04563         return NULL;
04564     }
04565 
04566 
04567     try { // catches all exceptions coming up from c++ and generate a python exception
04568         PyObject* ret = ((MeshPy*)self)->harmonizeNormals(args);
04569         return ret;
04570     }
04571     catch(const Base::Exception& e) // catch the FreeCAD exceptions
04572     {
04573         std::string str;
04574         str += "FreeCAD exception thrown (";
04575         str += e.what();
04576         str += ")";
04577         e.ReportException();
04578         PyErr_SetString(PyExc_Exception,str.c_str());
04579         return NULL;
04580     }
04581     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
04582     {
04583         std::string str;
04584         str += "File system exception thrown (";
04585         //str += e.who();
04586         //str += ", ";
04587         str += e.what();
04588         str += ")\n";
04589         Base::Console().Error(str.c_str());
04590         PyErr_SetString(PyExc_Exception,str.c_str());
04591         return NULL;
04592     }
04593     catch(const Py::Exception&)
04594     {
04595         // The exception text is already set
04596         return NULL;
04597     }
04598     catch(const char* e) // catch simple string exceptions
04599     {
04600         Base::Console().Error(e);
04601         PyErr_SetString(PyExc_Exception,e);
04602         return NULL;
04603     }
04604     // in debug not all exceptions will be catched to get the attention of the developer!
04605 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
04606     catch(const std::exception& e) // catch other c++ exceptions
04607     {
04608         std::string str;
04609         str += "FC++ exception thrown (";
04610         str += e.what();
04611         str += ")";
04612         Base::Console().Error(str.c_str());
04613         PyErr_SetString(PyExc_Exception,str.c_str());
04614         return NULL;
04615     }
04616     catch(...)  // catch the rest!
04617     {
04618         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
04619         return NULL;
04620     }
04621 #endif
04622 }
04623 
04624 // flipNormals() callback and implementer
04625 // PyObject*  MeshPy::flipNormals(PyObject *args){};
04626 // has to be implemented in MeshPyImp.cpp
04627 PyObject * MeshPy::staticCallback_flipNormals (PyObject *self, PyObject *args)
04628 {
04629     // test if twin object not allready deleted
04630     if (!((PyObjectBase*) self)->isValid()){
04631         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
04632         return NULL;
04633     }
04634 
04635 
04636     try { // catches all exceptions coming up from c++ and generate a python exception
04637         PyObject* ret = ((MeshPy*)self)->flipNormals(args);
04638         return ret;
04639     }
04640     catch(const Base::Exception& e) // catch the FreeCAD exceptions
04641     {
04642         std::string str;
04643         str += "FreeCAD exception thrown (";
04644         str += e.what();
04645         str += ")";
04646         e.ReportException();
04647         PyErr_SetString(PyExc_Exception,str.c_str());
04648         return NULL;
04649     }
04650     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
04651     {
04652         std::string str;
04653         str += "File system exception thrown (";
04654         //str += e.who();
04655         //str += ", ";
04656         str += e.what();
04657         str += ")\n";
04658         Base::Console().Error(str.c_str());
04659         PyErr_SetString(PyExc_Exception,str.c_str());
04660         return NULL;
04661     }
04662     catch(const Py::Exception&)
04663     {
04664         // The exception text is already set
04665         return NULL;
04666     }
04667     catch(const char* e) // catch simple string exceptions
04668     {
04669         Base::Console().Error(e);
04670         PyErr_SetString(PyExc_Exception,e);
04671         return NULL;
04672     }
04673     // in debug not all exceptions will be catched to get the attention of the developer!
04674 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
04675     catch(const std::exception& e) // catch other c++ exceptions
04676     {
04677         std::string str;
04678         str += "FC++ exception thrown (";
04679         str += e.what();
04680         str += ")";
04681         Base::Console().Error(str.c_str());
04682         PyErr_SetString(PyExc_Exception,str.c_str());
04683         return NULL;
04684     }
04685     catch(...)  // catch the rest!
04686     {
04687         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
04688         return NULL;
04689     }
04690 #endif
04691 }
04692 
04693 // fillupHoles() callback and implementer
04694 // PyObject*  MeshPy::fillupHoles(PyObject *args){};
04695 // has to be implemented in MeshPyImp.cpp
04696 PyObject * MeshPy::staticCallback_fillupHoles (PyObject *self, PyObject *args)
04697 {
04698     // test if twin object not allready deleted
04699     if (!((PyObjectBase*) self)->isValid()){
04700         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
04701         return NULL;
04702     }
04703 
04704 
04705     try { // catches all exceptions coming up from c++ and generate a python exception
04706         PyObject* ret = ((MeshPy*)self)->fillupHoles(args);
04707         return ret;
04708     }
04709     catch(const Base::Exception& e) // catch the FreeCAD exceptions
04710     {
04711         std::string str;
04712         str += "FreeCAD exception thrown (";
04713         str += e.what();
04714         str += ")";
04715         e.ReportException();
04716         PyErr_SetString(PyExc_Exception,str.c_str());
04717         return NULL;
04718     }
04719     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
04720     {
04721         std::string str;
04722         str += "File system exception thrown (";
04723         //str += e.who();
04724         //str += ", ";
04725         str += e.what();
04726         str += ")\n";
04727         Base::Console().Error(str.c_str());
04728         PyErr_SetString(PyExc_Exception,str.c_str());
04729         return NULL;
04730     }
04731     catch(const Py::Exception&)
04732     {
04733         // The exception text is already set
04734         return NULL;
04735     }
04736     catch(const char* e) // catch simple string exceptions
04737     {
04738         Base::Console().Error(e);
04739         PyErr_SetString(PyExc_Exception,e);
04740         return NULL;
04741     }
04742     // in debug not all exceptions will be catched to get the attention of the developer!
04743 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
04744     catch(const std::exception& e) // catch other c++ exceptions
04745     {
04746         std::string str;
04747         str += "FC++ exception thrown (";
04748         str += e.what();
04749         str += ")";
04750         Base::Console().Error(str.c_str());
04751         PyErr_SetString(PyExc_Exception,str.c_str());
04752         return NULL;
04753     }
04754     catch(...)  // catch the rest!
04755     {
04756         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
04757         return NULL;
04758     }
04759 #endif
04760 }
04761 
04762 // smooth() callback and implementer
04763 // PyObject*  MeshPy::smooth(PyObject *args){};
04764 // has to be implemented in MeshPyImp.cpp
04765 PyObject * MeshPy::staticCallback_smooth (PyObject *self, PyObject *args)
04766 {
04767     // test if twin object not allready deleted
04768     if (!((PyObjectBase*) self)->isValid()){
04769         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
04770         return NULL;
04771     }
04772 
04773 
04774     try { // catches all exceptions coming up from c++ and generate a python exception
04775         PyObject* ret = ((MeshPy*)self)->smooth(args);
04776         return ret;
04777     }
04778     catch(const Base::Exception& e) // catch the FreeCAD exceptions
04779     {
04780         std::string str;
04781         str += "FreeCAD exception thrown (";
04782         str += e.what();
04783         str += ")";
04784         e.ReportException();
04785         PyErr_SetString(PyExc_Exception,str.c_str());
04786         return NULL;
04787     }
04788     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
04789     {
04790         std::string str;
04791         str += "File system exception thrown (";
04792         //str += e.who();
04793         //str += ", ";
04794         str += e.what();
04795         str += ")\n";
04796         Base::Console().Error(str.c_str());
04797         PyErr_SetString(PyExc_Exception,str.c_str());
04798         return NULL;
04799     }
04800     catch(const Py::Exception&)
04801     {
04802         // The exception text is already set
04803         return NULL;
04804     }
04805     catch(const char* e) // catch simple string exceptions
04806     {
04807         Base::Console().Error(e);
04808         PyErr_SetString(PyExc_Exception,e);
04809         return NULL;
04810     }
04811     // in debug not all exceptions will be catched to get the attention of the developer!
04812 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
04813     catch(const std::exception& e) // catch other c++ exceptions
04814     {
04815         std::string str;
04816         str += "FC++ exception thrown (";
04817         str += e.what();
04818         str += ")";
04819         Base::Console().Error(str.c_str());
04820         PyErr_SetString(PyExc_Exception,str.c_str());
04821         return NULL;
04822     }
04823     catch(...)  // catch the rest!
04824     {
04825         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
04826         return NULL;
04827     }
04828 #endif
04829 }
04830 
04831 // optimizeTopology() callback and implementer
04832 // PyObject*  MeshPy::optimizeTopology(PyObject *args){};
04833 // has to be implemented in MeshPyImp.cpp
04834 PyObject * MeshPy::staticCallback_optimizeTopology (PyObject *self, PyObject *args)
04835 {
04836     // test if twin object not allready deleted
04837     if (!((PyObjectBase*) self)->isValid()){
04838         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
04839         return NULL;
04840     }
04841 
04842 
04843     try { // catches all exceptions coming up from c++ and generate a python exception
04844         PyObject* ret = ((MeshPy*)self)->optimizeTopology(args);
04845         return ret;
04846     }
04847     catch(const Base::Exception& e) // catch the FreeCAD exceptions
04848     {
04849         std::string str;
04850         str += "FreeCAD exception thrown (";
04851         str += e.what();
04852         str += ")";
04853         e.ReportException();
04854         PyErr_SetString(PyExc_Exception,str.c_str());
04855         return NULL;
04856     }
04857     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
04858     {
04859         std::string str;
04860         str += "File system exception thrown (";
04861         //str += e.who();
04862         //str += ", ";
04863         str += e.what();
04864         str += ")\n";
04865         Base::Console().Error(str.c_str());
04866         PyErr_SetString(PyExc_Exception,str.c_str());
04867         return NULL;
04868     }
04869     catch(const Py::Exception&)
04870     {
04871         // The exception text is already set
04872         return NULL;
04873     }
04874     catch(const char* e) // catch simple string exceptions
04875     {
04876         Base::Console().Error(e);
04877         PyErr_SetString(PyExc_Exception,e);
04878         return NULL;
04879     }
04880     // in debug not all exceptions will be catched to get the attention of the developer!
04881 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
04882     catch(const std::exception& e) // catch other c++ exceptions
04883     {
04884         std::string str;
04885         str += "FC++ exception thrown (";
04886         str += e.what();
04887         str += ")";
04888         Base::Console().Error(str.c_str());
04889         PyErr_SetString(PyExc_Exception,str.c_str());
04890         return NULL;
04891     }
04892     catch(...)  // catch the rest!
04893     {
04894         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
04895         return NULL;
04896     }
04897 #endif
04898 }
04899 
04900 // optimizeEdges() callback and implementer
04901 // PyObject*  MeshPy::optimizeEdges(PyObject *args){};
04902 // has to be implemented in MeshPyImp.cpp
04903 PyObject * MeshPy::staticCallback_optimizeEdges (PyObject *self, PyObject *args)
04904 {
04905     // test if twin object not allready deleted
04906     if (!((PyObjectBase*) self)->isValid()){
04907         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
04908         return NULL;
04909     }
04910 
04911 
04912     try { // catches all exceptions coming up from c++ and generate a python exception
04913         PyObject* ret = ((MeshPy*)self)->optimizeEdges(args);
04914         return ret;
04915     }
04916     catch(const Base::Exception& e) // catch the FreeCAD exceptions
04917     {
04918         std::string str;
04919         str += "FreeCAD exception thrown (";
04920         str += e.what();
04921         str += ")";
04922         e.ReportException();
04923         PyErr_SetString(PyExc_Exception,str.c_str());
04924         return NULL;
04925     }
04926     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
04927     {
04928         std::string str;
04929         str += "File system exception thrown (";
04930         //str += e.who();
04931         //str += ", ";
04932         str += e.what();
04933         str += ")\n";
04934         Base::Console().Error(str.c_str());
04935         PyErr_SetString(PyExc_Exception,str.c_str());
04936         return NULL;
04937     }
04938     catch(const Py::Exception&)
04939     {
04940         // The exception text is already set
04941         return NULL;
04942     }
04943     catch(const char* e) // catch simple string exceptions
04944     {
04945         Base::Console().Error(e);
04946         PyErr_SetString(PyExc_Exception,e);
04947         return NULL;
04948     }
04949     // in debug not all exceptions will be catched to get the attention of the developer!
04950 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
04951     catch(const std::exception& e) // catch other c++ exceptions
04952     {
04953         std::string str;
04954         str += "FC++ exception thrown (";
04955         str += e.what();
04956         str += ")";
04957         Base::Console().Error(str.c_str());
04958         PyErr_SetString(PyExc_Exception,str.c_str());
04959         return NULL;
04960     }
04961     catch(...)  // catch the rest!
04962     {
04963         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
04964         return NULL;
04965     }
04966 #endif
04967 }
04968 
04969 // nearestFacetOnRay() callback and implementer
04970 // PyObject*  MeshPy::nearestFacetOnRay(PyObject *args){};
04971 // has to be implemented in MeshPyImp.cpp
04972 PyObject * MeshPy::staticCallback_nearestFacetOnRay (PyObject *self, PyObject *args)
04973 {
04974     // test if twin object not allready deleted
04975     if (!((PyObjectBase*) self)->isValid()){
04976         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
04977         return NULL;
04978     }
04979 
04980 
04981     try { // catches all exceptions coming up from c++ and generate a python exception
04982         PyObject* ret = ((MeshPy*)self)->nearestFacetOnRay(args);
04983         return ret;
04984     }
04985     catch(const Base::Exception& e) // catch the FreeCAD exceptions
04986     {
04987         std::string str;
04988         str += "FreeCAD exception thrown (";
04989         str += e.what();
04990         str += ")";
04991         e.ReportException();
04992         PyErr_SetString(PyExc_Exception,str.c_str());
04993         return NULL;
04994     }
04995     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
04996     {
04997         std::string str;
04998         str += "File system exception thrown (";
04999         //str += e.who();
05000         //str += ", ";
05001         str += e.what();
05002         str += ")\n";
05003         Base::Console().Error(str.c_str());
05004         PyErr_SetString(PyExc_Exception,str.c_str());
05005         return NULL;
05006     }
05007     catch(const Py::Exception&)
05008     {
05009         // The exception text is already set
05010         return NULL;
05011     }
05012     catch(const char* e) // catch simple string exceptions
05013     {
05014         Base::Console().Error(e);
05015         PyErr_SetString(PyExc_Exception,e);
05016         return NULL;
05017     }
05018     // in debug not all exceptions will be catched to get the attention of the developer!
05019 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
05020     catch(const std::exception& e) // catch other c++ exceptions
05021     {
05022         std::string str;
05023         str += "FC++ exception thrown (";
05024         str += e.what();
05025         str += ")";
05026         Base::Console().Error(str.c_str());
05027         PyErr_SetString(PyExc_Exception,str.c_str());
05028         return NULL;
05029     }
05030     catch(...)  // catch the rest!
05031     {
05032         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
05033         return NULL;
05034     }
05035 #endif
05036 }
05037 
05038 // getPlanes() callback and implementer
05039 // PyObject*  MeshPy::getPlanes(PyObject *args){};
05040 // has to be implemented in MeshPyImp.cpp
05041 PyObject * MeshPy::staticCallback_getPlanes (PyObject *self, PyObject *args)
05042 {
05043     // test if twin object not allready deleted
05044     if (!((PyObjectBase*) self)->isValid()){
05045         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
05046         return NULL;
05047     }
05048 
05049 
05050     try { // catches all exceptions coming up from c++ and generate a python exception
05051         PyObject* ret = ((MeshPy*)self)->getPlanes(args);
05052         return ret;
05053     }
05054     catch(const Base::Exception& e) // catch the FreeCAD exceptions
05055     {
05056         std::string str;
05057         str += "FreeCAD exception thrown (";
05058         str += e.what();
05059         str += ")";
05060         e.ReportException();
05061         PyErr_SetString(PyExc_Exception,str.c_str());
05062         return NULL;
05063     }
05064     catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception
05065     {
05066         std::string str;
05067         str += "File system exception thrown (";
05068         //str += e.who();
05069         //str += ", ";
05070         str += e.what();
05071         str += ")\n";
05072         Base::Console().Error(str.c_str());
05073         PyErr_SetString(PyExc_Exception,str.c_str());
05074         return NULL;
05075     }
05076     catch(const Py::Exception&)
05077     {
05078         // The exception text is already set
05079         return NULL;
05080     }
05081     catch(const char* e) // catch simple string exceptions
05082     {
05083         Base::Console().Error(e);
05084         PyErr_SetString(PyExc_Exception,e);
05085         return NULL;
05086     }
05087     // in debug not all exceptions will be catched to get the attention of the developer!
05088 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
05089     catch(const std::exception& e) // catch other c++ exceptions
05090     {
05091         std::string str;
05092         str += "FC++ exception thrown (";
05093         str += e.what();
05094         str += ")";
05095         Base::Console().Error(str.c_str());
05096         PyErr_SetString(PyExc_Exception,str.c_str());
05097         return NULL;
05098     }
05099     catch(...)  // catch the rest!
05100     {
05101         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
05102         return NULL;
05103     }
05104 #endif
05105 }
05106 
05107 // Points() callback and implementer
05108 // PyObject*  MeshPy::Points(PyObject *args){};
05109 // has to be implemented in MeshPyImp.cpp
05110 PyObject * MeshPy::staticCallback_getPoints (PyObject *self, void * /*closure*/)
05111 {
05112     if (!((PyObjectBase*) self)->isValid()){
05113         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
05114         return NULL;
05115     }
05116 
05117     try {
05118         return Py::new_reference_to(((MeshPy*)self)->getPoints());
05119     } catch (const Py::Exception&) {
05120         // The exception text is already set
05121         return NULL;
05122     } catch (...) {
05123         PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'Points' of object 'MeshObject'");
05124         return NULL;
05125     }
05126 }
05127 
05128 int MeshPy::staticCallback_setPoints (PyObject *self, PyObject * /*value*/, void * /*closure*/)
05129 {
05130     if (!((PyObjectBase*) self)->isValid()){
05131         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
05132         return -1;
05133     }
05134 
05135     PyErr_SetString(PyExc_AttributeError, "Attribute 'Points' of object 'MeshObject' is read-only");
05136     return -1;
05137 }
05138 
05139 // CountPoints() callback and implementer
05140 // PyObject*  MeshPy::CountPoints(PyObject *args){};
05141 // has to be implemented in MeshPyImp.cpp
05142 PyObject * MeshPy::staticCallback_getCountPoints (PyObject *self, void * /*closure*/)
05143 {
05144     if (!((PyObjectBase*) self)->isValid()){
05145         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
05146         return NULL;
05147     }
05148 
05149     try {
05150         return Py::new_reference_to(((MeshPy*)self)->getCountPoints());
05151     } catch (const Py::Exception&) {
05152         // The exception text is already set
05153         return NULL;
05154     } catch (...) {
05155         PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'CountPoints' of object 'MeshObject'");
05156         return NULL;
05157     }
05158 }
05159 
05160 int MeshPy::staticCallback_setCountPoints (PyObject *self, PyObject * /*value*/, void * /*closure*/)
05161 {
05162     if (!((PyObjectBase*) self)->isValid()){
05163         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
05164         return -1;
05165     }
05166 
05167     PyErr_SetString(PyExc_AttributeError, "Attribute 'CountPoints' of object 'MeshObject' is read-only");
05168     return -1;
05169 }
05170 
05171 // Facets() callback and implementer
05172 // PyObject*  MeshPy::Facets(PyObject *args){};
05173 // has to be implemented in MeshPyImp.cpp
05174 PyObject * MeshPy::staticCallback_getFacets (PyObject *self, void * /*closure*/)
05175 {
05176     if (!((PyObjectBase*) self)->isValid()){
05177         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
05178         return NULL;
05179     }
05180 
05181     try {
05182         return Py::new_reference_to(((MeshPy*)self)->getFacets());
05183     } catch (const Py::Exception&) {
05184         // The exception text is already set
05185         return NULL;
05186     } catch (...) {
05187         PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'Facets' of object 'MeshObject'");
05188         return NULL;
05189     }
05190 }
05191 
05192 int MeshPy::staticCallback_setFacets (PyObject *self, PyObject * /*value*/, void * /*closure*/)
05193 {
05194     if (!((PyObjectBase*) self)->isValid()){
05195         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
05196         return -1;
05197     }
05198 
05199     PyErr_SetString(PyExc_AttributeError, "Attribute 'Facets' of object 'MeshObject' is read-only");
05200     return -1;
05201 }
05202 
05203 // CountFacets() callback and implementer
05204 // PyObject*  MeshPy::CountFacets(PyObject *args){};
05205 // has to be implemented in MeshPyImp.cpp
05206 PyObject * MeshPy::staticCallback_getCountFacets (PyObject *self, void * /*closure*/)
05207 {
05208     if (!((PyObjectBase*) self)->isValid()){
05209         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
05210         return NULL;
05211     }
05212 
05213     try {
05214         return Py::new_reference_to(((MeshPy*)self)->getCountFacets());
05215     } catch (const Py::Exception&) {
05216         // The exception text is already set
05217         return NULL;
05218     } catch (...) {
05219         PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'CountFacets' of object 'MeshObject'");
05220         return NULL;
05221     }
05222 }
05223 
05224 int MeshPy::staticCallback_setCountFacets (PyObject *self, PyObject * /*value*/, void * /*closure*/)
05225 {
05226     if (!((PyObjectBase*) self)->isValid()){
05227         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
05228         return -1;
05229     }
05230 
05231     PyErr_SetString(PyExc_AttributeError, "Attribute 'CountFacets' of object 'MeshObject' is read-only");
05232     return -1;
05233 }
05234 
05235 // Topology() callback and implementer
05236 // PyObject*  MeshPy::Topology(PyObject *args){};
05237 // has to be implemented in MeshPyImp.cpp
05238 PyObject * MeshPy::staticCallback_getTopology (PyObject *self, void * /*closure*/)
05239 {
05240     if (!((PyObjectBase*) self)->isValid()){
05241         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
05242         return NULL;
05243     }
05244 
05245     try {
05246         return Py::new_reference_to(((MeshPy*)self)->getTopology());
05247     } catch (const Py::Exception&) {
05248         // The exception text is already set
05249         return NULL;
05250     } catch (...) {
05251         PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'Topology' of object 'MeshObject'");
05252         return NULL;
05253     }
05254 }
05255 
05256 int MeshPy::staticCallback_setTopology (PyObject *self, PyObject * /*value*/, void * /*closure*/)
05257 {
05258     if (!((PyObjectBase*) self)->isValid()){
05259         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
05260         return -1;
05261     }
05262 
05263     PyErr_SetString(PyExc_AttributeError, "Attribute 'Topology' of object 'MeshObject' is read-only");
05264     return -1;
05265 }
05266 
05267 // Area() callback and implementer
05268 // PyObject*  MeshPy::Area(PyObject *args){};
05269 // has to be implemented in MeshPyImp.cpp
05270 PyObject * MeshPy::staticCallback_getArea (PyObject *self, void * /*closure*/)
05271 {
05272     if (!((PyObjectBase*) self)->isValid()){
05273         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
05274         return NULL;
05275     }
05276 
05277     try {
05278         return Py::new_reference_to(((MeshPy*)self)->getArea());
05279     } catch (const Py::Exception&) {
05280         // The exception text is already set
05281         return NULL;
05282     } catch (...) {
05283         PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'Area' of object 'MeshObject'");
05284         return NULL;
05285     }
05286 }
05287 
05288 int MeshPy::staticCallback_setArea (PyObject *self, PyObject * /*value*/, void * /*closure*/)
05289 {
05290     if (!((PyObjectBase*) self)->isValid()){
05291         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
05292         return -1;
05293     }
05294 
05295     PyErr_SetString(PyExc_AttributeError, "Attribute 'Area' of object 'MeshObject' is read-only");
05296     return -1;
05297 }
05298 
05299 // Volume() callback and implementer
05300 // PyObject*  MeshPy::Volume(PyObject *args){};
05301 // has to be implemented in MeshPyImp.cpp
05302 PyObject * MeshPy::staticCallback_getVolume (PyObject *self, void * /*closure*/)
05303 {
05304     if (!((PyObjectBase*) self)->isValid()){
05305         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
05306         return NULL;
05307     }
05308 
05309     try {
05310         return Py::new_reference_to(((MeshPy*)self)->getVolume());
05311     } catch (const Py::Exception&) {
05312         // The exception text is already set
05313         return NULL;
05314     } catch (...) {
05315         PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'Volume' of object 'MeshObject'");
05316         return NULL;
05317     }
05318 }
05319 
05320 int MeshPy::staticCallback_setVolume (PyObject *self, PyObject * /*value*/, void * /*closure*/)
05321 {
05322     if (!((PyObjectBase*) self)->isValid()){
05323         PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
05324         return -1;
05325     }
05326 
05327     PyErr_SetString(PyExc_AttributeError, "Attribute 'Volume' of object 'MeshObject' is read-only");
05328     return -1;
05329 }
05330 
05331 
05332 
05333 //--------------------------------------------------------------------------
05334 // Parents structure
05335 //--------------------------------------------------------------------------
05336 PyParentObject MeshPy::Parents[] = { PARENTSMeshMeshPy };
05337 
05338 //--------------------------------------------------------------------------
05339 // Constructor
05340 //--------------------------------------------------------------------------
05341 MeshPy::MeshPy(MeshObject *pcObject, PyTypeObject *T)
05342     : ComplexGeoDataPy(reinterpret_cast<ComplexGeoDataPy::PointerType>(pcObject), T)
05343 {
05344 }
05345 
05346 
05347 //--------------------------------------------------------------------------
05348 // destructor
05349 //--------------------------------------------------------------------------
05350 MeshPy::~MeshPy()                                // Everything handled in parent
05351 {
05352 }
05353 
05354 //--------------------------------------------------------------------------
05355 // MeshPy representation
05356 //--------------------------------------------------------------------------
05357 PyObject *MeshPy::_repr(void)
05358 {
05359     return Py_BuildValue("s", representation().c_str());
05360 }
05361 
05362 //--------------------------------------------------------------------------
05363 // MeshPy Attributes
05364 //--------------------------------------------------------------------------
05365 PyObject *MeshPy::_getattr(char *attr)                          // __getattr__ function: note only need to handle new state
05366 {
05367     try {
05368         // getter method for special Attributes (e.g. dynamic ones)
05369         PyObject *r = getCustomAttributes(attr);
05370         if(r) return r;
05371     }
05372 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
05373     catch(const Base::Exception& e) // catch the FreeCAD exceptions
05374     {
05375         std::string str;
05376         str += "FreeCAD exception thrown (";
05377         str += e.what();
05378         str += ")";
05379         e.ReportException();
05380         PyErr_SetString(PyExc_Exception,str.c_str());
05381         return NULL;
05382     }
05383     catch(const std::exception& e) // catch other c++ exceptions
05384     {
05385         std::string str;
05386         str += "FC++ exception thrown (";
05387         str += e.what();
05388         str += ")";
05389         Base::Console().Error(str.c_str());
05390         PyErr_SetString(PyExc_Exception,str.c_str());
05391         return NULL;
05392     }
05393     catch(const Py::Exception&)
05394     {
05395         // The exception text is already set
05396         return NULL;
05397     }
05398     catch(...)  // catch the rest!
05399     {
05400         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
05401         return NULL;
05402     }
05403 #else  // DONT_CATCH_CXX_EXCEPTIONS  
05404     catch(const Base::Exception& e) // catch the FreeCAD exceptions
05405     {
05406         std::string str;
05407         str += "FreeCAD exception thrown (";
05408         str += e.what();
05409         str += ")";
05410         e.ReportException();
05411         PyErr_SetString(PyExc_Exception,str.c_str());
05412         return NULL;
05413     }
05414     catch(const Py::Exception&)
05415     {
05416         // The exception text is already set
05417         return NULL;
05418     }
05419 #endif  // DONT_CATCH_CXX_EXCEPTIONS
05420 
05421     PyObject *rvalue = Py_FindMethod(Methods, this, attr);
05422     if (rvalue == NULL)
05423     {
05424         PyErr_Clear();
05425         return ComplexGeoDataPy::_getattr(attr);
05426     }
05427     else
05428     {
05429         return rvalue;
05430     }
05431 }
05432 
05433 int MeshPy::_setattr(char *attr, PyObject *value)       // __setattr__ function: note only need to handle new state
05434 {
05435     try {
05436         // setter for  special Attributes (e.g. dynamic ones)
05437         int r = setCustomAttributes(attr, value);
05438         if(r==1) return 0;
05439     }
05440 #ifndef DONT_CATCH_CXX_EXCEPTIONS 
05441     catch(const Base::Exception& e) // catch the FreeCAD exceptions
05442     {
05443         std::string str;
05444         str += "FreeCAD exception thrown (";
05445         str += e.what();
05446         str += ")";
05447         e.ReportException();
05448         PyErr_SetString(PyExc_Exception,str.c_str());
05449         return -1;
05450     }
05451     catch(const std::exception& e) // catch other c++ exceptions
05452     {
05453         std::string str;
05454         str += "FC++ exception thrown (";
05455         str += e.what();
05456         str += ")";
05457         Base::Console().Error(str.c_str());
05458         PyErr_SetString(PyExc_Exception,str.c_str());
05459         return -1;
05460     }
05461     catch(const Py::Exception&)
05462     {
05463         // The exception text is already set
05464         return -1;
05465     }
05466     catch(...)  // catch the rest!
05467     {
05468         PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
05469         return -1;
05470     }
05471 #else  // DONT_CATCH_CXX_EXCEPTIONS  
05472     catch(const Base::Exception& e) // catch the FreeCAD exceptions
05473     {
05474         std::string str;
05475         str += "FreeCAD exception thrown (";
05476         str += e.what();
05477         str += ")";
05478         e.ReportException();
05479         PyErr_SetString(PyExc_Exception,str.c_str());
05480         return -1;
05481     }
05482     catch(const Py::Exception&)
05483     {
05484         // The exception text is already set
05485         return -1;
05486     }
05487 #endif  // DONT_CATCH_CXX_EXCEPTIONS
05488 
05489     return ComplexGeoDataPy::_setattr(attr, value);
05490 }
05491 
05492 MeshObject *MeshPy::getMeshObjectPtr(void) const
05493 {
05494     return static_cast<MeshObject *>(_pcTwinPointer);
05495 }
05496 
05497 #if 0
05498 /* From here on come the methods you have to implement, but NOT in this module. Implement in MeshPyImp.cpp! This prototypes 
05499  * are just for convenience when you add a new method.
05500  */
05501 
05502 PyObject *MeshPy::PyMake(struct _typeobject *, PyObject *, PyObject *)  // Python wrapper
05503 {
05504     // create a new instance of MeshPy and the Twin object 
05505     return new MeshPy(new MeshObject);
05506 }
05507 
05508 // constructor method
05509 int MeshPy::PyInit(PyObject* /*args*/, PyObject* /*kwd*/)
05510 {
05511     return 0;
05512 }
05513 
05514 // returns a string which represents the object e.g. when printed in python
05515 std::string MeshPy::representation(void) const
05516 {
05517     return std::string("<MeshObject object>");
05518 }
05519 
05520 PyObject* MeshPy::read(PyObject *args)
05521 {
05522     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05523     return 0;
05524 }
05525 
05526 PyObject* MeshPy::write(PyObject *args)
05527 {
05528     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05529     return 0;
05530 }
05531 
05532 PyObject* MeshPy::writeInventor(PyObject *args)
05533 {
05534     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05535     return 0;
05536 }
05537 
05538 PyObject* MeshPy::copy(PyObject *args)
05539 {
05540     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05541     return 0;
05542 }
05543 
05544 PyObject* MeshPy::offset(PyObject *args)
05545 {
05546     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05547     return 0;
05548 }
05549 
05550 PyObject* MeshPy::offsetSpecial(PyObject *args)
05551 {
05552     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05553     return 0;
05554 }
05555 
05556 PyObject* MeshPy::crossSections(PyObject *args)
05557 {
05558     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05559     return 0;
05560 }
05561 
05562 PyObject* MeshPy::unite(PyObject *args)
05563 {
05564     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05565     return 0;
05566 }
05567 
05568 PyObject* MeshPy::intersect(PyObject *args)
05569 {
05570     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05571     return 0;
05572 }
05573 
05574 PyObject* MeshPy::difference(PyObject *args)
05575 {
05576     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05577     return 0;
05578 }
05579 
05580 PyObject* MeshPy::inner(PyObject *args)
05581 {
05582     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05583     return 0;
05584 }
05585 
05586 PyObject* MeshPy::outer(PyObject *args)
05587 {
05588     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05589     return 0;
05590 }
05591 
05592 PyObject* MeshPy::coarsen(PyObject *args)
05593 {
05594     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05595     return 0;
05596 }
05597 
05598 PyObject* MeshPy::translate(PyObject *args)
05599 {
05600     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05601     return 0;
05602 }
05603 
05604 PyObject* MeshPy::rotate(PyObject *args)
05605 {
05606     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05607     return 0;
05608 }
05609 
05610 PyObject* MeshPy::transform(PyObject *args)
05611 {
05612     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05613     return 0;
05614 }
05615 
05616 PyObject* MeshPy::transformToEigen(PyObject *args)
05617 {
05618     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05619     return 0;
05620 }
05621 
05622 PyObject* MeshPy::addFacet(PyObject *args)
05623 {
05624     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05625     return 0;
05626 }
05627 
05628 PyObject* MeshPy::addFacets(PyObject *args)
05629 {
05630     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05631     return 0;
05632 }
05633 
05634 PyObject* MeshPy::removeFacets(PyObject *args)
05635 {
05636     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05637     return 0;
05638 }
05639 
05640 PyObject* MeshPy::addMesh(PyObject *args)
05641 {
05642     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05643     return 0;
05644 }
05645 
05646 PyObject* MeshPy::setPoint(PyObject *args)
05647 {
05648     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05649     return 0;
05650 }
05651 
05652 PyObject* MeshPy::countSegments(PyObject *args)
05653 {
05654     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05655     return 0;
05656 }
05657 
05658 PyObject* MeshPy::getSegment(PyObject *args)
05659 {
05660     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05661     return 0;
05662 }
05663 
05664 PyObject* MeshPy::getSeparateComponents(PyObject *args)
05665 {
05666     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05667     return 0;
05668 }
05669 
05670 PyObject* MeshPy::getFacetSelection(PyObject *args)
05671 {
05672     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05673     return 0;
05674 }
05675 
05676 PyObject* MeshPy::getPointSelection(PyObject *args)
05677 {
05678     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05679     return 0;
05680 }
05681 
05682 PyObject* MeshPy::meshFromSegment(PyObject *args)
05683 {
05684     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05685     return 0;
05686 }
05687 
05688 PyObject* MeshPy::clear(PyObject *args)
05689 {
05690     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05691     return 0;
05692 }
05693 
05694 PyObject* MeshPy::isSolid(PyObject *args)
05695 {
05696     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05697     return 0;
05698 }
05699 
05700 PyObject* MeshPy::hasNonManifolds(PyObject *args)
05701 {
05702     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05703     return 0;
05704 }
05705 
05706 PyObject* MeshPy::removeNonManifolds(PyObject *args)
05707 {
05708     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05709     return 0;
05710 }
05711 
05712 PyObject* MeshPy::hasSelfIntersections(PyObject *args)
05713 {
05714     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05715     return 0;
05716 }
05717 
05718 PyObject* MeshPy::fixSelfIntersections(PyObject *args)
05719 {
05720     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05721     return 0;
05722 }
05723 
05724 PyObject* MeshPy::removeFoldsOnSurface(PyObject *args)
05725 {
05726     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05727     return 0;
05728 }
05729 
05730 PyObject* MeshPy::hasNonUniformOrientedFacets(PyObject *args)
05731 {
05732     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05733     return 0;
05734 }
05735 
05736 PyObject* MeshPy::countNonUniformOrientedFacets(PyObject *args)
05737 {
05738     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05739     return 0;
05740 }
05741 
05742 PyObject* MeshPy::countComponents(PyObject *args)
05743 {
05744     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05745     return 0;
05746 }
05747 
05748 PyObject* MeshPy::removeComponents(PyObject *args)
05749 {
05750     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05751     return 0;
05752 }
05753 
05754 PyObject* MeshPy::fixIndices(PyObject *args)
05755 {
05756     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05757     return 0;
05758 }
05759 
05760 PyObject* MeshPy::fixDeformations(PyObject *args)
05761 {
05762     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05763     return 0;
05764 }
05765 
05766 PyObject* MeshPy::fixDegenerations(PyObject *args)
05767 {
05768     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05769     return 0;
05770 }
05771 
05772 PyObject* MeshPy::removeDuplicatedPoints(PyObject *args)
05773 {
05774     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05775     return 0;
05776 }
05777 
05778 PyObject* MeshPy::removeDuplicatedFacets(PyObject *args)
05779 {
05780     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05781     return 0;
05782 }
05783 
05784 PyObject* MeshPy::refine(PyObject *args)
05785 {
05786     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05787     return 0;
05788 }
05789 
05790 PyObject* MeshPy::splitEdges(PyObject *args)
05791 {
05792     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05793     return 0;
05794 }
05795 
05796 PyObject* MeshPy::splitEdge(PyObject *args)
05797 {
05798     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05799     return 0;
05800 }
05801 
05802 PyObject* MeshPy::splitFacet(PyObject *args)
05803 {
05804     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05805     return 0;
05806 }
05807 
05808 PyObject* MeshPy::swapEdge(PyObject *args)
05809 {
05810     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05811     return 0;
05812 }
05813 
05814 PyObject* MeshPy::collapseEdge(PyObject *args)
05815 {
05816     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05817     return 0;
05818 }
05819 
05820 PyObject* MeshPy::collapseFacet(PyObject *args)
05821 {
05822     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05823     return 0;
05824 }
05825 
05826 PyObject* MeshPy::collapseFacets(PyObject *args)
05827 {
05828     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05829     return 0;
05830 }
05831 
05832 PyObject* MeshPy::insertVertex(PyObject *args)
05833 {
05834     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05835     return 0;
05836 }
05837 
05838 PyObject* MeshPy::snapVertex(PyObject *args)
05839 {
05840     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05841     return 0;
05842 }
05843 
05844 PyObject* MeshPy::printInfo(PyObject *args)
05845 {
05846     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05847     return 0;
05848 }
05849 
05850 PyObject* MeshPy::foraminate(PyObject *args)
05851 {
05852     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05853     return 0;
05854 }
05855 
05856 PyObject* MeshPy::harmonizeNormals(PyObject *args)
05857 {
05858     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05859     return 0;
05860 }
05861 
05862 PyObject* MeshPy::flipNormals(PyObject *args)
05863 {
05864     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05865     return 0;
05866 }
05867 
05868 PyObject* MeshPy::fillupHoles(PyObject *args)
05869 {
05870     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05871     return 0;
05872 }
05873 
05874 PyObject* MeshPy::smooth(PyObject *args)
05875 {
05876     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05877     return 0;
05878 }
05879 
05880 PyObject* MeshPy::optimizeTopology(PyObject *args)
05881 {
05882     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05883     return 0;
05884 }
05885 
05886 PyObject* MeshPy::optimizeEdges(PyObject *args)
05887 {
05888     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05889     return 0;
05890 }
05891 
05892 PyObject* MeshPy::nearestFacetOnRay(PyObject *args)
05893 {
05894     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05895     return 0;
05896 }
05897 
05898 PyObject* MeshPy::getPlanes(PyObject *args)
05899 {
05900     PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
05901     return 0;
05902 }
05903 
05904 
05905 
05906 Py::List MeshPy::getPoints(void) const
05907 {
05908     //return Py::List();
05909     throw Py::AttributeError("Not yet implemented");
05910 }
05911 
05912 Py::Int MeshPy::getCountPoints(void) const
05913 {
05914     //return Py::Int();
05915     throw Py::AttributeError("Not yet implemented");
05916 }
05917 
05918 Py::List MeshPy::getFacets(void) const
05919 {
05920     //return Py::List();
05921     throw Py::AttributeError("Not yet implemented");
05922 }
05923 
05924 Py::Int MeshPy::getCountFacets(void) const
05925 {
05926     //return Py::Int();
05927     throw Py::AttributeError("Not yet implemented");
05928 }
05929 
05930 Py::Tuple MeshPy::getTopology(void) const
05931 {
05932     //return Py::Tuple();
05933     throw Py::AttributeError("Not yet implemented");
05934 }
05935 
05936 Py::Float MeshPy::getArea(void) const
05937 {
05938     //return Py::Float();
05939     throw Py::AttributeError("Not yet implemented");
05940 }
05941 
05942 Py::Float MeshPy::getVolume(void) const
05943 {
05944     //return Py::Float();
05945     throw Py::AttributeError("Not yet implemented");
05946 }
05947 
05948 PyObject *MeshPy::getCustomAttributes(const char* attr) const
05949 {
05950     return 0;
05951 }
05952 
05953 int MeshPy::setCustomAttributes(const char* attr, PyObject *obj)
05954 {
05955     return 0; 
05956 }
05957 #endif
05958 
05959 
05960 

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