Salome HOME
NRI : Remove dependence with VISU.
[modules/kernel.git] / src / SALOMEDS / SALOMEDS_TableOfIntegerAttribute.hxx
1 //  File      : SALOMEDS_TableOfIntegerAttribute.hxx
2 //  Created   : Tue Oct  8 10:13:30 2002
3 //  Author    : Michael Ponikarov
4 //  Project   : SALOME
5 //  Module    : SALOMEDS
6 //  Copyright : Open CASCADE
7 //  $Header$
8
9 #ifndef _SALOMEDS_TableOfIntegerAttribute_HeaderFile
10 #define _SALOMEDS_TableOfIntegerAttribute_HeaderFile
11
12 #ifndef _Standard_HeaderFile
13 #include <Standard.hxx>
14 #endif
15 #ifndef _Handle_SALOMEDS_TableOfIntegerAttribute_HeaderFile
16 #include <Handle_SALOMEDS_TableOfIntegerAttribute.hxx>
17 #endif
18
19 #ifndef _TColStd_SequenceOfTransient_HeaderFile
20 #include <TColStd_SequenceOfTransient.hxx>
21 #endif
22 #ifndef _TCollection_ExtendedString_HeaderFile
23 #include <TCollection_ExtendedString.hxx>
24 #endif
25 #ifndef _Handle_TColStd_HSequenceOfExtendedString_HeaderFile
26 #include <Handle_TColStd_HSequenceOfExtendedString.hxx>
27 #endif
28
29 #ifndef _TColStd_DataMapOfIntegerInteger_HeaderFile
30 #include <TColStd_DataMapOfIntegerInteger.hxx>
31 #endif
32
33 #ifndef _TDF_Attribute_HeaderFile
34 #include <TDF_Attribute.hxx>
35 #endif
36 #ifndef _Standard_Integer_HeaderFile
37 #include <Standard_Integer.hxx>
38 #endif
39 #ifndef _Handle_TColStd_HSequenceOfInteger_HeaderFile
40 #include <Handle_TColStd_HSequenceOfInteger.hxx>
41 #endif
42 #ifndef _Standard_Boolean_HeaderFile
43 #include <Standard_Boolean.hxx>
44 #endif
45 #ifndef _Handle_TDF_Attribute_HeaderFile
46 #include <Handle_TDF_Attribute.hxx>
47 #endif
48 #ifndef _Handle_TDF_RelocationTable_HeaderFile
49 #include <Handle_TDF_RelocationTable.hxx>
50 #endif
51 class TColStd_HSequenceOfExtendedString;
52 class Standard_GUID;
53 class TDF_Label;
54 class TCollection_ExtendedString;
55 class TColStd_HSequenceOfInteger;
56 class TDF_Attribute;
57 class TDF_RelocationTable;
58
59 #include <strstream>
60
61 class SALOMEDS_TableOfIntegerAttribute : public TDF_Attribute {
62
63 public:
64
65     inline void* operator new(size_t,void* anAddress) 
66       {
67         return anAddress;
68       }
69     inline void* operator new(size_t size) 
70       { 
71         return Standard::Allocate(size); 
72       }
73     inline void  operator delete(void *anAddress) 
74       { 
75         if (anAddress) Standard::Free((Standard_Address&)anAddress); 
76       }
77 //    inline void  operator delete(void *anAddress, size_t size) 
78 //      { 
79 //        if (anAddress) Standard::Free((Standard_Address&)anAddress,size); 
80 //      }
81  // Methods PUBLIC
82  // 
83 Standard_EXPORT static const Standard_GUID& GetID() ;
84 Standard_EXPORT static  Handle_SALOMEDS_TableOfIntegerAttribute Set(const TDF_Label& label) ;
85 Standard_EXPORT SALOMEDS_TableOfIntegerAttribute();
86 Standard_EXPORT   void SetNbColumns(const Standard_Integer theNbColumns);
87 Standard_EXPORT   void SetTitle(const TCollection_ExtendedString& theTitle) ;
88 Standard_EXPORT   TCollection_ExtendedString GetTitle() const;
89 Standard_EXPORT   void SetRowData(const Standard_Integer theRow,const Handle(TColStd_HSequenceOfInteger)& theData) ;
90 Standard_EXPORT   Handle_TColStd_HSequenceOfInteger GetRowData(const Standard_Integer theRow) ;
91 Standard_EXPORT   void SetRowTitle(const Standard_Integer theRow,const TCollection_ExtendedString& theTitle) ;
92 Standard_EXPORT   TCollection_ExtendedString GetRowTitle(const Standard_Integer theRow) const;
93 Standard_EXPORT   void SetColumnData(const Standard_Integer theColumn,const Handle(TColStd_HSequenceOfInteger)& theData) ;
94 Standard_EXPORT   Handle_TColStd_HSequenceOfInteger GetColumnData(const Standard_Integer theColumn) ;
95 Standard_EXPORT   void SetColumnTitle(const Standard_Integer theColumn,const TCollection_ExtendedString& theTitle) ;
96 Standard_EXPORT   TCollection_ExtendedString GetColumnTitle(const Standard_Integer theColumn) const;
97 Standard_EXPORT   Standard_Integer GetNbRows() const;
98 Standard_EXPORT   Standard_Integer GetNbColumns() const;
99
100 Standard_EXPORT   void PutValue(const Standard_Integer theValue,const Standard_Integer theRow,const Standard_Integer theColumn) ;
101 Standard_EXPORT   Standard_Boolean HasValue(const Standard_Integer theRow,const Standard_Integer theColumn) ;
102 Standard_EXPORT   Standard_Integer GetValue(const Standard_Integer theRow,const Standard_Integer theColumn) ;
103 Standard_EXPORT  const Standard_GUID& ID() const;
104 Standard_EXPORT   void Restore(const Handle(TDF_Attribute)& with) ;
105 Standard_EXPORT   Handle_TDF_Attribute NewEmpty() const;
106 Standard_EXPORT   void Paste(const Handle(TDF_Attribute)& into,const Handle(TDF_RelocationTable)& RT) const;
107
108 Standard_EXPORT   Handle_TColStd_HSequenceOfInteger GetSetRowIndices(const Standard_Integer theRow);
109 Standard_EXPORT   Handle_TColStd_HSequenceOfInteger GetSetColumnIndices(const Standard_Integer theColumn);
110
111 Standard_EXPORT   void ConvertToString(ostrstream& theStream);
112 Standard_EXPORT   bool RestoreFromString(istrstream& theStream);
113
114 Standard_EXPORT ~SALOMEDS_TableOfIntegerAttribute();
115
116
117
118
119  // Type management
120  //
121  Standard_EXPORT friend Handle_Standard_Type& SALOMEDS_TableOfIntegerAttribute_Type_();
122  Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
123  Standard_EXPORT Standard_Boolean              IsKind(const Handle(Standard_Type)&) const;
124
125 protected:
126
127  // Methods PROTECTED
128  // 
129
130
131  // Fields PROTECTED
132  //
133
134
135 private: 
136
137  // Methods PRIVATE
138  // 
139
140
141  // Fields PRIVATE
142  //
143 TColStd_DataMapOfIntegerInteger myTable;
144 TCollection_ExtendedString myTitle;
145 Handle_TColStd_HSequenceOfExtendedString myRows;
146 Handle_TColStd_HSequenceOfExtendedString myCols;
147 Standard_Integer myNbRows;
148 Standard_Integer myNbColumns;
149
150 };
151
152
153
154
155
156 // other inline functions and methods (like "C++: function call" methods)
157 //
158
159
160 #endif