42 myPrimaryEdges(
MSEdge::getAllEdges().begin(),
MSEdge::getAllEdges().end()) {
80 if (lane ==
nullptr) {
81 WRITE_WARNINGF(
"The lane '%' does not exist in the primary network.",
id);
99 if (junction ==
nullptr) {
100 WRITE_WARNINGF(
"The junction '%' does not exist in the primary network.",
id);
117 const std::string toID = attrs.
get<std::string>(
SUMO_ATTR_TO,
nullptr, ok);
122 if (lane ==
nullptr) {
126 std::string fromLaneID = fromID +
"_" +
toString(fromLaneIdx);
127 std::string toLaneID = toID +
"_" +
toString(toLaneIdx);
129 if (lane->getLinkCont()[0]->getLane()->getID() != toLaneID
130 || lane->getIncomingLanes()[0].lane->getID() != fromLaneID) {
132 const MSJunction* junction = lane->getEdge().getToJunction();
134 if (lane2->getLinkCont()[0]->getLane()->getID() == toLaneID
135 && lane2->getIncomingLanes()[0].lane->getID() == fromLaneID) {
152 std::map<MSLane*, PositionVector> shapes2;
154 shapes2[lane] = lane->
getShape(
true);
157 for (
auto laneMap : item.second) {
158 laneMap.first->addSecondaryShape(shapes2[laneMap.second]);
#define WRITE_WARNINGF(...)
#define WRITE_WARNING(msg)
@ SUMO_TAG_CONNECTION
connectioon between two lanes
@ SUMO_TAG_JUNCTION
begin/end of the description of a junction
@ SUMO_TAG_LANE
begin/end of the description of a single lane
@ SUMO_ATTR_SHAPE
edge: the shape in xml-definition
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
A road/street connecting two junctions.
The base class for an intersection.
void addSecondaryPosition(const Position &pos)
used by the gui
virtual const std::vector< MSLane * > getInternalLanes() const
Returns all internal lanes on the junction.
const PositionVector & getShape() const
Returns this junction's shape.
Representation of a lane in the micro simulation.
virtual void addSecondaryShape(const PositionVector &)
static bool dictionary(const std::string &id, MSLane *lane)
Static (sic!) container methods {.
MSEdge & getEdge() const
Returns the lane's edge.
The simulated network and simulation perfomer.
MSJunctionControl & getJunctionControl()
Returns the junctions control.
bool hasInternalLinks() const
return whether the network contains internal links
void sortInternalShapes()
resolve mismatch between internal lane ids of both networks
NLNetShapeHandler(const std::string &file, MSNet &net)
Constructor.
void addConnection(const SUMOSAXAttributes &attrs)
records connection topology for later resorting
void addLane(const SUMOSAXAttributes &attrs)
adds a secondary lane shape
std::map< const MSJunction *, std::map< MSLane *, MSLane * > > myShuffledJunctions
mapping between primary internal lane and corresponding secondary internal lane
std::set< const MSEdge * > myPrimaryEdges
lanes of the primary network that should receive a secondary shape
virtual ~NLNetShapeHandler()
Destructor.
MSNet & myNet
The net to fill (preinitialised)
void addJunction(const SUMOSAXAttributes &attrs)
adds a junction position
virtual void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
T get(const std::string &id) const
Retrieves an item.
A point in 2D or 3D with translation and scaling methods.
Encapsulated SAX-Attributes.
T getOpt(int attr, const char *objectid, bool &ok, T defaultValue=T(), bool report=true) const
Tries to read given attribute assuming it is an int.
T get(int attr, const char *objectid, bool &ok, bool report=true) const
Tries to read given attribute assuming it is an int.
virtual bool hasAttribute(int id) const =0
Returns the information whether the named (by its enum-value) attribute is within the current list.
SAX-handler base for SUMO-files.