1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: ModelAPI_AttributeIntArray.h
5 // Author: Natalia ERMOLAEVA
7 #ifndef ModelAPI_AttributeIntArray_H_
8 #define ModelAPI_AttributeIntArray_H_
11 #include <ModelAPI_Attribute.h>
16 /**\class ModelAPI_AttributeIntArray
18 * \brief API for the attribute that contains several integers in the array inside.
19 * Used for RGB color storage for an example. By default size is one, zero-based.
22 class ModelAPI_AttributeIntArray : public ModelAPI_Attribute
26 /// Returns the size of the array (zero means that it is empty)
27 MODELAPI_EXPORT virtual int size() = 0;
29 /// Sets the new size of the array. The previous data is erased.
30 MODELAPI_EXPORT virtual void setSize(const int theSize) = 0;
32 /// Defines the value of the array by index [0; size-1]
33 MODELAPI_EXPORT virtual void setValue(const int theIndex,
34 const int theValue) = 0;
36 /// Returns the value by the index
37 MODELAPI_EXPORT virtual int value(const int theIndex) = 0;
39 /// Returns the type of this class of attributes
40 MODELAPI_EXPORT static std::string typeId()
45 /// Returns the type of this class of attributes, not static method
46 MODELAPI_EXPORT virtual std::string attributeType();
48 /// To virtually destroy the fields of successors
49 MODELAPI_EXPORT virtual ~ModelAPI_AttributeIntArray();
52 /// Objects are created for features automatically
53 MODELAPI_EXPORT ModelAPI_AttributeIntArray();
56 //! Pointer on double attribute
57 typedef std::shared_ptr<ModelAPI_AttributeIntArray> AttributeIntArrayPtr;