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)
+
+ /*!
+ * Return ID of node closest to a given point
+ */
+ long FindNodeClosestTo(in double x, in double y, in double z);
+
0020139: EDF 944 SMESH : Get 2D/3D element with X, Y, Z coordinates
+ /*!
+ * Return elements of given type where the given point is IN or ON.
+ *
+ * 'ALL' type means elements of any type excluding nodes and 0D elements
+ */
+ long_array FindElementsByPoint(in double x, in double y, in double z, in ElementType type);
+
+ /*!
+ * Return ID of node closest to a given point
+ */
+ long FindNodeClosestTo(in double x, in double y, in double z);
+
0020139: EDF 944 SMESH : Get 2D/3D element with X, Y, Z coordinates
+ /*!
+ * Return elements of given type where the given point is IN or ON.
+ *
+ * 'ALL' type means elements of any type excluding nodes and 0D elements
+ */
+ long_array FindElementsByPoint(in double x, in double y, in double z, in ElementType type);
+
struct SMESH_NodeSearcher
{
virtual const SMDS_MeshNode* FindClosestTo( const gp_Pnt& pnt ) = 0;
+ virtual void MoveNode( const SMDS_MeshNode* node, const gp_Pnt& toPnt ) = 0;
};
0020139: EDF 944 SMESH : Get 2D/3D element with X, Y, Z coordinates
+//=======================================================================
+/*!
+ * \brief Return elements of given type where the given point is IN or ON.
+ *
+ * 'ALL' type means elements of any type excluding nodes and 0D elements
+ */
+//=======================================================================
+
+struct SMESH_ElementSearcher
+{
+ virtual void FindElementsByPoint(const gp_Pnt& point,
+ SMDSAbs_ElementType type,
+ std::vector< const SMDS_MeshElement* >& foundNodes)=0;
+};
if ( it.More() )
+ {
index = _myMeshDS->AddCompoundSubmesh( aSubShape, it.Value().ShapeType() );
+ if ( index > _nbSubShapes ) _nbSubShapes = index; // not to create sm for this group again
+ }
}
1) in FindSubShapeAssociation(): use shape partnership (TopoDS_Shape::IsPartner())
for association
2) in FindFaceAssociation(): try two algoritms to find a correct outer wire