SHAPER  9.15.0
Model_AttributeTables.h
1 // Copyright (C) 2014-2025 CEA, EDF
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 
20 #ifndef Model_AttributeTables_H_
21 #define Model_AttributeTables_H_
22 
23 #include "Model.h"
24 
25 #include <ModelAPI_AttributeTables.h>
26 
27 #include <TDF_Label.hxx>
28 #include <TDataStd_IntegerList.hxx>
29 
30 #include <string>
31 
43 {
44 public:
46  MODEL_EXPORT virtual int rows();
48  MODEL_EXPORT virtual int columns();
50  MODEL_EXPORT virtual int tables();
51 
54  MODEL_EXPORT virtual void setSize(
55  const int theRows, const int theColumns, const int theTables = 1);
56 
58  MODEL_EXPORT virtual void setType(ValueType theType);
60  MODEL_EXPORT virtual const ValueType& type() const;
62  MODEL_EXPORT virtual void setValue(
63  const Value theValue, const int theRow, const int theColumn, const int theTable = 0);
65  MODEL_EXPORT virtual Value value(
66  const int theRow, const int theColumn, const int theTable = 0);
67 
69  MODEL_EXPORT virtual std::string valueStr(
70  const int theRow, const int theColumn, const int theTable = 0);
71 
72 protected:
74  MODEL_EXPORT Model_AttributeTables(TDF_Label& theLabel);
76  virtual void reinit();
77 
78 private:
81  //Handle_TDF_Attribute myArray;
82 
85  Handle_TDataStd_IntegerList myProp;
86 
88  int myTables, myRows, myCols;
91 
93  TDF_Label myLab;
94 
95  friend class Model_Data;
96 };
97 
98 #endif
API for the attribute that contains tables of some values type.
Definition: ModelAPI_AttributeTables.h:39
ValueType
Type of the value in the table.
Definition: ModelAPI_AttributeTables.h:42
API for the attribute that contains tables of some values type.
Definition: Model_AttributeTables.h:43
virtual void setSize(const int theRows, const int theColumns, const int theTables=1)
Sets the new size of the tables set.
Definition: Model_AttributeTables.cpp:60
virtual Value value(const int theRow, const int theColumn, const int theTable=0)
Returns the value by the index (indexes are zero-based).
Definition: Model_AttributeTables.cpp:217
virtual void reinit()
Reinitializes the internal state of the attribute (may be needed on undo/redo, abort,...
Definition: Model_AttributeTables.cpp:275
Model_AttributeTables(TDF_Label &theLabel)
Objects are created for features automatically.
Definition: Model_AttributeTables.cpp:269
virtual int rows()
Returns the number of rows in the table.
Definition: Model_AttributeTables.cpp:45
virtual std::string valueStr(const int theRow, const int theColumn, const int theTable=0)
Returns the value in the format of string (useful for the python connection)
Definition: Model_AttributeTables.cpp:247
virtual void setValue(const Value theValue, const int theRow, const int theColumn, const int theTable=0)
Defines the value by the index in the tables set (indexes are zero-based).
Definition: Model_AttributeTables.cpp:190
virtual int columns()
Returns the number of columns in the table.
Definition: Model_AttributeTables.cpp:50
virtual const ValueType & type() const
Defines the tyoe of values in the table. If it differs from the current, erases the content.
Definition: Model_AttributeTables.cpp:185
virtual void setType(ValueType theType)
Defines the tyoe of values in the table. If it differs from the current, erases the content.
Definition: Model_AttributeTables.cpp:167
virtual int tables()
Returns the number of tables.
Definition: Model_AttributeTables.cpp:55
General object of the application that allows to get/set attributes from the document and compute res...
Definition: Model_Data.h:62
Definition: ModelAPI_AttributeTables.h:49