79 #ifdef CHECK_MEMORY_LEAKS 81 #endif // CHECK_MEMORY_LEAKS 97 myNetBuilder(netBuilder),
100 myEdgeIDSupplier(
"gneE", netBuilder->getEdgeCont().getAllNames()),
101 myJunctionIDSupplier(
"gneJ", netBuilder->getNodeCont().getAllNames()),
102 myShapeContainer(myGrid),
103 myNeedRecompute(true) {
108 const std::vector<std::string>& edgeNames = ec.
getAllNames();
109 for (std::vector<std::string>::const_iterator name_it = edgeNames.begin(); name_it != edgeNames.end(); ++name_it) {
113 throw ProcessError(
"Network size exceeds 1 Lightyear. Please reconsider your inputs.\n");
119 const std::vector<std::string>& nodeNames = nc.
getAllNames();
120 for (std::vector<std::string>::const_iterator name_it = nodeNames.begin(); name_it != nodeNames.end(); ++name_it) {
169 for (GNEEdges::iterator it =
myEdges.begin(); it !=
myEdges.end(); it++) {
170 it->second->decRef(
"GNENet::~GNENet");
174 it->second->decRef(
"GNENet::~GNENet");
248 const std::string& suggestedName,
250 bool allowDuplicateGeom) {
253 for (EdgeVector::const_iterator it = outgoing.begin(); it != outgoing.end(); it++) {
254 if ((*it)->getToNode() == dest->
getNBNode() && (*it)->getGeometry().size() == 2) {
255 if (!allowDuplicateGeom) {
262 if (suggestedName !=
"" && !
retrieveEdge(suggestedName,
false)) {
273 edge =
new GNEEdge(*nbe,
this, wasSplit);
277 std::string defaultType =
"";
278 int defaultNrLanes = 1;
279 int defaultPriority = 1;
283 defaultType, defaultSpeed,
284 defaultNrLanes, defaultPriority,
287 edge =
new GNEEdge(*nbe,
this, wasSplit);
289 undoList->
p_begin(
"create edge");
305 undoList->
p_begin(
"delete junction");
309 for (EdgeVector::const_iterator it = incident.begin(); it != incident.end(); it++) {
317 std::set<GUIGlID> deselected;
318 deselected.insert(junction->
getGlID());
327 undoList->
p_begin(
"delete edge");
330 for (std::vector<GNELane*>::const_iterator i = edge->
getLanes().begin(); i != edge->
getLanes().end(); i++) {
331 for (std::vector<GNEAdditional*>::const_iterator j = (*i)->getAdditionals().begin(); j != (*i)->getAdditionals().end(); j++) {
346 std::set<GUIGlID> deselected;
347 deselected.insert(edge->
getGlID());
367 undoList->
p_begin(
"delete lane");
370 undoList->add(
new GNEChange_Lane(edge, lane, laneAttrs,
false),
true);
372 std::set<GUIGlID> deselected;
373 deselected.insert(lane->
getGlID());
390 undoList->
p_begin(
"duplicate lane");
394 undoList->add(
new GNEChange_Lane(edge, newLane, laneAttrs,
true),
true);
410 undoList->
p_begin(
"split edge");
415 std::pair<PositionVector, PositionVector> newGeoms = oldGeom.
splitAt(linePos);
420 const std::string::size_type sep_index = baseName.rfind(
'.');
421 if (sep_index != std::string::npos) {
422 std::string posString = baseName.substr(sep_index + 1);
425 baseName = baseName.substr(0, sep_index);
432 if (newJunction == 0) {
436 undoList, baseName +
toString(posBase),
true);
438 undoList, baseName +
toString(posBase + (
int)linePos),
true);
442 newGeoms.first.pop_back();
443 newGeoms.first.erase(newGeoms.first.begin());
448 newGeoms.second.pop_back();
449 newGeoms.second.erase(newGeoms.second.begin());
452 std::vector<NBEdge::Connection>& connections = edge->getNBEdge()->getConnections();
453 for (std::vector<NBEdge::Connection>::iterator con_it = connections.begin(); con_it != connections.end(); con_it++) {
455 secondPart, con_it->fromLane, con_it->toEdge->getID(), con_it->toLane,
false,
true),
true);
465 undoList->
p_begin(
"split edges");
466 for (std::set<GNEEdge*>::const_iterator it = edges.begin(); it != edges.end(); ++it) {
467 newJunction =
splitEdge(*it, pos, undoList, newJunction);
475 undoList->
p_begin(
"reverse edge");
478 assert(reversed != 0);
486 undoList->
p_begin(
"add reversed edge");
490 assert(reversed != 0);
503 assert(reversed != 0);
506 std::set<GUIGlID> toSelect;
507 toSelect.insert(reversed->getGlID());
508 toSelect.insert(src->
getGlID());
509 toSelect.insert(dest->getGlID());
519 undoList->
p_begin(
"merge junctions");
526 for (EdgeVector::const_iterator it = incoming.begin(); it != incoming.end(); it++) {
532 for (EdgeVector::const_iterator it = outgoing.begin(); it != outgoing.end(); it++) {
566 std::string path = filename;
567 while (!path.empty() && path[path.size() - 1] !=
'\\') {
568 path = path.substr(0, path.size() - 1);
574 if (i->second->getAdditionalSetParent() == NULL) {
575 i->second->writeAdditional(device, path);
606 }
else if (failHard) {
617 GNEEdges::const_iterator i =
myEdges.find(
id);
621 }
else if (failHard) {
630 std::vector<GNEEdge*>
632 std::vector<GNEEdge*> result;
633 for (GNEEdges::const_iterator it =
myEdges.begin(); it !=
myEdges.end(); ++it) {
635 result.push_back(it->second);
642 std::vector<GNELane*>
644 std::vector<GNELane*> result;
645 for (GNEEdges::const_iterator it =
myEdges.begin(); it !=
myEdges.end(); ++it) {
647 for (GNEEdge::LaneVector::const_iterator it_lane = lanes.begin(); it_lane != lanes.end(); ++it_lane) {
649 result.push_back(*it_lane);
659 for (GNEEdges::const_iterator it =
myEdges.begin(); it !=
myEdges.end(); ++it) {
661 for (GNEEdge::LaneVector::const_iterator it_lane = lanes.begin(); it_lane != lanes.end(); ++it_lane) {
662 if ((*it_lane)->getID() == id) {
677 std::vector<GNEJunction*>
679 std::vector<GNEJunction*> result;
682 result.push_back(it->second);
697 std::vector<GNEAttributeCarrier*>
699 std::vector<GNEAttributeCarrier*> result;
700 for (std::set<GUIGlID>::iterator it = ids.begin(); it != ids.end(); it++) {
711 ac =
dynamic_cast<GNEEdge*
>(object);
714 ac =
dynamic_cast<GNELane*
>(object);
717 if (dynamic_cast<GNEAdditional*>(
object)) {
719 }
else if (dynamic_cast<GNEAdditionalSet*>(
object)) {
727 throw ProcessError(
"GUIGlObject does not match the declared type");
729 result.push_back(ac);
732 throw ProcessError(
"Attempted to retrieve non-existant GUIGlObject");
741 std::set<GUIGlID> result;
744 std::set<GUIGlObjectType> knownTypes;
750 for (std::set<GUIGlObjectType>::const_iterator it = knownTypes.begin(); it != knownTypes.end(); it++) {
751 const std::set<GUIGlID> tmp =
getGlIDs(*it);
752 result.insert(tmp.begin(), tmp.end());
758 result.insert(it->second->getGlID());
762 for (GNEEdges::const_iterator it =
myEdges.begin(); it !=
myEdges.end(); it++) {
763 result.insert(it->second->getGlID());
767 for (GNEEdges::const_iterator it =
myEdges.begin(); it !=
myEdges.end(); it++) {
768 const std::set<GUIGlID> laneIDs = it->second->getLaneGlIDs();
769 for (std::set<GUIGlID>::const_iterator lid_it = laneIDs.begin(); lid_it != laneIDs.end(); lid_it++) {
770 result.insert(*lid_it);
779 if (it->second->getNBNode()->isTLControlled()) {
780 result.insert(it->second->getGlID());
787 result.insert(it->second->getGlID());
814 window->getApp()->endWaitCursor();
828 for (std::set<NBTrafficLightDefinition*>::iterator it = tldefs.begin(); it != tldefs.end(); it++) {
854 if (selected.size() < 2) {
857 undoList->
p_begin(
"Join selected junctions");
861 std::set<NBNode*> cluster;
862 for (std::vector<GNEJunction*>::iterator it = selected.begin(); it != selected.end(); it++) {
863 cluster.insert((*it)->getNBNode());
864 const EdgeVector& incoming = (*it)->getNBNode()->getIncomingEdges();
865 allIncoming.insert(allIncoming.end(), incoming.begin(), incoming.end());
866 const EdgeVector& outgoing = (*it)->getNBNode()->getOutgoingEdges();
867 allOutgoing.insert(allOutgoing.end(), outgoing.begin(), outgoing.end());
884 for (EdgeVector::const_iterator it = allIncoming.begin(); it != allIncoming.end(); it++) {
888 for (EdgeVector::const_iterator it = allOutgoing.begin(); it != allOutgoing.end(); it++) {
893 for (std::vector<GNEJunction*>::iterator it = selected.begin(); it != selected.end(); it++) {
903 undoList->
p_begin(
"Clean junctions");
904 std::vector<GNEJunction*> toRemove;
908 toRemove.push_back(junction);
911 for (std::vector<GNEJunction*>::iterator it = toRemove.begin(); it != toRemove.end(); ++it) {
920 undoList->
p_begin(
"Replace junction by geometry");
923 for (std::vector<std::pair<NBEdge*, NBEdge*> >::iterator j = toJoin.begin(); j != toJoin.end(); j++) {
987 Position delta = moveDest - moveSrc;
989 std::set<GNEJunction*> junctionSet;
991 for (std::vector<GNEJunction*>::iterator it = junctions.begin(); it != junctions.end(); it++) {
992 Position newPos = (*it)->getNBNode()->getPosition() + delta;
994 junctionSet.insert(*it);
999 for (std::vector<GNEEdge*>::iterator it = edges.begin(); it != edges.end(); it++) {
1002 if (junctionSet.count(edge->
getSource()) > 0 &&
1003 junctionSet.count(edge->
getDest()) > 0) {
1017 undoList->
p_begin(
"move selection");
1019 std::set<GNEJunction*> junctionSet;
1021 for (std::vector<GNEJunction*>::iterator it = junctions.begin(); it != junctions.end(); it++) {
1022 (*it)->registerMove(undoList);
1023 junctionSet.insert(*it);
1028 for (std::vector<GNEEdge*>::iterator it = edges.begin(); it != edges.end(); it++) {
1051 throw ProcessError(
"additional element with ID='" + additional->
getID() +
"' already exist");
1066 GNEAdditionals::iterator positionToRemove =
myAdditionals.find(std::pair<std::string, SumoXMLTag>(additional->
getID(), additional->
getTag()));
1069 throw ProcessError(
"additional element with ID='" + additional->
getID() +
"' don't exist");
1083 GNEAdditionals::iterator additionalToUpdate =
myAdditionals.find(std::pair<std::string, SumoXMLTag>(oldID, additional->
getTag()));
1097 return myAdditionals.at(std::pair<std::string, SumoXMLTag>(
id, type));
1107 if ((it->second->getTag() == type) && (it->second->getLane() != NULL) && (it->second->getLane() == lane) && (fabs(it->second->getPositionInView().x() - pos) <
POSITION_EPS)) {
1108 return it->second->getID();
1115 std::vector<GNEAdditional*>
1117 std::vector<GNEAdditional*> vectorOfAdditionals;
1120 vectorOfAdditionals.push_back(i->second);
1123 return vectorOfAdditionals;
1163 junction->
incRef(
"GNENet::registerJunction");
1180 edge->
incRef(
"GNENet::registerEdge");
1195 junction->
decRef(
"GNENet::deleteSingleJunction");
1207 edge->
decRef(
"GNENet::deleteSingleEdge");
1237 std::set<std::string> liveExplicitTurnarounds;
1240 liveExplicitTurnarounds.insert(*it);
1245 for (GNEEdges::const_iterator it =
myEdges.begin(); it !=
myEdges.end(); it++) {
1246 it->second->updateLaneGeometries();
1249 it->second->setLogicValid(
true);
1251 it->second->updateGeometry();
GNEJunction * splitEdge(GNEEdge *edge, const Position &pos, GNEUndoList *undoList, GNEJunction *newJunction=0)
split edge at position by inserting a new junction
void computeAndUpdate(OptionsCont &oc)
recompute the network and update lane geometries
std::vector< GNEJunction * > retrieveJunctions(bool onlySelected=false)
return all junctions
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
void setResponsible(bool newVal)
set responsibility for deleting internal strctures
virtual void setParticipantsInformation()
Builds the list of participating nodes/edges/links.
ShapeContainer & getShapeContainer()
get shape container
const EdgeVector & getIncomingEdges() const
Returns this node's incoming edges.
std::vector< GNELane * > retrieveLanes(bool onlySelected=false)
return all lanes
void close()
Closes the device and removes it from the dictionary.
SumoXMLTag
Numbers representing SUMO-XML - element names.
GNEAdditionalSet * getAdditionalSetParent() const
get additionalSet parent, or NULL if don't belongs to an additionalSet
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
SUMOReal getHeight() const
Returns the height of the boundary.
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true)
get edge by id
static const SUMOReal UNSPECIFIED_WIDTH
unspecified lane width
IDSupplier myEdgeIDSupplier
SUMOReal getWidth() const
Returns the width of the boudary.
SUMOReal nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D
std::vector< std::string > getAllNames() const
Returns all ids of known edges.
SUMORTree myGrid
the rtree which contains all GUIGlObjects (so named for historical reasons)
void joinSelectedJunctions(GNEUndoList *undoList)
FXApp * getApp()
get pointer to the main App
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.
static const RGBColor selectedLaneColor
color of selected lane
void setMicrosimID(const std::string &newID)
override to also set lane ids
A container for traffic light definitions and built programs.
void compute(OptionsCont &oc, const std::set< std::string > &explicitTurnarounds=std::set< std::string >(), bool removeElements=true)
Performs the network building steps.
void setLogicValid(bool valid, GNEUndoList *undoList=0, const std::string &status=GUESSED)
SUMOReal ymin() const
Returns minimum y-coordinate.
Stores the information about how to visualize structures.
std::set< GUIGlID > getGlIDs(GUIGlObjectType type=GLO_MAX)
void addIncomingEdge(NBEdge *edge)
adds an incoming edge
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...
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
static void writeJoinedJunctions(const OptionsCont &oc, NBNodeCont &nc)
Writes the joined-juncionts to file.
void computeEverything(GNEApplicationWindow *window, bool force=false)
std::vector< GNELane * > LaneVector
Definition of the lane's positions vector.
void removeAdditionalGLObject(GUIGlObject *o)
Removes an additional object (detector/shape/trigger) from being visualised.
NBNode * getNBNode() const
Return net build node.
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 myUpdateTarget
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.
SUMOReal getTotalWidth() const
Returns the combined width of all lanes of this edge.
std::string getAttribute(SumoXMLAttr key) const
void splitEdgesBidi(const std::set< GNEEdge * > &edges, const Position &pos, GNEUndoList *undoList)
split all edges at position by inserting one new junction
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)
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.
GUIShapeContainer myShapeContainer
the container for additional pois and polygons
Storage for geometrical objects.
void insertEdge(GNEEdge *edge)
inserts a single edge into the net and into the underlying netbuild-container
bool checkIsRemovable() const
const std::vector< GNEAdditional * > & getAdditionals() const
return list of additionals associated with this edge
Lane & getLaneStruct(int lane)
static const SUMOReal UNSPECIFIED_OFFSET
unspecified lane offset
An Element wich group additionalSet elements.
void deleteEdge(GNEEdge *edge, GNEUndoList *undoList)
removes edge
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.
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
std::string getAdditionalID(SumoXMLTag type, const GNELane *lane, const SUMOReal pos) const
Returns the additional close to the given position.
int getIndex() const
returns the index of the lane
void remapEdge(GNEEdge *oldEdge, GNEJunction *from, GNEJunction *to, GNEUndoList *undoList, bool keepEndpoints=false)
GUIGlID getGlID() const
Returns the numerical id of the object.
GNEJunction * registerJunction(GNEJunction *junction)
registers a junction with GNENet containers
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.
const Boundary & getBoundary() const
returns the bounder of the network
static OptionsCont & getOptions()
Retrieves the options.
PositionVector reverse() const
reverse position vector
void renameJunction(GNEJunction *junction, const std::string &newID)
updates the map and reserves new id
virtual const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
const EdgeVector & getOutgoingEdges() const
Returns this node's outgoing edges.
IDSupplier myJunctionIDSupplier
An (internal) definition of a single lane of an edge.
const std::string & getID() const
Returns the id.
SVCPermissions permissions
List of vehicle types that are allowed on this lane.
const PositionVector getInnerGeometry() const
Returns the geometry of the edge without the endpoints.
friend class GNEChange_Connection
const Position & getPosition() const
Returns the position of this node.
const std::set< GUIGlID > & getSelected() const
Returns the list of ids of all selected objects.
void updateAdditionalID(const std::string &oldID, GNEAdditional *additional)
update additional ID in container
std::string getNext()
Returns the next id.
const std::set< NBTrafficLightDefinition * > & getControllingTLS() const
Returns the traffic lights that were assigned to this node.
bool insert(NBEdge *edge, bool ignorePrunning=false)
Adds an edge to the dictionary.
GNEEdge & getParentEdge()
Returns underlying parent edge.
FXWindow * myUpdateTarget
The window to be notofied of about changes.
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
void extract(NBDistrictCont &dc, NBEdge *edge, bool remember=false)
Removes the given edge from the container like erase but does not delete it.
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()
Returns the edge container.
GNELane * retrieveLane(const std::string &id, bool failHard=true)
get lane by id
Boundary myZBoundary
the z boundary (stored in the x-coordinate), values of 0 are ignored
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 ...
bool addAdditionalChild(GNEAdditional *additional)
add additional element to this set
static GUIGlObjectStorage gIDStorage
A single static instance of this class.
Boundary getBoundary() const
Returns the street's geometry.
SUMOReal z() const
Returns the z-position.
void removeFromCrossings(GNEEdge *edge, GNEUndoList *undoList)
removes the given edge from all pedestrian crossings
int getNumLanes() const
Returns the number of lanes.
std::vector< GNEAdditional * > getAdditionals(SumoXMLTag type=SUMO_TAG_NOTHING)
get vector with additionals
void computeJunction(GNEJunction *junction)
const EdgeVector & getEdges() const
Returns all edges which participate in this node.
Storage for edges, including some functionality operating on multiple edges.
static void writeNetwork(const OptionsCont &oc, NBNetBuilder &nb)
Writes the network into XML-files (nodes, edges, connections, traffic lights)
int getNumberOfAdditionals(SumoXMLTag type=SUMO_TAG_NOTHING)
Returns the number of additionals of the net.
void save(OptionsCont &oc)
save the network
std::vector< GNEAttributeCarrier * > retrieveAttributeCarriers(const std::set< GUIGlID > &ids, GUIGlObjectType type)
get the attribute carriers based on GlIDs
bool removeAdditionalChild(GNEAdditional *additional)
remove additional element to this set
std::vector< std::string > getAllNames() const
get all node names
friend class GNEChange_Edge
const std::string getID() const
function to support debugging
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
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
void incRef(const std::string &debugMsg="")
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="")
void rename(NBNode *node, const std::string &newID)
Renames the node. Throws exception if newID already exists.
std::vector< std::pair< NBEdge *, NBEdge * > > getEdgesToJoin() const
std::pair< PositionVector, PositionVector > splitAt(SUMOReal where) const
Returns the two lists made when this list vector is splitted at the given point.
static void writeNetwork(const OptionsCont &oc, NBNetBuilder &nb)
Writes the network stored in the given net builder.
void replaceJunctionByGeometry(GNEJunction *junction, GNEUndoList *undoList)
A road/street connecting two junctions (netedit-version)
void reserveJunctionID(const std::string &id)
reserve junction ID (To avoid duplicates)
GNEAdditional * getAdditional(SumoXMLTag type, const std::string &id) const
Returns the named additional.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
void add(SUMOReal x, SUMOReal y)
Makes the boundary include the given coordinate.
void setResponsible(bool newVal)
set responsibility for deleting internal strctures
static int _2int(const E *const data)
converts a char-type array into the integer value described by it
void deleteSingleJunction(GNEJunction *junction)
deletes a single junction
NBNode * getToNode() const
Returns the destination node of the edge.
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
NBEdge * retrieve(const std::string &id, bool retrieveExtracted=false) const
Returns the edge that has the given id.
bool deleteGeometry(const Position &pos, GNEUndoList *undoList)
deletes the closest geometry node within SNAP_RADIUS.
std::vector< GNEEdge * > retrieveEdges(bool onlySelected=false)
return all edges
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 the node container.
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.
Boundary getBoundary() const
Returns the boundary of the junction.
Instance responsible for building networks.
static OutputDevice & getDevice(const std::string &name)
Returns the described OutputDevice.
friend class GNEChange_Junction
declare friend class
void removeSolitaryJunctions(GNEUndoList *undoList)
std::vector< NBEdge * > EdgeVector
void analyzeCluster(std::set< NBNode * > cluster, std::string &id, Position &pos, bool &hasTLS, TrafficLightType &type)
const PositionVector & getGeometry() const
Returns the geometry of the edge.
void move(Position pos)
reposition the node at pos and informs the edges
A storage for options typed value containers)
bool insert(const std::string &id, const Position &position, NBDistrict *district=0)
Inserts a node into the map.
NBTrafficLightLogicCont & getTLLogicCont()
Returns the traffic light logics container.
GNEJunction * getDest() const
returns the destination-junction
void renameEdge(GNEEdge *edge, const std::string &newID)
updates the map and reserves new id
void deleteJunction(GNEJunction *junction, GNEUndoList *undoList)
removes junction and all incident edges
LaneSpreadFunction getLaneSpreadFunction() const
Returns how this edge's lanes' lateral offset is computed.
void removeExplicitTurnaround(std::string id)
remove edge id from the list of explicit turnarounds
Represents a single node (junction) during network building.
void saveJoined(OptionsCont &oc)
save log of joined junctions (and nothing else)
void deleteAdditional(GNEAdditional *additional)
delete additional element previously inserted
SumoXMLTag getTag() const
get Tag assigned to this object
GNEEdge * addReversedEdge(GNEEdge *edge, GNEUndoList *undoList)
add reversed edge
void move2side(SUMOReal amount)
move position vector to side using certain ammount
void setUpdateTarget(FXWindow *updateTarget)
Set the target to be notified of network changes.
Static storage of an output device and its base (abstract) implementation.
GNEEdges myEdges
map with the name and pointer to edges of net
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 deleteSingleEdge(GNEEdge *edge)
deletes a single edge
NBNode * retrieve(const std::string &id) const
Returns the node with the given name.
Container for nodes during the netbuilding process.
NBEdge * getNBEdge()
returns the internal NBEdge
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.
#define WRITE_MESSAGE(msg)
GUIGlObject * getObjectBlocking(GUIGlID id)
Returns the object from the container locking it.
void insertAdditional(GNEAdditional *additional, bool hardFail=true)
Insert a additional element previously created in GNEAdditionalHandler.
NBDistrictCont & getDistrictCont()
Returns the districts container.
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
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
void setStatusBarText(const std::string &)
set text of the statusBar
GNEJunction * getSource() const
returns the source-junction
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)
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.
static const SUMOReal Z_INITIALIZED
marker for whether the z-boundary is initialized
void duplicateLane(GNELane *lane, GNEUndoList *undoList)
duplicates lane
void append(const PositionVector &v, SUMOReal sameThreshold=2.0)
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
void registerJoinedCluster(const std::set< NBNode * > &cluster)
gets all joined clusters (see doc for myClusters2Join)
void finishMoveSelection(GNEUndoList *undoList)
register changes to junction and edge positions with the undoList
NBNode * getFromNode() const
Returns the origin node of the edge.