1 // File: ModelAPI_AttributeSelection.h
3 // Author: Mikhail PONIKAROV
5 #ifndef ModelAPI_AttributeSelection_H_
6 #define ModelAPI_AttributeSelection_H_
8 #include "ModelAPI_Attribute.h"
9 #include <ModelAPI_Result.h>
11 /**\class ModelAPI_AttributeSelection
13 * \brief Attribute that contains reference to the sub-shape of some result, the selected shape.
16 class ModelAPI_AttributeSelection : public ModelAPI_Attribute
19 /// Defines the result and its selected sub-shape
20 virtual void setValue(
21 const ResultPtr& theContext, const boost::shared_ptr<GeomAPI_Shape>& theSubShape) = 0;
23 /// Returns the selected subshape
24 virtual boost::shared_ptr<GeomAPI_Shape> value() = 0;
26 /// Returns the context of the selection (the whole shape owner)
27 virtual ResultPtr context() = 0;
29 /// Updates the underlied selection due to the changes in the referenced objects
30 /// \returns false if update is failed
31 virtual bool update() = 0;
33 /// Returns the type of this class of attributes
34 static std::string type()
39 /// Returns the type of this class of attributes, not static method
40 virtual std::string attributeType()
45 /// To virtually destroy the fields of successors
46 virtual ~ModelAPI_AttributeSelection()
51 /// Objects are created for features automatically
52 MODELAPI_EXPORT ModelAPI_AttributeSelection()
57 //! Pointer on double attribute
58 typedef boost::shared_ptr<ModelAPI_AttributeSelection> AttributeSelectionPtr;