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:
22 /// whole objects, compsoilds, solids, shells, faces or edges.
23 /// The result is less than the minimal dimension from pair of intersection:
24 /// for two solids or two faces it is wire, for the edge and face it is vertex, etc.
25 class FeaturesPlugin_Intersection : public ModelAPI_Feature
29 inline static const std::string& ID()
31 static const std::string MY_ID("Intersection");
35 /// Attribute name of objects.
36 inline static const std::string& OBJECT_LIST_ID()
38 static const std::string MY_OBJECT_LIST_ID("main_objects");
39 return MY_OBJECT_LIST_ID;
42 /// Attribute name of tools.
43 inline static const std::string& TOOL_LIST_ID()
45 static const std::string MY_TOOL_LIST_ID("tool_objects");
46 return MY_TOOL_LIST_ID;
49 /// Returns the kind of a feature.
50 FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
52 static std::string MY_KIND = FeaturesPlugin_Intersection::ID();
57 FEATURESPLUGIN_EXPORT virtual void execute();
59 /// Request for initialization of data model of the feature: adding all attributes.
60 FEATURESPLUGIN_EXPORT virtual void initAttributes();
62 /// Use plugin manager for features creation.
63 FeaturesPlugin_Intersection();
66 /// Load Naming data structure of the feature to the document.
67 void loadNamingDS(std::shared_ptr<ModelAPI_ResultBody> theResultBody,
68 const std::shared_ptr<GeomAPI_Shape> theBaseShape,
69 const ListOfShape& theTools,
70 GeomAlgoAPI_MakeShape& theMakeShape);