1 -- File: IntTools_MarkedRangeSet.cdl
2 -- Created: Wed Sep 26 16:06:40 2001
3 -- Author: Michael KLOKOV
5 ---Copyright: Matra Datavision 2001
7 class MarkedRangeSet from IntTools
9 ---Purpose: class MarkedRangeSet provides continuous set of ranges marked with flags
12 SequenceOfInteger from TColStd,
13 CArray1OfReal from IntTools,
14 SequenceOfReal from TColStd,
18 Create returns MarkedRangeSet from IntTools;
23 Create(theFirstBoundary, theLastBoundary: Real from Standard;
24 theInitFlag: Integer from Standard) returns MarkedRangeSet from IntTools;
26 --- build set of ranges which consists of one range with
27 --- boundary values theFirstBoundary and theLastBoundary
30 Create(theSortedArray: CArray1OfReal from IntTools;
31 theInitFlag: Integer from Standard) returns MarkedRangeSet from IntTools;
33 --- Build set of ranges based on the array of progressive sorted values
36 --- The constructor do not check if the values of array are not sorted
37 --- It should be checked before function invocation
40 SetBoundaries(me: in out; theFirstBoundary, theLastBoundary: Real from Standard;
41 theInitFlag: Integer from Standard);
43 --- build set of ranges which consists of one range with
44 --- boundary values theFirstBoundary and theLastBoundary
47 SetRanges(me: in out; theSortedArray: CArray1OfReal from IntTools;
48 theInitFlag: Integer from Standard);
50 --- Build set of ranges based on the array of progressive sorted values
53 --- The function do not check if the values of array are not sorted
54 --- It should be checked before function invocation
57 InsertRange(me: in out; theFirstBoundary, theLastBoundary: Real from Standard;
58 theFlag: Integer from Standard)
59 returns Boolean from Standard;
61 --- Inserts a new range marked with flag theFlag
62 --- It replace the existing ranges or parts of ranges
64 --- Returns True if the range is inside the initial boundaries,
65 --- otherwise or in case of some error returns False
68 InsertRange(me: in out; theRange: Range from IntTools;
69 theFlag: Integer from Standard)
70 returns Boolean from Standard;
72 --- Inserts a new range marked with flag theFlag
73 --- It replace the existing ranges or parts of ranges
75 --- Returns True if the range is inside the initial boundaries,
76 --- otherwise or in case of some error returns False
79 InsertRange(me: in out; theFirstBoundary, theLastBoundary: Real from Standard;
80 theFlag: Integer from Standard;
81 theIndex: Integer from Standard)
82 returns Boolean from Standard;
84 --- Inserts a new range marked with flag theFlag
85 --- It replace the existing ranges or parts of ranges
87 --- The index theIndex is a position where the range will be inserted.
88 --- Returns True if the range is inside the initial boundaries,
89 --- otherwise or in case of some error returns False
92 InsertRange(me: in out; theRange: Range from IntTools;
93 theFlag: Integer from Standard;
94 theIndex: Integer from Standard)
95 returns Boolean from Standard;
97 --- Inserts a new range marked with flag theFlag
98 --- It replace the existing ranges or parts of ranges
100 --- The index theIndex is a position where the range will be inserted.
101 --- Returns True if the range is inside the initial boundaries,
102 --- otherwise or in case of some error returns False
105 SetFlag(me: in out; theIndex: Integer from Standard;
106 theFlag: Integer from Standard);
108 --- Set flag theFlag for range with index theIndex
111 Flag(me; theIndex: Integer from Standard)
112 returns Integer from Standard;
114 --- Returns flag of the range with index theIndex
117 GetIndex(me; theValue: Real from Standard)
118 returns Integer from Standard;
120 --- Returns index of range which contains theValue.
121 --- If theValue do not belong any range returns 0.
124 GetIndices(me: in out; theValue: Real from Standard)
125 returns SequenceOfInteger from TColStd;
126 ---C++: return const &
129 GetIndex(me; theValue: Real from Standard;
130 UseLower : Boolean from Standard)
131 returns Integer from Standard;
133 --- Returns index of range which contains theValue
134 --- If theValue do not belong any range returns 0.
135 --- If UseLower is Standard_True then lower boundary of the range
136 --- can be equal to theValue, otherwise upper boundary of the range
137 --- can be equal to theValue.
141 returns Integer from Standard;
144 --- Returns number of ranges
147 Range(me; theIndex: Integer from Standard)
148 returns Range from IntTools;
150 --- Returns the range with index theIndex.
151 --- the Index can be from 1 to Length()
155 myRangeSetStorer : SequenceOfReal from TColStd;
156 myRangeNumber : Integer from Standard;
157 myFlags : SequenceOfInteger from TColStd;
158 myFoundIndices : SequenceOfInteger from TColStd;
160 end MarkedRangeSet from IntTools;