139{
140
144 VP1Interval* currentInterval = 0;
145
146 if(positive) {
151 } else {
156 }
157
158
159 if(*currentInterval==newInterval) {
162 return;
163 }
164
165
169 *currentInterval = newInterval;
170 *useItFirst = useMap->end();
171 *useItLast = useMap->end();
172 return;
173 }
174
175
176
177 if(currentInterval->
isEmpty()) {
178 *useItFirst = useMap->lower_bound(newInterval.
lower());
180 *useItLast = useMap->end();
181 else
182 *useItLast = useMap->upper_bound(newInterval.
upper());
183
186
187 *currentInterval = newInterval;
188 return;
189 }
190
191
193
194 if(currentInterval->
lower() != newInterval.
lower() &&
195 currentInterval->
upper() != newInterval.
upper()) {
196
197
200
201 *useItFirst = useMap->lower_bound(newInterval.
lower());
203 *useItLast = useMap->end();
204 else
205 *useItLast = useMap->upper_bound(newInterval.
upper());
206
209
210 }
else if (currentInterval->
lower() != newInterval.
lower()) {
211
212 newIterator = useMap->lower_bound(newInterval.
lower());
213
214 if(currentInterval->
lower() < newInterval.
lower())
215
218 else
219
222
223 *useItFirst = newIterator;
224
225 } else {
226
227
229 newIterator = useMap->end();
230
231
234 } else {
235 newIterator = useMap->upper_bound(newInterval.
upper());
236
237 if(*useItLast == useMap->end() ||
238 currentInterval->
upper() > newInterval.
upper()) {
239
242 } else {
243
246 }
247 }
248 *useItLast = newIterator;
249 }
250
251 *currentInterval = newInterval;
252}