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 /****************************************************************************/
14 // The lop level container for GNE-network-components such as GNEEdge and
15 // GNEJunction. Contains an internal instances of NBNetBuilder GNE components
16 // wrap netbuild-components of this underlying NBNetBuilder and supply
17 // visualisation and editing capabilities (adapted from GUINet)
18 //
19 // WorkrouteFlow (rough draft)
20 // wrap NB-components
21 // do netedit stuff
22 // call NBNetBuilder::buildLoaded to save results
23 //
24 /****************************************************************************/
25 #ifndef GNENet_h
26 #define GNENet_h
27 
28 
29 // ===========================================================================
30 // included modules
31 // ===========================================================================
32 #include <config.h>
33 
34 #include <fx.h>
40 #include <utils/geom/Boundary.h>
47 
48 
49 // ===========================================================================
50 // class declarations
51 // ===========================================================================
52 
53 class NBNetBuilder;
54 class GNEAdditional;
55 class GNEDemandElement;
58 class GNEConnection;
59 class GNECrossing;
60 class GNEEdge;
61 class GNEJunction;
62 class GNELane;
63 class GNENetElement;
64 class GNEPOI;
65 class GNEPoly;
66 class GNEShape;
67 class GNEUndoList;
68 class GNEViewNet;
69 
70 // ===========================================================================
71 // class definitions
72 // ===========================================================================
77 class GNENet : public GUIGlObject, public ShapeContainer {
78 
80  friend class GNEAdditionalHandler;
81  friend class GNERouteHandler;
82  friend class GNEChange_Junction;
83  friend class GNEChange_Edge;
84  friend class GNEChange_Lane;
85  friend class GNEChange_Connection;
86  friend class GNEChange_Shape;
88  friend class GNEChange_Additional;
90 
91 public:
95  std::map<std::string, GNEJunction*> junctions;
96 
98  std::map<std::string, GNEEdge*> edges;
99 
101  std::map<SumoXMLTag, std::map<std::string, GNEAdditional*> > additionals;
102 
104  std::map<SumoXMLTag, std::map<std::string, GNEDemandElement*> > demandElements;
105 
107  std::map<std::string, GNEDemandElement*> vehicleDepartures;
108  };
109 
114  GNENet(NBNetBuilder* netBuilder);
115 
117  ~GNENet();
118 
121 
129 
138 
145 
147  const Boundary& getZBoundary() const;
148 
153  void drawGL(const GUIVisualizationSettings& s) const;
155 
158 
173  bool addPolygon(const std::string& id, const std::string& type, const RGBColor& color, double layer,
174  double angle, const std::string& imgFile, bool relativePath, const PositionVector& shape,
175  bool geo, bool fill, double lineWidth, bool ignorePruning = false);
176 
194  bool addPOI(const std::string& id, const std::string& type, const RGBColor& color, const Position& pos, bool geo,
195  const std::string& lane, double posOverLane, double posLat, double layer, double angle,
196  const std::string& imgFile, bool relativePath, double width, double height, bool ignorePruning = false);
198 
200  const Boundary& getBoundary() const;
201 
206 
210  const SUMORTree& getVisualisationSpeedUp() const;
211 
217  GNEJunction* createJunction(const Position& pos, GNEUndoList* undoList);
218 
231  GNEEdge* createEdge(GNEJunction* src, GNEJunction* dest, GNEEdge* tpl, GNEUndoList* undoList,
232  const std::string& suggestedName = "", bool wasSplit = false, bool allowDuplicateGeom = false,
233  bool recomputeConnections = true);
234 
239  void deleteJunction(GNEJunction* junction, GNEUndoList* undoList);
240 
245  void deleteEdge(GNEEdge* edge, GNEUndoList* undoList, bool recomputeConnections);
246 
252  void replaceIncomingEdge(GNEEdge* which, GNEEdge* by, GNEUndoList* undoList);
253 
258  void deleteLane(GNELane* lane, GNEUndoList* undoList, bool recomputeConnections);
259 
264  void deleteConnection(GNEConnection* connection, GNEUndoList* undoList);
265 
270  void deleteCrossing(GNECrossing* crossing, GNEUndoList* undoList);
271 
276  void deleteShape(GNEShape* shape, GNEUndoList* undoList);
277 
282  void deleteAdditional(GNEAdditional* additional, GNEUndoList* undoList);
283 
288  void deleteDemandElement(GNEDemandElement* demandElement, GNEUndoList* undoList);
289 
294  void duplicateLane(GNELane* lane, GNEUndoList* undoList, bool recomputeConnections);
295 
301  bool restrictLane(SUMOVehicleClass vclass, GNELane* lane, GNEUndoList* undoList);
302 
308  bool addRestrictedLane(SUMOVehicleClass vclass, GNEEdge* edge, int index, GNEUndoList* undoList);
309 
315  bool removeRestrictedLane(SUMOVehicleClass vclass, GNEEdge* edge, GNEUndoList* undoList);
316 
322  GNEJunction* splitEdge(GNEEdge* edge, const Position& pos, GNEUndoList* undoList, GNEJunction* newJunction = 0);
323 
329  void splitEdgesBidi(GNEEdge* edge, GNEEdge* oppositeEdge, const Position& pos, GNEUndoList* undoList);
330 
334  void reverseEdge(GNEEdge* edge, GNEUndoList* undoList);
335 
340  GNEEdge* addReversedEdge(GNEEdge* edge, GNEUndoList* undoList);
341 
348  void mergeJunctions(GNEJunction* moved, GNEJunction* target, GNEUndoList* undoList);
349 
352 
358  GNEJunction* retrieveJunction(const std::string& id, bool failHard = true);
359 
365  GNEEdge* retrieveEdge(const std::string& id, bool failHard = true);
366 
372  GNEEdge* retrieveEdge(GNEJunction* from, GNEJunction* to, bool failHard = true);
373 
379  GNEPoly* retrievePolygon(const std::string& id, bool failHard = true) const;
380 
386  GNEPOI* retrievePOI(const std::string& id, bool failHard = true) const;
387 
393  GNEConnection* retrieveConnection(const std::string& id, bool failHard = true) const;
394 
398  std::vector<GNEConnection*> retrieveConnections(bool onlySelected = false) const;
399 
405  GNECrossing* retrieveCrossing(const std::string& id, bool failHard = true) const;
406 
410  std::vector<GNECrossing*> retrieveCrossings(bool onlySelected = false) const;
411 
417  GNEAttributeCarrier* retrieveAttributeCarrier(const GUIGlID id, bool failHard = true);
418 
422  std::vector<GNEAttributeCarrier*> retrieveAttributeCarriers(SumoXMLTag type = SUMO_TAG_NOTHING);
423 
427  std::vector<GNEEdge*> retrieveEdges(bool onlySelected = false);
428 
432  std::vector<GNELane*> retrieveLanes(bool onlySelected = false);
433 
440  GNELane* retrieveLane(const std::string& id, bool failHard = true, bool checkVolatileChange = false);
441 
445  std::vector<GNEJunction*> retrieveJunctions(bool onlySelected = false);
446 
451  std::vector<GNEShape*> retrieveShapes(SumoXMLTag shapeTag, bool onlySelected = false);
452 
456  std::vector<GNEShape*> retrieveShapes(bool onlySelected = false);
457 
459  void requireSaveNet(bool value);
460 
462  bool isNetSaved() const;
463 
467  void save(OptionsCont& oc);
468 
472  void savePlain(OptionsCont& oc);
473 
477  void saveJoined(OptionsCont& oc);
478 
480  void setViewNet(GNEViewNet* viewNet);
481 
484 
487 
489  void renameEdge(GNEEdge* edge, const std::string& newID);
490 
492  void renameJunction(GNEJunction* junction, const std::string& newID);
493 
495  void changeEdgeEndpoints(GNEEdge* edge, const std::string& newSourceID, const std::string& newDestID);
496 
498  GNEViewNet* getViewNet() const;
499 
501  std::vector<GNEAttributeCarrier*> getSelectedAttributeCarriers(bool ignoreCurrentSupermode);
502 
505 
508 
510  void initGNEConnections();
511 
513  void computeAndUpdate(OptionsCont& oc, bool volatileOptions);
514 
522  void computeNetwork(GNEApplicationWindow* window, bool force = false, bool volatileOptions = false, std::string additionalPath = "", std::string demandPath = "");
523 
528 
535  bool joinSelectedJunctions(GNEUndoList* undoList);
536 
538  bool cleanInvalidCrossings(GNEUndoList* undoList);
539 
541  void removeSolitaryJunctions(GNEUndoList* undoList);
542 
544  void cleanUnusedRoutes(GNEUndoList* undoList);
545 
547  void joinRoutes(GNEUndoList* undoList);
548 
550  void cleanInvalidDemandElements(GNEUndoList* undoList);
551 
553  void replaceJunctionByGeometry(GNEJunction* junction, GNEUndoList* undoList);
554 
556  void splitJunction(GNEJunction* junction, bool reconnect, GNEUndoList* undoList);
557 
559  void clearJunctionConnections(GNEJunction* junction, GNEUndoList* undoList);
560 
562  void resetJunctionConnections(GNEJunction* junction, GNEUndoList* undoList);
563 
567  void computeJunction(GNEJunction* junction);
568 
570  void requireRecompute();
571 
573  bool netHasGNECrossings() const;
574 
576  FXApp* getApp();
577 
579  NBNetBuilder* getNetBuilder() const;
580 
582  void addExplicitTurnaround(std::string id);
583 
585  void removeExplicitTurnaround(std::string id);
586 
589 
595  GNEAdditional* retrieveAdditional(SumoXMLTag type, const std::string& id, bool hardFail = true) const;
596 
600  std::vector<GNEAdditional*> retrieveAdditionals(bool onlySelected = false) const;
601 
607 
611  void updateAdditionalID(const std::string& oldID, GNEAdditional* additional);
612 
614  void requireSaveAdditionals(bool value);
615 
619  void saveAdditionals(const std::string& filename);
620 
622  bool isAdditionalsSaved() const;
623 
625  std::string generateAdditionalID(SumoXMLTag type) const;
626 
628 
631 
637  GNEDemandElement* retrieveDemandElement(SumoXMLTag type, const std::string& id, bool hardFail = true) const;
638 
642  std::vector<GNEDemandElement*> retrieveDemandElements(bool onlySelected = false) const;
643 
649 
653  void updateDemandElementID(const std::string& oldID, GNEDemandElement* demandElement);
654 
658  void updateDemandElementBegin(const std::string& oldBegin, GNEDemandElement* demandElement);
659 
661  void requireSaveDemandElements(bool value);
662 
666  void saveDemandElements(const std::string& filename);
667 
669  bool isDemandElementsSaved() const;
670 
672  std::string generateDemandElementID(const std::string& prefix, SumoXMLTag type) const;
673 
675 
678 
687  GNEPoly* addPolygonForEditShapes(GNENetElement* netElement, const PositionVector& shape, bool fill, RGBColor col);
688 
690  void removePolygonForEditShapes(GNEPoly* polygon);
691 
693  std::string generateShapeID(SumoXMLTag shapeTag) const;
694 
696  void changeShapeID(GNEShape* s, const std::string& OldID);
697 
699  int getNumberOfShapes() const;
701 
705  void requireSaveTLSPrograms();
706 
710  void saveTLSPrograms(const std::string& filename);
711 
713  int getNumberOfTLSPrograms() const;
715 
719  void enableUpdateGeometry();
720 
722  void disableUpdateGeometry();
723 
725  bool isUpdateGeometryEnabled() const;
726 
728 
729 protected:
732 
735 
738 
741 
743  // @{
746  // @}
747 
749  std::set<std::string> myExplicitTurnarounds;
750 
753 
756 
759 
762 
765 
768 
771 
773  bool additionalExist(GNEAdditional* additional) const;
774 
778  void insertAdditional(GNEAdditional* additional);
779 
783  bool deleteAdditional(GNEAdditional* additional, bool updateViewAfterDeleting);
784 
786 
789 
791  bool demandElementExist(GNEDemandElement* demandElement) const;
792 
796  void insertDemandElement(GNEDemandElement* demandElement);
797 
801  bool deleteDemandElement(GNEDemandElement* demandElement, bool updateViewAfterDeleting);
802 
804 
805 private:
807  void initJunctionsAndEdges();
808 
810  void insertJunction(GNEJunction* junction);
811 
813  void insertEdge(GNEEdge* edge);
814 
817 
819  GNEEdge* registerEdge(GNEEdge* edge);
820 
822  void deleteSingleJunction(GNEJunction* junction, bool updateViewAfterDeleting);
823 
825  void deleteSingleEdge(GNEEdge* edge, bool updateViewAfterDeleting);
826 
828  void insertShape(GNEShape* shape, bool updateViewAfterDeleting);
829 
831  void removeShape(GNEShape* shape, bool updateViewAfterDeleting);
832 
834  void update();
835 
837  void reserveEdgeID(const std::string& id);
838 
840  void reserveJunctionID(const std::string& id);
841 
843  bool checkJunctionPosition(const Position& pos);
844 
846  void saveAdditionalsConfirmed(const std::string& filename);
847 
849  void saveDemandElementsConfirmed(const std::string& filename);
850 
851  static void replaceInListAttribute(GNEAttributeCarrier* ac, SumoXMLAttr key, const std::string& which, const std::string& by, GNEUndoList* undoList);
852 
855 
857  static const double Z_INITIALIZED;
858 
860  std::map<std::string, int> myEdgesAndNumberOfLanes;
861 
864 
867  FXDECLARE_ABSTRACT(GNEChange_ReplaceEdgeInTLS)
868 
869  public:
872  GNEChange(0, true),
873  myTllcont(tllcont), myReplaced(replaced), myBy(by) { }
874 
877 
879  FXString undoName() const {
880  return "Redo replace in TLS";
881  }
882 
884  FXString redoName() const {
885  return "Undo replace in TLS";
886  }
887 
889  void undo() {
891  }
892 
894  void redo() {
896  }
897 
899  bool trueChange() {
900  return myReplaced != myBy;
901  }
902 
903  private:
906 
909 
912  };
913 
914 };
915 
916 #endif
917 
918 /****************************************************************************/
GNENet::insertAdditional
void insertAdditional(GNEAdditional *additional)
Insert a additional element int GNENet container.
Definition: GNENet.cpp:2709
GNENet::requireSaveNet
void requireSaveNet(bool value)
inform that net has to be saved
Definition: GNENet.cpp:982
GNENet::myUpdateGeometryEnabled
bool myUpdateGeometryEnabled
Flag to enable or disable update geometry of elements after inserting or removing element in net.
Definition: GNENet.h:767
Boundary.h
GNENet::getAttributeCarriers
const AttributeCarriers & getAttributeCarriers() const
retrieve all attribute carriers of Net
Definition: GNENet.cpp:1063
SUMOVehicleClass
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
Definition: SUMOVehicleClass.h:133
GUIGlObject.h
GNENet::retrieveAdditional
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
Definition: GNENet.cpp:2183
GNENet::myJunctionIDSupplier
IDSupplier myJunctionIDSupplier
Definition: GNENet.h:745
GNEDemandElement
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNEDemandElement.h:55
GNERouteHandler
Builds trigger objects for GNENet (busStops, chargingStations, detectors, etc..)
Definition: GNERouteHandler.h:50
GNENet::initJunctionsAndEdges
void initJunctionsAndEdges()
Init Junctions and edges.
Definition: GNENet.cpp:2853
GNEAdditional
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:48
GUIParameterTableWindow
A window containing a gl-object's parameter.
Definition: GUIParameterTableWindow.h:62
GNENet::Z_INITIALIZED
static const double Z_INITIALIZED
marker for whether the z-boundary is initialized
Definition: GNENet.h:857
GNENet::replaceInListAttribute
static void replaceInListAttribute(GNEAttributeCarrier *ac, SumoXMLAttr key, const std::string &which, const std::string &by, GNEUndoList *undoList)
Definition: GNENet.cpp:3252
GNEChange_DemandElement
Definition: GNEChange_DemandElement.h:45
GNENet::generateAdditionalID
std::string generateAdditionalID(SumoXMLTag type) const
generate additional id
Definition: GNENet.cpp:2306
GNENet::myDemandElementsSaved
bool myDemandElementsSaved
Flag to check if demand elements has to be saved.
Definition: GNENet.h:764
GNENet::removeShape
void removeShape(GNEShape *shape, bool updateViewAfterDeleting)
remove created shape (but NOT delete)
Definition: GNENet.cpp:3032
GNENet::AttributeCarriers::junctions
std::map< std::string, GNEJunction * > junctions
map with the name and pointer to junctions of net
Definition: GNENet.h:95
GNENet::cleanInvalidDemandElements
void cleanInvalidDemandElements(GNEUndoList *undoList)
clean invalid demand elements
Definition: GNENet.cpp:1899
GNENet::getNumberOfTLSPrograms
int getNumberOfTLSPrograms() const
get number of TLS Programs
Definition: GNENet.cpp:2671
GNENet::removeExplicitTurnaround
void removeExplicitTurnaround(std::string id)
remove edge id from the list of explicit turnarounds
Definition: GNENet.cpp:2177
GNENet::retrievePOI
GNEPOI * retrievePOI(const std::string &id, bool failHard=true) const
get POI by id
Definition: GNENet.cpp:1115
GNENet::deleteEdge
void deleteEdge(GNEEdge *edge, GNEUndoList *undoList, bool recomputeConnections)
removes edge
Definition: GNENet.cpp:430
GNENet::netHasGNECrossings
bool netHasGNECrossings() const
check if net has GNECrossings
Definition: GNENet.cpp:1575
GUISUMOAbstractView
Definition: GUISUMOAbstractView.h:72
NBEdgeCont
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:60
GNENet::deleteShape
void deleteShape(GNEShape *shape, GNEUndoList *undoList)
remove shape
Definition: GNENet.cpp:619
NBNetBuilder
Instance responsible for building networks.
Definition: NBNetBuilder.h:109
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:1457
NBTrafficLightLogicCont
A container for traffic light definitions and built programs.
Definition: NBTrafficLightLogicCont.h:57
GNENet::resetJunctionConnections
void resetJunctionConnections(GNEJunction *junction, GNEUndoList *undoList)
reset junction's connections
Definition: GNENet.cpp:2083
GNENet::removeGLObjectFromGrid
void removeGLObjectFromGrid(GUIGlObject *o)
add GL Object into net
Definition: GNENet.cpp:1328
GNENet::reserveEdgeID
void reserveEdgeID(const std::string &id)
reserve edge ID (To avoid duplicates)
Definition: GNENet.cpp:3069
GNENet::disableUpdateGeometry
void disableUpdateGeometry()
disable update geometry of elements after inserting or removing an element in net
Definition: GNENet.cpp:2682
GNEPOI
Definition: GNEPOI.h:44
GNENet
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:77
GNENet::insertEdge
void insertEdge(GNEEdge *edge)
inserts a single edge into the net and into the underlying netbuild-container
Definition: GNENet.cpp:2896
GNEChange_Additional
Definition: GNEChange_Additional.h:44
GNENet::AttributeCarriers::vehicleDepartures
std::map< std::string, GNEDemandElement * > vehicleDepartures
special map used for saving Demand Elements of type "Vehicle" (Vehicles, routeFlows,...
Definition: GNENet.h:107
GNENet::saveJoined
void saveJoined(OptionsCont &oc)
save log of joined junctions (and nothing else)
Definition: GNENet.cpp:1018
GNENet::myEdgeIDSupplier
IDSupplier myEdgeIDSupplier
Definition: GNENet.h:744
GNENet::updateAdditionalID
void updateAdditionalID(const std::string &oldID, GNEAdditional *additional)
update additional ID in container
Definition: GNENet.cpp:2222
GNENet::deleteSingleEdge
void deleteSingleEdge(GNEEdge *edge, bool updateViewAfterDeleting)
deletes a single edge
Definition: GNENet.cpp:2975
GNENet::reverseEdge
void reverseEdge(GNEEdge *edge, GNEUndoList *undoList)
reverse edge
Definition: GNENet.cpp:887
GNEPoly
Definition: GNEPoly.h:45
GNENet::deleteAdditional
void deleteAdditional(GNEAdditional *additional, GNEUndoList *undoList)
remove additional
Definition: GNENet.cpp:628
GNENet::getSelectedAttributeCarriers
std::vector< GNEAttributeCarrier * > getSelectedAttributeCarriers(bool ignoreCurrentSupermode)
get all selected attribute carriers (or only relative to current supermode
Definition: GNENet.cpp:2123
GNEChange.h
GNENet::getParameterWindow
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
Definition: GNENet.cpp:202
GNENet::myNeedRecompute
bool myNeedRecompute
whether the net needs recomputation
Definition: GNENet.h:752
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:875
ShapeContainer
Storage for geometrical objects.
Definition: ShapeContainer.h:49
GNENet::GNEChange_ReplaceEdgeInTLS::myReplaced
NBEdge * myReplaced
replaced NBEdge
Definition: GNENet.h:908
IDSupplier
Definition: IDSupplier.h:37
GNENet::retrieveDemandElement
GNEDemandElement * retrieveDemandElement(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named demand element.
Definition: GNENet.cpp:2316
GNENet::requireSaveTLSPrograms
void requireSaveTLSPrograms()
Definition: GNENet.cpp:2646
GNENet::getApp
FXApp * getApp()
get pointer to the main App
Definition: GNENet.cpp:1586
GNENet::myAllowUndoShapes
bool myAllowUndoShapes
flag used to indicate if shaped created can be undo
Definition: GNENet.h:863
GNENet::cleanInvalidCrossings
bool cleanInvalidCrossings(GNEUndoList *undoList)
clear invalid crossings
Definition: GNENet.cpp:1736
GNEViewNet
Definition: GNEViewNet.h:42
GNEApplicationWindow
The main window of the Netedit.
Definition: GNEApplicationWindow.h:58
GNENet::replaceIncomingEdge
void replaceIncomingEdge(GNEEdge *which, GNEEdge *by, GNEUndoList *undoList)
replaces edge
Definition: GNENet.cpp:493
GNENet::update
void update()
notify myViewNet
Definition: GNENet.cpp:3061
GNENet::changeShapeID
void changeShapeID(GNEShape *s, const std::string &OldID)
change Shape ID
Definition: GNENet.cpp:2622
GNEChange_Edge
Definition: GNEChange_Edge.h:47
GNENet::restrictLane
bool restrictLane(SUMOVehicleClass vclass, GNELane *lane, GNEUndoList *undoList)
transform lane to restricted lane
Definition: GNENet.cpp:690
GNENet::drawGL
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GNENet.cpp:212
GNENet::insertJunction
void insertJunction(GNEJunction *junction)
inserts a single junction into the net and into the underlying netbuild-container
Definition: GNENet.cpp:2889
GUIVisualizationSettings.h
SUMO_TAG_NOTHING
@ SUMO_TAG_NOTHING
invalid tag
Definition: SUMOXMLDefinitions.h:43
GNENet::addExplicitTurnaround
void addExplicitTurnaround(std::string id)
add edge id to the list of explicit turnarounds
Definition: GNENet.cpp:2171
GNENet::retrieveConnections
std::vector< GNEConnection * > retrieveConnections(bool onlySelected=false) const
return all connections
Definition: GNENet.cpp:1148
PositionVector
A list of positions.
Definition: PositionVector.h:45
GUIGLObjectPopupMenu
The popup menu of a globject.
Definition: GUIGLObjectPopupMenu.h:47
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:101
GNENet::myViewNet
GNEViewNet * myViewNet
The viewNet to be notofied of about changes.
Definition: GNENet.h:734
GNENet::GNEChange_ReplaceEdgeInTLS::undoName
FXString undoName() const
undo name
Definition: GNENet.h:879
GNENet::getVisualisationSpeedUp
SUMORTree & getVisualisationSpeedUp()
Returns the RTree used for visualisation speed-up.
Definition: GNENet.cpp:301
GNENet::GNEChange_ReplaceEdgeInTLS::trueChange
bool trueChange()
wether original and new value differ
Definition: GNENet.h:899
GNENet::getCenteringBoundary
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Definition: GNENet.cpp:289
GNENet::reserveJunctionID
void reserveJunctionID(const std::string &id)
reserve junction ID (To avoid duplicates)
Definition: GNENet.cpp:3075
GNENet::GNEChange_CalibratorItem
friend class GNEChange_CalibratorItem
Definition: GNENet.h:87
SumoXMLTag
SumoXMLTag
Numbers representing SUMO-XML - element names.
Definition: SUMOXMLDefinitions.h:41
GNENet::deleteCrossing
void deleteCrossing(GNECrossing *crossing, GNEUndoList *undoList)
remove crossing
Definition: GNENet.cpp:602
NBEdge
The representation of a single edge during network building.
Definition: NBEdge.h:91
GNENet::deleteLane
void deleteLane(GNELane *lane, GNEUndoList *undoList, bool recomputeConnections)
removes lane
Definition: GNENet.cpp:549
GNENet::generateShapeID
std::string generateShapeID(SumoXMLTag shapeTag) const
generate Shape ID
Definition: GNENet.cpp:2597
GNENet::setViewNet
void setViewNet(GNEViewNet *viewNet)
Set the viewNet to be notified of network changes.
Definition: GNENet.cpp:1026
GNEEdge
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:51
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:770
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:295
GNENet::retrievePolygon
GNEPoly * retrievePolygon(const std::string &id, bool failHard=true) const
get Polygon by id
Definition: GNENet.cpp:1102
GNENet::AttributeCarriers::edges
std::map< std::string, GNEEdge * > edges
map with the name and pointer to edges of net
Definition: GNENet.h:98
SUMORTree
A RT-tree for efficient storing of SUMO's GL-objects.
Definition: SUMORTree.h:68
GNENet::myNetBuilder
NBNetBuilder * myNetBuilder
The internal netbuilder.
Definition: GNENet.h:737
GNENet::joinSelectedJunctions
bool joinSelectedJunctions(GNEUndoList *undoList)
join selected junctions
Definition: GNENet.cpp:1598
GNENet::registerEdge
GNEEdge * registerEdge(GNEEdge *edge)
registers an edge with GNENet containers
Definition: GNENet.cpp:2932
RGBColor
Definition: RGBColor.h:39
GNENet::getNetBuilder
NBNetBuilder * getNetBuilder() const
get net builder
Definition: GNENet.cpp:1592
GNENet::retrieveLanes
std::vector< GNELane * > retrieveLanes(bool onlySelected=false)
return all lanes
Definition: GNENet.cpp:1213
GNENet::joinRoutes
void joinRoutes(GNEUndoList *undoList)
join routes
Definition: GNENet.cpp:1833
GNECrossing
This object is responsible for drawing a shape and for supplying a a popup menu. Messages are routete...
Definition: GNECrossing.h:44
GNENet::deleteSingleJunction
void deleteSingleJunction(GNEJunction *junction, bool updateViewAfterDeleting)
deletes a single junction
Definition: GNENet.cpp:2954
GNEChange_Junction
Definition: GNEChange_Junction.h:42
GNENet::myEdgesAndNumberOfLanes
std::map< std::string, int > myEdgesAndNumberOfLanes
map with the Edges and their number of lanes
Definition: GNENet.h:860
GNENet::AttributeCarriers
struct used for saving all attribute carriers of net, in different formats
Definition: GNENet.h:93
GNEShape
Definition: GNEShape.h:34
GNENet::computeAndUpdate
void computeAndUpdate(OptionsCont &oc, bool volatileOptions)
recompute the network and update lane geometries
Definition: GNENet.cpp:3094
GNENet::getEdgeCont
NBEdgeCont & getEdgeCont()
returns the NBEdgeCont of the underlying netbuilder
Definition: GNENet.cpp:2153
GNENet::requireSaveAdditionals
void requireSaveAdditionals(bool value)
inform that additionals has to be saved
Definition: GNENet.cpp:2236
GNENet::isAdditionalsSaved
bool isAdditionalsSaved() const
check if additionals are saved
Definition: GNENet.cpp:2300
GNENet::requireSaveDemandElements
void requireSaveDemandElements(bool value)
inform that demand elements has to be saved
Definition: GNENet.cpp:2392
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:1987
GNENet::retrieveDemandElements
std::vector< GNEDemandElement * > retrieveDemandElements(bool onlySelected=false) const
return all demand elements
Definition: GNENet.cpp:2328
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:2568
SUMOVehicleClass.h
GNENet::retrieveShapes
std::vector< GNEShape * > retrieveShapes(SumoXMLTag shapeTag, bool onlySelected=false)
return shape by type shapes
Definition: GNENet.cpp:1274
GNENet::enableUpdateGeometry
void enableUpdateGeometry()
Definition: GNENet.cpp:2676
Boundary
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:41
GNENet::getNumberOfDemandElements
int getNumberOfDemandElements(SumoXMLTag type=SUMO_TAG_NOTHING) const
Returns the number of demand elements of the net.
Definition: GNENet.cpp:2343
GNENet::renameJunction
void renameJunction(GNEJunction *junction, const std::string &newID)
updates the map and reserves new id
Definition: GNENet.cpp:2159
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:326
GNENet::myAdditionalsSaved
bool myAdditionalsSaved
Flag to check if additionals has to be saved.
Definition: GNENet.h:758
GNENet::retrieveJunction
GNEJunction * retrieveJunction(const std::string &id, bool failHard=true)
get junction by id
Definition: GNENet.cpp:1050
GNEChange_Lane
Definition: GNEChange_Lane.h:46
GNENet::addRestrictedLane
bool addRestrictedLane(SUMOVehicleClass vclass, GNEEdge *edge, int index, GNEUndoList *undoList)
add restricted lane to edge
Definition: GNENet.cpp:720
GNENet::retrieveAttributeCarrier
GNEAttributeCarrier * retrieveAttributeCarrier(const GUIGlID id, bool failHard=true)
get a single attribute carrier based on a GLID
Definition: GNENet.cpp:1334
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:38
GNENet::initGNEConnections
void initGNEConnections()
initialize GNEConnections
Definition: GNENet.cpp:3081
GNENet::save
void save(OptionsCont &oc)
save the network
Definition: GNENet.cpp:1000
GNENet::duplicateLane
void duplicateLane(GNELane *lane, GNEUndoList *undoList, bool recomputeConnections)
duplicates lane
Definition: GNENet.cpp:674
GNENet::retrieveCrossings
std::vector< GNECrossing * > retrieveCrossings(bool onlySelected=false) const
return all crossings
Definition: GNENet.cpp:1184
OptionsCont
A storage for options typed value containers)
Definition: OptionsCont.h:89
GNENet::GNEChange_ReplaceEdgeInTLS::redoName
FXString redoName() const
get Redo name
Definition: GNENet.h:884
GNENetElement
Definition: GNENetElement.h:43
GNENet::updateDemandElementBegin
void updateDemandElementBegin(const std::string &oldBegin, GNEDemandElement *demandElement)
update demand element begin in container
Definition: GNENet.cpp:2378
GNEChange_Connection
Definition: GNEChange_Connection.h:44
IDSupplier.h
GUIGlObject
Definition: GUIGlObject.h:65
GNENet::saveDemandElementsConfirmed
void saveDemandElementsConfirmed(const std::string &filename)
save demand elements after confirming invalid objects
Definition: GNENet.cpp:2544
GNENet::registerJunction
GNEJunction * registerJunction(GNEJunction *junction)
registers a junction with GNENet containers
Definition: GNENet.cpp:2907
GNENet::updateDemandElementID
void updateDemandElementID(const std::string &oldID, GNEDemandElement *demandElement)
update demand element ID in container
Definition: GNENet.cpp:2355
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:104
GNENet::myNetSaved
bool myNetSaved
Flag to check if net has to be saved.
Definition: GNENet.h:755
GNENet::deleteConnection
void deleteConnection(GNEConnection *connection, GNEUndoList *undoList)
remove connection
Definition: GNENet.cpp:587
GNENet::isDemandElementsSaved
bool isDemandElementsSaved() const
check if demand elements are saved
Definition: GNENet.cpp:2455
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:217
GNENet::retrieveAdditionals
std::vector< GNEAdditional * > retrieveAdditionals(bool onlySelected=false) const
return all additionals
Definition: GNENet.cpp:2195
GNENet::getViewNet
GNEViewNet * getViewNet() const
get view net
Definition: GNENet.cpp:2117
GNENet::createJunction
GNEJunction * createJunction(const Position &pos, GNEUndoList *undoList)
creates a new junction
Definition: GNENet.cpp:313
GNENet::myAttributeCarriers
AttributeCarriers myAttributeCarriers
AttributeCarriers of net.
Definition: GNENet.h:740
GNENet::replaceJunctionByGeometry
void replaceJunctionByGeometry(GNEJunction *junction, GNEUndoList *undoList)
replace the selected junction by geometry node(s) and merge the edges
Definition: GNENet.cpp:1940
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:935
GNENet::additionalExist
bool additionalExist(GNEAdditional *additional) const
return true if additional exist (use pointer instead ID)
Definition: GNENet.cpp:2697
GNENet::retrieveAttributeCarriers
std::vector< GNEAttributeCarrier * > retrieveAttributeCarriers(SumoXMLTag type=SUMO_TAG_NOTHING)
get the attribute carriers based on Type
Definition: GNENet.cpp:1357
GNENet::retrieveJunctions
std::vector< GNEJunction * > retrieveJunctions(bool onlySelected=false)
return all junctions
Definition: GNENet.cpp:1261
GNENet::myExplicitTurnarounds
std::set< std::string > myExplicitTurnarounds
list of edge ids for which turn-arounds must be added explicitly
Definition: GNENet.h:749
GNENet::getPopUpMenu
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
Definition: GNENet.cpp:192
GNENet::getBoundary
const Boundary & getBoundary() const
returns the bounder of the network
Definition: GNENet.cpp:185
GNENet::retrieveCrossing
GNECrossing * retrieveCrossing(const std::string &id, bool failHard=true) const
get Crossing by id
Definition: GNENet.cpp:1164
GNENet::deleteJunction
void deleteJunction(GNEJunction *junction, GNEUndoList *undoList)
removes junction and all incident edges
Definition: GNENet.cpp:385
GNENet::addGLObjectIntoGrid
void addGLObjectIntoGrid(GUIGlObject *o)
add GL Object into net
Definition: GNENet.cpp:1322
GNENet::~GNENet
~GNENet()
Destructor.
Definition: GNENet.cpp:133
GNENet::getTLLogicCont
NBTrafficLightLogicCont & getTLLogicCont()
returns the tllcont of the underlying netbuilder
Definition: GNENet.cpp:2147
GNENet::saveAdditionals
void saveAdditionals(const std::string &filename)
save additional elements of the network
Definition: GNENet.cpp:2255
GUIMainWindow
Definition: GUIMainWindow.h:46
GNENet::savePlain
void savePlain(OptionsCont &oc)
save plain xml representation of the network (and nothing else)
Definition: GNENet.cpp:1010
GNENet::requireRecompute
void requireRecompute()
inform the net about the need for recomputation
Definition: GNENet.cpp:1569
GNENet::saveTLSPrograms
void saveTLSPrograms(const std::string &filename)
save TLS Programs elements of the network
Definition: GNENet.cpp:2656
GNENet::GNENet
GNENet(NBNetBuilder *netBuilder)
Constructor.
Definition: GNENet.cpp:87
GNENet::addReversedEdge
GNEEdge * addReversedEdge(GNEEdge *edge, GNEUndoList *undoList)
add reversed edge
Definition: GNENet.cpp:900
GNENet::removeSolitaryJunctions
void removeSolitaryJunctions(GNEUndoList *undoList)
removes junctions that have no edges
Definition: GNENet.cpp:1788
GNENet::GNEChange_ReplaceEdgeInTLS::~GNEChange_ReplaceEdgeInTLS
~GNEChange_ReplaceEdgeInTLS()
@bief destructor
Definition: GNENet.h:876
GNENet::saveAdditionalsConfirmed
void saveAdditionalsConfirmed(const std::string &filename)
save additionals after confirming invalid objects
Definition: GNENet.cpp:2487
GUIGlID
unsigned int GUIGlID
Definition: GUIGlObject.h:42
GNENet::removeRestrictedLane
bool removeRestrictedLane(SUMOVehicleClass vclass, GNEEdge *edge, GNEUndoList *undoList)
remove restricted lane
Definition: GNENet.cpp:756
GNENet::myGrid
SUMORTree myGrid
the rtree which contains all GUIGlObjects (so named for historical reasons)
Definition: GNENet.h:731
GNENet::clearJunctionConnections
void clearJunctionConnections(GNEJunction *junction, GNEUndoList *undoList)
clear junction's connections
Definition: GNENet.cpp:2071
GNENet::retrieveEdges
std::vector< GNEEdge * > retrieveEdges(bool onlySelected=false)
return all edges
Definition: GNENet.cpp:1200
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:240
GNENet::retrieveEdge
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true)
get edge by id
Definition: GNENet.cpp:1069
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:1551
GNENet::retrieveLane
GNELane * retrieveLane(const std::string &id, bool failHard=true, bool checkVolatileChange=false)
get lane by id
Definition: GNENet.cpp:1228
GNENet::getNumberOfShapes
int getNumberOfShapes() const
get number of shapes
Definition: GNENet.cpp:2640
config.h
GNENet::renameEdge
void renameEdge(GNEEdge *edge, const std::string &newID)
updates the map and reserves new id
Definition: GNENet.cpp:2094
GNENet::retrieveConnection
GNEConnection * retrieveConnection(const std::string &id, bool failHard=true) const
get Connection by id
Definition: GNENet.cpp:1128
ShapeContainer.h
GNENet::isUpdateGeometryEnabled
bool isUpdateGeometryEnabled() const
check if update geometry after inserting or removing has to be updated
Definition: GNENet.cpp:2688
GNENet::GNEChange_ReplaceEdgeInTLS
class for GNEChange_ReplaceEdgeInTLS
Definition: GNENet.h:866
GNENet::myZBoundary
Boundary myZBoundary
the z boundary (stored in the x-coordinate), values of 0 are ignored
Definition: GNENet.h:854
GNENet::demandElementExist
bool demandElementExist(GNEDemandElement *demandElement) const
return true if demand element exist (use pointer instead ID)
Definition: GNENet.cpp:2765
GNENet::removePolygonForEditShapes
void removePolygonForEditShapes(GNEPoly *polygon)
remove Polygon for edit shapes
Definition: GNENet.cpp:2583
GNENet::GNEChange_ReplaceEdgeInTLS::redo
void redo()
redo action
Definition: GNENet.h:894
GNENet::generateDemandElementID
std::string generateDemandElementID(const std::string &prefix, SumoXMLTag type) const
generate demand element id
Definition: GNENet.cpp:2461
GNEUndoList
Definition: GNEUndoList.h:48
GUIVisualizationSettings
Stores the information about how to visualize structures.
Definition: GUIVisualizationSettings.h:345
NBTrafficLightLogicCont.h
GNEAdditionalHandler
Builds additional objects for GNENet (busStops, chargingStations, detectors, etc.....
Definition: GNEAdditionalHandler.h:47
GNEJunction
Definition: GNEJunction.h:47
GNENet::deleteDemandElement
void deleteDemandElement(GNEDemandElement *demandElement, GNEUndoList *undoList)
remove demand element
Definition: GNENet.cpp:645
GNENet::insertDemandElement
void insertDemandElement(GNEDemandElement *demandElement)
Insert a demand element element int GNENet container.
Definition: GNENet.cpp:2777
GNENet::computeDemandElements
void computeDemandElements(GNEApplicationWindow *window)
compute demand elements param[in] window The window to inform about delay
Definition: GNENet.cpp:1538
SumoXMLAttr
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
Definition: SUMOXMLDefinitions.h:372
GNENet::GNEChange_ReplaceEdgeInTLS::myBy
NBEdge * myBy
replaced by NBEdge
Definition: GNENet.h:911
GNENet::GNEChange_ReplaceEdgeInTLS::GNEChange_ReplaceEdgeInTLS
GNEChange_ReplaceEdgeInTLS(NBTrafficLightLogicCont &tllcont, NBEdge *replaced, NBEdge *by)
constructor
Definition: GNENet.h:871
GNENet::getNumberOfAdditionals
int getNumberOfAdditionals(SumoXMLTag type=SUMO_TAG_NOTHING) const
Returns the number of additionals of the net.
Definition: GNENet.cpp:2210
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:970
GNENet::GNEChange_ReplaceEdgeInTLS::myTllcont
NBTrafficLightLogicCont & myTllcont
container for traffic light logic
Definition: GNENet.h:905
GNEChange
the function-object for an editing operation (abstract base)
Definition: GNEChange.h:42
GNENet::myTLSProgramsSaved
bool myTLSProgramsSaved
Flag to check if shapes has to be saved.
Definition: GNENet.h:761
GNENet::isNetSaved
bool isNetSaved() const
return if net has to be saved
Definition: GNENet.cpp:994
GNENet::cleanUnusedRoutes
void cleanUnusedRoutes(GNEUndoList *undoList)
clean unused routes
Definition: GNENet.cpp:1805
PositionVector.h
GNELane
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:45
GNEChange_Shape
Definition: GNEChange_Shape.h:42
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:2411
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:220
GNENet::changeEdgeEndpoints
void changeEdgeEndpoints(GNEEdge *edge, const std::string &newSourceID, const std::string &newDestID)
modifies endpoins of the given edge
Definition: GNENet.cpp:2107
GNENet::GNEChange_ReplaceEdgeInTLS::undo
void undo()
undo action
Definition: GNENet.h:889
GNENet::insertShape
void insertShape(GNEShape *shape, bool updateViewAfterDeleting)
insert shape
Definition: GNENet.cpp:3000