1 // Created on: 1991-02-26
2 // Created by: Isabelle GRIGNON
3 // Copyright (c) 1991-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _Extrema_SeqPOnCOfCCLocFOfLocECC2d_HeaderFile
18 #define _Extrema_SeqPOnCOfCCLocFOfLocECC2d_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <TCollection_BaseSequence.hxx>
25 #include <Standard_Integer.hxx>
26 class Standard_NoSuchObject;
27 class Standard_OutOfRange;
28 class Extrema_POnCurv2d;
29 class Extrema_SequenceNodeOfSeqPOnCOfCCLocFOfLocECC2d;
33 class Extrema_SeqPOnCOfCCLocFOfLocECC2d : public TCollection_BaseSequence
40 //! Constructs an empty sequence.
42 //! - the function Append or Prepend to add an item or
43 //! a collection of items at the end, or at the beginning of the sequence,
44 //! - the function InsertAfter or InsertBefore to add an
45 //! item or a collection of items at any position in the sequence,
46 //! - operator() or the function SetValue to assign a
47 //! new value to an item of the sequence,
48 //! - operator() to read an item of the sequence,
49 //! - the function Remove to remove an item at any
50 //! position in the sequence.
52 //! To copy a sequence, you must explicitly call the
53 //! assignment operator (operator=).
54 Extrema_SeqPOnCOfCCLocFOfLocECC2d();
56 //! Creation by copy of existing Sequence.
57 Standard_EXPORT Extrema_SeqPOnCOfCCLocFOfLocECC2d(const Extrema_SeqPOnCOfCCLocFOfLocECC2d& Other);
59 //! Removes all element(s) of the sequence <me>
65 Standard_EXPORT void Clear();
66 ~Extrema_SeqPOnCOfCCLocFOfLocECC2d()
71 //! Copies the contents of the sequence Other into this sequence.
72 //! If this sequence is not empty, it is automatically cleared before the copy.
73 Standard_EXPORT const Extrema_SeqPOnCOfCCLocFOfLocECC2d& Assign (const Extrema_SeqPOnCOfCCLocFOfLocECC2d& Other);
74 const Extrema_SeqPOnCOfCCLocFOfLocECC2d& operator = (const Extrema_SeqPOnCOfCCLocFOfLocECC2d& Other)
79 //! Appends <T> at the end of <me>.
85 Standard_EXPORT void Append (const Extrema_POnCurv2d& T);
87 //! Concatenates <S> at the end of <me>.
94 //! me = (A B C D E F)
96 void Append (Extrema_SeqPOnCOfCCLocFOfLocECC2d& S);
98 //! Add <T> at the beginning of <me>.
104 Standard_EXPORT void Prepend (const Extrema_POnCurv2d& T);
106 //! Concatenates <S> at the beginning of <me>.
110 //! me = (A B C) S = (D E F)
111 //! after me = (D E F A B C)
113 void Prepend (Extrema_SeqPOnCOfCCLocFOfLocECC2d& S);
115 //! Inserts <T> in <me> before the position <Index>.
116 //! Raises an exception if the index is out of bounds.
119 //! me = (A B D), Index = 3, T = C
122 void InsertBefore (const Standard_Integer Index, const Extrema_POnCurv2d& T);
124 //! Inserts the sequence <S> in <me> before
125 //! the position <Index>. <S> is cleared.
126 //! Raises an exception if the index is out of bounds
129 //! me = (A B F), Index = 3, S = (C D E)
131 //! me = (A B C D E F)
133 void InsertBefore (const Standard_Integer Index, Extrema_SeqPOnCOfCCLocFOfLocECC2d& S);
135 //! Inserts <T> in <me> after the position <Index>.
136 //! Raises an exception if the index is out of bound
139 //! me = (A B C), Index = 3, T = D
142 Standard_EXPORT void InsertAfter (const Standard_Integer Index, const Extrema_POnCurv2d& T);
144 //! Inserts the sequence <S> in <me> after the
145 //! position <Index>. <S> is cleared.
146 //! Raises an exception if the index is out of bound.
149 //! me = (A B C), Index = 3, S = (D E F)
151 //! me = (A B C D E F)
153 void InsertAfter (const Standard_Integer Index, Extrema_SeqPOnCOfCCLocFOfLocECC2d& S);
155 //! Returns the first element of the sequence <me>
156 //! Raises an exception if the sequence is empty.
163 Standard_EXPORT const Extrema_POnCurv2d& First() const;
165 //! Returns the last element of the sequence <me>
166 //! Raises an exception if the sequence is empty.
173 Standard_EXPORT const Extrema_POnCurv2d& Last() const;
175 //! Keeps in <me> the items 1 to <Index>-1 and
176 //! puts in <Sub> the items <Index> to the end.
179 //! me = (A B C D) ,Index = 3
183 void Split (const Standard_Integer Index, Extrema_SeqPOnCOfCCLocFOfLocECC2d& Sub);
185 //! Returns the Item at position <Index> in <me>.
186 //! Raises an exception if the index is out of bound
189 //! me = (A B C), Index = 1
194 Standard_EXPORT const Extrema_POnCurv2d& Value (const Standard_Integer Index) const;
195 const Extrema_POnCurv2d& operator() (const Standard_Integer Index) const
200 //! Changes the item at position <Index>
201 //! Raises an exception if the index is out of bound
204 //! me = (A B C), Index = 1, Item = D
207 Standard_EXPORT void SetValue (const Standard_Integer Index, const Extrema_POnCurv2d& I);
209 //! Returns the Item at position <Index> in
210 //! <me>. This method may be used to modify
211 //! <me> : S.Value(Index) = Item.
212 //! Raises an exception if the index is out of bound
215 //! me = (A B C), Index = 1
220 Standard_EXPORT Extrema_POnCurv2d& ChangeValue (const Standard_Integer Index);
221 Extrema_POnCurv2d& operator() (const Standard_Integer Index)
223 return ChangeValue(Index);
226 //! Removes from <me> the item at position <Index>.
227 //! Raises an exception if the index is out of bounds
230 //! me = (A B C), Index = 3
233 Standard_EXPORT void Remove (const Standard_Integer Index);
235 //! Removes from <me> all the items of
236 //! positions between <FromIndex> and <ToIndex>.
237 //! Raises an exception if the indices are out of bounds.
240 //! me = (A B C D E F), FromIndex = 1 ToIndex = 3
243 Standard_EXPORT void Remove (const Standard_Integer FromIndex, const Standard_Integer ToIndex);
262 #define SeqItem Extrema_POnCurv2d
263 #define SeqItem_hxx <Extrema_POnCurv2d.hxx>
264 #define TCollection_SequenceNode Extrema_SequenceNodeOfSeqPOnCOfCCLocFOfLocECC2d
265 #define TCollection_SequenceNode_hxx <Extrema_SequenceNodeOfSeqPOnCOfCCLocFOfLocECC2d.hxx>
266 #define Handle_TCollection_SequenceNode Handle(Extrema_SequenceNodeOfSeqPOnCOfCCLocFOfLocECC2d)
267 #define TCollection_Sequence Extrema_SeqPOnCOfCCLocFOfLocECC2d
268 #define TCollection_Sequence_hxx <Extrema_SeqPOnCOfCCLocFOfLocECC2d.hxx>
270 #include <TCollection_Sequence.lxx>
274 #undef TCollection_SequenceNode
275 #undef TCollection_SequenceNode_hxx
276 #undef Handle_TCollection_SequenceNode
277 #undef TCollection_Sequence
278 #undef TCollection_Sequence_hxx
283 #endif // _Extrema_SeqPOnCOfCCLocFOfLocECC2d_HeaderFile