Salome HOME
Support of the newer version of OCCT 7.2.0 with patches
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_ShapeTools.h
index 2e48c96bbf61ee8cb28585d49976fa56a06370c5..42f87c8626ce40d8725329917da8a7305cc5d41c 100644 (file)
 #include <map>
 #include <set>
 
+class GeomAPI_Ax1;
 class GeomAPI_Edge;
 class GeomAPI_Dir;
 class GeomAPI_Face;
 class GeomAPI_PlanarEdges;
 class GeomAPI_Pln;
 class GeomAPI_Pnt;
+class GeomAPI_Wire;
 class GeomDataAPI_Point2D;
 class ModelAPI_Object;
 
@@ -47,6 +49,9 @@ public:
   /// \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);
+
   /// \return the centre of mass of the current face.
   /// The coordinates returned for the center of mass
   /// are expressed in the absolute Cartesian coordinate system.
@@ -136,8 +141,9 @@ public:
   // Computes intersection point between the edge curve and a face surface (only one point, with
   // preferences to point that belongs to edge and face boundaries.
   /// \returns null if there is no intersection
-  GEOMALGOAPI_EXPORT static std::shared_ptr<GeomAPI_Vertex> intersect(
-    const std::shared_ptr<GeomAPI_Edge> theEdge, const std::shared_ptr<GeomAPI_Face> theFace);
+  GEOMALGOAPI_EXPORT static std::list<std::shared_ptr<GeomAPI_Vertex> > intersect(
+    const std::shared_ptr<GeomAPI_Edge> theEdge, const std::shared_ptr<GeomAPI_Face> theFace,
+    const bool thePointsOutsideFace);
 
   typedef std::map<std::shared_ptr<GeomAPI_Pnt>,
                    std::pair<std::list<std::shared_ptr<GeomDataAPI_Point2D> >,
@@ -162,6 +168,17 @@ public:
                                     const std::list<std::shared_ptr<GeomAPI_Pnt> >& thePoints,
                                     const std::set<std::shared_ptr<GeomAPI_Shape> >& theShapes);
 
+  /// \brief Returns a dir from a shape and an axis.
+  /// \param[in] theBaseShape shape whose center of mass serves as the starting point of the dir.
+  /// \param[in] theAxis axis that serves as a direction for the dir
+  /// \return dir that builds from center of mass of the base shape and the axis
+  GEOMALGOAPI_EXPORT static std::shared_ptr<GeomAPI_Dir> buildDirFromAxisAndShape(
+                                    const std::shared_ptr<GeomAPI_Shape> theBaseShape,
+                                    const std::shared_ptr<GeomAPI_Ax1> theAxis);
+
+  /// \brief Reapproximate a wire to build a single edge
+  GEOMALGOAPI_EXPORT static std::shared_ptr<GeomAPI_Edge> wireToEdge(
+      const std::shared_ptr<GeomAPI_Wire>& theWire);
 };
 
 #endif