1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: Model_AttributeIntArray.h
5 // Author: Natalia ERMOLAEVA
7 #ifndef MODEL_ATTRIBUTEINTARRAY_H_
8 #define MODEL_ATTRIBUTEINTARRAY_H_
11 #include <ModelAPI_AttributeIntArray.h>
13 #include <TDF_Label.hxx>
14 #include <TDataStd_IntegerArray.hxx>
18 /**\class Model_AttributeIntArray
20 * \brief API for the attribute that contains several integers in the array inside.
21 * Used for RGB color storage for an example. By default size is one, zero-based.
22 * Represented as array in OCCT. Empty array means that this attribute does not exists.
25 class Model_AttributeIntArray : public ModelAPI_AttributeIntArray
27 /// The OCCT array that keeps all values.
28 Handle_TDataStd_IntegerArray myArray;
29 /// Stores the label as a field to set array if size is not null (null array is buggy in OCAF)
33 /// Returns the size of the array (zero means that it is empty)
34 MODEL_EXPORT virtual int size();
36 /// Sets the new size of the array. The previous data is erased.
37 MODEL_EXPORT virtual void setSize(const int theSize);
39 /// Defines the value of the array by index [0; size-1]
40 MODEL_EXPORT virtual void setValue(const int theIndex,
43 /// Returns the value by the index
44 MODEL_EXPORT virtual int value(const int theIndex);
48 /// Initializes attibutes
49 Model_AttributeIntArray(TDF_Label& theLabel);
51 friend class Model_Data;