1 -- Created on: 2001-09-26
2 -- Created by: Michael KLOKOV
3 -- Copyright (c) 2001-2012 OPEN CASCADE SAS
5 -- The content of this file is subject to the Open CASCADE Technology Public
6 -- License Version 6.5 (the "License"). You may not use the content of this file
7 -- except in compliance with the License. Please obtain a copy of the License
8 -- at http://www.opencascade.org and read it completely before using this file.
10 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
11 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 -- The Original Code and all software distributed under the License is
14 -- distributed on an "AS IS" basis, without warranty of any kind, and the
15 -- Initial Developer hereby disclaims all such warranties, including without
16 -- limitation, any warranties of merchantability, fitness for a particular
17 -- purpose or non-infringement. Please see the License for the specific terms
18 -- and conditions governing the rights and limitations under the License.
21 class MarkedRangeSet from IntTools
23 ---Purpose: class MarkedRangeSet provides continuous set of ranges marked with flags
26 SequenceOfInteger from TColStd,
27 CArray1OfReal from IntTools,
28 SequenceOfReal from TColStd,
32 Create returns MarkedRangeSet from IntTools;
37 Create(theFirstBoundary, theLastBoundary: Real from Standard;
38 theInitFlag: Integer from Standard) returns MarkedRangeSet from IntTools;
40 --- build set of ranges which consists of one range with
41 --- boundary values theFirstBoundary and theLastBoundary
44 Create(theSortedArray: CArray1OfReal from IntTools;
45 theInitFlag: Integer from Standard) returns MarkedRangeSet from IntTools;
47 --- Build set of ranges based on the array of progressive sorted values
50 --- The constructor do not check if the values of array are not sorted
51 --- It should be checked before function invocation
54 SetBoundaries(me: in out; theFirstBoundary, theLastBoundary: Real from Standard;
55 theInitFlag: Integer from Standard);
57 --- build set of ranges which consists of one range with
58 --- boundary values theFirstBoundary and theLastBoundary
61 SetRanges(me: in out; theSortedArray: CArray1OfReal from IntTools;
62 theInitFlag: Integer from Standard);
64 --- Build set of ranges based on the array of progressive sorted values
67 --- The function do not check if the values of array are not sorted
68 --- It should be checked before function invocation
71 InsertRange(me: in out; theFirstBoundary, theLastBoundary: Real from Standard;
72 theFlag: Integer from Standard)
73 returns Boolean from Standard;
75 --- Inserts a new range marked with flag theFlag
76 --- It replace the existing ranges or parts of ranges
78 --- Returns True if the range is inside the initial boundaries,
79 --- otherwise or in case of some error returns False
82 InsertRange(me: in out; theRange: Range from IntTools;
83 theFlag: Integer from Standard)
84 returns Boolean from Standard;
86 --- Inserts a new range marked with flag theFlag
87 --- It replace the existing ranges or parts of ranges
89 --- Returns True if the range is inside the initial boundaries,
90 --- otherwise or in case of some error returns False
93 InsertRange(me: in out; theFirstBoundary, theLastBoundary: Real from Standard;
94 theFlag: Integer from Standard;
95 theIndex: Integer from Standard)
96 returns Boolean from Standard;
98 --- Inserts a new range marked with flag theFlag
99 --- It replace the existing ranges or parts of ranges
101 --- The index theIndex is a position where the range will be inserted.
102 --- Returns True if the range is inside the initial boundaries,
103 --- otherwise or in case of some error returns False
106 InsertRange(me: in out; theRange: Range from IntTools;
107 theFlag: Integer from Standard;
108 theIndex: Integer from Standard)
109 returns Boolean from Standard;
111 --- Inserts a new range marked with flag theFlag
112 --- It replace the existing ranges or parts of ranges
114 --- The index theIndex is a position where the range will be inserted.
115 --- Returns True if the range is inside the initial boundaries,
116 --- otherwise or in case of some error returns False
119 SetFlag(me: in out; theIndex: Integer from Standard;
120 theFlag: Integer from Standard);
122 --- Set flag theFlag for range with index theIndex
125 Flag(me; theIndex: Integer from Standard)
126 returns Integer from Standard;
128 --- Returns flag of the range with index theIndex
131 GetIndex(me; theValue: Real from Standard)
132 returns Integer from Standard;
134 --- Returns index of range which contains theValue.
135 --- If theValue do not belong any range returns 0.
138 GetIndices(me: in out; theValue: Real from Standard)
139 returns SequenceOfInteger from TColStd;
140 ---C++: return const &
143 GetIndex(me; theValue: Real from Standard;
144 UseLower : Boolean from Standard)
145 returns Integer from Standard;
147 --- Returns index of range which contains theValue
148 --- If theValue do not belong any range returns 0.
149 --- If UseLower is Standard_True then lower boundary of the range
150 --- can be equal to theValue, otherwise upper boundary of the range
151 --- can be equal to theValue.
155 returns Integer from Standard;
158 --- Returns number of ranges
161 Range(me; theIndex: Integer from Standard)
162 returns Range from IntTools;
164 --- Returns the range with index theIndex.
165 --- the Index can be from 1 to Length()
169 myRangeSetStorer : SequenceOfReal from TColStd;
170 myRangeNumber : Integer from Standard;
171 myFlags : SequenceOfInteger from TColStd;
172 myFoundIndices : SequenceOfInteger from TColStd;
174 end MarkedRangeSet from IntTools;