1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
3 // File: FeaturesPlugin_Intersection.h
4 // Created: 15 Feb 2016
5 // Author: Dmitry Bobylev
7 #ifndef FeaturesPlugin_Intersection_H_
8 #define FeaturesPlugin_Intersection_H_
10 #include "FeaturesPlugin.h"
12 #include <ModelAPI_Feature.h>
14 #include <GeomAPI_Shape.h>
16 class GeomAlgoAPI_MakeShape;
18 /// \class FeaturesPlugin_Intersection
20 /// \brief Intersection feature takes a list of shapes as objects and list of shapes as tools.
21 /// The types of objects and tools may be different: whole objects, compsoilds, solids, shells, faces or edges.
22 /// The result is less than the minimal dimension from pair of intersection:
23 /// for two solids or two faces it is wire, for the edge and face it is vertex, etc.
24 class FeaturesPlugin_Intersection : public ModelAPI_Feature
28 inline static const std::string& ID()
30 static const std::string MY_ID("Intersection");
34 /// Attribute name of objects.
35 inline static const std::string& OBJECT_LIST_ID()
37 static const std::string MY_OBJECT_LIST_ID("main_objects");
38 return MY_OBJECT_LIST_ID;
41 /// Attribute name of tools.
42 inline static const std::string& TOOL_LIST_ID()
44 static const std::string MY_TOOL_LIST_ID("tool_objects");
45 return MY_TOOL_LIST_ID;
48 /// Returns the kind of a feature.
49 FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
51 static std::string MY_KIND = FeaturesPlugin_Intersection::ID();
56 FEATURESPLUGIN_EXPORT virtual void execute();
58 /// Request for initialization of data model of the feature: adding all attributes.
59 FEATURESPLUGIN_EXPORT virtual void initAttributes();
61 /// Use plugin manager for features creation.
62 FeaturesPlugin_Intersection();
65 /// Load Naming data structure of the feature to the document.
66 void loadNamingDS(std::shared_ptr<ModelAPI_ResultBody> theResultBody,
67 const std::shared_ptr<GeomAPI_Shape> theBaseShape,
68 const ListOfShape& theTools,
69 GeomAlgoAPI_MakeShape& theMakeShape);