Salome HOME
Join modifications from BR_Dev_For_4_0 tag V4_1_1.
[modules/kernel.git] / src / SALOMEDSImpl / SALOMEDSImpl_AttributeTableOfReal.hxx
1 //  SALOME SALOMEDSImpl : data structure of SALOME and sources of Salome data server 
2 //
3 //  Copyright (C) 2003  CEA/DEN, EDF R&D
4 //
5 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
6 //
7 //  File   : SALOMEDSImpl_AttributeTableOfReal.hxx
8 //  Author : Michael Ponikarov
9 //  Module : SALOME
10
11 #ifndef _SALOMEDSImpl_AttributeTableOfReal_HeaderFile
12 #define _SALOMEDSImpl_AttributeTableOfReal_HeaderFile
13
14 #include "DF_Attribute.hxx"
15 #include "DF_Label.hxx"      
16 #include "SALOMEDSImpl_GenericAttribute.hxx"
17
18 #include <string>
19 #include <vector>
20 #include <map>
21
22 class SALOMEDSImpl_AttributeTableOfReal : public SALOMEDSImpl_GenericAttribute 
23 {
24
25 public:
26 Standard_EXPORT virtual std::string Save();
27 Standard_EXPORT virtual void Load(const std::string&); 
28 Standard_EXPORT static const std::string& GetID() ;
29 Standard_EXPORT static SALOMEDSImpl_AttributeTableOfReal* Set(const DF_Label& label) ;
30 Standard_EXPORT SALOMEDSImpl_AttributeTableOfReal();
31 Standard_EXPORT   void SetNbColumns(const int theNbColumns);
32 Standard_EXPORT   void SetTitle(const std::string& theTitle) ;
33 Standard_EXPORT   std::string GetTitle() const;
34 Standard_EXPORT   void SetRowData(const int theRow,const std::vector<double>& theData) ;
35 Standard_EXPORT   std::vector<double> GetRowData(const int theRow) ;
36 Standard_EXPORT   void SetRowTitle(const int theRow,const std::string& theTitle) ;
37 Standard_EXPORT   void SetRowUnit(const int theRow,const std::string& theUnit) ;
38 Standard_EXPORT   std::string GetRowUnit(const int theRow) const;
39 Standard_EXPORT   void SetRowUnits(const std::vector<std::string>& theUnits) ;
40 Standard_EXPORT   std::vector<std::string> GetRowUnits();
41 Standard_EXPORT   void SetRowTitles(const std::vector<std::string>& theTitles) ;
42 Standard_EXPORT   std::vector<std::string> GetRowTitles();
43 Standard_EXPORT   std::string GetRowTitle(const int theRow) const;
44 Standard_EXPORT   void SetColumnData(const int theColumn,const std::vector<double>& theData) ;
45 Standard_EXPORT   std::vector<double> GetColumnData(const int theColumn) ;
46 Standard_EXPORT   void SetColumnTitle(const int theColumn,const std::string& theTitle) ;
47 Standard_EXPORT   void SetColumnTitles(const std::vector<std::string>& theTitles);
48 Standard_EXPORT   std::vector<std::string> GetColumnTitles();
49 Standard_EXPORT   std::string GetColumnTitle(const int theColumn) const;
50 Standard_EXPORT   int GetNbRows() const;
51 Standard_EXPORT   int GetNbColumns() const;
52
53 Standard_EXPORT   void PutValue(const double& theValue,const int theRow,const int theColumn) ;
54 Standard_EXPORT   bool HasValue(const int theRow,const int theColumn) ;
55 Standard_EXPORT   double GetValue(const int theRow,const int theColumn) ;
56 Standard_EXPORT  const std::string& ID() const;
57 Standard_EXPORT   void Restore(DF_Attribute* with) ;
58 Standard_EXPORT   DF_Attribute* NewEmpty() const;
59 Standard_EXPORT   void Paste(DF_Attribute* into);
60
61 Standard_EXPORT   std::vector<int> GetSetRowIndices(const int theRow);
62 Standard_EXPORT   std::vector<int> GetSetColumnIndices(const int theColumn);
63
64 Standard_EXPORT ~SALOMEDSImpl_AttributeTableOfReal() {}
65
66 private: 
67 std::map<int, double> myTable;
68 std::string myTitle;
69 std::vector<std::string> myRows;
70 std::vector<std::string> myCols;
71 int myNbRows;
72 int myNbColumns;
73
74 };
75
76 #endif