Salome HOME
23023: [CEA 1445] missing ExtrusionAlongPathObject function
authoreap <eap@opencascade.com>
Thu, 19 Mar 2015 14:08:42 +0000 (17:08 +0300)
committereap <eap@opencascade.com>
Thu, 19 Mar 2015 14:08:42 +0000 (17:08 +0300)
+class meshEditor(SMESH._objref_SMESH_MeshEditor):

idl/SMESH_MeshEditor.idl
src/SMESH_I/SMESH_2smeshpy.cxx
src/SMESH_I/SMESH_MeshEditor_i.cxx
src/SMESH_I/SMESH_MeshEditor_i.hxx
src/SMESH_SWIG/smeshBuilder.py

index 699f635..cc6dc08 100644 (file)
@@ -39,6 +39,11 @@ module SMESH
   interface SMESH_MeshEditor
   {
    /*!
+    * Returns a mesh subject to edition
+    */
+    SMESH_Mesh GetMesh();
+
+   /*!
     * Return data of mesh edition preview which is computed provided
     * that the editor was obtained through SMESH_Mesh::GetMeshEditPreviewer()
     */
index 5724138..a2d70b8 100644 (file)
@@ -2102,8 +2102,8 @@ bool _pyMesh::NeedMeshAccess( const Handle(_pyCommand)& theCommand )
   if ( sameMethods.empty() ) {
     const char * names[] =
       { "ExportDAT","ExportUNV","ExportSTL","ExportSAUV", "RemoveGroup","RemoveGroupWithContents",
-        "GetGroups","UnionGroups","IntersectGroups","CutGroups","GetLog","GetId","ClearLog",
-        "GetStudyId","HasDuplicatedGroupNamesMED","GetMEDMesh","NbNodes","NbElements",
+        "GetGroups","UnionGroups","IntersectGroups","CutGroups","CreateDimGroup","GetLog","GetId",
+        "ClearLog","GetStudyId","HasDuplicatedGroupNamesMED","GetMEDMesh","NbNodes","NbElements",
         "NbEdges","NbEdgesOfOrder","NbFaces","NbFacesOfOrder","NbTriangles",
         "NbTrianglesOfOrder","NbQuadrangles","NbQuadranglesOfOrder","NbPolygons","NbVolumes",
         "NbVolumesOfOrder","NbTetras","NbTetrasOfOrder","NbHexas","NbHexasOfOrder",
index accbde2..7b0ba25 100644 (file)
@@ -441,6 +441,17 @@ SMESH_MeshEditor_i::~SMESH_MeshEditor_i()
 
 //================================================================================
 /*!
+ * \brief Returns the mesh
+ */
+//================================================================================
+
+SMESH::SMESH_Mesh_ptr SMESH_MeshEditor_i::GetMesh()
+{
+  return myMesh_i->_this();
+}
+
+//================================================================================
+/*!
  * \brief Clear members
  */
 //================================================================================
index bd914f3..ec9ae98 100644 (file)
@@ -57,6 +57,8 @@ public:
    */
   int GetMeshId() const { return myMesh->GetId(); }
 
+  SMESH::SMESH_Mesh_ptr GetMesh();
+
   // --- CORBA
 
   /*!
index d1887b5..0433e46 100644 (file)
@@ -1247,7 +1247,6 @@ class Mesh:
         for attrName in dir(self):
             attr = getattr( self, attrName )
             if isinstance( attr, algoCreator ):
-                #print "algoCreator ", attrName
                 setattr( self, attrName, attr.copy( self ))
                 pass
             pass
@@ -4735,6 +4734,22 @@ class Mesh:
 
     pass # end of Mesh class
 
+## class used to add to SMESH_MeshEditor methods removed from its CORBA API
+#
+class meshEditor(SMESH._objref_SMESH_MeshEditor):
+    def __init__(self):
+        self.mesh = None
+    def __getattr__(self, name ): # method called if an attribute not found
+        if not self.mesh:
+            self.mesh = Mesh( None, None, SMESH._objref_SMESH_MeshEditor.GetMesh(self))
+        if hasattr( self.mesh, name ):
+            return getattr( self.mesh, name )
+        if name == "ExtrusionAlongPathObjX":
+            return getattr( self.mesh, "ExtrusionAlongPathX" )
+        return None
+    pass
+omniORB.registerObjref(SMESH._objref_SMESH_MeshEditor._NP_RepositoryId, meshEditor)
+
 ## Helper class for wrapping of SMESH.SMESH_Pattern CORBA class
 #
 class Pattern(SMESH._objref_SMESH_Pattern):