Salome HOME
fixed bug where "Always create result" was required
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_Chamfer.h
index cad7204e980f8507228a17aaa0b3e7e78ec41eb3..bdee869280098d2b0e7fea5cc22bf453face639e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
+// Copyright (C) 2017-2022  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 #ifndef FeaturesPlugin_Chamfer_H_
 #define FeaturesPlugin_Chamfer_H_
 
-#include "FeaturesPlugin.h"
-
-#include <GeomAPI_Shape.h>
-
-#include <ModelAPI_Feature.h>
-
-class GeomAlgoAPI_MakeShape;
-class GeomAPI_DataMapOfShapeMapOfShapes;
+#include "FeaturesPlugin_VersionedChFi.h"
 
 /// \class FeaturesPlugin_Chamfer
 /// \ingroup Plugins
 /// \brief Feature for applying the Chamfer operations on Solids.
 ///        Supports two distances chamfer and distance-angle chamfer.
-class FeaturesPlugin_Chamfer : public ModelAPI_Feature
+class FeaturesPlugin_Chamfer : public FeaturesPlugin_VersionedChFi
 {
 public:
   /// Feature kind.
@@ -103,9 +96,6 @@ public:
     return MY_ANGLE_ID;
   }
 
-  /// Creates a new part document if needed.
-  FEATURESPLUGIN_EXPORT virtual void execute();
-
   /// Request for initialization of data model of the feature: adding all attributes.
   FEATURESPLUGIN_EXPORT virtual void initAttributes();
 
@@ -113,11 +103,15 @@ public:
   FeaturesPlugin_Chamfer();
 
 private:
-  /// Load Naming data structure of the feature to the document
-  void loadNamingDS(std::shared_ptr<ModelAPI_ResultBody> theResultBody,
-                    const std::shared_ptr<GeomAPI_Shape> theBaseShape,
-                    const std::shared_ptr<GeomAPI_Shape> theResultShape,
-                    const std::shared_ptr<GeomAlgoAPI_MakeShape>& theMakeShape);
+  /// Return attribute storing the selected objects of the operation.
+  virtual std::shared_ptr<ModelAPI_Attribute> objectsAttribute();
+
+  /// Return name of modified shape prefix name
+  virtual const std::string& modifiedShapePrefix() const;
+
+  /// Run chamfer/fillet operation and returns the modification algorithm if succeed.
+  virtual std::shared_ptr<GeomAlgoAPI_MakeShape>
+      performOperation(const GeomShapePtr& theSolid, const ListOfShape& theEdges);
 };
 
 #endif