1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138
| void drawNode(NODE* node) { int x = node->x; int y = node->y; int model = node->model; int value = node->value; int isnew = node->isnew; COLORREF color = node->color; setfillcolor(color); solidrectangle(x, y, x + 30, y + 30); setlinecolor(BLACK); switch (model) { case 0: setlinestyle(PS_SOLID, 2); line(x + 15, y, x + 15, y + 30); line(x - 1, y + 15, x + 30, y + 15); break; case 3: setlinestyle(PS_SOLID, 2); line(x + 15, y + 15, x + 15, y + 30); setlinestyle(PS_SOLID, 3); line(x - 1, y + 15, x + 30, y + 15); break; case 4: setlinestyle(PS_SOLID, 2); line(x + 15, y, x + 15, y + 15); setlinestyle(PS_SOLID, 3); line(x - 1, y + 15, x + 30, y + 15); break; case 1: setlinestyle(PS_SOLID, 2); line(x + 14, y + 15, x + 30, y + 15); setlinestyle(PS_SOLID, 3); line(x + 15, y, x + 15, y + 30); break; case 2: setlinestyle(PS_SOLID, 2); line(x - 1, y + 15, x + 15, y + 15); setlinestyle(PS_SOLID, 3); line(x + 15, y, x + 15, y + 30); break; case 7: setlinestyle(PS_SOLID, 3); line(x - 1, y + 15, x + 15, y + 15); line(x + 15, y + 15, x + 15, y + 30); break; case 6: setlinestyle(PS_SOLID, 3); line(x + 15, y, x + 15, y + 15); line(x - 1, y + 15, x + 15, y + 15); break; case 5: setlinestyle(PS_SOLID, 3); line(x + 15, y, x + 15, y + 15); line(x + 15, y + 15, x + 30, y + 15); break; case 8: setlinestyle(PS_SOLID, 3); line(x + 15, y + 15, x + 30, y + 15); line(x + 15, y + 15, x + 15, y + 30); break; case 9: setlinestyle(PS_SOLID, 2); line(x + 15, y, x + 15, y + 30); line(x - 1, y + 15, x + 30, y + 15); setfillcolor(BLACK); setlinestyle(PS_SOLID, 2); fillcircle(x + 15, y + 15, 4); break; } if (isnew) { setlinestyle(PS_SOLID, 2); setlinecolor(LIGHTGRAY); line(x + 1, y + 2, x + 8, y + 2); line(x + 2, y + 1, x + 2, y + 8); line(x + 29, y + 2, x + 22, y + 2); line(x + 29, y + 1, x + 29, y + 8); line(x + 2, y + 29, x + 8, y + 29); line(x + 2, y + 22, x + 2, y + 29); line(x + 29, y + 29, x + 22, y + 29); line(x + 29, y + 22, x + 29, y + 29); } switch (value) { case 1: setfillcolor(BLACK); setlinecolor(BLACK); setlinestyle(PS_SOLID, 1); fillcircle(x + 15, y + 15, 12); break; case 2: setfillcolor(WHITE); setlinecolor(BLACK); setlinestyle(PS_SOLID, 1); fillcircle(x + 15, y + 15, 12); break; } }
|