1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: ModelAPI_AttributeSelection.h
5 // Author: Mikhail PONIKAROV
7 #ifndef ModelAPI_AttributeSelection_H_
8 #define ModelAPI_AttributeSelection_H_
10 #include "ModelAPI_Attribute.h"
11 #include <ModelAPI_Result.h>
13 /**\class ModelAPI_AttributeSelection
15 * \brief Attribute that contains reference to the sub-shape of some result, the selected shape.
18 class ModelAPI_AttributeSelection : public ModelAPI_Attribute
21 /// Defines the result and its selected sub-shape
22 virtual void setValue(
23 const ResultPtr& theContext, const std::shared_ptr<GeomAPI_Shape>& theSubShape) = 0;
25 /// Returns the selected subshape
26 virtual std::shared_ptr<GeomAPI_Shape> value() = 0;
28 /// Returns the context of the selection (the whole shape owner)
29 virtual ResultPtr context() = 0;
31 /// Updates the underlied selection due to the changes in the referenced objects
32 /// \returns false if update is failed
33 virtual bool update() = 0;
35 /// Returns the type of this class of attributes
36 static std::string type()
41 /// Returns the type of this class of attributes, not static method
42 virtual std::string attributeType()
47 /// Returns a textual string of the selection
48 virtual std::string namingName() = 0;
51 /// Selects sub-shape by the textual Name
52 virtual void selectSubShape(const std::string& theType, const std::string& theSubShapeName) = 0;
54 /// To virtually destroy the fields of successors
55 virtual ~ModelAPI_AttributeSelection()
60 /// Objects are created for features automatically
61 MODELAPI_EXPORT ModelAPI_AttributeSelection()
66 //! Pointer on double attribute
67 typedef std::shared_ptr<ModelAPI_AttributeSelection> AttributeSelectionPtr;