Salome HOME
0020746: EDF 1274 SMESH : MergeAllNodesButNodesFromGroup feature
authoreap <eap@opencascade.com>
Wed, 15 Sep 2010 12:09:30 +0000 (12:09 +0000)
committereap <eap@opencascade.com>
Wed, 15 Sep 2010 12:09:30 +0000 (12:09 +0000)
     ## Finds groups of ajacent nodes within Tolerance.
     #  @param Tolerance the value of tolerance
     #  @param SubMeshOrGroup SubMesh or Group
+    #  @param exceptNodes list of either SubMeshes, Groups or node IDs to exclude from search
     #  @return the list of groups of nodes
     #  @ingroup l2_modif_trsf
-    def FindCoincidentNodesOnPart (self, SubMeshOrGroup, Tolerance):
+    def FindCoincidentNodesOnPart (self, SubMeshOrGroup, Tolerance, exceptNodes=[]):

src/SMESH_SWIG/smeshDC.py

index d8e0dde74de2a9e09b1a6f37a74232e8169031e9..170c9664ad6a0e63b9312a4d6c137770a1fda2da 100644 (file)
@@ -3571,10 +3571,17 @@ class Mesh:
     ## Finds groups of ajacent nodes within Tolerance.
     #  @param Tolerance the value of tolerance
     #  @param SubMeshOrGroup SubMesh or Group
+    #  @param exceptNodes list of either SubMeshes, Groups or node IDs to exclude from search
     #  @return the list of groups of nodes
     #  @ingroup l2_modif_trsf
-    def FindCoincidentNodesOnPart (self, SubMeshOrGroup, Tolerance):
-        return self.editor.FindCoincidentNodesOnPart(SubMeshOrGroup, Tolerance)
+    def FindCoincidentNodesOnPart (self, SubMeshOrGroup, Tolerance, exceptNodes=[]):
+        if (isinstance( SubMeshOrGroup, Mesh )):
+            SubMeshOrGroup = SubMeshOrGroup.GetMesh()
+        if not isinstance( ExceptSubMeshOrGroups, list):
+            ExceptSubMeshOrGroups = [ ExceptSubMeshOrGroups ]
+        if ExceptSubMeshOrGroups and isinstance( ExceptSubMeshOrGroups[0], int):
+            ExceptSubMeshOrGroups = [ self.editor.MakeIDSource( ExceptSubMeshOrGroups, SMESH.NODE)]
+        return self.editor.FindCoincidentNodesOnPartBut(SubMeshOrGroup, Tolerance,ExceptSubMeshOrGroups)
 
     ## Merges nodes
     #  @param GroupsOfNodes the list of groups of nodes