1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: Model_AttributeStringArray.h
4 // Created: 14 Nov 2016
5 // Author: Mikhail Ponikarov
7 #ifndef Model_AttributeStringArray_H_
8 #define Model_AttributeStringArray_H_
11 #include <ModelAPI_AttributeStringArray.h>
12 #include <TDataStd_ExtStringArray.hxx>
13 #include <TDF_Label.hxx>
15 /// \class Model_AttributeStringArray
16 /// \ingroup DataModel
17 /// \brief API for the attribute that contains several strings in the array inside.
18 class Model_AttributeStringArray: public ModelAPI_AttributeStringArray
21 /// Returns the size of the array (zero means that it is empty)
22 MODEL_EXPORT virtual int size();
24 /// Sets the new size of the array. The previous data is erased.
25 MODEL_EXPORT virtual void setSize(const int theSize);
27 /// Defines the value of the array by index [0; size-1]
28 MODEL_EXPORT virtual void setValue(const int theIndex,
29 const std::string theValue);
31 /// Returns the value by the index
32 MODEL_EXPORT virtual std::string value(const int theIndex);
35 /// Objects are created for features automatically
36 MODEL_EXPORT Model_AttributeStringArray(TDF_Label& theLabel);
39 /// The OCCT array that keeps all values.
40 Handle_TDataStd_ExtStringArray myArray;
42 /// Stores the label as a field to set array if size is not null (null array is buggy in OCAF)
45 friend class Model_Data;