X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModelAPI%2FModelAPI_AttributeSelection.h;h=495da4180492d8eb36b9d62ba4d6e7978e6bd698;hb=6bb3ec6c114b55c02bad00ec953cd5b867eb7083;hp=9b4970c124a01e80f7ef4187e683c8f0a8e67971;hpb=93310e00f0ac95395137c842108790bf62e6425e;p=modules%2Fshaper.git diff --git a/src/ModelAPI/ModelAPI_AttributeSelection.h b/src/ModelAPI/ModelAPI_AttributeSelection.h index 9b4970c12..495da4180 100644 --- a/src/ModelAPI/ModelAPI_AttributeSelection.h +++ b/src/ModelAPI/ModelAPI_AttributeSelection.h @@ -1,3 +1,5 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + // File: ModelAPI_AttributeSelection.h // Created: 2 Oct 2014 // Author: Mikhail PONIKAROV @@ -6,7 +8,7 @@ #define ModelAPI_AttributeSelection_H_ #include "ModelAPI_Attribute.h" -#include +#include /**\class ModelAPI_AttributeSelection * \ingroup DataModel @@ -18,36 +20,46 @@ class ModelAPI_AttributeSelection : public ModelAPI_Attribute public: /// Defines the result and its selected sub-shape virtual void setValue( - const ResultBodyPtr& theContext, const boost::shared_ptr& theSubShape) = 0; + const ResultPtr& theContext, const std::shared_ptr& theSubShape) = 0; /// Returns the selected subshape - virtual boost::shared_ptr value() = 0; + virtual std::shared_ptr value() = 0; /// Returns the context of the selection (the whole shape owner) - virtual ResultBodyPtr context() = 0; + virtual ResultPtr context() = 0; + + /// Updates the underlied selection due to the changes in the referenced objects + /// \returns false if update is failed + virtual bool update() = 0; /// Returns the type of this class of attributes - static std::string type() + static std::string typeId() { return "Selection"; } /// Returns the type of this class of attributes, not static method - virtual std::string attributeType() - { - return type(); - } + MODELAPI_EXPORT virtual std::string attributeType(); + + /// Returns a textual string of the selection + virtual std::string namingName() = 0; + + /// Returns an id of the selection + virtual int Id() = 0; + + + /// Selects sub-shape by the textual Name + virtual void selectSubShape(const std::string& theType, const std::string& theSubShapeName) = 0; /// To virtually destroy the fields of successors - virtual ~ModelAPI_AttributeSelection() - { - } + MODELAPI_EXPORT virtual ~ModelAPI_AttributeSelection(); protected: /// Objects are created for features automatically - MODELAPI_EXPORT ModelAPI_AttributeSelection() - { - } + MODELAPI_EXPORT ModelAPI_AttributeSelection(); }; +//! Pointer on double attribute +typedef std::shared_ptr AttributeSelectionPtr; + #endif