57 #ifdef CHECK_MEMORY_LEAKS
59 #endif // CHECK_MEMORY_LEAKS
68 if (!oc.
isSet(
"visum-files")) {
73 for (std::vector<std::string>::const_iterator file = files.begin(); file != files.end(); ++file) {
75 throw ProcessError(
"Could not open visum-file '" + *file +
"'.");
78 load(*file, oc, toFill, tm);
90 std::map<SUMOLong, Position> punkte;
91 std::map<SUMOLong, PositionVector> kanten;
92 std::map<SUMOLong, PositionVector> teilflaechen;
93 std::map<SUMOLong, SUMOLong> flaechenelemente;
99 if (line.length() == 0 || line[0] ==
'*' || line[0] ==
'$') {
103 if (what ==
"$PUNKT") {
114 }
else if (what ==
"$KANTE") {
121 vec.push_back(punkte[toID]);
124 }
else if (what ==
"$ZWISCHENPUNKT") {
134 kanten[id].insertAt(index, pos);
136 }
else if (what ==
"$TEILFLAECHENELEMENT") {
143 if (teilflaechen.find(
id) == teilflaechen.end()) {
147 for (
int i = 0; i < (
int) kanten[kid].size(); ++i) {
148 teilflaechen[id].push_back_noDoublePos(kanten[kid][i]);
151 for (
int i = (
int) kanten[kid].size() - 1; i >= 0; --i) {
152 teilflaechen[id].push_back_noDoublePos(kanten[kid][i]);
156 }
else if (what ==
"$FLAECHENELEMENT") {
160 flaechenelemente[id] = tid;
164 if (line[0] ==
'$') {
166 if (line.find(
"$PUNKT") == 0) {
168 }
else if (line.find(
"$KANTE") == 0) {
170 }
else if (line.find(
"$ZWISCHENPUNKT") == 0) {
171 what =
"$ZWISCHENPUNKT";
172 }
else if (line.find(
"$TEILFLAECHENELEMENT") == 0) {
173 what =
"$TEILFLAECHENELEMENT";
174 }
else if (line.find(
"$FLAECHENELEMENT") == 0) {
175 what =
"$FLAECHENELEMENT";
178 lineParser.
reinit(line.substr(what.length() + 1));
185 std::map<std::string, std::string> typemap;
188 bool parsingCategories =
false;
189 bool parsingPOIs =
false;
190 bool parsingDistrictsDirectly =
false;
192 std::string polyType, lastID;
197 if (line.length() == 0) {
201 if (line[0] ==
'*') {
205 if (line[0] ==
'$') {
207 parsingCategories =
false;
209 parsingDistrictsDirectly =
false;
213 if (parsingCategories) {
216 std::string catid = st.
next();
217 std::string catname = st.
next();
218 typemap[catid] = catname;
226 std::string catid = lineParser.
get(
"CATID");
232 WRITE_WARNING(
"Unable to project coordinates for POI '" +
id +
"'.");
234 std::string type = typemap[catid];
236 bool discard = oc.
getBool(
"discard");
237 int layer = oc.
getInt(
"layer");
253 toFill.
insert(
id, poi, layer);
258 if (polyType !=
"") {
260 std::string
id = st.
next();
262 if (!first && lastID !=
id) {
265 int layer = oc.
getInt(
"layer");
266 bool discard = oc.
getBool(
"discard");
267 if (tm.
has(polyType)) {
281 toFill.
insert(
id, poly, 1);
288 std::string index = st.
next();
289 std::string xpos = st.
next();
290 std::string ypos = st.
next();
293 WRITE_WARNING(
"Unable to project coordinates for polygon '" +
id +
"'.");
299 if (parsingDistrictsDirectly) {
308 std::string type =
"district";
309 bool discard = oc.
getBool(
"discard");
310 int layer = oc.
getInt(
"layer");
325 if (teilflaechen[flaechenelemente[area]].size() > 0) {
326 Polygon* poly =
new Polygon(
id, type, color, teilflaechen[flaechenelemente[area]],
false, (
SUMOReal)layer);
327 toFill.
insert(
id, poly, layer);
331 WRITE_WARNING(
"Unable to project coordinates for POI '" +
id +
"'.");
334 toFill.
insert(
id, poi, layer);
340 if (line.find(
"$POIKATEGORIEDEF:") == 0 || line.find(
"$POIKATEGORIE:") == 0) {
342 parsingCategories =
true;
343 lineParser.
reinit(line.substr(line.find(
":") + 1));
345 if (line.find(
"$POI:") == 0) {
348 lineParser.
reinit(line.substr(line.find(
":") + 1));
350 if (line.find(
"$BEZIRK") == 0 && line.find(
"FLAECHEID") != std::string::npos) {
352 parsingDistrictsDirectly =
true;
353 lineParser.
reinit(line.substr(line.find(
":") + 1));
357 if (line.find(
"$BEZIRKPOLY") != std::string::npos) {
358 polyType =
"district";
360 if (line.find(
"$GEBIETPOLY") != std::string::npos) {