Salome HOME
correct previous integration (Porting to Python 2.6)
[modules/smesh.git] / src / SMESH_SWIG / smeshDC.py
index 689e76f492afc3fcc99ecfdf89793fb750673ccf..a9ef16e52c9c1e2e1bc3f815711cd7c1281d5ea0 100644 (file)
@@ -1,3 +1,4 @@
+#  -*- coding: iso-8859-1 -*-
 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
@@ -420,7 +421,9 @@ class smeshDC(SMESH._objref_SMESH_Gen):
     #  @return an instance of Mesh class.
     #  @ingroup l2_construct
     def Mesh(self, obj=0, name=0):
-      return Mesh(self,self.geompyD,obj,name)
+        if isinstance(obj,str):
+            obj,name = name,obj
+        return Mesh(self,self.geompyD,obj,name)
 
     ## Returns a long value from enumeration
     #  Should be used for SMESH.FunctorType enumeration
@@ -2139,8 +2142,21 @@ class Mesh:
     #  @return the ID of a node
     #  @ingroup l2_modif_throughp
     def FindNodeClosestTo(self, x, y, z):
-        preview = self.mesh.GetMeshEditPreviewer()
-        return preview.MoveClosestNodeToPoint(x, y, z, -1)
+        #preview = self.mesh.GetMeshEditPreviewer()
+        #return preview.MoveClosestNodeToPoint(x, y, z, -1)
+        return self.editor.FindNodeClosestTo(x, y, z)
+
+    ## Finds the elements where a point lays IN or ON
+    #  @param x  the X coordinate of a point
+    #  @param y  the Y coordinate of a point
+    #  @param z  the Z coordinate of a point
+    #  @param elementType type of elements to find (SMESH.ALL type
+    #         means elements of any type excluding nodes and 0D elements)
+    #  @return list of IDs of found elements
+    #  @ingroup l2_modif_throughp
+    def FindElementsByPoint(self, x, y, z, elementType = SMESH.ALL):
+        return self.editor.FindElementsByPoint(x, y, z, elementType)
+        
 
     ## Finds the node closest to a point and moves it to a point location
     #  @param x  the X coordinate of a point
@@ -2497,6 +2513,12 @@ class Mesh:
     def ConvertFromQuadratic(self):
         return self.editor.ConvertFromQuadratic()
 
+    ## Creates 2D mesh as skin on boundary faces of a 3D mesh
+    #  @return TRUE if operation has been completed successfully, FALSE otherwise
+    #  @ingroup l2_modif_edit
+    def  Make2DMeshFrom3D(self):
+        return self.editor. Make2DMeshFrom3D()
+        
     ## Renumber mesh nodes
     #  @ingroup l2_modif_renumber
     def RenumberNodes(self):