Salome HOME
0020876: EDF 1246 SMESH: DoubleNodes fonctions available in the GUI
authoreap <eap@opencascade.com>
Wed, 15 Sep 2010 13:25:06 +0000 (13:25 +0000)
committereap <eap@opencascade.com>
Wed, 15 Sep 2010 13:25:06 +0000 (13:25 +0000)
  Add an argument to DoubleNodeXXX() creating groups

doc/salome/gui/SMESH/input/tui_transforming_meshes.doc
src/SMESH_I/SMESH_2smeshpy.cxx
src/SMESH_SWIG/smeshDC.py

index e47935311fba41a8064a7cd4487ced7abea8c8ac..e50fcda36d46fb1384e8c4c29849db7f69cba760 100644 (file)
@@ -380,7 +380,7 @@ print "Nodes      : ", mesh.NbNodes()
 print "Edges      : ", mesh.NbEdges()
 print "Triangles  : ", mesh.NbTriangles()
 
-groupOfCreatedNodes = mesh.DoubleNodeGroup(nodes1, faces1)
+groupOfCreatedNodes = mesh.DoubleNodeGroup(nodes1, faces1, theMakeGroup=True)
 print "New nodes:", groupOfCreatedNodes.GetIDs()
 
 print "\nMesh after the first nodes duplication:"
@@ -408,7 +408,7 @@ print "Nodes      : ", mesh.NbNodes()
 print "Edges      : ", mesh.NbEdges()
 print "Triangles  : ", mesh.NbTriangles()
 
-groupOfNewEdges = mesh.DoubleNodeElemGroup( edges, nodes2, faces2 )
+groupOfNewEdges = mesh.DoubleNodeElemGroup( edges, nodes2, faces2, theMakeGroup=True )
 print "New edges:", groupOfNewEdges.GetIDs()
 
 print "\nMesh after the second nodes duplication:"
index a5435f6c03b5d58699d73491ccee1d62ea275e0d..1f4a1de143548ed7f9ac5316b699725feb59cd8b 100644 (file)
@@ -1162,6 +1162,7 @@ void _pyMeshEditor::Process( const Handle(_pyCommand)& theCommand)
   {
     isPyMeshMethod=true;
     theCommand->SetMethod( method.SubString( 1, method.Length()-3));
+    theCommand->SetArg(theCommand->GetNbArgs()+1,"True");
   }
 
   // meshes made by *MakeMesh() methods are not wrapped by _pyMesh,
index d72fd5cf85f0da9c80c6e9a65bce66084b1062e2..d524cf81e4255d48949b13e33e63b748f949d64f 100644 (file)
@@ -3697,10 +3697,14 @@ class Mesh:
     #  This method provided for convenience works as DoubleNodes() described above.
     #  @param theNodes group of nodes to be doubled
     #  @param theModifiedElems group of elements to be updated.
-    #  @return TRUE if operation has been completed successfully, FALSE otherwise
+    #  @param theMakeGroup forces the generation of a group containing new nodes.
+    #  @return TRUE or a created group if operation has been completed successfully,
+    #          FALSE or None otherwise
     #  @ingroup l2_modif_edit
-    def DoubleNodeGroup(self, theNodes, theModifiedElems):
-        return self.editor.DoubleNodeGroupNew(theNodes, theModifiedElems)
+    def DoubleNodeGroup(self, theNodes, theModifiedElems, theMakeGroup=False):
+        if theMakeGroup:
+            return self.editor.DoubleNodeGroupNew(theNodes, theModifiedElems)
+        return self.editor.DoubleNodeGroup(theNodes, theModifiedElems)
 
     ## Creates a hole in a mesh by doubling the nodes of some particular elements
     #  This method provided for convenience works as DoubleNodes() described above.
@@ -3740,9 +3744,12 @@ class Mesh:
     #  @param theNodesNot - group of nodes not to replicated
     #  @param theAffectedElems - group of elements to which the replicated nodes
     #         should be associated to.
+    #  @param theMakeGroup forces the generation of a group containing new elements.
     #  @ingroup l2_modif_edit
-    def DoubleNodeElemGroup(self, theElems, theNodesNot, theAffectedElems):
-        return self.editor.DoubleNodeElemGroupNew(theElems, theNodesNot, theAffectedElems)
+    def DoubleNodeElemGroup(self, theElems, theNodesNot, theAffectedElems, theMakeGroup=False):
+        if theMakeGroup:
+            return self.editor.DoubleNodeElemGroupNew(theElems, theNodesNot, theAffectedElems)
+        return self.editor.DoubleNodeElemGroup(theElems, theNodesNot, theAffectedElems)
 
     ## Creates a hole in a mesh by doubling the nodes of some particular elements
     #  This method provided for convenience works as DoubleNodes() described above.