0020876: EDF 1246 SMESH: DoubleNodes fonctions available in the GUI

Add an argument to DoubleNodeXXX() creating groups
This commit is contained in:
eap 2010-09-15 13:25:06 +00:00
parent ddff0c0a7e
commit 893497d10a
3 changed files with 15 additions and 7 deletions

View 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:"

View 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,

View 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.