1 package org.opentrafficsim.road.network.factory.xml.old;
2
3 import java.io.Serializable;
4
5 import org.djunits.value.vdouble.scalar.Length;
6 import org.opentrafficsim.core.geometry.OTSPoint3D;
7 import org.opentrafficsim.core.network.NetworkException;
8 import org.opentrafficsim.core.network.factory.xml.units.Coordinates;
9 import org.opentrafficsim.core.network.factory.xml.units.LengthUnits;
10 import org.w3c.dom.NamedNodeMap;
11 import org.w3c.dom.Node;
12 import org.xml.sax.SAXException;
13
14
15
16
17
18
19
20
21
22
23 class PolyLineTag implements Serializable
24 {
25
26 private static final long serialVersionUID = 20150724L;
27
28
29 @SuppressWarnings("checkstyle:visibilitymodifier")
30 Length length = null;
31
32
33 OTSPoint3D[] coordinates = null;
34
35
36
37
38
39
40
41
42
43 @SuppressWarnings("checkstyle:needbraces")
44 static void parsePolyLine(final Node polyLine, final XmlNetworkLaneParserOld parser, final LinkTag linkTag)
45 throws SAXException, NetworkException
46 {
47 NamedNodeMap polyLineAttributes = polyLine.getAttributes();
48 linkTag.polyLineTag = new PolyLineTag();
49
50 if (polyLineAttributes.getNamedItem("INTERMEDIATEPOINTS") != null)
51 linkTag.polyLineTag.coordinates =
52 Coordinates.parseCoordinates(polyLineAttributes.getNamedItem("INTERMEDIATEPOINTS").getNodeValue());
53 if (polyLineAttributes.getNamedItem("LENGTH") != null)
54 linkTag.polyLineTag.length = LengthUnits.parseLength(polyLineAttributes.getNamedItem("LENGTH").getNodeValue());
55
56 }
57
58
59 @Override
60 public final String toString()
61 {
62 return "PolyLineTag [length=" + this.length + "]";
63 }
64 }