ccstruct/pageblk.h File Reference

#include "elst.h"
#include "txtregn.h"
#include "bits16.h"
#include "hpddef.h"

Go to the source code of this file.

Classes

Enumerations

Functions

Variables


Enumeration Type Documentation

enum PB_TYPE

Type of PAGE_BLOCK, used to abstract operators.

See pageblk.cpp

Enumerator:
PB_TEXT 
PB_RULES 
PB_GRAPHICS 
PB_IMAGE 
PB_SCRIBBLE 
PB_WEIRD 

Definition at line 32 of file pageblk.h.

00033 {
00034   PB_TEXT,
00035   PB_RULES,
00036   PB_GRAPHICS,
00037   PB_IMAGE,
00038   PB_SCRIBBLE,
00039   PB_WEIRD
00040 };


Function Documentation

DLLSYM void delete_all_in ( PAGE_BLOCK pblock,
POLY_BLOCK delete_area 
)

FIX: Given an area to delete, deletes all objects overlaped.

Definition at line 431 of file pageblk.cpp.

References POLY_BLOCK::contains(), delete_all_in(), and POLY_BLOCK::overlap().

Referenced by delete_all_in().

00431                                                                 { 
00432   PAGE_BLOCK_IT c;
00433   INT16 i, pnum;
00434 
00435   c.set_to_list (pblock->child ());
00436   pnum = pblock->child ()->length ();
00437   for (i = 0; i < pnum; i++, c.forward ()) {
00438     if (delete_area->contains (c.data ()))
00439       c.extract ()->pb_delete ();
00440     else if (delete_area->overlap (c.data ()))
00441       delete_all_in (c.data (), delete_area);
00442   }
00443 }

DLLSYM void delete_all_tr_in ( TEXT_BLOCK tblock,
POLY_BLOCK delete_area 
)

FIX: ??

Text regions

Definition at line 635 of file pageblk.cpp.

References POLY_BLOCK::contains(), POLY_BLOCK::overlap(), and TEXT_BLOCK::regions().

00635                                                                    { 
00636   TEXT_REGION_IT t, tc;
00637   INT16 i, tnum, j, ttnum;
00638 
00639   t.set_to_list (tblock->regions ());
00640   tnum = tblock->regions ()->length ();
00641   for (i = 0; i < tnum; i++, t.forward ()) {
00642     if (delete_area->contains (t.data ()))
00643       delete (t.extract ());
00644     else if (delete_area->overlap (t.data ())) {
00645       tc.set_to_list (t.data ()->regions ());
00646       ttnum = t.data ()->regions ()->length ();
00647       for (j = 0; j < ttnum; j++, tc.forward ())
00648         if (delete_area->contains (tc.data ()))
00649           delete (tc.extract ());
00650     }
00651   }
00652 }

void print_background ( DEBUG_WIN f,
BITS16  background 
)

Print info on background.

What's this doing here?

Definition at line 941 of file pageblk.cpp.

References backlabel, BITS16::bit(), f, and NUM_BACKGROUNDS.

Referenced by TEXT_BLOCK::show_attrs(), GRAPHICS_BLOCK::show_attrs(), and SCRIBBLE_BLOCK::show_attrs().

00941                                                        { 
00942   int i;
00943 
00944   f->dprintf ("Background is \n");
00945   for (i = 0; i < NUM_BACKGROUNDS; i++) {
00946     if (background.bit (i))
00947       f->dprintf ("%s, ", backlabel[i]);
00948   }
00949 
00950   f->dprintf ("\n");
00951 
00952 }

DLLSYM void show_all_in ( PAGE_BLOCK pblock,
POLY_BLOCK show_area,
DEBUG_WIN f 
)

FIX: Recursively dig into blocks and show info about them (??).

Definition at line 413 of file pageblk.cpp.

References POLY_BLOCK::contains(), f, POLY_BLOCK::overlap(), and show_all_in().

Referenced by show_all_in().

00413                                                                           { 
00414   PAGE_BLOCK_IT c;
00415   INT16 i, pnum;
00416 
00417   c.set_to_list (pblock->child ());
00418   pnum = pblock->child ()->length ();
00419   for (i = 0; i < pnum; i++, c.forward ()) {
00420     if (show_area->contains (c.data ()))
00421       c.data ()->show_attrs (f);
00422     else if (show_area->overlap (c.data ()))
00423       show_all_in (c.data (), show_area, f);
00424   }
00425 }

DLLSYM void show_all_tr_in ( TEXT_BLOCK tblock,
POLY_BLOCK show_area,
DEBUG_WIN f 
)

FIX: ??

Text regions

Definition at line 608 of file pageblk.cpp.

References POLY_BLOCK::contains(), f, POLY_BLOCK::overlap(), and TEXT_BLOCK::regions().

00610                                          {
00611   TEXT_REGION_IT t, tc;
00612   INT16 i, tnum, j, ttnum;
00613 
00614   t.set_to_list (tblock->regions ());
00615   tnum = tblock->regions ()->length ();
00616   for (i = 0; i < tnum; i++, t.forward ()) {
00617     if (show_area->contains (t.data ()))
00618       t.data ()->show_attrs (f);
00619     else if (show_area->overlap (t.data ())) {
00620       tc.set_to_list (t.data ()->regions ());
00621       ttnum = t.data ()->regions ()->length ();
00622       for (j = 0; j < ttnum; j++, tc.forward ())
00623         if (show_area->contains (tc.data ()))
00624           tc.data ()->show_attrs (f);
00625     }
00626   }
00627 }

DLLSYM PAGE_BLOCK* smallest_containing ( PAGE_BLOCK pblock,
POLY_BLOCK other 
)

FIX: recursively (??) find smallest block (??).

Definition at line 449 of file pageblk.cpp.

References smallest_containing().

Referenced by smallest_containing().

00449                                                                        { 
00450   PAGE_BLOCK_IT c;
00451 
00452   c.set_to_list (pblock->child ());
00453   if (c.empty ())
00454     return (pblock);
00455 
00456   for (c.mark_cycle_pt (); !c.cycled_list (); c.forward ())
00457     if (c.data ()->contains (other))
00458       return (smallest_containing (c.data (), other));
00459 
00460   return (pblock);
00461 }


Variable Documentation

class DLLSYM GRAPHICS_BLOCK

Definition at line 44 of file pageblk.h.

class DLLSYM IMAGE_BLOCK

Definition at line 46 of file pageblk.h.

class DLLSYM PAGE_BLOCK

Constructor?

Definition at line 42 of file pageblk.h.

class DLLSYM RULE_BLOCK

Definition at line 45 of file pageblk.h.

class DLLSYM SCRIBBLE_BLOCK

Definition at line 47 of file pageblk.h.

class DLLSYM TEXT_BLOCK

Definition at line 43 of file pageblk.h.

class DLLSYM WEIRD_BLOCK

Definition at line 48 of file pageblk.h.


Generated on Wed Feb 28 19:49:16 2007 for Tesseract by  doxygen 1.5.1