Salome HOME
updated copyright message
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_VersionedChFi.h
1 // Copyright (C) 2017-2023  CEA, EDF
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #ifndef FeaturesPlugin_VersionedChFi_H_
21 #define FeaturesPlugin_VersionedChFi_H_
22
23 #include "FeaturesPlugin.h"
24
25 #include <GeomAPI_Shape.h>
26 #include <GeomAPI_ShapeHierarchy.h>
27
28 #include <ModelAPI_Feature.h>
29
30 class GeomAlgoAPI_MakeShape;
31
32 /// \class FeaturesPlugin_VersionedChFi
33 /// \ingroup Plugins
34 /// \brief Base feature for the Fillet and the Chamfer operations
35 ///        which supports versioning.
36 class FeaturesPlugin_VersionedChFi : public ModelAPI_Feature
37 {
38 public:
39   /// Performs the fillet algorithm and stores it in the data structure.
40   FEATURESPLUGIN_EXPORT virtual void execute();
41
42 protected:
43   FeaturesPlugin_VersionedChFi() {}
44
45   /// Intialize the version for the newly created feature.
46   void initVersion(const std::shared_ptr<ModelAPI_Attribute>& theObjectsAttr);
47
48   /// Process SelectionList attribute and fill the objects hierarchy.
49   bool processAttribute(const std::shared_ptr<ModelAPI_Attribute>& theAttribute,
50                         GeomAPI_ShapeHierarchy& theObjects);
51
52   /// Return attribute storing the selected objects of the operation.
53   virtual std::shared_ptr<ModelAPI_Attribute> objectsAttribute() = 0;
54
55   /// Return name of modified shape prefix name
56   virtual const std::string& modifiedShapePrefix() const = 0;
57
58   /// Run chamfer/fillet operation and returns the modification algorithm if succeed.
59   virtual std::shared_ptr<GeomAlgoAPI_MakeShape>
60       performOperation(const GeomShapePtr& theSolid, const ListOfShape& theEdges) = 0;
61 };
62
63 #endif