Salome HOME
22635: EDF 8345 - Creation of group based on groups
authoreap <eap@opencascade.com>
Thu, 6 Aug 2015 14:13:42 +0000 (17:13 +0300)
committereap <eap@opencascade.com>
Thu, 6 Aug 2015 14:13:42 +0000 (17:13 +0300)
Fix for a dump script generated by 7.5.1

src/SMESH_I/SMESH_2smeshpy.cxx
src/SMESH_SWIG/smeshBuilder.py

index 097dd94b7f57fa21ebf7cfb523030d46964153b2..8b51e5b8e6564494d82cc9cc99a30c72b39b1514 100644 (file)
@@ -1872,7 +1872,7 @@ void _pyMesh::Process( const Handle(_pyCommand)& theCommand )
     }
   }
   // ----------------------------------------------------------------------
-  else if ( method == "GetSubMesh" ) { // collect submeshes of the mesh
+  else if ( method == "GetSubMesh" ) { // collect sub-meshes of the mesh
     Handle(_pySubMesh) subMesh = theGen->FindSubMesh( theCommand->GetResultValue() );
     if ( !subMesh.IsNull() ) {
       subMesh->SetCreator( this );
@@ -1894,7 +1894,8 @@ void _pyMesh::Process( const Handle(_pyCommand)& theCommand )
   // ----------------------------------------------------------------------
   else if ( method == "CreateGroup" ||
             method == "CreateGroupFromGEOM" ||
-            method == "CreateGroupFromFilter" )
+            method == "CreateGroupFromFilter" ||
+            method == "CreateDimGroup" )
   {
     Handle(_pyGroup) group = new _pyGroup( theCommand );
     myGroups.push_back( group );
index 1d500a6666e4de2e1c2b2e8813143c4c3a5696db..99079e7adb9a21e16a0adf8cab1f2dc5aa91b0e2 100644 (file)
@@ -4918,7 +4918,25 @@ class Mesh:
 
     pass # end of Mesh class
 
-## class used to add to SMESH_MeshEditor methods removed from its CORBA API
+
+## class used to compensate change of CORBA API of SMESH_Mesh for backward compatibility
+#  with old dump scripts which call SMESH_Mesh directly and not via smeshBuilder.Mesh
+#
+class meshProxy(SMESH._objref_SMESH_Mesh):
+    def __init__(self):
+        SMESH._objref_SMESH_Mesh.__init__(self)
+    def __deepcopy__(self, memo=None):
+        new = self.__class__()
+        return new
+    def CreateDimGroup(self,*args): # 2 args added: nbCommonNodes, underlyingOnly
+        if len( args ) == 3:
+            args += SMESH.ALL_NODES, True
+        return SMESH._objref_SMESH_Mesh.CreateDimGroup( self, *args )
+    pass
+omniORB.registerObjref(SMESH._objref_SMESH_Mesh._NP_RepositoryId, meshProxy)
+
+## class used to compensate change of CORBA API of SMESH_MeshEditor for backward compatibility
+#  with old dump scripts which call SMESH_MeshEditor directly and not via smeshBuilder.Mesh
 #
 class meshEditor(SMESH._objref_SMESH_MeshEditor):
     def __init__(self):
@@ -4937,12 +4955,10 @@ class meshEditor(SMESH._objref_SMESH_MeshEditor):
         new = self.__class__()
         return new
     def FindCoincidentNodes(self,*args): # a 2nd arg added (SeparateCornerAndMediumNodes)
-        if len( args ) == 1:
-            return SMESH._objref_SMESH_MeshEditor.FindCoincidentNodes( self, args[0], False )
+        if len( args ) == 1: args += False,
         return SMESH._objref_SMESH_MeshEditor.FindCoincidentNodes( self, *args )
     def FindCoincidentNodesOnPart(self,*args): # a 3d arg added (SeparateCornerAndMediumNodes)
-        if len( args ) == 2:
-            args += False,
+        if len( args ) == 2: args += False,
         return SMESH._objref_SMESH_MeshEditor.FindCoincidentNodesOnPart( self, *args )
     def MergeNodes(self,*args): # a 2nd arg added (NodesToKeep)
         if len( args ) == 1: