class ModelHighAPI_Selection
{
public:
+ enum VariantType {
+ VT_Empty,
+ VT_ResultSubShapePair,
+ VT_TypeSubShapeNamePair
+ };
+
+public:
+ /// Default constructor with empty selection.
+ MODELHIGHAPI_EXPORT
+ ModelHighAPI_Selection();
+
/// Constructor for result and sub-shape
MODELHIGHAPI_EXPORT
- ModelHighAPI_Selection(const std::shared_ptr<ModelAPI_Result>& theContext = std::shared_ptr<ModelAPI_Result>(),
+ ModelHighAPI_Selection(const std::shared_ptr<ModelAPI_Result>& theContext,
const std::shared_ptr<GeomAPI_Shape>& theSubShape = std::shared_ptr<GeomAPI_Shape>());
/// Constructor for sub-shape by the textual Name
MODELHIGHAPI_EXPORT
MODELHIGHAPI_EXPORT
virtual void appendToList(const std::shared_ptr<ModelAPI_AttributeSelectionList> & theAttribute) const;
+ /// \return variant type.
+ MODELHIGHAPI_EXPORT
+ virtual VariantType variantType() const;
+
+ /// \return pair of result and sub-shape.
+ MODELHIGHAPI_EXPORT
+ virtual ResultSubShapePair resultSubShapePair() const;
+
+ /// \return pair of sub-shape type and name.
+ MODELHIGHAPI_EXPORT
+ virtual TypeSubShapeNamePair typeSubShapeNamePair() const;
+
+ /// \return shape type.
+ MODELHIGHAPI_EXPORT
+ virtual std::string shapeType() const;
+
+ /// Shortcut for result()->data()->setName()
+ MODELHIGHAPI_EXPORT
+ void setName(const std::string& theName);
+
+ /// Change result's color
+ MODELHIGHAPI_EXPORT
+ void setColor(int theRed, int theGreen, int theBlue);
+
private:
- enum VariantType { VT_ResultSubShapePair, VT_TypeSubShapeNamePair } myVariantType;
+ VariantType myVariantType;
ResultSubShapePair myResultSubShapePair;
TypeSubShapeNamePair myTypeSubShapeNamePair;
};