Salome HOME
PR: merge from branch BR_UnitTests tag mergeto_trunk_17oct05
[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 //
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 <Standard_DefineHandle.hxx>
15 #include <Standard.hxx>
16 #include <TDF_Attribute.hxx>
17 #include <TDF_Label.hxx>       
18 #include "SALOMEDSImpl_GenericAttribute.hxx"
19
20 class Standard_GUID;
21 class Handle(TDF_Attribute);
22 class Handle(TDF_RelocationTable);
23
24
25 DEFINE_STANDARD_HANDLE( SALOMEDSImpl_AttributeTableOfReal, SALOMEDSImpl_GenericAttribute )
26
27 #include <TColStd_SequenceOfTransient.hxx>
28 #include <TCollection_ExtendedString.hxx>
29 #include <TColStd_HSequenceOfExtendedString.hxx>
30 #include <TColStd_DataMapOfIntegerReal.hxx>
31 #include <TColStd_HSequenceOfInteger.hxx>
32 #include <TColStd_HSequenceOfReal.hxx>
33
34 #include <strstream>
35 #include <TCollection_AsciiString.hxx>
36
37 class SALOMEDSImpl_AttributeTableOfReal : public SALOMEDSImpl_GenericAttribute 
38 {
39
40 public:
41 Standard_EXPORT virtual TCollection_AsciiString Save();
42 Standard_EXPORT virtual void Load(const TCollection_AsciiString&); 
43 Standard_EXPORT static const Standard_GUID& GetID() ;
44 Standard_EXPORT static  Handle_SALOMEDSImpl_AttributeTableOfReal Set(const TDF_Label& label) ;
45 Standard_EXPORT SALOMEDSImpl_AttributeTableOfReal();
46 Standard_EXPORT   void SetNbColumns(const Standard_Integer theNbColumns);
47 Standard_EXPORT   void SetTitle(const TCollection_ExtendedString& theTitle) ;
48 Standard_EXPORT   TCollection_ExtendedString GetTitle() const;
49 Standard_EXPORT   void SetRowData(const Standard_Integer theRow,const Handle(TColStd_HSequenceOfReal)& theData) ;
50 Standard_EXPORT   Handle_TColStd_HSequenceOfReal GetRowData(const Standard_Integer theRow) ;
51 Standard_EXPORT   void SetRowTitle(const Standard_Integer theRow,const TCollection_ExtendedString& theTitle) ;
52 Standard_EXPORT   void SetRowUnit(const Standard_Integer theRow,const TCollection_ExtendedString& theUnit) ;
53 Standard_EXPORT   TCollection_ExtendedString GetRowUnit(const Standard_Integer theRow) const;
54 Standard_EXPORT   void SetRowUnits(const Handle(TColStd_HSequenceOfExtendedString)& theUnits) ;
55 Standard_EXPORT   Handle(TColStd_HSequenceOfExtendedString) GetRowUnits();
56 Standard_EXPORT   void SetRowTitles(const Handle(TColStd_HSequenceOfExtendedString)& theTitles) ;
57 Standard_EXPORT   Handle(TColStd_HSequenceOfExtendedString) GetRowTitles();
58 Standard_EXPORT   TCollection_ExtendedString GetRowTitle(const Standard_Integer theRow) const;
59 Standard_EXPORT   void SetColumnData(const Standard_Integer theColumn,const Handle(TColStd_HSequenceOfReal)& theData) ;
60 Standard_EXPORT   Handle_TColStd_HSequenceOfReal GetColumnData(const Standard_Integer theColumn) ;
61 Standard_EXPORT   void SetColumnTitle(const Standard_Integer theColumn,const TCollection_ExtendedString& theTitle) ;
62 Standard_EXPORT   void SetColumnTitles(const Handle(TColStd_HSequenceOfExtendedString)& theTitles);
63 Standard_EXPORT   Handle(TColStd_HSequenceOfExtendedString) GetColumnTitles();
64 Standard_EXPORT   TCollection_ExtendedString GetColumnTitle(const Standard_Integer theColumn) const;
65 Standard_EXPORT   Standard_Integer GetNbRows() const;
66 Standard_EXPORT   Standard_Integer GetNbColumns() const;
67
68 Standard_EXPORT   void PutValue(const Standard_Real theValue,const Standard_Integer theRow,const Standard_Integer theColumn) ;
69 Standard_EXPORT   Standard_Boolean HasValue(const Standard_Integer theRow,const Standard_Integer theColumn) ;
70 Standard_EXPORT   Standard_Real GetValue(const Standard_Integer theRow,const Standard_Integer theColumn) ;
71 Standard_EXPORT  const Standard_GUID& ID() const;
72 Standard_EXPORT   void Restore(const Handle(TDF_Attribute)& with) ;
73 Standard_EXPORT   Handle_TDF_Attribute NewEmpty() const;
74 Standard_EXPORT   void Paste(const Handle(TDF_Attribute)& into,const Handle(TDF_RelocationTable)& RT) const;
75
76 Standard_EXPORT   Handle_TColStd_HSequenceOfInteger GetSetRowIndices(const Standard_Integer theRow);
77 Standard_EXPORT   Handle_TColStd_HSequenceOfInteger GetSetColumnIndices(const Standard_Integer theColumn);
78
79 Standard_EXPORT   void ConvertToString(ostrstream& theStream);
80 Standard_EXPORT   bool RestoreFromString(istrstream& theStream);
81
82 Standard_EXPORT ~SALOMEDSImpl_AttributeTableOfReal() {}
83
84 private: 
85 TColStd_DataMapOfIntegerReal myTable;
86 TCollection_ExtendedString myTitle;
87 Handle_TColStd_HSequenceOfExtendedString myRows;
88 Handle_TColStd_HSequenceOfExtendedString myCols;
89 Standard_Integer myNbRows;
90 Standard_Integer myNbColumns;
91
92 public:
93   DEFINE_STANDARD_RTTI( SALOMEDSImpl_AttributeTableOfReal )
94
95 };
96
97 #endif