#include <pdblock.h>
Definition at line 129 of file pdblock.h.
BLOCK_RECT_IT::BLOCK_RECT_IT | ( | PDBLK * | blkptr | ) |
Iterate rectangles.
Construct a block rectangle iterator.
Definition at line 232 of file pdblock.cpp.
References block, and start_block().
00234 :left_it (&blkptr->leftside), right_it (&blkptr->rightside) { 00235 block = blkptr; //remember block 00236 //non empty list 00237 if (!blkptr->leftside.empty ()) { 00238 start_block(); //ready for iteration 00239 } 00240 }
BOOL8 BLOCK_RECT_IT::cycled_rects | ( | ) | [inline] |
void BLOCK_RECT_IT::forward | ( | ) |
Next rectangle.
Move to the next rectangle in the block.
Definition at line 278 of file pdblock.cpp.
Referenced by BLOCK_LINE_IT::get_line().
00278 { //next rectangle 00279 if (!left_it.empty ()) { //non-empty list 00280 if (left_it.data_relative (1)->y () == ymax) 00281 left_it.forward (); //move to meet top 00282 if (right_it.data_relative (1)->y () == ymax) 00283 right_it.forward (); 00284 //last is special 00285 if (left_it.at_last () || right_it.at_last ()) { 00286 left_it.move_to_first (); //restart 00287 right_it.move_to_first (); 00288 //now at bottom 00289 ymin = left_it.data ()->y (); 00290 } 00291 else { 00292 ymin = ymax; //new bottom 00293 } 00294 //next point 00295 ymax = left_it.data_relative (1)->y (); 00296 if (right_it.data_relative (1)->y () < ymax) 00297 //least step forward 00298 ymax = right_it.data_relative (1)->y (); 00299 } 00300 }
BLOCK_RECT_IT::NEWDELETE2 | ( | BLOCK_RECT_IT | ) |
void BLOCK_RECT_IT::start_block | ( | ) |
Restart a block.
Definition at line 260 of file pdblock.cpp.
Referenced by BLOCK_RECT_IT(), and BLOCK_LINE_IT::get_line().
00260 { //start (new) block 00261 left_it.move_to_first (); 00262 right_it.move_to_first (); 00263 left_it.mark_cycle_pt (); 00264 right_it.mark_cycle_pt (); 00265 ymin = left_it.data ()->y (); //bottom of first box 00266 ymax = left_it.data_relative (1)->y (); 00267 if (right_it.data_relative (1)->y () < ymax) 00268 //smallest step 00269 ymax = right_it.data_relative (1)->y (); 00270 }
PDBLK* BLOCK_RECT_IT::block [private] |
ICOORDELT_IT BLOCK_RECT_IT::left_it [private] |
ICOORDELT_IT BLOCK_RECT_IT::right_it [private] |
INT16 BLOCK_RECT_IT::ymax [private] |
top of rectangle
Definition at line 157 of file pdblock.h.
Referenced by forward(), and start_block().
INT16 BLOCK_RECT_IT::ymin [private] |
bottom of rectangle
Definition at line 155 of file pdblock.h.
Referenced by forward(), and start_block().