X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FModelHighAPI%2FModelHighAPI_Selection.h;h=b138b8f009962002f990485681593e80e997f573;hb=5dd93936ffd114ed1b28deaa92954e2dfbb11866;hp=0be8642f78557c541dfe43b96d6d6ed0f2e2eec3;hpb=631e526ea63fc394c8fcbafe4af9a21cb84ddd4e;p=modules%2Fshaper.git diff --git a/src/ModelHighAPI/ModelHighAPI_Selection.h b/src/ModelHighAPI/ModelHighAPI_Selection.h index 0be8642f7..b138b8f00 100644 --- a/src/ModelHighAPI/ModelHighAPI_Selection.h +++ b/src/ModelHighAPI/ModelHighAPI_Selection.h @@ -29,9 +29,20 @@ typedef std::pair TypeSubShapeNamePair; 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& theContext = std::shared_ptr(), + ModelHighAPI_Selection(const std::shared_ptr& theContext, const std::shared_ptr& theSubShape = std::shared_ptr()); /// Constructor for sub-shape by the textual Name MODELHIGHAPI_EXPORT @@ -49,8 +60,32 @@ public: MODELHIGHAPI_EXPORT virtual void appendToList(const std::shared_ptr & 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; };