X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomAlgoAPI%2FGeomAlgoAPI_Offset.h;h=7c58f8e7015efb609ae5b26ef3af0dab971a2f27;hb=3692e4ddfe1d709b235b6f1a8b96218ead1a45c5;hp=7939f04cdb76e478fa07581183f15831848de6f2;hpb=b04366b7cb8e262e53383f50b3bc536c2d525816;p=modules%2Fshaper.git diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Offset.h b/src/GeomAlgoAPI/GeomAlgoAPI_Offset.h index 7939f04cd..7c58f8e70 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Offset.h +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Offset.h @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2019 CEA/DEN, EDF R&D +// Copyright (C) 2019-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 @@ -23,6 +23,18 @@ #include #include +class GeomAPI_Pln; + +/// \enum GeomAlgoAPI_OffsetJoint +/// \brief Type of joint of straight edges in 2D offset +/// \a KeepDistance Keep the distance from initial contour to the resulting one, +/// creating contour from lines and arcs where it is needed +/// \a Arcs On connection of straight edges, tangent arcs are created, +/// except the case of too short edges. Radius of arcs equals to the offset value. +/// \a Lines No arcs is created on the connection of the resulting lines, +/// adjacent lines are prolonged to the point of their intersection. +enum class GeomAlgoAPI_OffsetJoint { KeepDistance, Arcs, Lines }; + /// \class GeomAlgoAPI_Offset /// \ingroup DataAlgo /// \brief Perform 3D offset for the shape @@ -33,12 +45,25 @@ public: GEOMALGOAPI_EXPORT GeomAlgoAPI_Offset(const GeomShapePtr& theShape, const double theOffsetValue); + /// \brief Perform the offset algorithm on the plane + /// \param[in] thePlane base plane for all offsets + /// \param[in] theEdgesOrWire base shapes + /// \param[in] theOffsetValue offset distance, it can be negative + /// \param[in] theJointType type of joint of straight edges + GEOMALGOAPI_EXPORT GeomAlgoAPI_Offset + (const std::shared_ptr& thePlane, + const GeomShapePtr& theEdgeOrWire, + const double theOffsetValue, + const GeomAlgoAPI_OffsetJoint theJoint = GeomAlgoAPI_OffsetJoint::KeepDistance, + const bool theIsApprox = false); + /// \return the list of shapes generated from the shape \a theShape. /// \param[in] theOldShape base shape. /// \param[out] theNewShapes shapes generated from \a theShape. Does not cleared! GEOMALGOAPI_EXPORT virtual void generated(const GeomShapePtr theOldShape, ListOfShape& theNewShapes); + private: /// \brief Perform offset operation void build(const GeomShapePtr& theShape, const double theOffsetValue);