1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: Model_AttributeDoubleArray.h
4 // Created: 08 July 2016
5 // Author: Dmitry Bobylev
7 #ifndef Model_AttributeDoubleArray_H_
8 #define Model_AttributeDoubleArray_H_
12 #include <ModelAPI_AttributeDoubleArray.h>
14 #include <TDF_Label.hxx>
15 #include <TDataStd_RealArray.hxx>
19 /// \class Model_AttributeDoubleArray
20 /// \ingroup DataModel
21 /// \brief API for the attribute that contains several double in the array inside.
22 class Model_AttributeDoubleArray: public ModelAPI_AttributeDoubleArray
25 /// Returns the size of the array (zero means that it is empty)
26 MODEL_EXPORT virtual int size();
28 /// Sets the new size of the array. The previous data is erased.
29 MODEL_EXPORT virtual void setSize(const int theSize);
31 /// Defines the value of the array by index [0; size-1]
32 MODEL_EXPORT virtual void setValue(const int theIndex,
33 const double theValue);
35 /// Returns the value by the index
36 MODEL_EXPORT virtual double value(const int theIndex);
39 /// Initializes attibutes
40 Model_AttributeDoubleArray(TDF_Label& theLabel);
41 /// Reinitializes the internal state of the attribute (may be needed on undo/redo, abort, etc)
42 virtual void reinit();
45 /// The OCCT array that keeps all values.
46 Handle_TDataStd_RealArray myArray;
48 /// Stores the label as a field to set array if size is not null (null array is buggy in OCAF)
51 friend class Model_Data;