void POLY_BLOCK::reflect_in_y_axis() { ICOORDELT *pt; // current point ICOORDELT_IT pts = &vertices; // Iterator. do { pt = pts.data(); pt->set_x(-pt->x()); pts.forward(); } while (!pts.at_first()); compute_bb(); }
void POLY_BLOCK::rotate(FCOORD rotation) { FCOORD pos; //current pos; ICOORDELT *pt; //current point ICOORDELT_IT pts = &vertices; //iterator do { pt = pts.data (); pos.set_x (pt->x ()); pos.set_y (pt->y ()); pos.rotate (rotation); pt->set_x ((inT16) (floor (pos.x () + 0.5))); pt->set_y ((inT16) (floor (pos.y () + 0.5))); pts.forward (); } while (!pts.at_first ()); compute_bb(); }
void plot_row_cells( //draw words ScrollView *win, //window tro draw in ScrollView::Color colour, //colour of lines TO_ROW *row, //for location float xshift, //amount of shift ICOORDELT_LIST *cells //cells to draw ) { TBOX word_box; //bounding box ICOORDELT_IT cell_it = cells; //blobs in row BLOBNBOX_IT blob_it = row->blob_list(); ICOORDELT *cell; //current cell word_box = blob_it.data()->bounding_box(); for (blob_it.mark_cycle_pt(); !blob_it.cycled_list();) word_box += box_next(&blob_it); win->Pen(colour); for (cell_it.mark_cycle_pt(); !cell_it.cycled_list(); cell_it.forward()) { cell = cell_it.data(); win->Line(cell->x() + xshift, word_box.bottom(), cell->x() + xshift, word_box.top()); } }