X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomAlgoAPI%2FGeomAlgoAPI_ShapeTools.h;h=55ae6fb78792fe6910f97d9d2531446c2f83bac6;hb=4c86b629d1bf8daa737f90b64e934c7bd22f6525;hp=49b3432445b394744ae06d5faa901f6dde0dc01f;hpb=4bccf0ccd2f13dca7b9d16c59f427dea91c289fa;p=modules%2Fshaper.git diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.h b/src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.h index 49b343244..55ae6fb78 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.h +++ b/src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.h @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2019 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 @@ -24,9 +24,12 @@ #include #include - +#include #include #include +#ifdef WIN32 +#include +#endif class GeomAPI_Ax1; class GeomAPI_Edge; @@ -45,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 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 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 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. @@ -65,6 +84,14 @@ public: /// \brief Calculate minimal distance between shapes GEOMALGOAPI_EXPORT static double minimalDistance(const GeomShapePtr& theShape1, const GeomShapePtr& theShape2); + GEOMALGOAPI_EXPORT static double minimalDistance(const GeomShapePtr& theShape1, + const GeomShapePtr& theShape2, + std::array & 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. @@ -141,16 +168,20 @@ public: GEOMALGOAPI_EXPORT static std::shared_ptr getFaceOuterWire(const std::shared_ptr theFace); + /// \return \c true if edges are tangent in the specified point + GEOMALGOAPI_EXPORT static bool isTangent(const std::shared_ptr theEdge1, + const std::shared_ptr theEdge2, + const std::shared_ptr theTgPoint); + /// \return true if edge is parallel to face. GEOMALGOAPI_EXPORT static bool isParallel(const std::shared_ptr theEdge, const std::shared_ptr theFace); - // 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. + /// 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::list > intersect( - const std::shared_ptr theEdge, const std::shared_ptr theFace, - const bool thePointsOutsideFace); + const std::shared_ptr theEdge, const std::shared_ptr theFace); typedef std::map, std::pair >, @@ -204,6 +235,11 @@ public: const ListOfShape& theBaseShapes, const std::shared_ptr 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