1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: GeomAlgoAPI_ShapeTools.h
4 // Created: 3 August 2015
5 // Author: Dmitry Bobylev
7 #ifndef GeomAlgoAPI_ShapeTools_H_
8 #define GeomAlgoAPI_ShapeTools_H_
10 #include <GeomAlgoAPI.h>
11 #include <GeomAPI_Pnt.h>
12 #include <GeomAPI_Shape.h>
16 /** \class GeomAlgoAPI_ShapeTools
20 class GEOMALGOAPI_EXPORT GeomAlgoAPI_ShapeTools
23 /// \return the total volume of the solids of the current shape or 0.0 if it can be computed.
24 static double volume(std::shared_ptr<GeomAPI_Shape> theShape);
26 /// \return the centre of mass of the current face. The coordinates returned for the center of mass
27 /// are expressed in the absolute Cartesian coordinate system. (This function works only for surfaces).
28 static std::shared_ptr<GeomAPI_Pnt> centreOfMass(std::shared_ptr<GeomAPI_Shape> theShape);
30 /** \brief Combines faces with common edges to shells, or solids to compsolids.
31 * \param[in] theCompound compound of shapes.
32 * \param[in] theType type of combine.
33 * \param[out] theShells resulting shells.
34 * \param[out] theFreeFaces faces that does not have common edges.
36 static void combineShapes(const std::shared_ptr<GeomAPI_Shape> theCompound,
37 const GeomAPI_Shape::ShapeType theType,
38 ListOfShape& theCombinedShapes,
39 ListOfShape& theFreeShapes);
42 * Returns infinite plane received from theFace plane
44 static std::shared_ptr<GeomAPI_Shape> faceToInfinitePlane(const std::shared_ptr<GeomAPI_Shape>& theFace);