337 {
338 ICOORDELT_IT v, r;
339 ICOORDELT_LIST *result;
340 ICOORDELT *x, *current, *previous;
341 float fy = y + 0.5f;
342 result = new ICOORDELT_LIST();
343 r.set_to_list(result);
344 v.set_to_list(block->
points());
345
346 for (v.mark_cycle_pt(); !v.cycled_list(); v.forward()) {
347 if (((v.data_relative(-1)->y() > y) && (v.data()->y() <= y)) ||
348 ((v.data_relative(-1)->y() <= y) && (v.data()->y() > y))) {
349 previous = v.data_relative(-1);
350 current = v.data();
351 float fx =
352 0.5f + previous->x() +
353 (current->x() - previous->x()) * (fy - previous->y()) / (current->y() - previous->y());
354 x =
new ICOORDELT(
static_cast<TDimension>(fx), 0);
355 r.add_to_end(x);
356 }
357 }
358
359 if (!r.empty()) {
361 for (r.mark_cycle_pt(); !r.cycled_list(); r.forward()) {
362 x = r.data();
363 }
364 for (r.mark_cycle_pt(); !r.cycled_list(); r.forward()) {
365 r.data()->set_y(r.data_relative(1)->x() - r.data()->x());
366 r.forward();
367 delete (r.extract());
368 }
369 }
370
371 return result;
372}
int lessthan(const void *first, const void *second)
ICOORDELT_LIST * points()