Salome HOME
0be8642f78557c541dfe43b96d6d6ed0f2e2eec3
[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 class GeomAPI_Shape;
18 class ModelAPI_AttributeSelection;
19 class ModelAPI_AttributeSelectionList;
20 class ModelAPI_Result;
21 //--------------------------------------------------------------------------------------
22 typedef std::pair<std::shared_ptr<ModelAPI_Result>, std::shared_ptr<GeomAPI_Shape> > ResultSubShapePair;
23 typedef std::pair<std::string, std::string> TypeSubShapeNamePair;
24 //--------------------------------------------------------------------------------------
25 /**\class ModelHighAPI_Selection
26  * \ingroup CPPHighAPI
27  * \brief Class for filling ModelAPI_AttributeSelection
28  */
29 class ModelHighAPI_Selection
30 {
31 public:
32   /// Constructor for result and sub-shape
33   MODELHIGHAPI_EXPORT
34   ModelHighAPI_Selection(const std::shared_ptr<ModelAPI_Result>& theContext = std::shared_ptr<ModelAPI_Result>(),
35                          const std::shared_ptr<GeomAPI_Shape>& theSubShape = std::shared_ptr<GeomAPI_Shape>());
36   /// Constructor for sub-shape by the textual Name
37   MODELHIGHAPI_EXPORT
38   ModelHighAPI_Selection(const std::string& theType,
39                          const std::string& theSubShapeName);
40   /// Destructor
41   MODELHIGHAPI_EXPORT
42   virtual ~ModelHighAPI_Selection();
43
44   /// Fill attribute values
45   MODELHIGHAPI_EXPORT
46   virtual void fillAttribute(const std::shared_ptr<ModelAPI_AttributeSelection> & theAttribute) const;
47
48   /// Append to list attribute
49   MODELHIGHAPI_EXPORT
50   virtual void appendToList(const std::shared_ptr<ModelAPI_AttributeSelectionList> & theAttribute) const;
51
52 private:
53   enum VariantType { VT_ResultSubShapePair, VT_TypeSubShapeNamePair } myVariantType;
54   ResultSubShapePair myResultSubShapePair;
55   TypeSubShapeNamePair myTypeSubShapeNamePair;
56 };
57
58 //--------------------------------------------------------------------------------------
59 //--------------------------------------------------------------------------------------
60 #endif /* SRC_MODELHIGHAPI_MODELHIGHAPI_SELECTION_H_ */