Salome HOME
updated copyright message
[modules/shaper.git] / src / FeaturesAPI / FeaturesAPI_Fillet.h
index 7670f2dcb8923843bf35b30aa79c1c73b2c3b609..4023bfceda183757902b848ec2ce5abe69566ca6 100644 (file)
@@ -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
 #include "FeaturesAPI.h"
 
 #include <FeaturesPlugin_Fillet.h>
+#include <FeaturesPlugin_Fillet1D.h>
 
+#include <ModelHighAPI_Double.h>
 #include <ModelHighAPI_Interface.h>
 #include <ModelHighAPI_Macro.h>
 
-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<ModelAPI_AttributeDouble> radius() const = 0;
+
+  /// Modify base objects of the fillet.
+  virtual void setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects) = 0;
+
+  /// Modify fillet to have fixed radius
+  virtual void setRadius(const ModelHighAPI_Double& theRadius) = 0;
+
+protected:
+  FeaturesAPI_Fillet(const std::shared_ptr<ModelAPI_Feature>& theFeature);
+};
+
+/// Pointer on the fillet object.
+typedef std::shared_ptr<FeaturesAPI_Fillet> 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<ModelAPI_Feature>& theFeature);
+  explicit FeaturesAPI_Fillet1D(const std::shared_ptr<ModelAPI_Feature>& theFeature);
 
   /// Constructor with values.
   FEATURESAPI_EXPORT
-  explicit FeaturesAPI_Fillet(const std::shared_ptr<ModelAPI_Feature>& theFeature,
-                              const std::list<ModelHighAPI_Selection>& theBaseObjects,
-                              const ModelHighAPI_Double& theRadius);
+  explicit FeaturesAPI_Fillet1D(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+                                const std::list<ModelHighAPI_Selection>& 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<ModelHighAPI_Selection>& 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<ModelAPI_Feature>& theFeature);
 
   /// Constructor with values.
   FEATURESAPI_EXPORT
-  explicit FeaturesAPI_Fillet(const std::shared_ptr<ModelAPI_Feature>& theFeature,
-                              const std::list<ModelHighAPI_Selection>& theBaseObjects,
-                              const ModelHighAPI_Double& theRadius1,
-                              const ModelHighAPI_Double& theRadius2);
+  explicit FeaturesAPI_Fillet2D(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+                                const std::list<ModelHighAPI_Selection>& theBaseObjects,
+                                const ModelHighAPI_Double& theRadius);
+
+  /// Constructor with values.
+  FEATURESAPI_EXPORT
+  explicit FeaturesAPI_Fillet2D(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+                                const std::list<ModelHighAPI_Selection>& 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<ModelHighAPI_Selection>& theBaseObjects);
+  virtual void setBase(const std::list<ModelHighAPI_Selection>& 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<FeaturesAPI_Fillet> FilletPtr;
-
-/// \ingroup CPPHighAPI
-/// \brief Create Fillet feature.
-FEATURESAPI_EXPORT
-FilletPtr addFillet(const std::shared_ptr<ModelAPI_Document>& thePart,
-                    const std::list<ModelHighAPI_Selection>& theBaseObjects,
-                    const ModelHighAPI_Double& theRadius);
 
 /// \ingroup CPPHighAPI
 /// \brief Create Fillet feature.
@@ -110,6 +178,7 @@ FEATURESAPI_EXPORT
 FilletPtr addFillet(const std::shared_ptr<ModelAPI_Document>& thePart,
                     const std::list<ModelHighAPI_Selection>& 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_