Salome HOME
Fix tests MakeBrick2 & MakeBrick3. Fix Box macro feature.
[modules/shaper.git] / src / ModelHighAPI / ModelHighAPI_Selection.h
1 // Name   : ModelHighAPI_Selection.h
2 // Purpose: 
3 //
4 // History:
5 // 06/06/16 - Sergey POKHODENKO - Creation of the file
6
7 #ifndef SRC_MODELHIGHAPI_MODELHIGHAPI_SELECTION_H_
8 #define SRC_MODELHIGHAPI_MODELHIGHAPI_SELECTION_H_
9
10 //--------------------------------------------------------------------------------------
11 #include "ModelHighAPI.h"
12
13 #include <memory>
14 #include <string>
15 #include <utility>
16
17 #include <boost/variant.hpp>
18 //--------------------------------------------------------------------------------------
19 class GeomAPI_Shape;
20 class ModelAPI_AttributeSelection;
21 class ModelAPI_AttributeSelectionList;
22 class ModelAPI_Result;
23 //--------------------------------------------------------------------------------------
24 typedef std::pair<std::shared_ptr<ModelAPI_Result>, std::shared_ptr<GeomAPI_Shape> > ResultSubShapePair;
25 typedef std::pair<std::string, std::string> TypeSubShapeNamePair;
26 //--------------------------------------------------------------------------------------
27 /**\class ModelHighAPI_Selection
28  * \ingroup CPPHighAPI
29  * \brief Class for filling ModelAPI_AttributeSelection
30  */
31 class ModelHighAPI_Selection
32 {
33 public:
34   /// Constructor for result and sub-shape
35   MODELHIGHAPI_EXPORT
36   ModelHighAPI_Selection(const std::shared_ptr<ModelAPI_Result>& theContext = std::shared_ptr<ModelAPI_Result>(),
37                          const std::shared_ptr<GeomAPI_Shape>& theSubShape = std::shared_ptr<GeomAPI_Shape>());
38   /// Constructor for sub-shape by the textual Name
39   MODELHIGHAPI_EXPORT
40   ModelHighAPI_Selection(const std::string& theType,
41                          const std::string& theSubShapeName);
42   /// Destructor
43   MODELHIGHAPI_EXPORT
44   virtual ~ModelHighAPI_Selection();
45
46   /// Fill attribute values
47   MODELHIGHAPI_EXPORT
48   virtual void fillAttribute(const std::shared_ptr<ModelAPI_AttributeSelection> & theAttribute) const;
49
50   /// Append to list attribute
51   MODELHIGHAPI_EXPORT
52   virtual void appendToList(const std::shared_ptr<ModelAPI_AttributeSelectionList> & theAttribute) const;
53
54 private:
55   boost::variant<ResultSubShapePair, TypeSubShapeNamePair> myValue;
56 };
57
58 //--------------------------------------------------------------------------------------
59 //--------------------------------------------------------------------------------------
60 #endif /* SRC_MODELHIGHAPI_MODELHIGHAPI_SELECTION_H_ */