1 // Created on: 1991-12-13
2 // Created by: Christophe MARION
3 // Copyright (c) 1991-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
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.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16 
17 #ifndef _Intrv_Intervals_HeaderFile
18 #define _Intrv_Intervals_HeaderFile
19 
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23 
24 #include <Intrv_SequenceOfInterval.hxx>
25 #include <Standard_Integer.hxx>
26 class Standard_OutOfRange;
27 class Intrv_Interval;
28 
29 
30 //! The class  Intervals is a  sorted  sequence of non
31 //! overlapping  Real Intervals.
32 class Intrv_Intervals
33 {
34 public:
35 
36   DEFINE_STANDARD_ALLOC
37 
38 
39   //! Creates a void sequence of intervals.
40   Standard_EXPORT Intrv_Intervals();
41 
42   //! Creates a sequence of one interval.
43   Standard_EXPORT Intrv_Intervals(const Intrv_Interval& Int);
44 
45   //! Creates   by   copying  an   existing  sequence of
46   //! intervals.
47   Standard_EXPORT Intrv_Intervals(const Intrv_Intervals& Int);
48 
49   //! Intersects the intervals with the interval <Tool>.
50   Standard_EXPORT void Intersect (const Intrv_Interval& Tool);
51 
52   //! Intersects the intervals with the intervals in the
53   //! sequence  <Tool>.
54   Standard_EXPORT void Intersect (const Intrv_Intervals& Tool);
55 
56   Standard_EXPORT void Subtract (const Intrv_Interval& Tool);
57 
58   Standard_EXPORT void Subtract (const Intrv_Intervals& Tool);
59 
60   Standard_EXPORT void Unite (const Intrv_Interval& Tool);
61 
62   Standard_EXPORT void Unite (const Intrv_Intervals& Tool);
63 
64   Standard_EXPORT void XUnite (const Intrv_Interval& Tool);
65 
66   Standard_EXPORT void XUnite (const Intrv_Intervals& Tool);
67 
68     Standard_Integer NbIntervals() const;
69 
70     const Intrv_Interval& Value (const Standard_Integer Index) const;
71 
72 
73 
74 
75 protected:
76 
77 
78 
79 
80 
81 private:
82 
83 
84 
85   Intrv_SequenceOfInterval myInter;
86 
87 
88 };
89 
90 
91 #include <Intrv_Intervals.lxx>
92 
93 
94 
95 
96 
97 #endif // _Intrv_Intervals_HeaderFile
98