| 175 | |
| 176 | #ifndef GRAPHICS_DISABLED |
| 177 | void PDBLK::plot( //draw outline |
| 178 | ScrollView* window, //window to draw in |
| 179 | inT32 serial, //serial number |
| 180 | ScrollView::Color colour //colour to draw in |
| 181 | ) { |
| 182 | ICOORD startpt; //start of outline |
| 183 | ICOORD endpt; //end of outline |
| 184 | ICOORD prevpt; //previous point |
| 185 | ICOORDELT_IT it = &leftside; //iterator |
| 186 | |
| 187 | //set the colour |
| 188 | window->Pen(colour); |
| 189 | window->TextAttributes("Times", BLOCK_LABEL_HEIGHT, false, false, false); |
| 190 | |
| 191 | if (hand_poly != NULL) { |
| 192 | hand_poly->plot(window, serial); |
| 193 | } else if (!leftside.empty ()) { |
| 194 | startpt = *(it.data ()); //bottom left corner |
| 195 | // tprintf("Block %d bottom left is (%d,%d)\n", |
| 196 | // serial,startpt.x(),startpt.y()); |
| 197 | char temp_buff[34]; |
| 198 | #if defined(__UNIX__) || defined(MINGW) |
| 199 | sprintf(temp_buff, INT32FORMAT, serial); |
| 200 | #else |
| 201 | ultoa (serial, temp_buff, 10); |
| 202 | #endif |
| 203 | window->Text(startpt.x (), startpt.y (), temp_buff); |
| 204 | |
| 205 | window->SetCursor(startpt.x (), startpt.y ()); |
| 206 | do { |
| 207 | prevpt = *(it.data ()); //previous point |
| 208 | it.forward (); //move to next point |
| 209 | //draw round corner |
| 210 | window->DrawTo(prevpt.x (), it.data ()->y ()); |
| 211 | window->DrawTo(it.data ()->x (), it.data ()->y ()); |
| 212 | } |
| 213 | while (!it.at_last ()); //until end of list |
| 214 | endpt = *(it.data ()); //end point |
| 215 | |
| 216 | //other side of boundary |
| 217 | window->SetCursor(startpt.x (), startpt.y ()); |
| 218 | it.set_to_list (&rightside); |
| 219 | prevpt = startpt; |
| 220 | for (it.mark_cycle_pt (); !it.cycled_list (); it.forward ()) { |
| 221 | //draw round corner |
| 222 | window->DrawTo(prevpt.x (), it.data ()->y ()); |
| 223 | window->DrawTo(it.data ()->x (), it.data ()->y ()); |
| 224 | prevpt = *(it.data ()); //previous point |
| 225 | } |
| 226 | //close boundary |
| 227 | window->DrawTo(endpt.x(), endpt.y()); |
| 228 | } |
| 229 | } |
| 230 | #endif |
| 231 | |
| 232 | /********************************************************************** |
nothing calls this directly
no test coverage detected