#include <pdblock.h>
Definition at line 170 of file pdblock.h.
BLOCK_LINE_IT::BLOCK_LINE_IT | ( | PDBLK * | blkptr | ) | [inline] |
Get a line.
Get the the start and width of a line in the block.
Definition at line 308 of file pdblock.cpp.
References ABORT, BADBLOCKLINE, block, BLOCK_RECT_IT::bounding_box(), BLOCK_RECT_IT::cycled_rects(), ERRCODE::error(), BLOCK_RECT_IT::forward(), LOSTBLOCKLINE, rect_it, BLOCK_RECT_IT::start_block(), and ICOORD::y().
Referenced by make_margins(), and whiteout_block().
00311 { 00312 ICOORD bleft; //bounding box 00313 ICOORD tright; //of block & rect 00314 00315 //get block box 00316 block->bounding_box (bleft, tright); 00317 if (y < bleft.y () || y >= tright.y ()) { 00318 // block->print(stderr,FALSE); 00319 BADBLOCKLINE.error ("BLOCK_LINE_IT::get_line", ABORT, "Y=%d", y); 00320 } 00321 00322 //get rectangle box 00323 rect_it.bounding_box (bleft, tright); 00324 //inside rectangle 00325 if (y >= bleft.y () && y < tright.y ()) { 00326 //width of line 00327 xext = tright.x () - bleft.x (); 00328 return bleft.x (); //start of line 00329 } 00330 for (rect_it.start_block (); !rect_it.cycled_rects (); rect_it.forward ()) { 00331 //get rectangle box 00332 rect_it.bounding_box (bleft, tright); 00333 //inside rectangle 00334 if (y >= bleft.y () && y < tright.y ()) { 00335 //width of line 00336 xext = tright.x () - bleft.x (); 00337 return bleft.x (); //start of line 00338 } 00339 } 00340 LOSTBLOCKLINE.error ("BLOCK_LINE_IT::get_line", ABORT, "Y=%d", y); 00341 return 0; //dummy to stop warning 00342 }
BLOCK_LINE_IT::NEWDELETE2 | ( | BLOCK_LINE_IT | ) | [inline] |
PDBLK* BLOCK_LINE_IT::block [private] |
BLOCK_RECT_IT BLOCK_LINE_IT::rect_it [private] |