Beispiel #1
0
void plot_to_row(                 //draw a row
        TO_ROW *row,     //row to draw
        ScrollView::Color colour,   //colour to draw in
        FCOORD rotation  //rotation for line
) {
    FCOORD plot_pt;                //point to plot
    //blobs
    BLOBNBOX_IT it = row->blob_list();
    float left, right;             //end of row

    if (it.empty()) {
        tprintf("No blobs in row at %g\n", row->parallel_c());
        return;
    }
    left = it.data()->bounding_box().left();
    it.move_to_last();
    right = it.data()->bounding_box().right();
    plot_blob_list(to_win, row->blob_list(), colour, ScrollView::BROWN);
    to_win->Pen(colour);
    plot_pt = FCOORD(left, row->line_m() * left + row->line_c());
    plot_pt.rotate(rotation);
    to_win->SetCursor(plot_pt.x(), plot_pt.y());
    plot_pt = FCOORD(right, row->line_m() * right + row->line_c());
    plot_pt.rotate(rotation);
    to_win->DrawTo(plot_pt.x(), plot_pt.y());
}
Beispiel #2
0
void TO_ROW::insert_blob(                //constructor
                         BLOBNBOX *blob  //first blob
                        ) {
  BLOBNBOX_IT it = &blobs;       //list of blobs

  if (it.empty ())
    it.add_before_then_move (blob);
  else {
    it.mark_cycle_pt ();
    while (!it.cycled_list ()
      && it.data ()->bounding_box ().left () <=
      blob->bounding_box ().left ())
      it.forward ();
    if (it.cycled_list ())
      it.add_to_end (blob);
    else
      it.add_before_stay_put (blob);
  }
}