From 893497d10aade3509e023092ed8e7c068d3a89a5 Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 15 Sep 2010 13:25:06 +0000 Subject: [PATCH] 0020876: EDF 1246 SMESH: DoubleNodes fonctions available in the GUI Add an argument to DoubleNodeXXX() creating groups --- .../gui/SMESH/input/tui_transforming_meshes.doc | 4 ++-- src/SMESH_I/SMESH_2smeshpy.cxx | 1 + src/SMESH_SWIG/smeshDC.py | 17 ++++++++++++----- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/doc/salome/gui/SMESH/input/tui_transforming_meshes.doc b/doc/salome/gui/SMESH/input/tui_transforming_meshes.doc index e47935311..e50fcda36 100644 --- a/doc/salome/gui/SMESH/input/tui_transforming_meshes.doc +++ b/doc/salome/gui/SMESH/input/tui_transforming_meshes.doc @@ -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:" diff --git a/src/SMESH_I/SMESH_2smeshpy.cxx b/src/SMESH_I/SMESH_2smeshpy.cxx index a5435f6c0..1f4a1de14 100644 --- a/src/SMESH_I/SMESH_2smeshpy.cxx +++ b/src/SMESH_I/SMESH_2smeshpy.cxx @@ -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, diff --git a/src/SMESH_SWIG/smeshDC.py b/src/SMESH_SWIG/smeshDC.py index d72fd5cf8..d524cf81e 100644 --- a/src/SMESH_SWIG/smeshDC.py +++ b/src/SMESH_SWIG/smeshDC.py @@ -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. -- 2.30.2