X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FFeaturesAPI%2FFeaturesAPI_Fillet.h;h=4023bfceda183757902b848ec2ce5abe69566ca6;hb=06e7f5859095193fc7f498bd89a7d28009794f53;hp=7670f2dcb8923843bf35b30aa79c1c73b2c3b609;hpb=97917d3698f5a2f7fc9596e7c755ff8f6751e373;p=modules%2Fshaper.git diff --git a/src/FeaturesAPI/FeaturesAPI_Fillet.h b/src/FeaturesAPI/FeaturesAPI_Fillet.h index 7670f2dcb..4023bfced 100644 --- a/src/FeaturesAPI/FeaturesAPI_Fillet.h +++ b/src/FeaturesAPI/FeaturesAPI_Fillet.h @@ -1,4 +1,4 @@ -// Copyright (C) 2017-2019 CEA/DEN, EDF R&D +// Copyright (C) 2017-2023 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,11 +23,12 @@ #include "FeaturesAPI.h" #include +#include +#include #include #include -class ModelHighAPI_Double; class ModelHighAPI_Selection; /// \class FeaturesAPI_Fillet @@ -35,27 +36,103 @@ class ModelHighAPI_Selection; /// \brief Interface for Fillet feature. class FeaturesAPI_Fillet: public ModelHighAPI_Interface { +public: + /// Destructor. + virtual ~FeaturesAPI_Fillet() {} + + virtual std::shared_ptr radius() const = 0; + + /// Modify base objects of the fillet. + virtual void setBase(const std::list& theBaseObjects) = 0; + + /// Modify fillet to have fixed radius + virtual void setRadius(const ModelHighAPI_Double& theRadius) = 0; + +protected: + FeaturesAPI_Fillet(const std::shared_ptr& theFeature); +}; + +/// Pointer on the fillet object. +typedef std::shared_ptr FilletPtr; + + +/// \class FeaturesAPI_Fillet1D +/// \ingroup CPPHighAPI +/// \brief Interface for Fillet1D feature - fillet on vertices of a wire. +class FeaturesAPI_Fillet1D : public FeaturesAPI_Fillet +{ public: /// Constructor without values. FEATURESAPI_EXPORT - explicit FeaturesAPI_Fillet(const std::shared_ptr& theFeature); + explicit FeaturesAPI_Fillet1D(const std::shared_ptr& theFeature); /// Constructor with values. FEATURESAPI_EXPORT - explicit FeaturesAPI_Fillet(const std::shared_ptr& theFeature, - const std::list& theBaseObjects, - const ModelHighAPI_Double& theRadius); + explicit FeaturesAPI_Fillet1D(const std::shared_ptr& theFeature, + const std::list& theBaseObjects, + const ModelHighAPI_Double& theRadius); + + /// Destructor. + FEATURESAPI_EXPORT + virtual ~FeaturesAPI_Fillet1D(); + + INTERFACE_4(FeaturesPlugin_Fillet1D::ID(), + creationMethod, FeaturesPlugin_Fillet1D::CREATION_METHOD(), + ModelAPI_AttributeString, + /** Creation method */, + baseWires, FeaturesPlugin_Fillet1D::WIRE_LIST_ID(), + ModelAPI_AttributeSelectionList, + /** Base objects */, + baseVertices, FeaturesPlugin_Fillet1D::VERTEX_LIST_ID(), + ModelAPI_AttributeSelectionList, + /** Base objects */, + radius, FeaturesPlugin_Fillet1D::RADIUS_ID(), + ModelAPI_AttributeDouble, + /** Value of the fixed radius fillet */) + + /// Modify base objects of the fillet. + FEATURESAPI_EXPORT + virtual void setBase(const std::list& theBaseObjects); + + /// Modify fillet to have fixed radius + FEATURESAPI_EXPORT + virtual void setRadius(const ModelHighAPI_Double& theRadius); + + /// Dump wrapped feature + FEATURESAPI_EXPORT + virtual void dump(ModelHighAPI_Dumper& theDumper) const; + +private: + void execIfBaseNotEmpty(); +}; + + +/// \class FeaturesAPI_Fillet2D +/// \ingroup CPPHighAPI +/// \brief Interface for Fillet feature - fillet edges on a solid. +class FeaturesAPI_Fillet2D : public FeaturesAPI_Fillet +{ +public: + /// Constructor without values. + FEATURESAPI_EXPORT + explicit FeaturesAPI_Fillet2D(const std::shared_ptr& theFeature); /// Constructor with values. FEATURESAPI_EXPORT - explicit FeaturesAPI_Fillet(const std::shared_ptr& theFeature, - const std::list& theBaseObjects, - const ModelHighAPI_Double& theRadius1, - const ModelHighAPI_Double& theRadius2); + explicit FeaturesAPI_Fillet2D(const std::shared_ptr& theFeature, + const std::list& theBaseObjects, + const ModelHighAPI_Double& theRadius); + + /// Constructor with values. + FEATURESAPI_EXPORT + explicit FeaturesAPI_Fillet2D(const std::shared_ptr& theFeature, + const std::list& theBaseObjects, + const ModelHighAPI_Double& theRadius1, + const ModelHighAPI_Double& theRadius2); /// Destructor. FEATURESAPI_EXPORT - virtual ~FeaturesAPI_Fillet(); + virtual ~FeaturesAPI_Fillet2D(); INTERFACE_5(FeaturesPlugin_Fillet::ID(), creationMethod, FeaturesPlugin_Fillet::CREATION_METHOD(), @@ -76,11 +153,11 @@ public: /// Modify base objects of the fillet. FEATURESAPI_EXPORT - void setBase(const std::list& theBaseObjects); + virtual void setBase(const std::list& theBaseObjects); /// Modify fillet to have fixed radius FEATURESAPI_EXPORT - void setRadius(const ModelHighAPI_Double& theRadius); + virtual void setRadius(const ModelHighAPI_Double& theRadius); /// Modify fillet to have varying radius FEATURESAPI_EXPORT @@ -94,15 +171,6 @@ private: void execIfBaseNotEmpty(); }; -/// Pointer on Fillet object. -typedef std::shared_ptr FilletPtr; - -/// \ingroup CPPHighAPI -/// \brief Create Fillet feature. -FEATURESAPI_EXPORT -FilletPtr addFillet(const std::shared_ptr& thePart, - const std::list& theBaseObjects, - const ModelHighAPI_Double& theRadius); /// \ingroup CPPHighAPI /// \brief Create Fillet feature. @@ -110,6 +178,7 @@ FEATURESAPI_EXPORT FilletPtr addFillet(const std::shared_ptr& thePart, const std::list& theBaseObjects, const ModelHighAPI_Double& theRadius1, - const ModelHighAPI_Double& theRadius2); + const ModelHighAPI_Double& theRadius2 = ModelHighAPI_Double(-1.0), + const bool keepSubResults = false); #endif // FeaturesAPI_Fillet_H_