| 77 | | Pimp pimptest; |
| 78 | | |
| 79 | | point_spatial p, q1, q2, q3, q4; |
| 80 | | |
| 81 | | // Drehsinn muss Uhrzeigersinn sein |
| 82 | | q1.x = 0; q1.y = 30; |
| 83 | | q2.x = 15; q2.y = 55; |
| 84 | | q3.x = 65; q3.y = 25; |
| 85 | | q4.x = 50; q4.y = 0; |
| 86 | | |
| 87 | | cout << "Hier MUSS immer stehen: Punkt drin" << endl; |
| 88 | | |
| 89 | | p.x = 32; p.y = 27; |
| 90 | | if (pimptest.point_in_quad(p, q1, q2, q3, q4)) cout << " 1. Punkt drin" << endl; else cout << " 1. Punkt nicht drin" << endl; |
| 91 | | p.x = 1; p.y = 30; |
| 92 | | if (pimptest.point_in_quad(p, q1, q2, q3, q4)) cout << " 2. Punkt drin" << endl; else cout << " 2. Punkt nicht drin" << endl; |
| 93 | | p.x = 50; p.y = 1; |
| 94 | | if (pimptest.point_in_quad(p, q1, q2, q3, q4)) cout << " 3. Punkt drin" << endl; else cout << " 3. Punkt nicht drin" << endl; |
| 95 | | p.x = 64; p.y = 25; |
| 96 | | if (pimptest.point_in_quad(p, q1, q2, q3, q4)) cout << " 4. Punkt drin" << endl; else cout << " 4. Punkt nicht drin" << endl; |
| 97 | | p.x = 15; p.y = 54; |
| 98 | | if (pimptest.point_in_quad(p, q1, q2, q3, q4)) cout << " 5. Punkt drin" << endl; else cout << " 5. Punkt nicht drin" << endl; |
| 99 | | p.x = 25; p.y = 16; |
| 100 | | if (pimptest.point_in_quad(p, q1, q2, q3, q4)) cout << " 6. Punkt drin" << endl; else cout << " 6. Punkt nicht drin" << endl; |
| 101 | | p.x = 57; p.y = 13; |
| 102 | | if (pimptest.point_in_quad(p, q1, q2, q3, q4)) cout << " 7. Punkt drin" << endl; else cout << " 7. Punkt nicht drin" << endl; |
| 103 | | |
| 104 | | cout << "Hier MUSS immer stehen: Punkt nicht drin" << endl; |
| 105 | | |
| 106 | | p.x = 65; p.y = -1; |
| 107 | | if (pimptest.point_in_quad(p, q1, q2, q3, q4)) cout << " 8. Punkt drin" << endl; else cout << " 8. Punkt nicht drin" << endl; |
| 108 | | p.x = 25; p.y = -14; |
| 109 | | if (pimptest.point_in_quad(p, q1, q2, q3, q4)) cout << " 9. Punkt drin" << endl; else cout << " 9. Punkt nicht drin" << endl; |
| 110 | | p.x = 66; p.y = 25; |
| 111 | | if (pimptest.point_in_quad(p, q1, q2, q3, q4)) cout << "10. Punkt drin" << endl; else cout << "10. Punkt nicht drin" << endl; |
| 112 | | p.x = 2; p.y = 57; |
| 113 | | if (pimptest.point_in_quad(p, q1, q2, q3, q4)) cout << "11. Punkt drin" << endl; else cout << "11. Punkt nicht drin" << endl; |
| 114 | | p.x = 64; p.y = 54; |
| 115 | | if (pimptest.point_in_quad(p, q1, q2, q3, q4)) cout << "12. Punkt drin" << endl; else cout << "12. Punkt nicht drin" << endl; |
| 116 | | p.x = -1; p.y = -1; |
| 117 | | if (pimptest.point_in_quad(p, q1, q2, q3, q4)) cout << "13. Punkt drin" << endl; else cout << "13. Punkt nicht drin" << endl; |
| 118 | | p.x = 66; p.y = 56; |
| 119 | | if (pimptest.point_in_quad(p, q1, q2, q3, q4)) cout << "14. Punkt drin" << endl; else cout << "14. Punkt nicht drin" << endl; |
| 120 | | |
| 121 | | /////////////////////////////////////////// |
| 122 | | |
| 123 | | |
| 124 | | // Initialisierung |
| 125 | | MapTest maptest; |
| 126 | | maptest.set_min_spatial_extend(200.0); |
| 127 | | maptest.set_max_spatial_extend(2000.0); |
| 128 | | maptest.set_mapsize_x(500); |
| 129 | | maptest.set_mapsize_y(500); |
| 130 | | |
| 131 | | // Beispielaufruf zum Testen von get_tile |
| 132 | | // maptest.get_tile(0, 0, 2000, 2000, 500, 500, "test_get_tile.jpg"); |
| 133 | | |
| 134 | | // Ziel-Liste anlegen |
| 135 | | num_of_goals = 1; |
| 136 | | goal_list = new point_spatial[num_of_goals]; |
| 137 | | goal_list[0].x = 3000; |
| 138 | | goal_list[0].y = 1000; |
| 139 | | maptest.set_goal_list(goal_list, num_of_goals); |
| 140 | | |
| 141 | | // Warten zum Kartenladen |
| 142 | | sleep(10); |
| 143 | | |
| 144 | | // Daten angeben, welchen Kartenausschnitt man haben m�e (Parameter in pimp.h erkl�) |
| 145 | | // MapData md(8.85582, 53.10345, 400, 400, 4000); |
| 146 | | |
| 147 | | MapData md(3000, 1000, 500, 500, 1000); |
| 148 | | mapdata_ausgabe(md); |
| 149 | | maptest.get_map(md, "test0.jpg"); |
| 150 | | |
| 151 | | return 0; |
| | 81 | double get_news(); |
| | 82 | { |
| | 83 | cin >> a; |
| | 84 | } |