#include <werdit.h>
Definition at line 31 of file werdit.h.
WERDIT::WERDIT | ( | ) | [inline] |
WERDIT::WERDIT | ( | BLOCK_LIST * | blocklist | ) | [inline] |
Definition at line 36 of file werdit.h.
References start_page().
00037 { //blocks on page 00038 start_page(blocklist); //ready to scan 00039 }
BLOCK* WERDIT::block | ( | ) | [inline] |
WERD * WERDIT::forward | ( | ) |
Give the next word on the page, or NULL if none left; use iterators.
none |
Definition at line 71 of file werdit.cpp.
References block_it, NULL, WERD::poly_copy(), row(), row_it, word_it, and ROW::x_height().
00071 { 00072 WERD *word; //actual word 00073 //WERD *larc_word; //linearc copy 00074 WERD *result; //output word 00075 ROW *row; //row of word 00076 00077 if (word_it.cycled_list ()) { 00078 return NULL; //finished page 00079 } 00080 else { 00081 word = word_it.data (); 00082 row = row_it.data (); 00083 word_it.forward (); 00084 if (word_it.cycled_list ()) { 00085 row_it.forward (); //finished row 00086 if (row_it.cycled_list ()) { 00087 do { 00088 block_it.forward (); //finished block 00089 if (!block_it.cycled_list ()) { 00090 row_it.set_to_list (block_it.data ()->row_list ()); 00091 row_it.mark_cycle_pt (); 00092 } 00093 } 00094 //find non-empty block 00095 while (!block_it.cycled_list () 00096 && row_it.cycled_list ()); 00097 } 00098 if (!row_it.cycled_list ()) { 00099 word_it.set_to_list (row_it.data ()->word_list ()); 00100 word_it.mark_cycle_pt (); 00101 } 00102 } 00103 00104 // if (wordit_linearc && !word->flag(W_POLYGON)) 00105 // { 00106 // larc_word=word->larc_copy(row->x_height()); 00107 // result=larc_word->poly_copy(row->x_height()); 00108 // delete larc_word; 00109 // } 00110 // else 00111 result = word->poly_copy (row->x_height ()); 00112 return result; 00113 } 00114 }
ROW* WERDIT::next_row | ( | ) | [inline] |
WERD* WERDIT::next_word | ( | ) | [inline] |
ROW* WERDIT::row | ( | ) | [inline] |
void WERDIT::start_page | ( | BLOCK_LIST * | block_list | ) |
Get ready to iterate over the page by setting the iterators.
block_list | blocks to check |
Definition at line 33 of file werdit.cpp.
References block_it, row_it, and word_it.
Referenced by WERDIT().
00035 { 00036 block_it.set_to_list (block_list); 00037 block_it.mark_cycle_pt (); 00038 do { 00039 while (block_it.data ()->row_list ()->empty () 00040 && !block_it.cycled_list ()) { 00041 block_it.forward (); 00042 } 00043 if (!block_it.data ()->row_list ()->empty ()) { 00044 row_it.set_to_list (block_it.data ()->row_list ()); 00045 row_it.mark_cycle_pt (); 00046 while (row_it.data ()->word_list ()->empty () 00047 && !row_it.cycled_list ()) { 00048 row_it.forward (); 00049 } 00050 if (!row_it.data ()->word_list ()->empty ()) { 00051 word_it.set_to_list (row_it.data ()->word_list ()); 00052 word_it.mark_cycle_pt (); 00053 } 00054 } 00055 } 00056 while (!block_it.cycled_list () && row_it.data ()->word_list ()->empty ()); 00057 }
BLOCK_IT WERDIT::block_it [private] |
ROW_IT WERDIT::row_it [private] |
Definition at line 60 of file werdit.h.
Referenced by forward(), next_row(), row(), and start_page().
WERD_IT WERDIT::word_it [private] |
Definition at line 61 of file werdit.h.
Referenced by forward(), next_word(), row(), and start_page().