102 myNetBuilder(netBuilder),
105 myEdgeIDSupplier(
"gneE", netBuilder->getEdgeCont().getAllNames()),
106 myJunctionIDSupplier(
"gneJ", netBuilder->getNodeCont().getAllNames()),
107 myShapeContainer(myGrid),
108 myNeedRecompute(true),
109 myAdditionalsSaved(true) {
114 const std::vector<std::string>& nodeNames = nc.
getAllNames();
115 for (std::vector<std::string>::const_iterator name_it = nodeNames.begin(); name_it != nodeNames.end(); ++name_it) {
122 const std::vector<std::string>& edgeNames = ec.
getAllNames();
123 for (std::vector<std::string>::const_iterator name_it = edgeNames.begin(); name_it != edgeNames.end(); ++name_it) {
127 throw ProcessError(
"Network size exceeds 1 Lightyear. Please reconsider your inputs.\n");
175 for (GNEEdges::iterator it =
myEdges.begin(); it !=
myEdges.end(); it++) {
176 it->second->decRef(
"GNENet::~GNENet");
180 it->second->decRef(
"GNENet::~GNENet");
253 const std::string& suggestedName,
255 bool allowDuplicateGeom) {
258 for (EdgeVector::const_iterator it = outgoing.begin(); it != outgoing.end(); it++) {
259 if ((*it)->getToNode() == dest->
getNBNode() && (*it)->getGeometry().size() == 2) {
260 if (!allowDuplicateGeom) {
267 if (suggestedName !=
"" && !
retrieveEdge(suggestedName,
false)) {
278 edge =
new GNEEdge(*nbe,
this, wasSplit);
281 double defaultSpeed = 50 / 3.6;
282 std::string defaultType =
"";
283 int defaultNrLanes = 1;
284 int defaultPriority = 1;
288 defaultType, defaultSpeed,
289 defaultNrLanes, defaultPriority,
292 edge =
new GNEEdge(*nbe,
this, wasSplit);
319 for (EdgeVector::const_iterator it = incident.begin(); it != incident.end(); it++) {
327 std::set<GUIGlID> deselected;
328 deselected.insert(junction->
getGlID());
342 for (std::vector<GNEAdditional*>::iterator i = copyOfEdgeAdditionals.begin(); i != copyOfEdgeAdditionals.end(); i++) {
346 for (std::vector<GNELane*>::const_iterator i = edge->
getLanes().begin(); i != edge->
getLanes().end(); i++) {
347 std::vector<GNEAdditional*> copyOfLaneAdditionals = (*i)->getAdditionalChilds();
348 for (std::vector<GNEAdditional*>::iterator j = copyOfLaneAdditionals.begin(); j != copyOfLaneAdditionals.end(); j++) {
364 std::set<GUIGlID> deselected;
365 deselected.insert(edge->
getGlID());
370 for (std::vector<GNERerouter*>::iterator i = rerouters.begin(); i != rerouters.end(); i++) {
371 if ((*i)->getEdgeChilds().size() == 0) {
391 for (std::vector<GNEAdditional*>::const_iterator i = copyOfAdditionals.begin(); i != copyOfAdditionals.end(); i++) {
402 undoList->add(
new GNEChange_Lane(edge, lane, laneAttrs,
false),
true);
404 std::set<GUIGlID> deselected;
405 deselected.insert(lane->
getGlID());
423 std::set<GUIGlID> deselected;
424 deselected.insert(connection->
getGlID());
434 undoList->
p_begin(
"delete crossing");
438 std::set<GUIGlID> deselected;
439 deselected.insert(crossing->
getGlID());
452 undoList->add(
new GNEChange_Lane(edge, newLane, laneAttrs,
true),
true);
460 bool addRestriction =
true;
463 for (std::vector<GNELane*>::const_iterator i = edge.
getLanes().begin(); i != edge.
getLanes().end(); i++) {
466 addRestriction =
false;
475 if (addRestriction) {
505 for (std::vector<GNELane*>::const_iterator i = edge.
getLanes().begin(); i != edge.
getLanes().end(); i++) {
506 if ((*i)->isRestricted(vclass)) {
520 for (std::vector<GNELane*>::const_iterator i = edge.
getLanes().begin(); i != edge.
getLanes().end(); i++) {
521 if ((*i)->isRestricted(vclass)) {
546 std::pair<PositionVector, PositionVector> newGeoms = oldGeom.
splitAt(linePos);
551 const std::string::size_type sep_index = baseName.rfind(
'.');
552 if (sep_index != std::string::npos) {
553 std::string posString = baseName.substr(sep_index + 1);
555 posBase = GNEAttributeCarrier::parse<int>(posString.c_str());
556 baseName = baseName.substr(0, sep_index);
563 if (newJunction == 0) {
567 undoList, baseName +
toString(posBase),
true);
568 GNEEdge* secondPart =
createEdge(newJunction, edge->getGNEJunctionDestiny(), edge,
569 undoList, baseName +
toString(posBase + (
int)linePos),
true);
573 newGeoms.first.pop_back();
574 newGeoms.first.erase(newGeoms.first.begin());
579 newGeoms.second.pop_back();
580 newGeoms.second.erase(newGeoms.second.begin());
583 std::vector<NBEdge::Connection>& connections = edge->getNBEdge()->getConnections();
584 for (std::vector<NBEdge::Connection>::iterator con_it = connections.begin(); con_it != connections.end(); con_it++) {
596 for (std::set<GNEEdge*>::const_iterator it = edges.begin(); it != edges.end(); ++it) {
597 newJunction =
splitEdge(*it, pos, undoList, newJunction);
608 assert(reversed != 0);
621 assert(reversed != 0);
634 assert(reversed != 0);
637 std::set<GUIGlID> toSelect;
638 toSelect.insert(reversed->getGlID());
639 toSelect.insert(src->
getGlID());
640 toSelect.insert(dest->getGlID());
657 for (EdgeVector::const_iterator it = incoming.begin(); it != incoming.end(); it++) {
663 for (EdgeVector::const_iterator it = outgoing.begin(); it != outgoing.end(); it++) {
701 i->second->writeAdditional(device);
733 }
else if (failHard) {
744 GNEEdges::const_iterator i =
myEdges.find(
id);
748 }
else if (failHard) {
757 std::vector<GNEEdge*>
759 std::vector<GNEEdge*> result;
760 for (GNEEdges::const_iterator it =
myEdges.begin(); it !=
myEdges.end(); ++it) {
762 result.push_back(it->second);
769 std::vector<GNELane*>
771 std::vector<GNELane*> result;
772 for (GNEEdges::const_iterator it =
myEdges.begin(); it !=
myEdges.end(); ++it) {
774 for (GNEEdge::LaneVector::const_iterator it_lane = lanes.begin(); it_lane != lanes.end(); ++it_lane) {
776 result.push_back(*it_lane);
790 for (GNEEdge::LaneVector::const_iterator it_lane = lanes.begin(); it_lane != lanes.end(); ++it_lane) {
791 if ((*it_lane)->getID() == id) {
804 std::vector<GNEJunction*>
806 std::vector<GNEJunction*> result;
809 result.push_back(it->second);
826 GNEAdditionals::iterator positionToRemove =
myAdditionals.find(std::pair<std::string, SumoXMLTag>(additional->
getID(), additional->
getTag()));
842 return "vaporizer_" +
toString(counter);
846 std::vector<GNEAttributeCarrier*>
848 std::vector<GNEAttributeCarrier*> result;
849 for (std::set<GUIGlID>::iterator it = ids.begin(); it != ids.end(); it++) {
860 ac =
dynamic_cast<GNEEdge*
>(object);
863 ac =
dynamic_cast<GNELane*
>(object);
875 ac =
dynamic_cast<GNEPoly*
>(object);
878 ac =
dynamic_cast<GNEPOI*
>(object);
884 throw ProcessError(
"GUIGlObject does not match the declared type");
886 result.push_back(ac);
889 throw ProcessError(
"Attempted to retrieve non-existant GUIGlObject");
898 std::set<GUIGlID> result;
901 std::set<GUIGlObjectType> knownTypes;
909 for (std::set<GUIGlObjectType>::const_iterator it = knownTypes.begin(); it != knownTypes.end(); it++) {
910 const std::set<GUIGlID> tmp =
getGlIDs(*it);
911 result.insert(tmp.begin(), tmp.end());
917 result.insert(it->second->getGlID());
921 for (GNEEdges::const_iterator it =
myEdges.begin(); it !=
myEdges.end(); it++) {
922 result.insert(it->second->getGlID());
926 for (GNEEdges::const_iterator it =
myEdges.begin(); it !=
myEdges.end(); it++) {
927 const std::set<GUIGlID> laneIDs = it->second->getLaneGlIDs();
928 for (std::set<GUIGlID>::const_iterator lid_it = laneIDs.begin(); lid_it != laneIDs.end(); lid_it++) {
929 result.insert(*lid_it);
937 if (it->second->getNBNode()->isTLControlled()) {
938 result.insert(it->second->getGlID());
947 result.insert(it->second->getGlID());
952 for (GNEEdges::const_iterator i =
myEdges.begin(); i !=
myEdges.end(); i++) {
954 const std::vector<GNEConnection*>& connections = i->second->getGNEConnections();
956 for (std::vector<GNEConnection*>::const_iterator j = connections.begin(); j != connections.end(); j++) {
958 result.insert((*j)->getGlID());
966 const std::vector<GNECrossing*>& crossings = i->second->getGNECrossings();
968 for (std::vector<GNECrossing*>::const_iterator j = crossings.begin(); j != crossings.end(); j++) {
970 result.insert((*j)->getGlID());
998 window->getApp()->endWaitCursor();
1012 for (std::set<NBTrafficLightDefinition*>::iterator it = tldefs.begin(); it != tldefs.end(); it++) {
1032 if (i->second->getCrossings().size() > 0) {
1055 if (selected.size() < 2) {
1062 std::set<NBNode*> cluster;
1063 for (std::vector<GNEJunction*>::iterator it = selected.begin(); it != selected.end(); it++) {
1064 cluster.insert((*it)->getNBNode());
1065 const EdgeVector& incoming = (*it)->getNBNode()->getIncomingEdges();
1066 allIncoming.insert(allIncoming.end(), incoming.begin(), incoming.end());
1067 const EdgeVector& outgoing = (*it)->getNBNode()->getOutgoingEdges();
1068 allOutgoing.insert(allOutgoing.end(), outgoing.begin(), outgoing.end());
1085 for (EdgeVector::const_iterator it = allIncoming.begin(); it != allIncoming.end(); it++) {
1089 for (EdgeVector::const_iterator it = allOutgoing.begin(); it != allOutgoing.end(); it++) {
1094 for (std::vector<GNEJunction*>::iterator it = selected.begin(); it != selected.end(); it++) {
1105 std::vector<GNEJunction*> toRemove;
1109 toRemove.push_back(junction);
1112 for (std::vector<GNEJunction*>::iterator it = toRemove.begin(); it != toRemove.end(); ++it) {
1121 undoList->
p_begin(
"Replace junction by geometry");
1124 for (std::vector<std::pair<NBEdge*, NBEdge*> >::iterator j = toJoin.begin(); j != toJoin.end(); j++) {
1148 for (std::vector<GNELane*>::const_iterator i = edge->
getLanes().begin(); i != edge->
getLanes().end(); i++) {
1149 (*i)->updateConnectionIDs();
1199 Position delta = moveDest - moveSrc;
1201 std::set<GNEJunction*> junctionSet;
1203 for (std::vector<GNEJunction*>::iterator it = junctions.begin(); it != junctions.end(); it++) {
1204 Position newPos = (*it)->getNBNode()->getPosition() + delta;
1205 (*it)->move(newPos);
1206 junctionSet.insert(*it);
1211 for (std::vector<GNEEdge*>::iterator it = edges.begin(); it != edges.end(); it++) {
1229 undoList->
p_begin(
"move selection");
1231 std::set<GNEJunction*> junctionSet;
1233 for (std::vector<GNEJunction*>::iterator it = junctions.begin(); it != junctions.end(); it++) {
1234 (*it)->registerMove(undoList);
1235 junctionSet.insert(*it);
1240 for (std::vector<GNEEdge*>::iterator it = edges.begin(); it != edges.end(); it++) {
1276 GNEAdditionals::iterator additionalToRemove =
myAdditionals.find(std::pair<std::string, SumoXMLTag>(additional->
getID(), additional->
getTag()));
1291 GNEAdditionals::iterator additionalToUpdate =
myAdditionals.find(std::pair<std::string, SumoXMLTag>(oldID, additional->
getTag()));
1306 if (i->second->getID() == id) {
1311 throw ProcessError(
"Attempted to retrieve non-existant additional");
1318 std::vector<GNEAdditional*>
1320 std::vector<GNEAdditional*> result;
1323 result.push_back(it->second);
1335 return myAdditionals.at(std::pair<std::string, SumoXMLTag>(
id, type));
1345 if ((it->second->getTag() == type) && (it->second->getLane() != NULL) && (it->second->getLane() == lane) && (fabs(it->second->getPositionInView().x() - pos) <
POSITION_EPS)) {
1346 return it->second->getID();
1353 std::vector<GNEAdditional*>
1355 std::vector<GNEAdditional*> vectorOfAdditionals;
1358 vectorOfAdditionals.push_back(i->second);
1361 return vectorOfAdditionals;
1380 for (std::vector<GNEAdditional*>::iterator i = calibrators.begin(); i != calibrators.end(); i++) {
1393 for (std::vector<GNEAdditional*>::iterator i = calibrators.begin(); i != calibrators.end(); i++) {
1406 for (std::vector<GNEAdditional*>::iterator i = calibrators.begin(); i != calibrators.end(); i++) {
1408 if (calibrator->
flowExists(calibratorFlowID)) {
1419 for (std::vector<GNEAdditional*>::iterator i = calibrators.begin(); i != calibrators.end(); i++) {
1432 for (std::vector<GNEAdditional*>::iterator i = calibrators.begin(); i != calibrators.end(); i++) {
1445 for (std::vector<GNEAdditional*>::iterator i = calibrators.begin(); i != calibrators.end(); i++) {
1478 junction->
incRef(
"GNENet::registerJunction");
1495 edge->
incRef(
"GNENet::registerEdge");
1516 junction->
decRef(
"GNENet::deleteSingleJunction");
1531 edge->
decRef(
"GNENet::deleteSingleEdge");
1565 for (GNEEdges::const_iterator it =
myEdges.begin(); it !=
myEdges.end(); it++) {
1566 it->second->remakeGNEConnections();
1568 for (GNEEdges::const_iterator it =
myEdges.begin(); it !=
myEdges.end(); it++) {
1569 it->second->updateGeometry();
1576 std::set<std::string> liveExplicitTurnarounds;
1579 liveExplicitTurnarounds.insert(*it);
1584 if (oc.
getBool(
"numerical-ids") || oc.
isSet(
"reserved-ids")) {
1587 for (GNEEdges::const_iterator it =
myEdges.begin(); it !=
myEdges.end(); it++) {
1588 it->second->setMicrosimID(it->second->getNBEdge()->getID());
1589 newEdgeMap[it->second->getNBEdge()->getID()] = it->second;
1592 newJunctionMap[it->second->getNBNode()->getID()] = it->second;
1593 it->second->setMicrosimID(it->second->getNBNode()->getID());
1599 if (!oc.
getBool(
"offset.disable-normalization")) {
1600 for (GNEEdges::const_iterator it =
myEdges.begin(); it !=
myEdges.end(); it++) {
1610 it->second->setLogicValid(
true);
1612 it->second->updateGeometry();
void setViewNet(GNEViewNet *viewNet)
Set the viewNet to be notified of network changes.
GNEJunction * splitEdge(GNEEdge *edge, const Position &pos, GNEUndoList *undoList, GNEJunction *newJunction=0)
split edge at position by inserting a new junction
LaneSpreadFunction getLaneSpreadFunction() const
Returns how this edge's lanes' lateral offset is computed.
void computeAndUpdate(OptionsCont &oc)
recompute the network and update lane geometries
std::vector< GNEJunction * > retrieveJunctions(bool onlySelected=false)
return all junctions
NBNode * retrieve(const std::string &id) const
Returns the node with the given name.
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
void setResponsible(bool newVal)
set responsibility for deleting internal strctures
std::string getVehicleClassNames(SVCPermissions permissions, bool expand)
Returns the ids of the given classes, divided using a ' '.
const std::vector< GNEAdditional * > & getAdditionalChilds() const
return list of additionals associated with this edge
virtual void setParticipantsInformation()
Builds the list of participating nodes/edges/links.
ShapeContainer & getShapeContainer()
get shape container
double ymin() const
Returns minimum y-coordinate.
std::vector< GNELane * > retrieveLanes(bool onlySelected=false)
return all lanes
void close()
Closes the device and removes it from the dictionary.
GNEViewNet * myViewNet
The viewNet to be notofied of about changes.
SumoXMLTag
Numbers representing SUMO-XML - element names.
const std::set< GUIGlID > & getSelected() const
Returns the set of ids of all selected objects.
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
void registerJoinedCluster(const std::set< NBNode *> &cluster)
gets all joined clusters (see doc for myClusters2Join)
void addIncomingGNEEdge(GNEEdge *edge)
add incoming GNEEdge
bool isRestricted(SUMOVehicleClass vclass) const
check if this lane is restricted
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true)
get edge by id
IDSupplier myEdgeIDSupplier
description of a vehicle type
void setStatusBarText(const std::string &statusBarText)
set text of the statusBar
void setAdditionalSaved(bool value)
set manually the flag of additionals
std::map< std::string, NBNode * >::const_iterator begin() const
Returns the pointer to the begin of the stored nodes.
void append(const PositionVector &v, double sameThreshold=2.0)
void removeIncomingGNEEdge(GNEEdge *edge)
remove incoming GNEEdge
SUMORTree myGrid
the rtree which contains all GUIGlObjects (so named for historical reasons)
double z() const
Returns the z-position.
void joinSelectedJunctions(GNEUndoList *undoList)
begin/end of the description of a junction
begin/end of the description of a single lane
FXApp * getApp()
get pointer to the main App
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
bool routeExists(const std::string &routeID) const
Check if exist a route with these ID.
void refreshElement(GUIGlObject *o)
refreshes boundary information for o and update
GNEAdditionals myAdditionals
map with the name and pointer to additional elements of net
The main window of the Netedit.
std::map< std::string, NBNode * >::const_iterator end() const
Returns the pointer to the end of the stored nodes.
NBNetBuilder * getNetBuilder() const
get net builder
static const RGBColor selectedLaneColor
color of selected lane
void setMicrosimID(const std::string &newID)
override to also set lane ids
bool revertLaneRestriction(GNELane *lane, GNEUndoList *undoList)
revert prevously restricted lane
A container for traffic light definitions and built programs.
GNEAdditional * getAdditional(SumoXMLTag type, const std::string &id) const
Returns the named additional.
void setLogicValid(bool valid, GNEUndoList *undoList=0, const std::string &status=GUESSED)
connectio between two lanes
Stores the information about how to visualize structures.
std::set< GUIGlID > getGlIDs(GUIGlObjectType type=GLO_MAX)
void addIncomingEdge(NBEdge *edge)
adds an incoming edge
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
The representation of a single edge during network building.
void reinitNodes(NBNode *from, NBNode *to)
Resets nodes but keeps all other values the same (used when joining)
Position moveGeometry(const Position &oldPos, const Position &newPos, bool relative=false)
change the edge geometry It is up to the Edge to decide whether an new geometry node should be genera...
static void writeJoinedJunctions(const OptionsCont &oc, NBNodeCont &nc)
Writes the joined-juncionts to file.
void computeEverything(GNEApplicationWindow *window, bool force=false)
bool vehicleTypeExists(const std::string &vehicleTypeID) const
Check if exist a vehicle type with these ID.
std::vector< GNELane * > LaneVector
Definition of the lane's vector.
const GNECalibratorRoute & getGNECalibratorRoute(const std::string &calibratorRouteID) const
Returns a reference to a calibrator route finding in all calibrators of net.
void removeAdditionalGLObject(GUIGlObject *o)
Removes an additional object (detector/shape/trigger) from being visualised.
void avoid(const std::string &id)
make sure that the given id is never supplied
void reverseEdge(GNEEdge *edge, GNEUndoList *undoList)
reverse edge
The base class for traffic light logic definitions.
void update()
notify myViewNet
void insertJunction(GNEJunction *junction)
inserts a single junction into the net and into the underlying netbuild-container ...
void buildCenterPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to center to the object.
static const double UNSPECIFIED_OFFSET
unspecified lane offset
void deleteConnection(GNEConnection *connection, GNEUndoList *undoList)
remove connection
double getWidth() const
Returns the width of the boudary (x-axis)
bool isSelected(GUIGlObjectType type, GUIGlID id)
Returns the information whether the object with the given type and id is selected.
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
GNEEdge * createEdge(GNEJunction *src, GNEJunction *dest, GNEEdge *tpl, GNEUndoList *undoList, const std::string &suggestedName="", bool wasSplit=false, bool allowDuplicateGeom=false)
creates a new edge (unless an edge with the same geometry already exists)
bool vehicleTypeExists(std::string vehicleTypeID) const
check if a vehicelType with ID = vehicleTypeID exists
void p_begin(const std::string &description)
Begin undo command sub-group. This begins a new group of commands that are treated as a single comman...
void addExplicitTurnaround(std::string id)
add edge id to the list of explicit turnarounds
void rename(NBEdge *edge, const std::string &newID)
Renames the edge. Throws exception if newID already exists.
PositionVector reverse() const
reverse position vector
GUIShapeContainer myShapeContainer
the container for additional pois and polygons
int getNumberOfAdditionals(SumoXMLTag type=SUMO_TAG_NOTHING) const
Returns the number of additionals of the net.
Storage for geometrical objects.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
void insertEdge(GNEEdge *edge)
inserts a single edge into the net and into the underlying netbuild-container
const std::string & getID() const
Returns the id.
bool isRailway(SVCPermissions permissions)
Returns whether an edge with the given permission is a railway edge.
Lane & getLaneStruct(int lane)
void deleteEdge(GNEEdge *edge, GNEUndoList *undoList)
removes edge
const Boundary & getBoundary() const
returns the bounder of the network
static void sortNodesEdges(NBNodeCont &nc, bool useNodeShape=false)
Sorts a node's edges clockwise regarding driving direction.
void registerMove(GNEUndoList *undoList)
registers completed movement with the undoList
A RT-tree for efficient storing of SUMO's GL-objects.
first coordinate of edge shape
bool routeExists(std::string routeID) const
check if a route with ID = routeID exists
void buildPositionCopyEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to copy the cursor position if geo projection is used, also builds an entry for copying the geo-position.
void addOutgoingEdge(NBEdge *edge)
adds an outgoing edge
Boundary getBoundary() const
Returns the boundary of the junction.
void remapEdge(GNEEdge *oldEdge, GNEJunction *from, GNEJunction *to, GNEUndoList *undoList, bool keepEndpoints=false)
std::pair< PositionVector, PositionVector > splitAt(double where) const
Returns the two lists made when this list vector is splitted at the given point.
GNEJunction * registerJunction(GNEJunction *junction)
registers a junction with GNENet containers
static const double UNSPECIFIED_WIDTH
unspecified lane width
A class that stores a 2D geometrical boundary.
bool myNeedRecompute
whether the net needs recomputation
NBNetBuilder * myNetBuilder
The internal netbuilder.
void setNetObject(GUIGlObject *object)
Sets the given object as the "network" object.
static OptionsCont & getOptions()
Retrieves the options.
const EdgeVector & getOutgoingEdges() const
Returns this node's outgoing edges (The edges which start at this node)
bool priority
whether the pedestrians have priority
bool restrictLane(SUMOVehicleClass vclass, GNELane *lane, GNEUndoList *undoList)
transform lane to restricted lane
bool myAdditionalsSaved
Flag to check if additionals must be saved.
void renameJunction(GNEJunction *junction, const std::string &newID)
updates the map and reserves new id
void removeOutgoingGNEEdge(GNEEdge *edge)
remove outgoing GNEEdge
IDSupplier myJunctionIDSupplier
const std::vector< GNECrossing * > & getGNECrossings() const
Returns GNECrossings.
NBEdge::Connection & getNBEdgeConnection() const
get Edge::Connection
An (internal) definition of a single lane of an edge.
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
std::string getAttribute(SumoXMLAttr key) const
static const double Z_INITIALIZED
marker for whether the z-boundary is initialized
GNEUndoList * getUndoList() const
get the undoList object
int getIndex() const
returns the index of the lane
friend class GNEChange_Connection
void updateAdditionalID(const std::string &oldID, GNEAdditional *additional)
update additional ID in container
std::string getNext()
Returns the next id.
bool removeRestrictedLane(SUMOVehicleClass vclass, GNEEdge &edge, GNEUndoList *undoList)
remove restricted lane
std::map< std::string, GNEJunction * > GNEJunctions
bool insert(NBEdge *edge, bool ignorePrunning=false)
Adds an edge to the dictionary.
const GNECalibratorRoute & getCalibratorRoute(const std::string &routeID)
get reference calibrator route
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
This object is responsible for drawing a shape and for supplying a a popup menu. Messages are routete...
GNEEdge & getParentEdge()
Returns underlying parent edge.
const GNECalibratorFlow & getGNECalibratorFlow(const std::string &calibratorFlowID) const
Returns a reference to a calibrator flow finding in all calibrators of net.
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
void refreshAdditional(GNEAdditional *additional)
refreshes boundary information of an additional after a geometry update
void extract(NBDistrictCont &dc, NBEdge *edge, bool remember=false)
Removes the given edge from the container like erase but does not delete it.
int getNumLanes() const
Returns the number of lanes.
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise, the sub-group will be added as a new command into parent group. A matching begin() must have been called previously.
A point in 2D or 3D with translation and scaling methods.
GNEJunction * retrieveJunction(const std::string &id, bool failHard=true)
get junction by id
GNEJunctions myJunctions
map with the name and pointer to junctions of net
NBEdgeCont & getEdgeCont()
GNELane * retrieveLane(const std::string &id, bool failHard=true)
get lane by id
GNEEdge * getEdgeFrom() const
get the name of the edge the vehicles leave
Boundary myZBoundary
the z boundary (stored in the x-coordinate), values of 0 are ignored
const PositionVector getInnerGeometry() const
Returns the geometry of the edge without the endpoints.
void deleteLane(GNELane *lane, GNEUndoList *undoList)
removes lane
void deleteGeometryOrEdge(GNEEdge *edge, const Position &pos, GNEUndoList *undoList)
removes geometry when pos is close to a geometry node, deletes the whole edge otherwise ...
static GUIGlObjectStorage gIDStorage
A single static instance of this class.
GNEJunction * getGNEJunctionDestiny() const
returns the destination-junction
void removeFromCrossings(GNEEdge *edge, GNEUndoList *undoList)
removes the given edge from all pedestrian crossings
const EdgeVector & getEdges() const
Returns all edges which participate in this node (Edges that start or end at this node) ...
void computeJunction(GNEJunction *junction)
Storage for edges, including some functionality operating on multiple edges.
void initGNEConnections()
initialize GNEConnections
NBNode::Crossing & getNBCrossing() const
get referente to NBode::Crossing
bool isAdditionalsSaved() const
check if additional are saved
const std::vector< GNERerouter * > & getGNERerouters() const
get rerouters vinculated with this edge
const GNECalibratorVehicleType & getCalibratorVehicleType(const std::string &vehicleTypeID)
get reference to calibrator vehicle type
static void writeNetwork(const OptionsCont &oc, NBNetBuilder &nb)
Writes the network into XML-files (nodes, edges, connections, traffic lights)
void save(OptionsCont &oc)
save the network
edge: the shape in xml-definition
std::vector< GNEAttributeCarrier * > retrieveAttributeCarriers(const std::set< GUIGlID > &ids, GUIGlObjectType type)
get the attribute carriers based on GlIDs
virtual const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
void deleteCrossing(GNECrossing *crossing, GNEUndoList *undoList)
remove crossing
void addOutgoingGNEEdge(GNEEdge *edge)
add outgoing GNEEdge
const std::string getID() const
function to support debugging
friend class GNEChange_Edge
StringBijection< SUMOVehicleClass > SumoVehicleClassStrings(sumoVehicleClassStringInitializer, SVC_CUSTOM2, false)
void moveSelection(const Position &moveSrc, const Position &moveDest)
move all selected junctions and edges
GNEJunction * createJunction(const Position &pos, GNEUndoList *undoList)
creates a new junction
void splitEdgesBidi(const std::set< GNEEdge *> &edges, const Position &pos, GNEUndoList *undoList)
split all edges at position by inserting one new junction
GNEJunction * getGNEJunctionSource() const
returns the source-junction
void incRef(const std::string &debugMsg="")
void analyzeCluster(std::set< NBNode *> cluster, std::string &id, Position &pos, bool &hasTLS, TrafficLightType &type)
SVCPermissions getPermissions(int lane=-1) const
get the union of allowed classes over all lanes or for a specific lane
void move2side(double amount)
move position vector to side using certain ammount
SUMORTree & getVisualisationSpeedUp()
Returns the RTree used for visualisation speed-up.
std::set< std::string > myExplicitTurnarounds
list of edge ids for which turn-arounds must be added explicitly
void decRef(const std::string &debugMsg="")
std::string generateVaporizerID() const
generate an ID for vaporizers
void rename(NBNode *node, const std::string &newID)
Renames the node. Throws exception if newID already exists.
void invalidateTLS(GNEUndoList *undoList, const NBConnection &deletedConnection=NBConnection::InvalidConnection)
begin/end of the description of an edge
static void writeNetwork(const OptionsCont &oc, NBNetBuilder &nb)
Writes the network stored in the given net builder.
const PositionVector & getGeometry() const
Returns the geometry of the edge.
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
void replaceJunctionByGeometry(GNEJunction *junction, GNEUndoList *undoList)
replace the selected junction by geometry node(s) and merge the edges
A road/street connecting two junctions (netedit-version)
void reserveJunctionID(const std::string &id)
reserve junction ID (To avoid duplicates)
void reset()
Resets the boundary.
void setResponsible(bool newVal)
set responsibility for deleting internal strctures
std::vector< std::string > getAllNames() const
get all node names
void deleteSingleJunction(GNEJunction *junction)
deletes a single junction
double width
This lane's width.
void deselect(GUIGlID id)
Deselects the object with the given id.
const Boundary & getZBoundary() const
Returns the Z boundary (stored in the x() coordinate) values of 0 do not affect the boundary...
const std::vector< GNELane * > & getLanes()
returns a reference to the lane vector
bool deleteGeometry(const Position &pos, GNEUndoList *undoList)
deletes the closest geometry node within SNAP_RADIUS.
const EdgeVector & getIncomingEdges() const
Returns this node's incoming edges (The edges which yield in this node)
std::vector< GNEEdge * > retrieveEdges(bool onlySelected=false)
return all edges
NBConnection getNBConnection() const
get NBConnection
GNEEdge * registerEdge(GNEEdge *edge)
registers an edge with GNENet containers
virtual void setMicrosimID(const std::string &newID)
Changes the microsimID of the object.
NBNodeCont & getNodeCont()
Returns a reference to the node container.
double getHeight() const
Returns the height of the boundary (y-axis)
void addAdditionalGLObject(GUIGlObject *o)
Adds an additional object (detector/shape/trigger) for visualisation.
bool computeSingleLogic(OptionsCont &oc, NBTrafficLightDefinition *def)
Computes a specific traffic light logic (using by NETEDIT)
GNENet(NBNetBuilder *netBuilder)
Constructor.
An Element which don't belongs to GNENet but has influency in the simulation.
Instance responsible for building networks.
static OutputDevice & getDevice(const std::string &name)
Returns the described OutputDevice.
friend class GNEChange_Junction
declare friend class
const std::set< NBTrafficLightDefinition * > & getControllingTLS() const
Returns the traffic lights that were assigned to this node (The set of tls that control this node) ...
void removeSolitaryJunctions(GNEUndoList *undoList)
removes junctions that have no edges
GNEAdditional * retrieveAdditional(const std::string &idl, bool hardFail=true) const
Returns the named additional.
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
double getTotalWidth() const
Returns the combined width of all lanes of this edge.
NBEdge * retrieve(const std::string &id, bool retrieveExtracted=false) const
Returns the edge that has the given id.
static const RGBColor selectedConnectionColor
color of selected connection
void move(Position pos)
reposition the node at pos and informs the edges
A storage for options typed value containers)
std::vector< GNEAdditional * > getAdditionals(SumoXMLTag type=SUMO_TAG_NOTHING) const
get vector with additionals
bool insert(const std::string &id, const Position &position, NBDistrict *district=0)
Inserts a node into the map.
NBTrafficLightLogicCont & getTLLogicCont()
Returns a reference to the traffic light logics container.
void renameEdge(GNEEdge *edge, const std::string &newID)
updates the map and reserves new id
bool flowExists(std::string flowID) const
check if a flow with ID = flowID exists
static const GeoConvHelper & getFinal()
the coordinate transformation for writing the location element and for tracking the original coordina...
void deleteJunction(GNEJunction *junction, GNEUndoList *undoList)
removes junction and all incident edges
std::string getAdditionalID(SumoXMLTag type, const GNELane *lane, const double pos) const
Returns the additional close to the given position.
const Position & getPosition() const
void removeExplicitTurnaround(std::string id)
remove edge id from the list of explicit turnarounds
EdgeVector edges
The edges being crossed.
Represents a single node (junction) during network building.
void saveJoined(OptionsCont &oc)
save log of joined junctions (and nothing else)
bool flowExists(const std::string &flowID) const
Check if exist a flow with these ID.
GUIGlID getGlID() const
Returns the numerical id of the object.
std::vector< GNEAdditional * > retrieveAdditionals(bool onlySelected=false)
return all additionals
void deleteAdditional(GNEAdditional *additional)
delete additional element previously inserted
GNEEdge * addReversedEdge(GNEEdge *edge, GNEUndoList *undoList)
add reversed edge
bool netHasCrossings() const
check if net has crossings
Static storage of an output device and its base (abstract) implementation.
GNEEdges myEdges
map with the name and pointer to edges of net
last coordinate of edge shape
static const RGBColor selectionColor
color of selection
void unblockObject(GUIGlID id)
Marks an object as unblocked.
void reserveEdgeID(const std::string &id)
reserve edge ID (To avoid duplicates)
void compute(OptionsCont &oc, const std::set< std::string > &explicitTurnarounds=std::set< std::string >(), bool mayAddOrRemove=true)
Performs the network building steps.
NBNode * getFromNode() const
Returns the origin node of the edge.
void deleteSingleEdge(GNEEdge *edge)
deletes a single edge
Container for nodes during the netbuilding process.
std::map< std::string, GNEEdge * > GNEEdges
NBEdge * getNBEdge()
returns the internal NBEdge
const GNECalibratorVehicleType & getGNECalibratorVehicleType(const std::string &calibratorVehicleTypeID) const
Returns a reference to a calibrator vehicle type finding in all calibrators of net.
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
void mergeJunctions(GNEJunction *moved, GNEJunction *target, GNEUndoList *undoList)
merge the given junctions edges between the given junctions will be deleted
bool extract(NBNode *node, bool remember=false)
Removes the given node but does not delete it.
Boundary getBoundary() const
Returns the street's geometry.
#define WRITE_MESSAGE(msg)
GUIGlObject * getObjectBlocking(GUIGlID id)
Returns the object from the container locking it.
static std::string getEdgeIDFromLane(const std::string laneID)
return edge id when given the lane ID
void insertAdditional(GNEAdditional *additional, bool hardFail=true)
Insert a additional element previously created in GNEAdditionalHandler.
const GNECalibratorFlow & getCalibratorFlow(const std::string &flowID)
get reference to calibrator flow
double nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D
NBDistrictCont & getDistrictCont()
Returns a reference the districts container.
bool checkIsRemovable() const
check if node is removable
NBNode * getNBNode() const
Return net build node.
std::vector< std::string > getAllNames() const
Returns all ids of known edges.
std::vector< std::pair< NBEdge *, NBEdge * > > getEdgesToJoin() const
get edges to join
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
bool addSRestrictedLane(SUMOVehicleClass vclass, GNEEdge &edge, GNEUndoList *undoList)
add restricted lane to edge
GUISelectedStorage gSelected
A global holder of selected objects.
A window containing a gl-object's parameter.
void changeEdgeEndpoints(GNEEdge *edge, const std::string &newSourceID, const std::string &newDestID)
modifies endpoins of the given edge
NBTrafficLightLogicCont & getTLLogicCont()
returns the tllcont of the underlying netbuilder
bool wasSplit()
whether this edge was created from a split
NBNode * getToNode() const
Returns the destination node of the edge.
void saveAdditionals(const std::string &filename)
save additional elements of the network
void savePlain(OptionsCont &oc)
save plain xml representation of the network (and nothing else)
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=gPrecision)
void requireRecompute()
inform the net about the need for recomputation
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
virtual void setTLControllingInformation() const =0
Informs edges about being controlled by a tls.
void duplicateLane(GNELane *lane, GNEUndoList *undoList)
duplicates lane
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
void markAsModified(GNEUndoList *undoList)
prevent re-guessing connections at this junction
GNEViewNet * getViewNet() const
get view net
const std::vector< GNEAdditional * > & getAdditionalChilds() const
get additional childs of lane
GNEJunction * getParentJunction() const
get parent Junction
void finishMoveSelection(GNEUndoList *undoList)
register changes to junction and edge positions with the undoList
SumoXMLTag getTag() const
get XML Tag assigned to this object