X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomAlgoAPI%2FGeomAlgoAPI_ShapeTools.h;h=d361eb927b34cd9aaefcd4b38fb4b1ef044f9813;hb=4d6bb9de0e54f09a9bbacc94a058cb7cd437d535;hp=c367d6867846bb36da2de8b2565c61a104e66e3d;hpb=77b93142eb8ba33bfb9a42040c2fd8926ffea5c8;p=modules%2Fshaper.git diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.h b/src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.h index c367d6867..d361eb927 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.h +++ b/src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.h @@ -21,11 +21,11 @@ class GEOMALGOAPI_EXPORT GeomAlgoAPI_ShapeTools { public: /// \return the total volume of the solids of the current shape or 0.0 if it can be computed. - static double volume(std::shared_ptr theShape); + static double volume(const std::shared_ptr 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. (This function works only for surfaces). - static std::shared_ptr centreOfMass(std::shared_ptr theShape); + static std::shared_ptr centreOfMass(const std::shared_ptr theShape); /** \brief Combines faces with common edges to shells, or solids to compsolids. * \param[in] theCompound compound of shapes. @@ -38,10 +38,26 @@ public: ListOfShape& theCombinedShapes, ListOfShape& theFreeShapes); + /** \brief Calculates bounding box for theShapes + * \return list of eight points. + * \param[in] theShapes list of shapes. + * \param[in] theEnlarge enlarges bounding box size. + */ + static std::list > getBoundingBox(const ListOfShape& theShapes, const double theEnlarge = 0.0); + /** - * Returns infinite plane received from theFace plane + * Returns infinite plane received from theFace plane. */ - static std::shared_ptr faceToInfinitePlane(const std::shared_ptr& theFace); + static std::shared_ptr faceToInfinitePlane(const std::shared_ptr theFace); + + /** \brief Enlarges or reduces plane to fit bounding box. + * \return plane that fits to bounding box. + * \param[in] thePlane base plane. + * \param[in] thePoints bounding box points (shoud be eight). + */ + static std::shared_ptr fitPlaneToBox(const std::shared_ptr thePlane, + const std::list >& thePoints); + }; #endif