Eclipse SUMO - Simulation of Urban MObility
GNENet.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
15 // The lop level container for GNE-network-components such as GNEEdge and
16 // GNEJunction. Contains an internal instances of NBNetBuilder GNE components
17 // wrap netbuild-components of this underlying NBNetBuilder and supply
18 // visualisation and editing capabilities (adapted from GUINet)
19 //
20 // WorkrouteFlow (rough draft)
21 // wrap NB-components
22 // do netedit stuff
23 // call NBNetBuilder::buildLoaded to save results
24 //
25 /****************************************************************************/
26 #ifndef GNENet_h
27 #define GNENet_h
28 
29 
30 // ===========================================================================
31 // included modules
32 // ===========================================================================
33 #include <config.h>
34 
35 #include <fx.h>
41 #include <utils/geom/Boundary.h>
48 
49 
50 // ===========================================================================
51 // class declarations
52 // ===========================================================================
53 
54 class NBNetBuilder;
55 class GNEAdditional;
56 class GNEDemandElement;
59 class GNEConnection;
60 class GNECrossing;
61 class GNEEdge;
62 class GNEJunction;
63 class GNELane;
64 class GNENetElement;
65 class GNEPOI;
66 class GNEPoly;
67 class GNEShape;
68 class GNEUndoList;
69 class GNEViewNet;
70 
71 // ===========================================================================
72 // class definitions
73 // ===========================================================================
78 class GNENet : public GUIGlObject, public ShapeContainer {
79 
81  friend class GNEAdditionalHandler;
82  friend class GNERouteHandler;
83  friend class GNEChange_Junction;
84  friend class GNEChange_Edge;
85  friend class GNEChange_Lane;
86  friend class GNEChange_Connection;
87  friend class GNEChange_Shape;
89  friend class GNEChange_Additional;
91 
92 public:
96  std::map<std::string, GNEJunction*> junctions;
97 
99  std::map<std::string, GNEEdge*> edges;
100 
102  std::map<SumoXMLTag, std::map<std::string, GNEAdditional*> > additionals;
103 
105  std::map<SumoXMLTag, std::map<std::string, GNEDemandElement*> > demandElements;
106 
108  std::map<std::string, GNEDemandElement*> vehicleDepartures;
109  };
110 
115  GNENet(NBNetBuilder* netBuilder);
116 
118  ~GNENet();
119 
122 
130 
139 
146 
148  const Boundary& getZBoundary() const;
149 
154  void drawGL(const GUIVisualizationSettings& s) const;
156 
159 
174  bool addPolygon(const std::string& id, const std::string& type, const RGBColor& color, double layer,
175  double angle, const std::string& imgFile, bool relativePath, const PositionVector& shape,
176  bool geo, bool fill, double lineWidth, bool ignorePruning = false);
177 
195  bool addPOI(const std::string& id, const std::string& type, const RGBColor& color, const Position& pos, bool geo,
196  const std::string& lane, double posOverLane, double posLat, double layer, double angle,
197  const std::string& imgFile, bool relativePath, double width, double height, bool ignorePruning = false);
199 
201  const Boundary& getBoundary() const;
202 
207 
211  const SUMORTree& getVisualisationSpeedUp() const;
212 
218  GNEJunction* createJunction(const Position& pos, GNEUndoList* undoList);
219 
232  GNEEdge* createEdge(GNEJunction* src, GNEJunction* dest, GNEEdge* tpl, GNEUndoList* undoList,
233  const std::string& suggestedName = "", bool wasSplit = false, bool allowDuplicateGeom = false,
234  bool recomputeConnections = true);
235 
240  void deleteJunction(GNEJunction* junction, GNEUndoList* undoList);
241 
246  void deleteEdge(GNEEdge* edge, GNEUndoList* undoList, bool recomputeConnections);
247 
253  void replaceIncomingEdge(GNEEdge* which, GNEEdge* by, GNEUndoList* undoList);
254 
259  void deleteLane(GNELane* lane, GNEUndoList* undoList, bool recomputeConnections);
260 
265  void deleteConnection(GNEConnection* connection, GNEUndoList* undoList);
266 
271  void deleteCrossing(GNECrossing* crossing, GNEUndoList* undoList);
272 
277  void deleteShape(GNEShape* shape, GNEUndoList* undoList);
278 
283  void deleteAdditional(GNEAdditional* additional, GNEUndoList* undoList);
284 
289  void deleteDemandElement(GNEDemandElement* demandElement, GNEUndoList* undoList);
290 
295  void duplicateLane(GNELane* lane, GNEUndoList* undoList, bool recomputeConnections);
296 
302  bool restrictLane(SUMOVehicleClass vclass, GNELane* lane, GNEUndoList* undoList);
303 
309  bool addRestrictedLane(SUMOVehicleClass vclass, GNEEdge& edge, int index, GNEUndoList* undoList);
310 
316  bool removeRestrictedLane(SUMOVehicleClass vclass, GNEEdge& edge, GNEUndoList* undoList);
317 
323  GNEJunction* splitEdge(GNEEdge* edge, const Position& pos, GNEUndoList* undoList, GNEJunction* newJunction = 0);
324 
330  void splitEdgesBidi(GNEEdge* edge, GNEEdge* oppositeEdge, const Position& pos, GNEUndoList* undoList);
331 
335  void reverseEdge(GNEEdge* edge, GNEUndoList* undoList);
336 
341  GNEEdge* addReversedEdge(GNEEdge* edge, GNEUndoList* undoList);
342 
349  void mergeJunctions(GNEJunction* moved, GNEJunction* target, GNEUndoList* undoList);
350 
353 
359  GNEJunction* retrieveJunction(const std::string& id, bool failHard = true);
360 
366  GNEEdge* retrieveEdge(const std::string& id, bool failHard = true);
367 
373  GNEEdge* retrieveEdge(GNEJunction* from, GNEJunction* to, bool failHard = true);
374 
380  GNEPoly* retrievePolygon(const std::string& id, bool failHard = true) const;
381 
387  GNEPOI* retrievePOI(const std::string& id, bool failHard = true) const;
388 
394  GNEConnection* retrieveConnection(const std::string& id, bool failHard = true) const;
395 
399  std::vector<GNEConnection*> retrieveConnections(bool onlySelected = false) const;
400 
406  GNECrossing* retrieveCrossing(const std::string& id, bool failHard = true) const;
407 
411  std::vector<GNECrossing*> retrieveCrossings(bool onlySelected = false) const;
412 
418  GNEAttributeCarrier* retrieveAttributeCarrier(const GUIGlID id, bool failHard = true);
419 
423  std::vector<GNEAttributeCarrier*> retrieveAttributeCarriers(SumoXMLTag type = SUMO_TAG_NOTHING);
424 
428  std::vector<GNEEdge*> retrieveEdges(bool onlySelected = false);
429 
433  std::vector<GNELane*> retrieveLanes(bool onlySelected = false);
434 
441  GNELane* retrieveLane(const std::string& id, bool failHard = true, bool checkVolatileChange = false);
442 
446  std::vector<GNEJunction*> retrieveJunctions(bool onlySelected = false);
447 
452  std::vector<GNEShape*> retrieveShapes(SumoXMLTag shapeTag, bool onlySelected = false);
453 
457  std::vector<GNEShape*> retrieveShapes(bool onlySelected = false);
458 
460  void requiereSaveNet(bool value);
461 
463  bool isNetSaved() const;
464 
468  void save(OptionsCont& oc);
469 
473  void savePlain(OptionsCont& oc);
474 
478  void saveJoined(OptionsCont& oc);
479 
481  void setViewNet(GNEViewNet* viewNet);
482 
485 
488 
490  void renameEdge(GNEEdge* edge, const std::string& newID);
491 
493  void renameJunction(GNEJunction* junction, const std::string& newID);
494 
496  void changeEdgeEndpoints(GNEEdge* edge, const std::string& newSourceID, const std::string& newDestID);
497 
499  GNEViewNet* getViewNet() const;
500 
502  std::vector<GNEAttributeCarrier*> getSelectedAttributeCarriers(bool ignoreCurrentSupermode);
503 
506 
509 
511  void initGNEConnections();
512 
514  void computeAndUpdate(OptionsCont& oc, bool volatileOptions);
515 
523  void computeNetwork(GNEApplicationWindow* window, bool force = false, bool volatileOptions = false, std::string additionalPath = "", std::string demandPath = "");
524 
529 
536  bool joinSelectedJunctions(GNEUndoList* undoList);
537 
539  bool cleanInvalidCrossings(GNEUndoList* undoList);
540 
542  void removeSolitaryJunctions(GNEUndoList* undoList);
543 
545  void cleanUnusedRoutes(GNEUndoList* undoList);
546 
548  void joinRoutes(GNEUndoList* undoList);
549 
551  void cleanInvalidDemandElements(GNEUndoList* undoList);
552 
554  void replaceJunctionByGeometry(GNEJunction* junction, GNEUndoList* undoList);
555 
557  void splitJunction(GNEJunction* junction, bool reconnect, GNEUndoList* undoList);
558 
560  void clearJunctionConnections(GNEJunction* junction, GNEUndoList* undoList);
561 
563  void resetJunctionConnections(GNEJunction* junction, GNEUndoList* undoList);
564 
568  void computeJunction(GNEJunction* junction);
569 
571  void requireRecompute();
572 
574  bool netHasGNECrossings() const;
575 
577  FXApp* getApp();
578 
580  NBNetBuilder* getNetBuilder() const;
581 
583  void addExplicitTurnaround(std::string id);
584 
586  void removeExplicitTurnaround(std::string id);
587 
590 
596  GNEAdditional* retrieveAdditional(SumoXMLTag type, const std::string& id, bool hardFail = true) const;
597 
601  std::vector<GNEAdditional*> retrieveAdditionals(bool onlySelected = false) const;
602 
608 
612  void updateAdditionalID(const std::string& oldID, GNEAdditional* additional);
613 
615  void requiereSaveAdditionals(bool value);
616 
620  void saveAdditionals(const std::string& filename);
621 
623  bool isAdditionalsSaved() const;
624 
626  std::string generateAdditionalID(SumoXMLTag type) const;
627 
629 
632 
638  GNEDemandElement* retrieveDemandElement(SumoXMLTag type, const std::string& id, bool hardFail = true) const;
639 
643  std::vector<GNEDemandElement*> retrieveDemandElements(bool onlySelected = false) const;
644 
650 
654  void updateDemandElementID(const std::string& oldID, GNEDemandElement* demandElement);
655 
659  void updateDemandElementBegin(const std::string& oldBegin, GNEDemandElement* demandElement);
660 
662  void requiereSaveDemandElements(bool value);
663 
667  void saveDemandElements(const std::string& filename);
668 
670  bool isDemandElementsSaved() const;
671 
673  std::string generateDemandElementID(const std::string& prefix, SumoXMLTag type) const;
674 
676 
679 
688  GNEPoly* addPolygonForEditShapes(GNENetElement* netElement, const PositionVector& shape, bool fill, RGBColor col);
689 
691  void removePolygonForEditShapes(GNEPoly* polygon);
692 
694  std::string generateShapeID(SumoXMLTag shapeTag) const;
695 
697  void changeShapeID(GNEShape* s, const std::string& OldID);
698 
700  int getNumberOfShapes() const;
702 
707 
711  void saveTLSPrograms(const std::string& filename);
712 
714  int getNumberOfTLSPrograms() const;
716 
720  void enableUpdateGeometry();
721 
723  void disableUpdateGeometry();
724 
726  bool isUpdateGeometryEnabled() const;
727 
729 
730 protected:
733 
736 
739 
742 
744  // @{
747  // @}
748 
750  std::set<std::string> myExplicitTurnarounds;
751 
754 
757 
760 
763 
766 
769 
772 
774  bool additionalExist(GNEAdditional* additional) const;
775 
779  void insertAdditional(GNEAdditional* additional);
780 
784  bool deleteAdditional(GNEAdditional* additional, bool updateViewAfterDeleting);
785 
787 
790 
792  bool demandElementExist(GNEDemandElement* demandElement) const;
793 
797  void insertDemandElement(GNEDemandElement* demandElement);
798 
802  bool deleteDemandElement(GNEDemandElement* demandElement, bool updateViewAfterDeleting);
803 
805 
806 private:
808  void initJunctionsAndEdges();
809 
811  void insertJunction(GNEJunction* junction);
812 
814  void insertEdge(GNEEdge* edge);
815 
818 
820  GNEEdge* registerEdge(GNEEdge* edge);
821 
823  void deleteSingleJunction(GNEJunction* junction, bool updateViewAfterDeleting);
824 
826  void deleteSingleEdge(GNEEdge* edge, bool updateViewAfterDeleting);
827 
829  void insertShape(GNEShape* shape, bool updateViewAfterDeleting);
830 
832  void removeShape(GNEShape* shape, bool updateViewAfterDeleting);
833 
835  void update();
836 
838  void reserveEdgeID(const std::string& id);
839 
841  void reserveJunctionID(const std::string& id);
842 
844  bool checkJunctionPosition(const Position& pos);
845 
847  void saveAdditionalsConfirmed(const std::string& filename);
848 
850  void saveDemandElementsConfirmed(const std::string& filename);
851 
852  static void replaceInListAttribute(GNEAttributeCarrier* ac, SumoXMLAttr key, const std::string& which, const std::string& by, GNEUndoList* undoList);
853 
856 
858  static const double Z_INITIALIZED;
859 
861  std::map<std::string, int> myEdgesAndNumberOfLanes;
862 
865 
868  FXDECLARE_ABSTRACT(GNEChange_ReplaceEdgeInTLS)
869 
870  public:
873  GNEChange(0, true),
874  myTllcont(tllcont), myReplaced(replaced), myBy(by) { }
875 
878 
880  FXString undoName() const {
881  return "Redo replace in TLS";
882  }
883 
885  FXString redoName() const {
886  return "Undo replace in TLS";
887  }
888 
890  void undo() {
892  }
893 
895  void redo() {
897  }
898 
900  bool trueChange() {
901  return myReplaced != myBy;
902  }
903 
904  private:
907 
910 
913  };
914 
915 };
916 
917 #endif
918 
919 /****************************************************************************/
GNENet::insertAdditional
void insertAdditional(GNEAdditional *additional)
Insert a additional element int GNENet container.
Definition: GNENet.cpp:2659
GNENet::myUpdateGeometryEnabled
bool myUpdateGeometryEnabled
Flag to enable or disable update geometry of elements after inserting or removing element in net.
Definition: GNENet.h:768
Boundary.h
GNENet::getAttributeCarriers
const AttributeCarriers & getAttributeCarriers() const
retrieve all attribute carriers of Net
Definition: GNENet.cpp:1014
SUMOVehicleClass
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
Definition: SUMOVehicleClass.h:134
GUIGlObject.h
GNENet::retrieveAdditional
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
Definition: GNENet.cpp:2133
GNENet::myJunctionIDSupplier
IDSupplier myJunctionIDSupplier
Definition: GNENet.h:746
GNEDemandElement
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNEDemandElement.h:54
GNERouteHandler
Builds trigger objects for GNENet (busStops, chargingStations, detectors, etc..)
Definition: GNERouteHandler.h:51
GNENet::initJunctionsAndEdges
void initJunctionsAndEdges()
Init Junctions and edges.
Definition: GNENet.cpp:2803
GNEAdditional
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:47
GUIParameterTableWindow
A window containing a gl-object's parameter.
Definition: GUIParameterTableWindow.h:63
GNENet::Z_INITIALIZED
static const double Z_INITIALIZED
marker for whether the z-boundary is initialized
Definition: GNENet.h:858
GNENet::replaceInListAttribute
static void replaceInListAttribute(GNEAttributeCarrier *ac, SumoXMLAttr key, const std::string &which, const std::string &by, GNEUndoList *undoList)
Definition: GNENet.cpp:3195
GNEChange_DemandElement
Definition: GNEChange_DemandElement.h:46
GNENet::generateAdditionalID
std::string generateAdditionalID(SumoXMLTag type) const
generate additional id
Definition: GNENet.cpp:2256
GNENet::myDemandElementsSaved
bool myDemandElementsSaved
Flag to check if demand elements has to be saved.
Definition: GNENet.h:765
GNENet::removeShape
void removeShape(GNEShape *shape, bool updateViewAfterDeleting)
remove created shape (but NOT delete)
Definition: GNENet.cpp:2975
GNENet::AttributeCarriers::junctions
std::map< std::string, GNEJunction * > junctions
map with the name and pointer to junctions of net
Definition: GNENet.h:96
GNENet::cleanInvalidDemandElements
void cleanInvalidDemandElements(GNEUndoList *undoList)
clean invalid demand elements
Definition: GNENet.cpp:1850
GNENet::getNumberOfTLSPrograms
int getNumberOfTLSPrograms() const
get number of TLS Programs
Definition: GNENet.cpp:2621
GNENet::removeExplicitTurnaround
void removeExplicitTurnaround(std::string id)
remove edge id from the list of explicit turnarounds
Definition: GNENet.cpp:2127
GNENet::retrievePOI
GNEPOI * retrievePOI(const std::string &id, bool failHard=true) const
get POI by id
Definition: GNENet.cpp:1066
GNENet::deleteEdge
void deleteEdge(GNEEdge *edge, GNEUndoList *undoList, bool recomputeConnections)
removes edge
Definition: GNENet.cpp:429
GNENet::netHasGNECrossings
bool netHasGNECrossings() const
check if net has GNECrossings
Definition: GNENet.cpp:1526
GUISUMOAbstractView
Definition: GUISUMOAbstractView.h:73
NBEdgeCont
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:61
GNENet::deleteShape
void deleteShape(GNEShape *shape, GNEUndoList *undoList)
remove shape
Definition: GNENet.cpp:616
NBNetBuilder
Instance responsible for building networks.
Definition: NBNetBuilder.h:110
GNENet::computeNetwork
void computeNetwork(GNEApplicationWindow *window, bool force=false, bool volatileOptions=false, std::string additionalPath="", std::string demandPath="")
trigger full netbuild computation param[in] window The window to inform about delay param[in] force W...
Definition: GNENet.cpp:1408
NBTrafficLightLogicCont
A container for traffic light definitions and built programs.
Definition: NBTrafficLightLogicCont.h:58
GNENet::requiereSaveNet
void requiereSaveNet(bool value)
inform that net has to be saved
Definition: GNENet.cpp:933
GNENet::resetJunctionConnections
void resetJunctionConnections(GNEJunction *junction, GNEUndoList *undoList)
reset junction's connections
Definition: GNENet.cpp:2033
GNENet::removeGLObjectFromGrid
void removeGLObjectFromGrid(GUIGlObject *o)
add GL Object into net
Definition: GNENet.cpp:1279
GNENet::reserveEdgeID
void reserveEdgeID(const std::string &id)
reserve edge ID (To avoid duplicates)
Definition: GNENet.cpp:3012
GNENet::disableUpdateGeometry
void disableUpdateGeometry()
disable update geometry of elements after inserting or removing an element in net
Definition: GNENet.cpp:2632
GNEPOI
Definition: GNEPOI.h:45
GNENet
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:78
GNENet::insertEdge
void insertEdge(GNEEdge *edge)
inserts a single edge into the net and into the underlying netbuild-container
Definition: GNENet.cpp:2839
GNENet::requiereSaveTLSPrograms
void requiereSaveTLSPrograms()
Definition: GNENet.cpp:2596
GNEChange_Additional
Definition: GNEChange_Additional.h:45
GNENet::AttributeCarriers::vehicleDepartures
std::map< std::string, GNEDemandElement * > vehicleDepartures
special map used for saving Demand Elements of type "Vehicle" (Vehicles, routeFlows,...
Definition: GNENet.h:108
GNENet::saveJoined
void saveJoined(OptionsCont &oc)
save log of joined junctions (and nothing else)
Definition: GNENet.cpp:969
GNENet::myEdgeIDSupplier
IDSupplier myEdgeIDSupplier
Definition: GNENet.h:745
GNENet::updateAdditionalID
void updateAdditionalID(const std::string &oldID, GNEAdditional *additional)
update additional ID in container
Definition: GNENet.cpp:2172
GNENet::deleteSingleEdge
void deleteSingleEdge(GNEEdge *edge, bool updateViewAfterDeleting)
deletes a single edge
Definition: GNENet.cpp:2918
GNENet::reverseEdge
void reverseEdge(GNEEdge *edge, GNEUndoList *undoList)
reverse edge
Definition: GNENet.cpp:838
GNEPoly
Definition: GNEPoly.h:46
GNENet::deleteAdditional
void deleteAdditional(GNEAdditional *additional, GNEUndoList *undoList)
remove additional
Definition: GNENet.cpp:625
GNENet::getSelectedAttributeCarriers
std::vector< GNEAttributeCarrier * > getSelectedAttributeCarriers(bool ignoreCurrentSupermode)
get all selected attribute carriers (or only relative to current supermode
Definition: GNENet.cpp:2073
GNEChange.h
GNENet::getParameterWindow
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
Definition: GNENet.cpp:203
GNENet::myNeedRecompute
bool myNeedRecompute
whether the net needs recomputation
Definition: GNENet.h:753
GNENet::splitEdgesBidi
void splitEdgesBidi(GNEEdge *edge, GNEEdge *oppositeEdge, const Position &pos, GNEUndoList *undoList)
split all edges at position by inserting one new junction
Definition: GNENet.cpp:826
ShapeContainer
Storage for geometrical objects.
Definition: ShapeContainer.h:50
GNENet::GNEChange_ReplaceEdgeInTLS::myReplaced
NBEdge * myReplaced
replaced NBEdge
Definition: GNENet.h:909
IDSupplier
Definition: IDSupplier.h:38
GNENet::retrieveDemandElement
GNEDemandElement * retrieveDemandElement(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named demand element.
Definition: GNENet.cpp:2266
GNENet::getApp
FXApp * getApp()
get pointer to the main App
Definition: GNENet.cpp:1537
GNENet::myAllowUndoShapes
bool myAllowUndoShapes
flag used to indicate if shaped created can be undo
Definition: GNENet.h:864
GNENet::cleanInvalidCrossings
bool cleanInvalidCrossings(GNEUndoList *undoList)
clear invalid crossings
Definition: GNENet.cpp:1687
GNEViewNet
Definition: GNEViewNet.h:43
GNEApplicationWindow
The main window of the Netedit.
Definition: GNEApplicationWindow.h:59
GNENet::replaceIncomingEdge
void replaceIncomingEdge(GNEEdge *which, GNEEdge *by, GNEUndoList *undoList)
replaces edge
Definition: GNENet.cpp:490
GNENet::update
void update()
notify myViewNet
Definition: GNENet.cpp:3004
GNENet::changeShapeID
void changeShapeID(GNEShape *s, const std::string &OldID)
change Shape ID
Definition: GNENet.cpp:2572
GNEChange_Edge
Definition: GNEChange_Edge.h:48
GNENet::restrictLane
bool restrictLane(SUMOVehicleClass vclass, GNELane *lane, GNEUndoList *undoList)
transform lane to restricted lane
Definition: GNENet.cpp:672
GNENet::drawGL
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GNENet.cpp:213
GNENet::insertJunction
void insertJunction(GNEJunction *junction)
inserts a single junction into the net and into the underlying netbuild-container
Definition: GNENet.cpp:2832
GUIVisualizationSettings.h
SUMO_TAG_NOTHING
invalid tag
Definition: SUMOXMLDefinitions.h:44
GNENet::getVisualisationSpeedUp
SUMORTree & getVisualisationSpeedUp()
Returns the RTree used for visualisation speed-up.
Definition: GNENet.cpp:302
GNENet::addExplicitTurnaround
void addExplicitTurnaround(std::string id)
add edge id to the list of explicit turnarounds
Definition: GNENet.cpp:2121
GNENet::retrieveConnections
std::vector< GNEConnection * > retrieveConnections(bool onlySelected=false) const
return all connections
Definition: GNENet.cpp:1099
PositionVector
A list of positions.
Definition: PositionVector.h:46
GUIGLObjectPopupMenu
The popup menu of a globject.
Definition: GUIGLObjectPopupMenu.h:48
GNENet::AttributeCarriers::additionals
std::map< SumoXMLTag, std::map< std::string, GNEAdditional * > > additionals
map with the name and pointer to additional elements of net
Definition: GNENet.h:102
GNENet::myViewNet
GNEViewNet * myViewNet
The viewNet to be notofied of about changes.
Definition: GNENet.h:735
GNENet::GNEChange_ReplaceEdgeInTLS::undoName
FXString undoName() const
undo name
Definition: GNENet.h:880
GNENet::GNEChange_ReplaceEdgeInTLS::trueChange
bool trueChange()
wether original and new value differ
Definition: GNENet.h:900
GNENet::getCenteringBoundary
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Definition: GNENet.cpp:290
GNENet::reserveJunctionID
void reserveJunctionID(const std::string &id)
reserve junction ID (To avoid duplicates)
Definition: GNENet.cpp:3018
GNENet::GNEChange_CalibratorItem
friend class GNEChange_CalibratorItem
Definition: GNENet.h:88
SumoXMLTag
SumoXMLTag
Numbers representing SUMO-XML - element names.
Definition: SUMOXMLDefinitions.h:42
GNENet::deleteCrossing
void deleteCrossing(GNECrossing *crossing, GNEUndoList *undoList)
remove crossing
Definition: GNENet.cpp:599
NBEdge
The representation of a single edge during network building.
Definition: NBEdge.h:86
GNENet::deleteLane
void deleteLane(GNELane *lane, GNEUndoList *undoList, bool recomputeConnections)
removes lane
Definition: GNENet.cpp:546
GNENet::generateShapeID
std::string generateShapeID(SumoXMLTag shapeTag) const
generate Shape ID
Definition: GNENet.cpp:2547
GNENet::setViewNet
void setViewNet(GNEViewNet *viewNet)
Set the viewNet to be notified of network changes.
Definition: GNENet.cpp:977
GNEEdge
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:50
GNENet::splitEdge
GNEJunction * splitEdge(GNEEdge *edge, const Position &pos, GNEUndoList *undoList, GNEJunction *newJunction=0)
split edge at position by inserting a new junction
Definition: GNENet.cpp:752
GNENet::getZBoundary
const Boundary & getZBoundary() const
Returns the Z boundary (stored in the x() coordinate) values of 0 do not affect the boundary.
Definition: GNENet.cpp:296
GNENet::retrievePolygon
GNEPoly * retrievePolygon(const std::string &id, bool failHard=true) const
get Polygon by id
Definition: GNENet.cpp:1053
GNENet::AttributeCarriers::edges
std::map< std::string, GNEEdge * > edges
map with the name and pointer to edges of net
Definition: GNENet.h:99
SUMORTree
A RT-tree for efficient storing of SUMO's GL-objects.
Definition: SUMORTree.h:69
GNENet::myNetBuilder
NBNetBuilder * myNetBuilder
The internal netbuilder.
Definition: GNENet.h:738
GNENet::joinSelectedJunctions
bool joinSelectedJunctions(GNEUndoList *undoList)
join selected junctions
Definition: GNENet.cpp:1549
GNENet::registerEdge
GNEEdge * registerEdge(GNEEdge *edge)
registers an edge with GNENet containers
Definition: GNENet.cpp:2875
RGBColor
Definition: RGBColor.h:40
GNENet::getNetBuilder
NBNetBuilder * getNetBuilder() const
get net builder
Definition: GNENet.cpp:1543
GNENet::retrieveLanes
std::vector< GNELane * > retrieveLanes(bool onlySelected=false)
return all lanes
Definition: GNENet.cpp:1164
GNENet::joinRoutes
void joinRoutes(GNEUndoList *undoList)
join routes
Definition: GNENet.cpp:1784
GNECrossing
This object is responsible for drawing a shape and for supplying a a popup menu. Messages are routete...
Definition: GNECrossing.h:45
GNENet::deleteSingleJunction
void deleteSingleJunction(GNEJunction *junction, bool updateViewAfterDeleting)
deletes a single junction
Definition: GNENet.cpp:2897
GNENet::requiereSaveAdditionals
void requiereSaveAdditionals(bool value)
inform that additionals has to be saved
Definition: GNENet.cpp:2186
GNEChange_Junction
Definition: GNEChange_Junction.h:43
GNENet::myEdgesAndNumberOfLanes
std::map< std::string, int > myEdgesAndNumberOfLanes
map with the Edges and their number of lanes
Definition: GNENet.h:861
GNENet::AttributeCarriers
struct used for saving all attribute carriers of net, in different formats
Definition: GNENet.h:94
GNEShape
Definition: GNEShape.h:35
GNENet::computeAndUpdate
void computeAndUpdate(OptionsCont &oc, bool volatileOptions)
recompute the network and update lane geometries
Definition: GNENet.cpp:3037
GNENet::getEdgeCont
NBEdgeCont & getEdgeCont()
returns the NBEdgeCont of the underlying netbuilder
Definition: GNENet.cpp:2103
GNENet::isAdditionalsSaved
bool isAdditionalsSaved() const
check if additionals are saved
Definition: GNENet.cpp:2250
SUMORTree.h
GUIShapeContainer.h
GNENet::splitJunction
void splitJunction(GNEJunction *junction, bool reconnect, GNEUndoList *undoList)
replace the selected junction by a list of junctions for each unique edge endpoint
Definition: GNENet.cpp:1937
GNENet::retrieveDemandElements
std::vector< GNEDemandElement * > retrieveDemandElements(bool onlySelected=false) const
return all demand elements
Definition: GNENet.cpp:2278
GNENet::addPolygonForEditShapes
GNEPoly * addPolygonForEditShapes(GNENetElement *netElement, const PositionVector &shape, bool fill, RGBColor col)
Builds a special polygon used for edit Junctions's shapes.
Definition: GNENet.cpp:2518
SUMOVehicleClass.h
GNENet::retrieveShapes
std::vector< GNEShape * > retrieveShapes(SumoXMLTag shapeTag, bool onlySelected=false)
return shape by type shapes
Definition: GNENet.cpp:1225
GNENet::enableUpdateGeometry
void enableUpdateGeometry()
Definition: GNENet.cpp:2626
Boundary
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:42
GNENet::getNumberOfDemandElements
int getNumberOfDemandElements(SumoXMLTag type=SUMO_TAG_NOTHING) const
Returns the number of demand elements of the net.
Definition: GNENet.cpp:2293
GNENet::requiereSaveDemandElements
void requiereSaveDemandElements(bool value)
inform that demand elements has to be saved
Definition: GNENet.cpp:2342
GNENet::renameJunction
void renameJunction(GNEJunction *junction, const std::string &newID)
updates the map and reserves new id
Definition: GNENet.cpp:2109
GNENet::createEdge
GNEEdge * createEdge(GNEJunction *src, GNEJunction *dest, GNEEdge *tpl, GNEUndoList *undoList, const std::string &suggestedName="", bool wasSplit=false, bool allowDuplicateGeom=false, bool recomputeConnections=true)
creates a new edge (unless an edge with the same geometry already exists)
Definition: GNENet.cpp:325
GNENet::myAdditionalsSaved
bool myAdditionalsSaved
Flag to check if additionals has to be saved.
Definition: GNENet.h:759
GNENet::retrieveJunction
GNEJunction * retrieveJunction(const std::string &id, bool failHard=true)
get junction by id
Definition: GNENet.cpp:1001
GNEChange_Lane
Definition: GNEChange_Lane.h:47
GNENet::retrieveAttributeCarrier
GNEAttributeCarrier * retrieveAttributeCarrier(const GUIGlID id, bool failHard=true)
get a single attribute carrier based on a GLID
Definition: GNENet.cpp:1285
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
GNENet::initGNEConnections
void initGNEConnections()
initialize GNEConnections
Definition: GNENet.cpp:3024
GNENet::save
void save(OptionsCont &oc)
save the network
Definition: GNENet.cpp:951
GNENet::duplicateLane
void duplicateLane(GNELane *lane, GNEUndoList *undoList, bool recomputeConnections)
duplicates lane
Definition: GNENet.cpp:656
GNENet::retrieveCrossings
std::vector< GNECrossing * > retrieveCrossings(bool onlySelected=false) const
return all crossings
Definition: GNENet.cpp:1135
OptionsCont
A storage for options typed value containers)
Definition: OptionsCont.h:90
GNENet::GNEChange_ReplaceEdgeInTLS::redoName
FXString redoName() const
get Redo name
Definition: GNENet.h:885
GNENetElement
Definition: GNENetElement.h:42
GNENet::updateDemandElementBegin
void updateDemandElementBegin(const std::string &oldBegin, GNEDemandElement *demandElement)
update demand element begin in container
Definition: GNENet.cpp:2328
GNEChange_Connection
Definition: GNEChange_Connection.h:45
IDSupplier.h
GUIGlObject
Definition: GUIGlObject.h:66
GNENet::saveDemandElementsConfirmed
void saveDemandElementsConfirmed(const std::string &filename)
save demand elements after confirming invalid objects
Definition: GNENet.cpp:2494
GNENet::registerJunction
GNEJunction * registerJunction(GNEJunction *junction)
registers a junction with GNENet containers
Definition: GNENet.cpp:2850
GNENet::updateDemandElementID
void updateDemandElementID(const std::string &oldID, GNEDemandElement *demandElement)
update demand element ID in container
Definition: GNENet.cpp:2305
GNENet::AttributeCarriers::demandElements
std::map< SumoXMLTag, std::map< std::string, GNEDemandElement * > > demandElements
map with the name and pointer to demand elements of net
Definition: GNENet.h:105
GNENet::myNetSaved
bool myNetSaved
Flag to check if net has to be saved.
Definition: GNENet.h:756
GNENet::deleteConnection
void deleteConnection(GNEConnection *connection, GNEUndoList *undoList)
remove connection
Definition: GNENet.cpp:584
GNENet::isDemandElementsSaved
bool isDemandElementsSaved() const
check if demand elements are saved
Definition: GNENet.cpp:2405
GNENet::addPolygon
bool addPolygon(const std::string &id, const std::string &type, const RGBColor &color, double layer, double angle, const std::string &imgFile, bool relativePath, const PositionVector &shape, bool geo, bool fill, double lineWidth, bool ignorePruning=false)
Builds a polygon using the given values and adds it to the container.
Definition: GNENet.cpp:218
GNENet::retrieveAdditionals
std::vector< GNEAdditional * > retrieveAdditionals(bool onlySelected=false) const
return all additionals
Definition: GNENet.cpp:2145
GNENet::getViewNet
GNEViewNet * getViewNet() const
get view net
Definition: GNENet.cpp:2067
GNENet::createJunction
GNEJunction * createJunction(const Position &pos, GNEUndoList *undoList)
creates a new junction
Definition: GNENet.cpp:314
GNENet::myAttributeCarriers
AttributeCarriers myAttributeCarriers
AttributeCarriers of net.
Definition: GNENet.h:741
GNENet::replaceJunctionByGeometry
void replaceJunctionByGeometry(GNEJunction *junction, GNEUndoList *undoList)
replace the selected junction by geometry node(s) and merge the edges
Definition: GNENet.cpp:1891
GNENet::mergeJunctions
void mergeJunctions(GNEJunction *moved, GNEJunction *target, GNEUndoList *undoList)
merge the given junctions edges between the given junctions will be deleted
Definition: GNENet.cpp:886
GNENet::additionalExist
bool additionalExist(GNEAdditional *additional) const
return true if additional exist (use pointer instead ID)
Definition: GNENet.cpp:2647
GNENet::retrieveAttributeCarriers
std::vector< GNEAttributeCarrier * > retrieveAttributeCarriers(SumoXMLTag type=SUMO_TAG_NOTHING)
get the attribute carriers based on Type
Definition: GNENet.cpp:1308
GNENet::retrieveJunctions
std::vector< GNEJunction * > retrieveJunctions(bool onlySelected=false)
return all junctions
Definition: GNENet.cpp:1212
GNENet::myExplicitTurnarounds
std::set< std::string > myExplicitTurnarounds
list of edge ids for which turn-arounds must be added explicitly
Definition: GNENet.h:750
GNENet::getPopUpMenu
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
Definition: GNENet.cpp:193
GNENet::getBoundary
const Boundary & getBoundary() const
returns the bounder of the network
Definition: GNENet.cpp:186
GNENet::retrieveCrossing
GNECrossing * retrieveCrossing(const std::string &id, bool failHard=true) const
get Crossing by id
Definition: GNENet.cpp:1115
GNENet::deleteJunction
void deleteJunction(GNEJunction *junction, GNEUndoList *undoList)
removes junction and all incident edges
Definition: GNENet.cpp:384
GNENet::addGLObjectIntoGrid
void addGLObjectIntoGrid(GUIGlObject *o)
add GL Object into net
Definition: GNENet.cpp:1273
GNENet::~GNENet
~GNENet()
Destructor.
Definition: GNENet.cpp:134
GNENet::getTLLogicCont
NBTrafficLightLogicCont & getTLLogicCont()
returns the tllcont of the underlying netbuilder
Definition: GNENet.cpp:2097
GNENet::saveAdditionals
void saveAdditionals(const std::string &filename)
save additional elements of the network
Definition: GNENet.cpp:2205
GUIMainWindow
Definition: GUIMainWindow.h:47
GNENet::savePlain
void savePlain(OptionsCont &oc)
save plain xml representation of the network (and nothing else)
Definition: GNENet.cpp:961
GNENet::requireRecompute
void requireRecompute()
inform the net about the need for recomputation
Definition: GNENet.cpp:1520
GNENet::saveTLSPrograms
void saveTLSPrograms(const std::string &filename)
save TLS Programs elements of the network
Definition: GNENet.cpp:2606
GNENet::removeRestrictedLane
bool removeRestrictedLane(SUMOVehicleClass vclass, GNEEdge &edge, GNEUndoList *undoList)
remove restricted lane
Definition: GNENet.cpp:738
GNENet::GNENet
GNENet(NBNetBuilder *netBuilder)
Constructor.
Definition: GNENet.cpp:88
GNENet::addReversedEdge
GNEEdge * addReversedEdge(GNEEdge *edge, GNEUndoList *undoList)
add reversed edge
Definition: GNENet.cpp:851
GNENet::removeSolitaryJunctions
void removeSolitaryJunctions(GNEUndoList *undoList)
removes junctions that have no edges
Definition: GNENet.cpp:1739
GNENet::GNEChange_ReplaceEdgeInTLS::~GNEChange_ReplaceEdgeInTLS
~GNEChange_ReplaceEdgeInTLS()
@bief destructor
Definition: GNENet.h:877
GNENet::saveAdditionalsConfirmed
void saveAdditionalsConfirmed(const std::string &filename)
save additionals after confirming invalid objects
Definition: GNENet.cpp:2437
GUIGlID
unsigned int GUIGlID
Definition: GUIGlObject.h:43
GNENet::myGrid
SUMORTree myGrid
the rtree which contains all GUIGlObjects (so named for historical reasons)
Definition: GNENet.h:732
GNENet::addRestrictedLane
bool addRestrictedLane(SUMOVehicleClass vclass, GNEEdge &edge, int index, GNEUndoList *undoList)
add restricted lane to edge
Definition: GNENet.cpp:702
GNENet::clearJunctionConnections
void clearJunctionConnections(GNEJunction *junction, GNEUndoList *undoList)
clear junction's connections
Definition: GNENet.cpp:2021
GNENet::retrieveEdges
std::vector< GNEEdge * > retrieveEdges(bool onlySelected=false)
return all edges
Definition: GNENet.cpp:1151
GNENet::addPOI
bool addPOI(const std::string &id, const std::string &type, const RGBColor &color, const Position &pos, bool geo, const std::string &lane, double posOverLane, double posLat, double layer, double angle, const std::string &imgFile, bool relativePath, double width, double height, bool ignorePruning=false)
Builds a POI using the given values and adds it to the container.
Definition: GNENet.cpp:241
GNENet::retrieveEdge
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true)
get edge by id
Definition: GNENet.cpp:1020
GNEConnection
Definition: GNEConnection.h:38
GNENet::computeJunction
void computeJunction(GNEJunction *junction)
trigger recomputation of junction shape and logic param[in] window The window to inform about delay
Definition: GNENet.cpp:1502
GNENet::retrieveLane
GNELane * retrieveLane(const std::string &id, bool failHard=true, bool checkVolatileChange=false)
get lane by id
Definition: GNENet.cpp:1179
GNENet::getNumberOfShapes
int getNumberOfShapes() const
get number of shapes
Definition: GNENet.cpp:2590
config.h
GNENet::renameEdge
void renameEdge(GNEEdge *edge, const std::string &newID)
updates the map and reserves new id
Definition: GNENet.cpp:2044
GNENet::retrieveConnection
GNEConnection * retrieveConnection(const std::string &id, bool failHard=true) const
get Connection by id
Definition: GNENet.cpp:1079
ShapeContainer.h
GNENet::isUpdateGeometryEnabled
bool isUpdateGeometryEnabled() const
check if update geometry after inserting or removing has to be updated
Definition: GNENet.cpp:2638
GNENet::GNEChange_ReplaceEdgeInTLS
class for GNEChange_ReplaceEdgeInTLS
Definition: GNENet.h:867
GNENet::myZBoundary
Boundary myZBoundary
the z boundary (stored in the x-coordinate), values of 0 are ignored
Definition: GNENet.h:855
GNENet::demandElementExist
bool demandElementExist(GNEDemandElement *demandElement) const
return true if demand element exist (use pointer instead ID)
Definition: GNENet.cpp:2715
GNENet::removePolygonForEditShapes
void removePolygonForEditShapes(GNEPoly *polygon)
remove Polygon for edit shapes
Definition: GNENet.cpp:2533
GNENet::GNEChange_ReplaceEdgeInTLS::redo
void redo()
redo action
Definition: GNENet.h:895
GNENet::generateDemandElementID
std::string generateDemandElementID(const std::string &prefix, SumoXMLTag type) const
generate demand element id
Definition: GNENet.cpp:2411
GNEUndoList
Definition: GNEUndoList.h:49
GUIVisualizationSettings
Stores the information about how to visualize structures.
Definition: GUIVisualizationSettings.h:346
NBTrafficLightLogicCont.h
GNEAdditionalHandler
Builds additional objects for GNENet (busStops, chargingStations, detectors, etc.....
Definition: GNEAdditionalHandler.h:48
GNEJunction
Definition: GNEJunction.h:48
GNENet::deleteDemandElement
void deleteDemandElement(GNEDemandElement *demandElement, GNEUndoList *undoList)
remove demand element
Definition: GNENet.cpp:638
GNENet::insertDemandElement
void insertDemandElement(GNEDemandElement *demandElement)
Insert a demand element element int GNENet container.
Definition: GNENet.cpp:2727
GNENet::computeDemandElements
void computeDemandElements(GNEApplicationWindow *window)
compute demand elements param[in] window The window to inform about delay
Definition: GNENet.cpp:1489
SumoXMLAttr
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
Definition: SUMOXMLDefinitions.h:373
GNENet::GNEChange_ReplaceEdgeInTLS::myBy
NBEdge * myBy
replaced by NBEdge
Definition: GNENet.h:912
GNENet::GNEChange_ReplaceEdgeInTLS::GNEChange_ReplaceEdgeInTLS
GNEChange_ReplaceEdgeInTLS(NBTrafficLightLogicCont &tllcont, NBEdge *replaced, NBEdge *by)
constructor
Definition: GNENet.h:872
GNENet::getNumberOfAdditionals
int getNumberOfAdditionals(SumoXMLTag type=SUMO_TAG_NOTHING) const
Returns the number of additionals of the net.
Definition: GNENet.cpp:2160
GNENet::checkJunctionPosition
bool checkJunctionPosition(const Position &pos)
return true if there are already a Junction in the given position, false in other case
Definition: GNENet.cpp:921
GNENet::GNEChange_ReplaceEdgeInTLS::myTllcont
NBTrafficLightLogicCont & myTllcont
container for traffic light logic
Definition: GNENet.h:906
GNEChange
the function-object for an editing operation (abstract base)
Definition: GNEChange.h:43
GNENet::myTLSProgramsSaved
bool myTLSProgramsSaved
Flag to check if shapes has to be saved.
Definition: GNENet.h:762
GNENet::isNetSaved
bool isNetSaved() const
return if net has to be saved
Definition: GNENet.cpp:945
GNENet::cleanUnusedRoutes
void cleanUnusedRoutes(GNEUndoList *undoList)
clean unused routes
Definition: GNENet.cpp:1756
PositionVector.h
GNELane
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:46
GNEChange_Shape
Definition: GNEChange_Shape.h:43
GNEAttributeCarrier
Definition: GNEAttributeCarrier.h:54
SUMOXMLDefinitions.h
GNENet::saveDemandElements
void saveDemandElements(const std::string &filename)
save demand element elements of the network
Definition: GNENet.cpp:2361
NBTrafficLightLogicCont::replaceRemoved
void replaceRemoved(NBEdge *removed, int removedLane, NBEdge *by, int byLane)
Replaces occurences of the removed edge/lane in all definitions by the given edge.
Definition: NBTrafficLightLogicCont.cpp:221
GNENet::changeEdgeEndpoints
void changeEdgeEndpoints(GNEEdge *edge, const std::string &newSourceID, const std::string &newDestID)
modifies endpoins of the given edge
Definition: GNENet.cpp:2057
GNENet::GNEChange_ReplaceEdgeInTLS::undo
void undo()
undo action
Definition: GNENet.h:890
GNENet::insertShape
void insertShape(GNEShape *shape, bool updateViewAfterDeleting)
insert shape
Definition: GNENet.cpp:2943