b311480e |
1 | -- Created on: 2001-09-26 |
2 | -- Created by: Michael KLOKOV |
973c2be1 |
3 | -- Copyright (c) 2001-2014 OPEN CASCADE SAS |
b311480e |
4 | -- |
973c2be1 |
5 | -- This file is part of Open CASCADE Technology software library. |
b311480e |
6 | -- |
d5f74e42 |
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 |
973c2be1 |
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. |
b311480e |
12 | -- |
973c2be1 |
13 | -- Alternatively, this file may be used under the terms of Open CASCADE |
14 | -- commercial license or contractual agreement. |
7fd59977 |
15 | |
16 | class MarkedRangeSet from IntTools |
17 | |
18 | ---Purpose: class MarkedRangeSet provides continuous set of ranges marked with flags |
19 | |
20 | uses |
21 | SequenceOfInteger from TColStd, |
22 | CArray1OfReal from IntTools, |
23 | SequenceOfReal from TColStd, |
24 | Range from IntTools |
25 | |
26 | is |
27 | Create returns MarkedRangeSet from IntTools; |
28 | ---Purpose: |
29 | --- Empty constructor |
30 | --- |
31 | |
32 | Create(theFirstBoundary, theLastBoundary: Real from Standard; |
33 | theInitFlag: Integer from Standard) returns MarkedRangeSet from IntTools; |
34 | ---Purpose: |
35 | --- build set of ranges which consists of one range with |
36 | --- boundary values theFirstBoundary and theLastBoundary |
37 | --- |
38 | |
39 | Create(theSortedArray: CArray1OfReal from IntTools; |
40 | theInitFlag: Integer from Standard) returns MarkedRangeSet from IntTools; |
41 | ---Purpose: |
42 | --- Build set of ranges based on the array of progressive sorted values |
43 | --- |
44 | -- Warning: |
45 | --- The constructor do not check if the values of array are not sorted |
46 | --- It should be checked before function invocation |
47 | --- |
48 | |
49 | SetBoundaries(me: in out; theFirstBoundary, theLastBoundary: Real from Standard; |
50 | theInitFlag: Integer from Standard); |
51 | ---Purpose: |
52 | --- build set of ranges which consists of one range with |
53 | --- boundary values theFirstBoundary and theLastBoundary |
54 | --- |
55 | |
56 | SetRanges(me: in out; theSortedArray: CArray1OfReal from IntTools; |
57 | theInitFlag: Integer from Standard); |
58 | ---Purpose: |
59 | --- Build set of ranges based on the array of progressive sorted values |
60 | --- |
61 | -- Warning: |
62 | --- The function do not check if the values of array are not sorted |
63 | --- It should be checked before function invocation |
64 | --- |
65 | |
66 | InsertRange(me: in out; theFirstBoundary, theLastBoundary: Real from Standard; |
67 | theFlag: Integer from Standard) |
68 | returns Boolean from Standard; |
69 | ---Purpose: |
70 | --- Inserts a new range marked with flag theFlag |
71 | --- It replace the existing ranges or parts of ranges |
72 | --- and their flags. |
73 | --- Returns True if the range is inside the initial boundaries, |
74 | --- otherwise or in case of some error returns False |
75 | --- |
76 | |
77 | InsertRange(me: in out; theRange: Range from IntTools; |
78 | theFlag: Integer from Standard) |
79 | returns Boolean from Standard; |
80 | ---Purpose: |
81 | --- Inserts a new range marked with flag theFlag |
82 | --- It replace the existing ranges or parts of ranges |
83 | --- and their flags. |
84 | --- Returns True if the range is inside the initial boundaries, |
85 | --- otherwise or in case of some error returns False |
86 | --- |
87 | |
88 | InsertRange(me: in out; theFirstBoundary, theLastBoundary: Real from Standard; |
89 | theFlag: Integer from Standard; |
90 | theIndex: Integer from Standard) |
91 | returns Boolean from Standard; |
92 | ---Purpose: |
93 | --- Inserts a new range marked with flag theFlag |
94 | --- It replace the existing ranges or parts of ranges |
95 | --- and their flags. |
96 | --- The index theIndex is a position where the range will be inserted. |
97 | --- Returns True if the range is inside the initial boundaries, |
98 | --- otherwise or in case of some error returns False |
99 | --- |
100 | |
101 | InsertRange(me: in out; theRange: Range from IntTools; |
102 | theFlag: Integer from Standard; |
103 | theIndex: Integer from Standard) |
104 | returns Boolean from Standard; |
105 | ---Purpose: |
106 | --- Inserts a new range marked with flag theFlag |
107 | --- It replace the existing ranges or parts of ranges |
108 | --- and their flags. |
109 | --- The index theIndex is a position where the range will be inserted. |
110 | --- Returns True if the range is inside the initial boundaries, |
111 | --- otherwise or in case of some error returns False |
112 | --- |
113 | |
114 | SetFlag(me: in out; theIndex: Integer from Standard; |
115 | theFlag: Integer from Standard); |
116 | ---Purpose: |
117 | --- Set flag theFlag for range with index theIndex |
118 | --- |
119 | |
120 | Flag(me; theIndex: Integer from Standard) |
121 | returns Integer from Standard; |
122 | ---Purpose: |
123 | --- Returns flag of the range with index theIndex |
124 | --- |
125 | |
126 | GetIndex(me; theValue: Real from Standard) |
127 | returns Integer from Standard; |
128 | ---Purpose: |
129 | --- Returns index of range which contains theValue. |
130 | --- If theValue do not belong any range returns 0. |
131 | --- |
132 | |
133 | GetIndices(me: in out; theValue: Real from Standard) |
134 | returns SequenceOfInteger from TColStd; |
135 | ---C++: return const & |
136 | |
137 | |
138 | GetIndex(me; theValue: Real from Standard; |
139 | UseLower : Boolean from Standard) |
140 | returns Integer from Standard; |
141 | ---Purpose: |
142 | --- Returns index of range which contains theValue |
143 | --- If theValue do not belong any range returns 0. |
144 | --- If UseLower is Standard_True then lower boundary of the range |
145 | --- can be equal to theValue, otherwise upper boundary of the range |
146 | --- can be equal to theValue. |
147 | --- |
148 | |
149 | Length(me) |
150 | returns Integer from Standard; |
151 | ---C++: inline |
152 | ---Purpose: |
153 | --- Returns number of ranges |
154 | --- |
155 | |
156 | Range(me; theIndex: Integer from Standard) |
157 | returns Range from IntTools; |
158 | ---Purpose: |
159 | --- Returns the range with index theIndex. |
160 | --- the Index can be from 1 to Length() |
161 | --- |
162 | |
163 | fields |
164 | myRangeSetStorer : SequenceOfReal from TColStd; |
165 | myRangeNumber : Integer from Standard; |
166 | myFlags : SequenceOfInteger from TColStd; |
167 | myFoundIndices : SequenceOfInteger from TColStd; |
168 | |
169 | end MarkedRangeSet from IntTools; |