1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2 // Name : ModelHighAPI_Selection.h
6 // 06/06/16 - Sergey POKHODENKO - Creation of the file
8 #ifndef SRC_MODELHIGHAPI_MODELHIGHAPI_SELECTION_H_
9 #define SRC_MODELHIGHAPI_MODELHIGHAPI_SELECTION_H_
11 //--------------------------------------------------------------------------------------
12 #include "ModelHighAPI.h"
17 //--------------------------------------------------------------------------------------
19 class ModelAPI_AttributeSelection;
20 class ModelAPI_AttributeSelectionList;
21 class ModelAPI_Result;
22 //--------------------------------------------------------------------------------------
23 typedef std::pair<std::shared_ptr<ModelAPI_Result>, std::shared_ptr<GeomAPI_Shape> >
25 typedef std::pair<std::string, std::string> TypeSubShapeNamePair;
26 //--------------------------------------------------------------------------------------
27 /**\class ModelHighAPI_Selection
29 * \brief Class for filling ModelAPI_AttributeSelection
31 class ModelHighAPI_Selection
36 VT_ResultSubShapePair,
37 VT_TypeSubShapeNamePair
41 /// Default constructor with empty selection.
43 ModelHighAPI_Selection();
45 /// Constructor for result and sub-shape
47 ModelHighAPI_Selection(const std::shared_ptr<ModelAPI_Result>& theContext,
48 const std::shared_ptr<GeomAPI_Shape>& theSubShape =
49 std::shared_ptr<GeomAPI_Shape>());
50 /// Constructor for sub-shape by the textual Name
52 ModelHighAPI_Selection(const std::string& theType,
53 const std::string& theSubShapeName);
56 virtual ~ModelHighAPI_Selection();
58 /// Fill attribute values
59 MODELHIGHAPI_EXPORT virtual
60 void fillAttribute(const std::shared_ptr<ModelAPI_AttributeSelection> & theAttribute) const;
62 /// Append to list attribute
63 MODELHIGHAPI_EXPORT virtual
64 void appendToList(const std::shared_ptr<ModelAPI_AttributeSelectionList> & theAttribute) const;
66 /// \return variant type.
68 virtual VariantType variantType() const;
70 /// \return pair of result and sub-shape.
72 virtual ResultSubShapePair resultSubShapePair() const;
74 /// \return pair of sub-shape type and name.
76 virtual TypeSubShapeNamePair typeSubShapeNamePair() const;
78 /// \return shape type.
80 virtual std::string shapeType() const;
82 /// Shortcut for result()->data()->setName()
84 void setName(const std::string& theName);
86 /// Change result's color
88 void setColor(int theRed, int theGreen, int theBlue);
90 /// Change result's deflection
92 void setDeflection(double theValue);
94 /// Returns the number of sub-elements.
96 int numberOfSubs() const;
98 /// Returns the sub-result by zero-base index.
100 ModelHighAPI_Selection subResult(int theIndex) const;
103 VariantType myVariantType;
104 ResultSubShapePair myResultSubShapePair;
105 TypeSubShapeNamePair myTypeSubShapeNamePair;
108 //--------------------------------------------------------------------------------------
109 //--------------------------------------------------------------------------------------
110 #endif /* SRC_MODELHIGHAPI_MODELHIGHAPI_SELECTION_H_ */