void POLY_BLOCK::plot(ScrollView* window, inT32 num) { ICOORDELT_IT v = &vertices; window->Pen(ColorForPolyBlockType(type)); v.move_to_first (); if (num > 0) { window->TextAttributes("Times", 80, false, false, false); char temp_buff[34]; #ifdef __UNIX__ sprintf(temp_buff, INT32FORMAT, num); #else ltoa (num, temp_buff, 10); #endif window->Text(v.data ()->x (), v.data ()->y (), temp_buff); } window->SetCursor(v.data ()->x (), v.data ()->y ()); for (v.mark_cycle_pt (); !v.cycled_list (); v.forward ()) { window->DrawTo(v.data ()->x (), v.data ()->y ()); } v.move_to_first (); window->DrawTo(v.data ()->x (), v.data ()->y ()); }
POLY_BLOCK::POLY_BLOCK(ICOORDELT_LIST *points, PolyBlockType t) { ICOORDELT_IT v = &vertices; vertices.clear(); v.move_to_first(); v.add_list_before(points); compute_bb(); type = t; }
// Initialize from box coordinates. POLY_BLOCK::POLY_BLOCK(const TBOX& box, PolyBlockType t) { vertices.clear(); ICOORDELT_IT v = &vertices; v.move_to_first(); v.add_to_end(new ICOORDELT(box.left(), box.top())); v.add_to_end(new ICOORDELT(box.left(), box.bottom())); v.add_to_end(new ICOORDELT(box.right(), box.bottom())); v.add_to_end(new ICOORDELT(box.right(), box.top())); compute_bb(); type = t; }