SHAPER  9.12.0
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 
31 
37 {
38 public:
40  FEATURESPLUGIN_EXPORT virtual void execute();
41 
42 protected:
44 
46  void initVersion(const std::shared_ptr<ModelAPI_Attribute>& theObjectsAttr);
47 
49  bool processAttribute(const std::shared_ptr<ModelAPI_Attribute>& theAttribute,
50  GeomAPI_ShapeHierarchy& theObjects);
51 
53  virtual std::shared_ptr<ModelAPI_Attribute> objectsAttribute() = 0;
54 
56  virtual const std::string& modifiedShapePrefix() const = 0;
57 
59  virtual std::shared_ptr<GeomAlgoAPI_MakeShape>
60  performOperation(const GeomShapePtr& theSolid, const ListOfShape& theEdges) = 0;
61 };
62 
63 #endif
Base feature for the Fillet and the Chamfer operations which supports versioning.
Definition: FeaturesPlugin_VersionedChFi.h:37
void initVersion(const std::shared_ptr< ModelAPI_Attribute > &theObjectsAttr)
Intialize the version for the newly created feature.
Definition: FeaturesPlugin_VersionedChFi.cpp:48
virtual void execute()
Performs the fillet algorithm and stores it in the data structure.
Definition: FeaturesPlugin_VersionedChFi.cpp:56
virtual std::shared_ptr< GeomAlgoAPI_MakeShape > performOperation(const GeomShapePtr &theSolid, const ListOfShape &theEdges)=0
Run chamfer/fillet operation and returns the modification algorithm if succeed.
bool processAttribute(const std::shared_ptr< ModelAPI_Attribute > &theAttribute, GeomAPI_ShapeHierarchy &theObjects)
Process SelectionList attribute and fill the objects hierarchy.
Definition: FeaturesPlugin_VersionedChFi.cpp:109
virtual std::shared_ptr< ModelAPI_Attribute > objectsAttribute()=0
Return attribute storing the selected objects of the operation.
virtual const std::string & modifiedShapePrefix() const =0
Return name of modified shape prefix name.
Storage for the hierarchy of shapes and their parents (compounds or compsolids)
Definition: GeomAPI_ShapeHierarchy.h:34
Interface to the root class of all topological shapes constructions.
Definition: GeomAlgoAPI_MakeShape.h:35
Feature function that represents the particular functionality of this operation.
Definition: ModelAPI_Feature.h:39