Salome HOME
Mantis 0054772: crash when select point in viewer inside created face
[modules/geom.git] / src / GEOMUtils / GEOMUtils.hxx
index 184bc970395e4286397f2e9e10cac776ca343f65..5546211fa96e45e176c4a51aaaba2948b805ff4e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2022  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -116,7 +116,7 @@ namespace GEOMUtils
    * \brief Sort shapes in the list by their coordinates.
    * \param SL The list of shapes to sort.
    */
-  struct CompareShapes : public std::binary_function<TopoDS_Shape, TopoDS_Shape, bool>
+  struct CompareShapes //: public std::binary_function<TopoDS_Shape, TopoDS_Shape, bool>
   {
     CompareShapes (bool isOldSorting)
       : myIsOldSorting(isOldSorting) {}
@@ -215,6 +215,19 @@ namespace GEOMUtils
                                               const TopoDS_Shape& theShape2,
                                               gp_Pnt& thePnt1, gp_Pnt& thePnt2);
   
+  /*!
+   * \brief Computes normal projection of \a thePoint to \a theFace.
+   *
+   * \param thePoint the 3d point
+   * \param theFace the face shape
+   * \param theU the output U parameter of the point on the face
+   * \param theV the output V parameter of the point on the face
+   * \retval the projection (3d point) if found, throws an exception otherwise
+   */
+  Standard_EXPORT gp_Pnt ProjectPointOnFace(const gp_Pnt& thePoint,
+                                            const TopoDS_Shape& theFace,
+                                            double& theU, double& theV);
+  
   /*!
    * \brief Returns the point clicked in 3D view.
    *
@@ -252,6 +265,15 @@ namespace GEOMUtils
    * \return \c true if shape is valid or \c false otherwise
    */
   Standard_EXPORT bool CheckShape( TopoDS_Shape& shape, bool checkGeometry = false );
+
+  /*!
+   * \brief Check boolean and partition operations arguments
+   *
+   * \param theShape the argument of an operation to be checked
+   * \return \c true if the argument is valid for a boolean or partition
+   *         operation or \c false otherwise
+   */
+  Standard_EXPORT bool CheckBOPArguments(const TopoDS_Shape &theShape);
   
   /*!
    * \brief Limit shape tolerance to the given value
@@ -314,7 +336,7 @@ namespace GEOMUtils
   /*!
    * \brief Extract single SOLID from COMPSOLID or COMPOUND.
    *
-   * If the argument shape is a COMPUND or COMPSOLID and there's
+   * If the argument shape is a COMPOUND or COMPSOLID and there's
    * only single simple-shape type inside, this sub-shape is returned as a result;
    * otherwise, the shape is not changed.
    *
@@ -381,6 +403,6 @@ namespace GEOMUtils
                                       const double              theTolShape,
                                       const double              theTolRef);
 
-};
+}
 
 #endif