1 // Copyright (C) 2017-2022 CEA/DEN, EDF R&D
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.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #ifndef FeaturesPlugin_VersionedChFi_H_
21 #define FeaturesPlugin_VersionedChFi_H_
23 #include "FeaturesPlugin.h"
25 #include <GeomAPI_Shape.h>
26 #include <GeomAPI_ShapeHierarchy.h>
28 #include <ModelAPI_Feature.h>
30 class GeomAlgoAPI_MakeShape;
32 /// \class FeaturesPlugin_VersionedChFi
34 /// \brief Base feature for the Fillet and the Chamfer operations
35 /// which supports versioning.
36 class FeaturesPlugin_VersionedChFi : public ModelAPI_Feature
39 /// Performs the fillet algorithm and stores it in the data structure.
40 FEATURESPLUGIN_EXPORT virtual void execute();
43 FeaturesPlugin_VersionedChFi() {}
45 /// Intialize the version for the newly created feature.
46 void initVersion(const std::shared_ptr<ModelAPI_Attribute>& theObjectsAttr);
48 /// Process SelectionList attribute and fill the objects hierarchy.
49 bool processAttribute(const std::shared_ptr<ModelAPI_Attribute>& theAttribute,
50 GeomAPI_ShapeHierarchy& theObjects);
52 /// Return attribute storing the selected objects of the operation.
53 virtual std::shared_ptr<ModelAPI_Attribute> objectsAttribute() = 0;
55 /// Return name of modified shape prefix name
56 virtual const std::string& modifiedShapePrefix() const = 0;
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;