1 -- Created on: 2001-09-26
2 -- Created by: Michael KLOKOV
3 -- Copyright (c) 2001-2014 OPEN CASCADE SAS
5 -- This file is part of Open CASCADE Technology software library.
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
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.
13 -- Alternatively, this file may be used under the terms of Open CASCADE
14 -- commercial license or contractual agreement.
16 class MarkedRangeSet from IntTools
18 ---Purpose: class MarkedRangeSet provides continuous set of ranges marked with flags
21 SequenceOfInteger from TColStd,
22 CArray1OfReal from IntTools,
23 SequenceOfReal from TColStd,
27 Create returns MarkedRangeSet from IntTools;
32 Create(theFirstBoundary, theLastBoundary: Real from Standard;
33 theInitFlag: Integer from Standard) returns MarkedRangeSet from IntTools;
35 --- build set of ranges which consists of one range with
36 --- boundary values theFirstBoundary and theLastBoundary
39 Create(theSortedArray: CArray1OfReal from IntTools;
40 theInitFlag: Integer from Standard) returns MarkedRangeSet from IntTools;
42 --- Build set of ranges based on the array of progressive sorted values
45 --- The constructor do not check if the values of array are not sorted
46 --- It should be checked before function invocation
49 SetBoundaries(me: in out; theFirstBoundary, theLastBoundary: Real from Standard;
50 theInitFlag: Integer from Standard);
52 --- build set of ranges which consists of one range with
53 --- boundary values theFirstBoundary and theLastBoundary
56 SetRanges(me: in out; theSortedArray: CArray1OfReal from IntTools;
57 theInitFlag: Integer from Standard);
59 --- Build set of ranges based on the array of progressive sorted values
62 --- The function do not check if the values of array are not sorted
63 --- It should be checked before function invocation
66 InsertRange(me: in out; theFirstBoundary, theLastBoundary: Real from Standard;
67 theFlag: Integer from Standard)
68 returns Boolean from Standard;
70 --- Inserts a new range marked with flag theFlag
71 --- It replace the existing ranges or parts of ranges
73 --- Returns True if the range is inside the initial boundaries,
74 --- otherwise or in case of some error returns False
77 InsertRange(me: in out; theRange: Range from IntTools;
78 theFlag: Integer from Standard)
79 returns Boolean from Standard;
81 --- Inserts a new range marked with flag theFlag
82 --- It replace the existing ranges or parts of ranges
84 --- Returns True if the range is inside the initial boundaries,
85 --- otherwise or in case of some error returns False
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;
93 --- Inserts a new range marked with flag theFlag
94 --- It replace the existing ranges or parts of ranges
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
101 InsertRange(me: in out; theRange: Range from IntTools;
102 theFlag: Integer from Standard;
103 theIndex: Integer from Standard)
104 returns Boolean from Standard;
106 --- Inserts a new range marked with flag theFlag
107 --- It replace the existing ranges or parts of ranges
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
114 SetFlag(me: in out; theIndex: Integer from Standard;
115 theFlag: Integer from Standard);
117 --- Set flag theFlag for range with index theIndex
120 Flag(me; theIndex: Integer from Standard)
121 returns Integer from Standard;
123 --- Returns flag of the range with index theIndex
126 GetIndex(me; theValue: Real from Standard)
127 returns Integer from Standard;
129 --- Returns index of range which contains theValue.
130 --- If theValue do not belong any range returns 0.
133 GetIndices(me: in out; theValue: Real from Standard)
134 returns SequenceOfInteger from TColStd;
135 ---C++: return const &
138 GetIndex(me; theValue: Real from Standard;
139 UseLower : Boolean from Standard)
140 returns Integer from Standard;
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.
150 returns Integer from Standard;
153 --- Returns number of ranges
156 Range(me; theIndex: Integer from Standard)
157 returns Range from IntTools;
159 --- Returns the range with index theIndex.
160 --- the Index can be from 1 to Length()
164 myRangeSetStorer : SequenceOfReal from TColStd;
165 myRangeNumber : Integer from Standard;
166 myFlags : SequenceOfInteger from TColStd;
167 myFoundIndices : SequenceOfInteger from TColStd;
169 end MarkedRangeSet from IntTools;