 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
43 #define DEBUGCOND true
45 #define MIN_TURN_DIAMETER 2.0
57 if (!oc.
isSet(
"opendrive-output")) {
62 const bool origNames = oc.
getBool(
"output.original-names");
63 const bool lefthand = oc.
getBool(
"lefthand");
64 const double straightThresh =
DEG2RAD(oc.
getFloat(
"opendrive-output.straight-threshold"));
67 int edgeID = nc.
size() * 10;
72 device <<
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
74 time_t now = time(
nullptr);
75 std::string dstr(ctime(&now));
78 device.openTag(
"header");
79 device.writeAttr(
"revMajor",
"1");
80 device.writeAttr(
"revMinor",
"4");
81 device.writeAttr(
"name",
"");
82 device.writeAttr(
"version",
"1.00");
83 device.writeAttr(
"date", dstr.substr(0, dstr.length() - 1));
84 device.writeAttr(
"north", b.
ymax());
85 device.writeAttr(
"south", b.
ymin());
86 device.writeAttr(
"east", b.
xmax());
87 device.writeAttr(
"west", b.
xmin());
98 device.openTag(
"geoReference");
99 device.writePreformattedTag(
" <![CDATA[\n "
109 for (std::map<std::string, NBEdge*>::const_iterator i = ec.
begin(); i != ec.
end(); ++i) {
110 const NBEdge* e = (*i).second;
115 fromNodeID, toNodeID,
116 origNames, straightThresh,
123 for (std::map<std::string, NBNode*>::const_iterator i = nc.
begin(); i != nc.
end(); ++i) {
125 int connectionID = 0;
126 const int nID =
getID(n->
getID(), nodeMap, nodeID);
128 junctionOSS <<
" <junction name=\"" << n->
getID() <<
"\" id=\"" << nID <<
"\">\n";
130 std::vector<NBEdge*> incoming = (*i).second->getIncomingEdges();
132 std::reverse(incoming.begin(), incoming.end());
134 for (
NBEdge* inEdge : incoming) {
135 std::string centerMark =
"none";
136 const int inEdgeID =
getID(inEdge->getID(), edgeMap, edgeID);
138 const NBEdge* outEdge =
nullptr;
139 bool isOuterEdge =
true;
140 int lastFromLane = -1;
141 std::vector<NBEdge::Connection> parallel;
142 std::vector<NBEdge::Connection> connections = inEdge->
getConnections();
144 std::reverse(connections.begin(), connections.end());
147 assert(c.toEdge != 0);
148 if (outEdge != c.toEdge || c.fromLane == lastFromLane) {
149 if (outEdge !=
nullptr) {
154 getID(parallel.back().getInternalLaneID(), edgeMap, edgeID),
156 getID(outEdge->getID(), edgeMap, edgeID),
158 parallel, isOuterEdge, straightThresh, centerMark);
164 lastFromLane = c.fromLane;
165 parallel.push_back(c);
170 if (!parallel.empty()) {
171 if (!lefthand && (n->
geometryLike() || inEdge->isTurningDirectionAt(outEdge))) {
172 centerMark =
"solid";
175 getID(parallel.back().getInternalLaneID(), edgeMap, edgeID),
177 getID(outEdge->getID(), edgeMap, edgeID),
179 parallel, isOuterEdge, straightThresh, centerMark);
184 junctionOSS <<
" </junction>\n";
191 for (std::map<std::string, NBNode*>::const_iterator i = nc.
begin(); i != nc.
end(); ++i) {
195 int numConnections = 0;
196 for (std::vector<NBEdge*>::const_iterator j = incoming.begin(); j != incoming.end(); ++j) {
197 numConnections += (int)((*j)->getConnections().size());
199 if (numConnections == 0) {
202 for (std::vector<NBEdge*>::const_iterator j = incoming.begin(); j != incoming.end(); ++j) {
203 const NBEdge* inEdge = *j;
204 const std::vector<NBEdge::Connection>& elv = inEdge->
getConnections();
205 for (std::vector<NBEdge::Connection>::const_iterator k = elv.begin(); k != elv.end(); ++k) {
208 if (outEdge ==
nullptr) {
222 int edgeID,
int fromNodeID,
int toNodeID,
223 const bool origNames,
224 const double straightThresh,
233 planViewOSS.
openTag(
"planView");
235 const std::vector<NBEdge::Lane>& lanes = e->
getLanes();
237 #ifdef DEBUG_SMOOTH_GEOM
239 std::cout <<
"write planview for edge " << e->
getID() <<
"\n";
265 device.
writeAttr(
"elementType",
"junction");
266 device.
writeAttr(
"elementId", fromNodeID);
271 device.
writeAttr(
"elementType",
"junction");
280 device <<
" <lateralProfile/>\n";
281 device <<
" <lanes>\n";
282 device <<
" <laneSection s=\"0\">\n";
285 device <<
" <right>\n";
288 device <<
" <link/>\n";
296 device <<
" <width sOffset=\"0\" a=\"" << e->
getLaneWidth(j) <<
"\" b=\"0\" c=\"0\" d=\"0\"/>\n";
297 std::string markType =
"broken";
308 device <<
" <roadMark sOffset=\"0\" type=\"" << markType <<
"\" weight=\"standard\" color=\"standard\" width=\"0.13\"/>\n";
309 device <<
" <speed sOffset=\"0\" max=\"" << lanes[j].speed <<
"\"/>\n";
310 device <<
" </lane>\n";
312 device <<
" </right>\n";
313 device <<
" </laneSection>\n";
314 device <<
" </lanes>\n";
316 device <<
" <signals/>\n";
318 device <<
" <userData code=\"sumoId\" value=\"" << e->
getID() <<
"\"/>\n";
328 if (outEdge !=
nullptr
332 || parallel.front().fromLane != 0
333 || parallel.front().toLane != 0)) {
334 parallel.insert(parallel.begin(),
NBEdge::Connection(0, const_cast<NBEdge*>(outEdge), 0,
false));
335 parallel.front().vmax = (inEdge->
getLanes()[0].speed + outEdge->
getLanes()[0].speed) / (
double) 2.0;
342 int edgeID,
int inEdgeID,
int outEdgeID,
344 const std::vector<NBEdge::Connection>& parallel,
345 const bool isOuterEdge,
346 const double straightThresh,
347 const std::string& centerMark) {
348 assert(parallel.size() != 0);
350 const NBEdge* outEdge = cLeft.toEdge;
356 double laneOffset = 0;
358 fallBackShape.push_back(begShape.back());
359 fallBackShape.push_back(endShape.front());
363 if (init.size() == 0) {
367 WRITE_WARNING(
"Could not compute smooth shape from lane '" + inEdge->
getLaneID(cLeft.fromLane) +
"' to lane '" + outEdge->
getLaneID(cLeft.toLane) +
"'. Use option 'junctions.scurve-stretch' or increase radius of junction '" + inEdge->
getToNode()->
getID() +
"' to fix this.");
374 if (init.size() != 0) {
384 junctionDevice <<
" <connection id=\"" << connectionID <<
"\" incomingRoad=\"" << inEdgeID <<
"\" connectingRoad=\"" << edgeID <<
"\" contactPoint=\"start\">\n";
400 device.
writeAttr(
"elementId", outEdgeID);
401 device.
writeAttr(
"contactPoint",
"start");
409 #ifdef DEBUG_SMOOTH_GEOM
411 std::cout <<
"write planview for internal edge " << cLeft.id <<
" init=" << init <<
" fallback=" << fallBackShape
412 <<
" begShape=" << begShape <<
" endShape=" << endShape
416 if (init.size() == 0) {
424 device <<
" <lateralProfile/>\n";
425 device <<
" <lanes>\n";
426 if (laneOffset != 0) {
427 device <<
" <laneOffset s=\"0\" a=\"" << laneOffset <<
"\" b=\"0\" c=\"0\" d=\"0\"/>\n";
429 device <<
" <laneSection s=\"0\">\n";
431 device <<
" <right>\n";
432 for (
int j = (
int)parallel.size(); --j >= 0;) {
437 device <<
" <link>\n";
438 device <<
" <predecessor id=\"" << fromIndex <<
"\"/>\n";
439 device <<
" <successor id=\"" << toIndex <<
"\"/>\n";
440 device <<
" </link>\n";
441 device <<
" <width sOffset=\"0\" a=\"" << outEdge->
getLaneWidth(c.
toLane) <<
"\" b=\"0\" c=\"0\" d=\"0\"/>\n";
442 std::string markType =
"broken";
448 }
else if (isOuterEdge && j > 0
463 device <<
" <roadMark sOffset=\"0\" type=\"" << markType <<
"\" weight=\"standard\" color=\"standard\" width=\"0.13\"/>\n";
464 device <<
" <speed sOffset=\"0\" max=\"" << c.
vmax <<
"\"/>\n";
465 device <<
" </lane>\n";
467 junctionDevice <<
" <laneLink from=\"" << fromIndex <<
"\" to=\"" << toIndex <<
"\"/>\n";
470 device <<
" </right>\n";
471 device <<
" </laneSection>\n";
472 device <<
" </lanes>\n";
473 device <<
" <objects/>\n";
474 device <<
" <signals/>\n";
476 junctionDevice <<
" </connection>\n";
484 for (
int j = 0; j < (int)shape.size() - 1; ++j) {
497 elevationDevice <<
" <elevation s=\"" << offset <<
"\" a=\"" << p.
z() <<
"\" b=\"" << (p2.
z() - p.
z()) /
MAX2(
POSITION_EPS, length) <<
"\" c=\"0\" d=\"0\"/>\n";
506 device <<
" <center>\n";
507 device <<
" <lane id=\"0\" type=\"none\" level=\"true\">\n";
508 device <<
" <link/>\n";
509 device <<
" <roadMark sOffset=\"0\" type=\"" << mark <<
"\" weight=\"standard\" color=\"standard\" width=\"" << markWidth <<
"\"/>\n";
510 device <<
" </lane>\n";
511 device <<
" </center>\n";
518 return map.
get(origID);
520 map.
insert(origID, lastID++);
527 switch (permissions) {
547 if (permissions ==
SVCAll) {
564 if (laneIndex == -1) {
566 laneIndex = lefthand ? 0 : (int)edge->
getNumLanes() - 1;
575 const int leftmost = lefthand ? 0 : (int)edge->
getNumLanes() - 1;
579 for (
int i = leftmost; i < laneIndex; i++) {
583 for (
int i = leftmost; i > laneIndex; i--) {
607 assert(init.size() == 3 || init.size() == 4);
618 init.
add(-p.
x(), -p.
y(), -p.
z());
622 double aU, bU, cU, dU;
623 double aV, bV, cV, dV;
624 double aZ, bZ, cZ, dZ;
627 if (init.size() == 3) {
630 bU = 2 * init[1].x() - 2 * init[0].x();
631 cU = init[0].x() - 2 * init[1].x() + init[2].x();
635 bV = 2 * init[1].y() - 2 * init[0].y();
636 cV = init[0].y() - 2 * init[1].y() + init[2].y();
641 bZ = (2 * initZ[1].z() - 2 * initZ[0].z()) / length;
642 cZ = (initZ[0].z() - 2 * initZ[1].z() + initZ[2].z()) / (length * length);
648 bU = 3 * init[1].x() - 3 * init[0].x();
649 cU = 3 * init[0].x() - 6 * init[1].x() + 3 * init[2].x();
650 dU = -init[0].x() + 3 * init[1].x() - 3 * init[2].x() + init[3].x();
653 bV = 3 * init[1].y() - 3 * init[0].y();
654 cV = 3 * init[0].y() - 6 * init[1].y() + 3 * init[2].y();
655 dV = -init[0].y() + 3 * init[1].y() - 3 * init[2].y() + init[3].y();
659 bZ = (3 * initZ[1].z() - 3 * initZ[0].z()) / length;
660 cZ = (3 * initZ[0].z() - 6 * initZ[1].z() + 3 * initZ[2].z()) / (length * length);
661 dZ = (-initZ[0].z() + 3 * initZ[1].z() - 3 * initZ[2].z() + initZ[3].z()) / (length * length * length);
684 elevationDevice.
openTag(
"elevation");
692 return offset + length;
698 #ifdef DEBUG_SMOOTH_GEOM
700 std::cout <<
"writeGeomSmooth\n n=" << shape.size() <<
" shape=" <<
toString(shape) <<
"\n";
704 const double longThresh = speed;
705 const double curveCutout = longThresh / 2;
707 assert(longThresh >= 2 * curveCutout);
708 assert(shape.size() > 2);
712 double maxAngleDiff = 0;
714 for (
int j = 1; j < (int)shape.size() - 1; ++j) {
722 maxAngleDiff =
MAX2(maxAngleDiff, dAngle);
723 #ifdef DEBUG_SMOOTH_GEOM
725 std::cout <<
" j=" << j <<
" dAngle=" <<
RAD2DEG(dAngle) <<
" length1=" << length1 <<
" length2=" << length2 <<
"\n";
728 if (dAngle > straightThresh
729 && (length1 > longThresh || j == 1)
730 && (length2 > longThresh || j == (
int)shape.size() - 2)) {
733 shape2.removeClosest(p1);
737 const int numPoints = (int)shape2.size();
738 #ifdef DEBUG_SMOOTH_GEOM
740 std::cout <<
" n=" << numPoints <<
" shape2=" <<
toString(shape2) <<
"\n";
744 if (maxAngleDiff < straightThresh) {
746 #ifdef DEBUG_SMOOTH_GEOM
748 std::cout <<
" special case: all lines. maxAngleDiff=" << maxAngleDiff <<
"\n";
756 for (
int j = 0; j < numPoints - 1; ++j) {
762 const double lineLength = line.
length2D();
763 if (lineLength >= longThresh) {
765 #ifdef DEBUG_SMOOTH_GEOM
767 std::cout <<
" writeLine=" <<
toString(line) <<
"\n";
774 if (j == 0 || j == numPoints - 2) {
777 begShape.
add(p0 - begShape.back());
778 }
else if (j == 1 || p0.
distanceTo2D(shape2[j - 1]) > longThresh) {
780 begShape.push_back(shape2[j - 1]);
781 begShape.push_back(p0);
784 begShape.push_back(shape2[j - 1]);
785 begShape.push_back(p1);
786 begShape.
add(p0 - begShape.back());
789 if (j == 0 || j == numPoints - 2) {
792 endShape.
add(p1 - endShape.front());
793 }
else if (j == numPoints - 3 || p1.
distanceTo2D(shape2[j + 2]) > longThresh) {
795 endShape.push_back(p1);
796 endShape.push_back(shape2[j + 2]);
799 endShape.push_back(p0);
800 endShape.push_back(shape2[j + 2]);
801 endShape.
add(p1 - endShape.front());
803 const double extrapolateLength =
MIN2((
double)25, lineLength / 4);
805 if (init.size() == 0) {
808 #ifdef DEBUG_SMOOTH_GEOM
810 std::cout <<
" writeLine lineLength=" << lineLength <<
" begShape" << j <<
"=" <<
toString(begShape) <<
" endShape" << j <<
"=" <<
toString(endShape) <<
" init" << j <<
"=" <<
toString(init) <<
"\n";
816 offset =
writeGeomPP3(device, elevationDevice, init, curveLength, offset);
817 #ifdef DEBUG_SMOOTH_GEOM
819 std::cout <<
" writeCurve lineLength=" << lineLength <<
" curveLength=" << curveLength <<
" begShape" << j <<
"=" <<
toString(begShape) <<
" endShape" << j <<
"=" <<
toString(endShape) <<
" init" << j <<
"=" <<
toString(init) <<
"\n";
834 double z = shape.size() == 0 ? 0 : shape[0].z();
835 for (
int i = 1; i < (int)shape.size(); ++i) {
841 device <<
" <elevationProfile>\n";
843 device <<
" <elevation s=\"0\" a=\"" << z <<
"\" b=\"0\" c=\"0\" d=\"0\"/>\n";
847 device <<
" </elevationProfile>\n";
857 assert(shape0.size() >= 2);
861 stopLine.push_back(to);
864 for (
int lane = 1; lane < e->
getNumLanes(); ++lane) {
882 WRITE_WARNING(
"Road object polygon '" +
id +
"' not found for edge '" + e->
getID() +
"'");
883 }
else if (p->
getShape().size() != 4) {
891 const double absAngle = sideline.
angleAt2D(0);
892 const double length = sideline.
length2D();
893 const double width = ortholine.
length2D();
896 WRITE_WARNING(
"Cannot map road object polygon '" +
id +
"' with center " +
toString(center) +
" onto edge '" + e->
getID() +
"'");
901 const double relAngle = absAngle - edgeAngle;
928 device <<
" <objects/>\n";
vehicle that is allowed to drive on high-speed rail tracks
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
static void addPedestrianConnection(const NBEdge *inEdge, const NBEdge *outEdge, std::vector< NBEdge::Connection > ¶llel)
NBEdge * toEdge
The edge the connections yields in.
Position getPolygonCenter() const
Returns the arithmetic of all corner points.
PositionVector getSubpartByIndex(int beginIndex, int count) const
get subpart of a position vector using index and a cout
double vmax
maximum velocity
#define WRITE_WARNING(msg)
const Boundary & getConvBoundary() const
Returns the converted boundary.
Storage for edges, including some functionality operating on multiple edges.
An output device that encapsulates an ofstream.
static double angleDiff(const double angle1, const double angle2)
Returns the difference of the second angle to the first angle in radiants.
Instance responsible for building networks.
double ymin() const
Returns minimum y-coordinate.
Static storage of an output device and its base (abstract) implementation.
std::map< std::string, NBNode * >::const_iterator end() const
Returns the pointer to the end of the stored nodes.
PositionVector getSubpart2D(double beginOffset, double endOffset) const
get subpart of a position vector in two dimensions (Z is ignored)
double z() const
Returns the z-position.
void rotate2D(double angle)
static PositionVector bezierControlPoints(const PositionVector &begShape, const PositionVector &endShape, bool isTurnaround, double extrapolateBeg, double extrapolateEnd, bool &ok, NBNode *recordError=0, double straightThresh=DEG2RAD(5), int shapeFlag=0)
get bezier control points
The link is a partial right direction.
static void writeEmptyCenterLane(OutputDevice &device, const std::string &mark, double markWidth)
bool isTurningDirectionAt(const NBEdge *const edge) const
Returns whether the given edge is the opposite direction to this edge.
static void writeNetwork(const OptionsCont &oc, NBNetBuilder &nb)
Writes the network into a openDRIVE-file.
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
void setPrecision(int precision=gPrecision)
Sets the precison or resets it to default.
static Position sideOffset(const Position &beg, const Position &end, const double amount)
get a side position of position vector using a offset
static PositionVector getRightLaneBorder(const NBEdge *edge, int laneIndex=-1)
double xmax() const
Returns maximum x-coordinate.
Storage for geometrical objects.
std::map< std::string, NBNode * >::const_iterator begin() const
Returns the pointer to the begin of the stored nodes.
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
static OptionsCont & getOptions()
Retrieves the options.
static double writeGeomLines(const PositionVector &shape, OutputDevice &device, OutputDevice &elevationDevice, double offset=0)
write geometry as sequence of lines (sumo style)
SVCPermissions getPermissions(int lane=-1) const
get the union of allowed classes over all lanes or for a specific lane
LinkDirection
The different directions a link between two lanes may take (or a stream between two edges)....
static PositionVector getLeftLaneBorder(const NBEdge *edge, int laneIndex=-1, double widthOffset=0)
get the left border of the given lane (the leftmost one by default)
static methods for processing the coordinates conversion for the current net
vehicle is a not electrified rail
bool usingGeoProjection() const
Returns whether a transformation from geo to metric coordinates will be performed.
const std::string & getProjString() const
Returns the original projection definition.
NBEdgeCont & getEdgeCont()
Container for nodes during the netbuilding process.
int fromLane
The lane the connections starts at.
std::string getString() const
Returns the current content as a string.
double angleAt2D(int pos) const
get angle in certain position of position vector
const std::string getParameter(const std::string &key, const std::string &defaultValue="") const
Returns the value for a given key.
The representation of a single edge during network building.
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
The link is a (hard) right direction.
static int getID(const std::string &origID, StringBijection< int > &map, int &lastID)
void add(double xoff, double yoff, double zoff)
int toLane
The lane the connections yields in.
double nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
NBNode * getToNode() const
Returns the destination node of the edge.
double xmin() const
Returns minimum x-coordinate.
double getLaneWidth() const
Returns the default width of lanes of this edge.
static const GeoConvHelper & getFinal()
the coordinate transformation for writing the location element and for tracking the original coordina...
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
static const double INVALID_OFFSET
a value to signify offsets outside the range of [0, Line.length()]
void insert(const std::string str, const T key, bool checkDuplicates=true)
T get(const std::string &str) const
std::string getLaneID(int lane) const
get lane ID
LinkDirection getDirection(const NBEdge *const incoming, const NBEdge *const outgoing, bool leftHand=false) const
Returns the representation of the described stream's direction.
vehicle is a passenger car (a "normal" car)
static std::string escapeXML(const std::string &orig, const bool maskDoubleHyphen=false)
Replaces the standard escapes by their XML entities.
A class that stores a 2D geometrical boundary.
rail vehicle that requires electrified tracks
int getNumLanes() const
Returns the number of lanes.
int numNormalConnections() const
return the number of lane-to-lane connections at this junction (excluding crossings)
static void writeNormalEdge(OutputDevice &device, const NBEdge *e, int edgeID, int fromNodeID, int toNodeID, const bool origNames, const double straightThresh, const ShapeContainer &shc)
write normal edge to device
bool isRailway(SVCPermissions permissions)
Returns whether an edge with the given permission is a railway edge.
A point in 2D or 3D with translation and scaling methods.
double x() const
Returns the x-position.
const Position getOffsetBase() const
Returns the network base.
A storage for options typed value containers)
const std::string & getShapeType() const
Returns the (abstract) type of the Shape.
The link is a (hard) left direction.
static std::string getLaneType(SVCPermissions permissions)
double length2D() const
Returns the length.
const PositionVector & getShape() const
Returns whether the shape of the polygon.
std::map< std::string, NBEdge * >::const_iterator end() const
Returns the pointer to the end of the stored edges.
const std::vector< NBEdge::Lane > & getLanes() const
Returns the lane definitions.
const std::string & getStreetName() const
Returns the street name of this edge.
double distance2D(const Position &p, bool perpendicular=false) const
closest 2D-distance to point p (or -1 if perpendicular is true and the point is beyond this vector)
double angleTo2D(const Position &other) const
returns the angle in the plane of the vector pointing from here to the other position
double distanceTo2D(const Position &p2) const
returns the euclidean distance in the x-y-plane
EdgeVector getIncomingEdges() const
Returns the list of incoming edges unsorted.
static void checkLaneGeometries(const NBEdge *e)
check if the lane geometries are compatible with OpenDRIVE assumptions (colinear stop line)
double getFloat(const std::string &name) const
Returns the double-value of the named option (only for Option_Float)
static void writeElevationProfile(const PositionVector &shape, OutputDevice &device, const OutputDevice_String &elevationDevice)
const PositionVector & getLaneShape(int i) const
Returns the shape of the nth lane.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
static OutputDevice & getDevice(const std::string &name)
Returns the described OutputDevice.
double y() const
Returns the y-position.
Position positionAtOffset2D(double pos, double lateralOffset=0) const
Returns the position at the given length.
double rotationAtOffset(double pos) const
Returns the rotation at the given length.
double getSpeed() const
Returns the speed allowed on this edge.
bool geometryLike() const
whether this is structurally similar to a geometry node
const SVCPermissions SVCAll
all VClasses are allowed
const EdgeVector & getIncomingEdges() const
Returns this node's incoming edges (The edges which yield in this node)
T get(const std::string &id) const
Retrieves an item.
int size() const
Returns the number of nodes stored in this container.
void lf()
writes a line feed if applicable
bool hasString(const std::string &str) const
PositionVector bezier(int numPoints)
return a bezier interpolation
int gPrecision
the precision for floating point outputs
Represents a single node (junction) during network building.
const Polygons & getPolygons() const
Returns all polygons.
ShapeContainer & getShapeCont()
static bool writeGeomSmooth(const PositionVector &shape, double speed, OutputDevice &device, OutputDevice &elevationDevice, double straightThresh, double &length)
NBNodeCont & getNodeCont()
Returns a reference to the node container.
A structure which describes a connection between edges or lanes.
static double writeGeomPP3(OutputDevice &device, OutputDevice &elevationDevice, PositionVector init, double length, double offset=0)
write geometry as a single bezier curve (paramPoly3)
The link is a partial left direction.
const std::string & getID() const
Returns the id.
std::map< std::string, NBEdge * >::const_iterator begin() const
Returns the pointer to the begin of the stored edges.
const std::vector< Connection > & getConnections() const
Returns the connections.
NBNode * getFromNode() const
Returns the origin node of the edge.
void move2side(double amount, double maxExtension=100)
move position vector to side using certain ammount
bool knowsParameter(const std::string &key) const
Returns whether the parameter is known.
static void writeRoadObjects(OutputDevice &device, const NBEdge *e, const ShapeContainer &shc)
write road objects referenced as edge parameters
double ymax() const
Returns maximum y-coordinate.
static int writeInternalEdge(OutputDevice &device, OutputDevice &junctionDevice, const NBEdge *inEdge, int nodeID, int edgeID, int inEdgeID, int outEdgeID, int connectionID, const std::vector< NBEdge::Connection > ¶llel, const bool isOuterEdge, const double straightThresh, const std::string ¢erMark)
write internal edge to device, return next connectionID
const std::string & getID() const