Salome HOME
Issue #3222: 1d fillet
[modules/shaper.git] / src / FeaturesAPI / FeaturesAPI_Fillet.h
index 37eeef6884d1cc10d9a8833eb33cd3eea5641a6b..7eac5d6c882c3bfd2f71a69bea4e4e62f8a6b48c 100644 (file)
@@ -23,6 +23,7 @@
 #include "FeaturesAPI.h"
 
 #include <FeaturesPlugin_Fillet.h>
+#include <FeaturesPlugin_Fillet1D.h>
 
 #include <ModelHighAPI_Double.h>
 #include <ModelHighAPI_Interface.h>
@@ -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_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_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& 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,8 +171,6 @@ private:
   void execIfBaseNotEmpty();
 };
 
-/// Pointer on Fillet object.
-typedef std::shared_ptr<FeaturesAPI_Fillet> FilletPtr;
 
 /// \ingroup CPPHighAPI
 /// \brief Create Fillet feature.