Salome HOME
Issue #1649: Added options to create plane by coincident point;
[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   enum VariantType {
33     VT_ResultSubShapePair,
34     VT_TypeSubShapeNamePair
35   };
36
37 public:
38   /// Constructor for result and sub-shape
39   MODELHIGHAPI_EXPORT
40   ModelHighAPI_Selection(const std::shared_ptr<ModelAPI_Result>& theContext = std::shared_ptr<ModelAPI_Result>(),
41                          const std::shared_ptr<GeomAPI_Shape>& theSubShape = std::shared_ptr<GeomAPI_Shape>());
42   /// Constructor for sub-shape by the textual Name
43   MODELHIGHAPI_EXPORT
44   ModelHighAPI_Selection(const std::string& theType,
45                          const std::string& theSubShapeName);
46   /// Destructor
47   MODELHIGHAPI_EXPORT
48   virtual ~ModelHighAPI_Selection();
49
50   /// Fill attribute values
51   MODELHIGHAPI_EXPORT
52   virtual void fillAttribute(const std::shared_ptr<ModelAPI_AttributeSelection> & theAttribute) const;
53
54   /// Append to list attribute
55   MODELHIGHAPI_EXPORT
56   virtual void appendToList(const std::shared_ptr<ModelAPI_AttributeSelectionList> & theAttribute) const;
57
58   /// \return variant type.
59   MODELHIGHAPI_EXPORT
60   virtual VariantType variantType() const;
61
62   /// \return pair of result and sub-shape.
63   MODELHIGHAPI_EXPORT
64   virtual ResultSubShapePair resultSubShapePair() const;
65
66   /// \return pair of sub-shape type and name.
67   MODELHIGHAPI_EXPORT
68   virtual TypeSubShapeNamePair typeSubShapeNamePair() const;
69
70 private:
71   VariantType myVariantType;
72   ResultSubShapePair myResultSubShapePair;
73   TypeSubShapeNamePair myTypeSubShapeNamePair;
74 };
75
76 //--------------------------------------------------------------------------------------
77 //--------------------------------------------------------------------------------------
78 #endif /* SRC_MODELHIGHAPI_MODELHIGHAPI_SELECTION_H_ */