From 086c6409d6415fa836ee0b96b3c3c970536c0c7b Mon Sep 17 00:00:00 2001 From: eap Date: Thu, 10 Sep 2009 06:01:17 +0000 Subject: [PATCH] 0020464: EDF 1100 SMESH: Performance issue of the function MoveNode 0020139: EDF 944 SMESH : Get 2D/3D element with X, Y, Z coordinates 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) --- src/SMESH_SWIG/smeshDC.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/SMESH_SWIG/smeshDC.py b/src/SMESH_SWIG/smeshDC.py index a1f62cdfa..edc7ca5e5 100644 --- a/src/SMESH_SWIG/smeshDC.py +++ b/src/SMESH_SWIG/smeshDC.py @@ -1840,8 +1840,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 -- 2.39.2