1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: Model_AttributeSelectionList.h
4 // Created: 22 Oct 2014
5 // Author: Mikhail PONIKAROV
7 #ifndef Model_AttributeSelectionList_H_
8 #define Model_AttributeSelectionList_H_
11 #include "Model_AttributeSelection.h"
12 #include <ModelAPI_AttributeSelectionList.h>
13 #include <TDataStd_Integer.hxx>
14 #include <TDataStd_Real.hxx>
17 /**\class Model_AttributeSelectionList
19 * \brief Attribute that contains list of references to the sub-shapes with
20 * possibility to manage them.
23 class Model_AttributeSelectionList : public ModelAPI_AttributeSelectionList
25 Handle(TDataStd_Integer) mySize; ///< Contains size of this list
26 Handle(TDataStd_Real) mySelectionType; ///< Contains current index, TODO: make it integer, not real
28 /// Adds the new reference to the end of the list
29 MODEL_EXPORT virtual void append(
30 const ResultPtr& theContext, const std::shared_ptr<GeomAPI_Shape>& theSubShape);
32 /// Adds the new reference to the end of the list by the naming name of the selected shape
33 /// The type of shape is taken from the current selection type
34 MODEL_EXPORT virtual void append(std::string theNamingName);
36 /// Returns the number ofselection attributes in the list
37 MODEL_EXPORT virtual int size();
39 MODEL_EXPORT virtual int selectionType();
41 MODEL_EXPORT virtual void setSelectionType(int);
43 /// Returns the attribute selection by the index (zero based)
44 MODEL_EXPORT virtual std::shared_ptr<ModelAPI_AttributeSelection> value(const int theIndex);
46 /// Returns all attributes
47 MODEL_EXPORT virtual void clear();
50 /// Objects are created for features automatically
51 MODEL_EXPORT Model_AttributeSelectionList(TDF_Label& theLabel);
53 friend class Model_Data;