0033040: Coding - get rid of unused headers [Storage to TopOpeBRepTool]
[occt.git] / src / TDataStd / TDataStd_RealList.hxx
1 // Created on: 2007-05-29
2 // Created by: Vlad Romashko
3 // Copyright (c) 2007-2014 OPEN CASCADE SAS
4 //
5 // This file is part of Open CASCADE Technology software library.
6 //
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
12 //
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
15
16 #ifndef _TDataStd_RealList_HeaderFile
17 #define _TDataStd_RealList_HeaderFile
18
19 #include <Standard.hxx>
20
21 #include <TColStd_ListOfReal.hxx>
22 #include <TDF_Attribute.hxx>
23 #include <Standard_Integer.hxx>
24 #include <Standard_Real.hxx>
25 #include <Standard_OStream.hxx>
26 #include <Standard_GUID.hxx>
27
28 class TDF_Label;
29 class TDF_RelocationTable;
30
31
32 class TDataStd_RealList;
33 DEFINE_STANDARD_HANDLE(TDataStd_RealList, TDF_Attribute)
34
35 //! Contains a list of doubles.
36 class TDataStd_RealList : public TDF_Attribute
37 {
38
39 public:
40
41   
42   //! Static methods
43   //! ==============
44   //! Returns the ID of the list of doubles attribute.
45   Standard_EXPORT static const Standard_GUID& GetID();
46   
47   //! Finds or creates a list of double values attribute.
48   Standard_EXPORT static Handle(TDataStd_RealList) Set (const TDF_Label& label);
49
50   //! Finds or creates a list of double values attribute with explicit user defined <guid>.
51   Standard_EXPORT static Handle(TDataStd_RealList) Set (const TDF_Label& label, const Standard_GUID& theGuid);
52
53   Standard_EXPORT TDataStd_RealList();
54   
55   Standard_EXPORT Standard_Boolean IsEmpty() const;
56   
57   Standard_EXPORT Standard_Integer Extent() const;
58   
59   Standard_EXPORT void Prepend (const Standard_Real value);
60   
61   Standard_EXPORT void Append (const Standard_Real value);
62  
63   //! Sets the explicit GUID (user defined) for the attribute.
64   Standard_EXPORT void SetID( const Standard_GUID&  theGuid) Standard_OVERRIDE;
65
66   //! Sets default GUID for the attribute.
67   Standard_EXPORT void SetID() Standard_OVERRIDE;
68
69   //! Inserts the <value> before the first meet of <before_value>.
70   Standard_EXPORT Standard_Boolean InsertBefore (const Standard_Real value, const Standard_Real before_value);
71   
72   //! Inserts the <value> before the <index> position.
73   //! The indices start with 1 .. Extent().
74   Standard_EXPORT Standard_Boolean InsertBeforeByIndex (const Standard_Integer index, const Standard_Real before_value);
75   
76   //! Inserts the <value> after the first meet of <after_value>.
77   Standard_EXPORT Standard_Boolean InsertAfter (const Standard_Real value, const Standard_Real after_value);
78   
79   //! Inserts the <value> after the <index> position.
80   //! The indices start with 1 .. Extent().
81   Standard_EXPORT Standard_Boolean InsertAfterByIndex (const Standard_Integer index, const Standard_Real after_value);
82   
83   //! Removes the first meet of the <value>.
84   Standard_EXPORT Standard_Boolean Remove (const Standard_Real value);
85   
86   //! Removes a value at <index> position.
87   Standard_EXPORT Standard_Boolean RemoveByIndex (const Standard_Integer index);
88   
89   Standard_EXPORT void Clear();
90   
91   Standard_EXPORT Standard_Real First() const;
92   
93   Standard_EXPORT Standard_Real Last() const;
94   
95   Standard_EXPORT const TColStd_ListOfReal& List() const;
96   
97   Standard_EXPORT const Standard_GUID& ID() const Standard_OVERRIDE;
98   
99   Standard_EXPORT void Restore (const Handle(TDF_Attribute)& With) Standard_OVERRIDE;
100   
101   Standard_EXPORT Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE;
102   
103   Standard_EXPORT void Paste (const Handle(TDF_Attribute)& Into, const Handle(TDF_RelocationTable)& RT) const Standard_OVERRIDE;
104   
105   Standard_EXPORT virtual Standard_OStream& Dump (Standard_OStream& anOS) const Standard_OVERRIDE;
106   
107   //! Dumps the content of me into the stream
108   Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
109
110
111
112
113   DEFINE_STANDARD_RTTIEXT(TDataStd_RealList,TDF_Attribute)
114
115 protected:
116
117
118
119
120 private:
121
122
123   TColStd_ListOfReal myList;
124   Standard_GUID myID;
125
126 };
127
128
129
130
131
132
133
134 #endif // _TDataStd_RealList_HeaderFile