Salome HOME
Merge branch 'jfa/40620_ExportXAO_separate_BREP'
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_ShapeTools.h
index 5ad2e78acd2b1846aa1c0619fd722c0da57260a9..55ae6fb78792fe6910f97d9d2531446c2f83bac6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2020  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2024  CEA, EDF
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 
 #include <GeomAPI_Shape.h>
 #include <GeomAPI_Vertex.h>
+#include <GeomAPI_Pnt.h>
 #include <map>
 #include <set>
 #ifdef WIN32
- #include<array>
-#endif WIN32
+#include<array>
+#endif
 
 class GeomAPI_Ax1;
 class GeomAPI_Edge;
@@ -47,12 +48,28 @@ class ModelAPI_Object;
 class GeomAlgoAPI_ShapeTools
 {
 public:
+  /// \return the lenth of the edges of the current shape or 0.0 if it can be computed.
+  GEOMALGOAPI_EXPORT static double length(const std::shared_ptr<GeomAPI_Shape> theShape);
+
   /// \return the total volume of the solids of the current shape or 0.0 if it can be computed.
   GEOMALGOAPI_EXPORT static double volume(const std::shared_ptr<GeomAPI_Shape> theShape);
 
   /// \return the total area of the faces of the current shape or 0.0 if it can be computed.
   GEOMALGOAPI_EXPORT static double area(const std::shared_ptr<GeomAPI_Shape> theShape);
 
+  /// indicate if two faces are continuous
+  /// with an angular tolerance used for G1 continuity to compare the angle between the normals
+  /// \param theFace1  the first face
+  /// \param theFace2  the second face
+  /// \param thePoint  the point for the normal
+  /// \param theAngle  the angular tolerance
+  /// \param theError  error
+  GEOMALGOAPI_EXPORT static bool isContinuousFaces(const GeomShapePtr& theFace1,
+                                                   const GeomShapePtr& theFace2,
+                                                   const GeomPointPtr& thePoint,
+                                                   const double & theAngle,
+                                                   std::string& theError);
+
   /// \return the center of mass of the current face.
   /// The coordinates returned for the center of mass
   /// are expressed in the absolute Cartesian coordinate system.
@@ -68,7 +85,13 @@ public:
   GEOMALGOAPI_EXPORT static double minimalDistance(const GeomShapePtr& theShape1,
                                                    const GeomShapePtr& theShape2);
   GEOMALGOAPI_EXPORT static double minimalDistance(const GeomShapePtr& theShape1,
-                                                   const GeomShapePtr& theShape2, std::array<double, 3> & fromShape1To2);
+                                                   const GeomShapePtr& theShape2,
+                                                   std::array<double, 3> & fromShape1To2);
+
+  /// \brief Calculate maximal value of all possible distances between shapes.
+  ///        The shapes can be two edges or two faces only.
+  GEOMALGOAPI_EXPORT static double shapeProximity(const GeomShapePtr& theShape1,
+                                                  const GeomShapePtr& theShape2);
 
   /// \brief Combines faces with common edges to shells, or solids to compsolids.
   /// \param[in] theCompound compound of shapes.
@@ -212,6 +235,11 @@ public:
                                                    const ListOfShape& theBaseShapes,
                                                    const std::shared_ptr<GeomAPI_Dir> theDir,
                                                    double& theToSize, double& theFromSize);
+
+  /// \brief Get shared faces of a shape
+  /// \param[in] theShape shape that should be exploded
+  /// \return list of shared faces
+  GEOMALGOAPI_EXPORT static ListOfShape getSharedFaces(const GeomShapePtr& theShape);
 };
 
 #endif