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() {
891  myTllcont.replaceRemoved(myBy, -1, myReplaced, -1);
892  }
893 
895  void redo() {
896  myTllcont.replaceRemoved(myReplaced, -1, myBy, -1);
897  }
898 
900  bool trueChange() {
901  return myReplaced != myBy;
902  }
903 
904  private:
907 
910 
913  };
914 
915 };
916 
917 #endif
918 
919 /****************************************************************************/
~GNEChange_ReplaceEdgeInTLS()
destructor
Definition: GNENet.h:877
void setViewNet(GNEViewNet *viewNet)
Set the viewNet to be notified of network changes.
Definition: GNENet.cpp:977
const AttributeCarriers & getAttributeCarriers() const
retrieve all attribute carriers of Net
Definition: GNENet.cpp:1014
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
bool addRestrictedLane(SUMOVehicleClass vclass, GNEEdge &edge, int index, GNEUndoList *undoList)
add restricted lane to edge
Definition: GNENet.cpp:702
std::vector< GNEJunction * > retrieveJunctions(bool onlySelected=false)
return all junctions
Definition: GNENet.cpp:1212
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
Definition: GNENet.cpp:193
void initJunctionsAndEdges()
Init Junctions and edges.
Definition: GNENet.cpp:2803
void insertAdditional(GNEAdditional *additional)
Insert a additional element int GNENet container.
Definition: GNENet.cpp:2659
std::vector< GNELane * > retrieveLanes(bool onlySelected=false)
return all lanes
Definition: GNENet.cpp:1164
GNEViewNet * myViewNet
The viewNet to be notofied of about changes.
Definition: GNENet.h:735
SumoXMLTag
Numbers representing SUMO-XML - element names.
NBTrafficLightLogicCont & myTllcont
container for traffic light logic
Definition: GNENet.h:906
the function-object for an editing operation (abstract base)
Definition: GNEChange.h:43
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true)
get edge by id
Definition: GNENet.cpp:1020
IDSupplier myEdgeIDSupplier
Definition: GNENet.h:745
SUMORTree myGrid
the rtree which contains all GUIGlObjects (so named for historical reasons)
Definition: GNENet.h:732
std::map< std::string, GNEEdge * > edges
map with the name and pointer to edges of net
Definition: GNENet.h:99
FXApp * getApp()
get pointer to the main App
Definition: GNENet.cpp:1537
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
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
The main window of the Netedit.
NBNetBuilder * getNetBuilder() const
get net builder
Definition: GNENet.cpp:1543
A container for traffic light definitions and built programs.
void deleteDemandElement(GNEDemandElement *demandElement, GNEUndoList *undoList)
remove demand element
Definition: GNENet.cpp:638
void deleteSingleEdge(GNEEdge *edge, bool updateViewAfterDeleting)
deletes a single edge
Definition: GNENet.cpp:2918
std::map< SumoXMLTag, std::map< std::string, GNEAdditional * > > additionals
map with the name and pointer to additional elements of net
Definition: GNENet.h:102
Definition: GNEPOI.h:45
GNEAttributeCarrier * retrieveAttributeCarrier(const GUIGlID id, bool failHard=true)
get a single attribute carrier based on a GLID
Definition: GNENet.cpp:1285
Stores the information about how to visualize structures.
std::vector< GNEAttributeCarrier * > getSelectedAttributeCarriers(bool ignoreCurrentSupermode)
get all selected attribute carriers (or only relative to current supermode
Definition: GNENet.cpp:2073
GNEConnection * retrieveConnection(const std::string &id, bool failHard=true) const
get Connection by id
Definition: GNENet.cpp:1079
The representation of a single edge during network building.
Definition: NBEdge.h:86
GNEPOI * retrievePOI(const std::string &id, bool failHard=true) const
get POI by id
Definition: GNENet.cpp:1066
void saveDemandElementsConfirmed(const std::string &filename)
save demand elements after confirming invalid objects
Definition: GNENet.cpp:2494
void reverseEdge(GNEEdge *edge, GNEUndoList *undoList)
reverse edge
Definition: GNENet.cpp:838
void update()
notify myViewNet
Definition: GNENet.cpp:3004
void insertJunction(GNEJunction *junction)
inserts a single junction into the net and into the underlying netbuild-container ...
Definition: GNENet.cpp:2832
void deleteShape(GNEShape *shape, GNEUndoList *undoList)
remove shape
Definition: GNENet.cpp:616
GNEPoly * retrievePolygon(const std::string &id, bool failHard=true) const
get Polygon by id
Definition: GNENet.cpp:1053
void deleteConnection(GNEConnection *connection, GNEUndoList *undoList)
remove connection
Definition: GNENet.cpp:584
void resetJunctionConnections(GNEJunction *junction, GNEUndoList *undoList)
reset junction&#39;s connections
Definition: GNENet.cpp:2033
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:78
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
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:46
std::vector< GNEConnection * > retrieveConnections(bool onlySelected=false) const
return all connections
Definition: GNENet.cpp:1099
void addExplicitTurnaround(std::string id)
add edge id to the list of explicit turnarounds
Definition: GNENet.cpp:2121
bool myAllowUndoShapes
flag used to indicate if shaped created can be undo
Definition: GNENet.h:864
bool cleanInvalidCrossings(GNEUndoList *undoList)
clear invalid crossings
Definition: GNENet.cpp:1687
int getNumberOfAdditionals(SumoXMLTag type=SUMO_TAG_NOTHING) const
Returns the number of additionals of the net.
Definition: GNENet.cpp:2160
Storage for geometrical objects.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GNENet.cpp:213
void insertEdge(GNEEdge *edge)
inserts a single edge into the net and into the underlying netbuild-container
Definition: GNENet.cpp:2839
std::map< std::string, GNEDemandElement * > vehicleDepartures
special map used for saving Demand Elements of type "Vehicle" (Vehicles, routeFlows, etc.) sorted by depart time
Definition: GNENet.h:108
const Boundary & getBoundary() const
returns the bounder of the network
Definition: GNENet.cpp:186
A RT-tree for efficient storing of SUMO&#39;s GL-objects.
Definition: SUMORTree.h:69
void cleanInvalidDemandElements(GNEUndoList *undoList)
clean invalid demand elements
Definition: GNENet.cpp:1850
GNEJunction * registerJunction(GNEJunction *junction)
registers a junction with GNENet containers
Definition: GNENet.cpp:2850
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:42
bool myNeedRecompute
whether the net needs recomputation
Definition: GNENet.h:753
Builds additional objects for GNENet (busStops, chargingStations, detectors, etc..)
NBNetBuilder * myNetBuilder
The internal netbuilder.
Definition: GNENet.h:738
bool netHasGNECrossings() const
check if net has GNECrossings
Definition: GNENet.cpp:1526
bool isDemandElementsSaved() const
check if demand elements are saved
Definition: GNENet.cpp:2405
void saveTLSPrograms(const std::string &filename)
save TLS Programs elements of the network
Definition: GNENet.cpp:2606
bool restrictLane(SUMOVehicleClass vclass, GNELane *lane, GNEUndoList *undoList)
transform lane to restricted lane
Definition: GNENet.cpp:672
std::string generateShapeID(SumoXMLTag shapeTag) const
generate Shape ID
Definition: GNENet.cpp:2547
void joinRoutes(GNEUndoList *undoList)
join routes
Definition: GNENet.cpp:1784
bool myAdditionalsSaved
Flag to check if additionals has to be saved.
Definition: GNENet.h:759
void renameJunction(GNEJunction *junction, const std::string &newID)
updates the map and reserves new id
Definition: GNENet.cpp:2109
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
Definition: GNENet.cpp:2133
IDSupplier myJunctionIDSupplier
Definition: GNENet.h:746
std::map< std::string, int > myEdgesAndNumberOfLanes
map with the Edges and their number of lanes
Definition: GNENet.h:861
static const double Z_INITIALIZED
marker for whether the z-boundary is initialized
Definition: GNENet.h:858
void removeShape(GNEShape *shape, bool updateViewAfterDeleting)
remove created shape (but NOT delete)
Definition: GNENet.cpp:2975
void updateAdditionalID(const std::string &oldID, GNEAdditional *additional)
update additional ID in container
Definition: GNENet.cpp:2172
bool removeRestrictedLane(SUMOVehicleClass vclass, GNEEdge &edge, GNEUndoList *undoList)
remove restricted lane
Definition: GNENet.cpp:738
std::vector< GNEDemandElement * > retrieveDemandElements(bool onlySelected=false) const
return all demand elements
Definition: GNENet.cpp:2278
NBEdge * myBy
replaced by NBEdge
Definition: GNENet.h:912
void deleteAdditional(GNEAdditional *additional, GNEUndoList *undoList)
remove additional
Definition: GNENet.cpp:625
GNEPoly * addPolygonForEditShapes(GNENetElement *netElement, const PositionVector &shape, bool fill, RGBColor col)
Builds a special polygon used for edit Junctions&#39;s shapes.
Definition: GNENet.cpp:2518
This object is responsible for drawing a shape and for supplying a a popup menu. Messages are routete...
Definition: GNECrossing.h:45
void saveAdditionalsConfirmed(const std::string &filename)
save additionals after confirming invalid objects
Definition: GNENet.cpp:2437
void enableUpdateGeometry()
Definition: GNENet.cpp:2626
void deleteLane(GNELane *lane, GNEUndoList *undoList, bool recomputeConnections)
removes lane
Definition: GNENet.cpp:546
NBEdgeCont & getEdgeCont()
returns the NBEdgeCont of the underlying netbuilder
Definition: GNENet.cpp:2103
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
Definition: GNENet.cpp:203
GNEDemandElement * retrieveDemandElement(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named demand element.
Definition: GNENet.cpp:2266
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
bool isUpdateGeometryEnabled() const
check if update geometry after inserting or removing has to be updated
Definition: GNENet.cpp:2638
GNEJunction * retrieveJunction(const std::string &id, bool failHard=true)
get junction by id
Definition: GNENet.cpp:1001
A list of positions.
bool joinSelectedJunctions(GNEUndoList *undoList)
join selected junctions
Definition: GNENet.cpp:1549
Boundary myZBoundary
the z boundary (stored in the x-coordinate), values of 0 are ignored
Definition: GNENet.h:855
void removeGLObjectFromGrid(GUIGlObject *o)
add GL Object into net
Definition: GNENet.cpp:1279
void replaceIncomingEdge(GNEEdge *which, GNEEdge *by, GNEUndoList *undoList)
replaces edge
Definition: GNENet.cpp:490
bool trueChange()
wether original and new value differ
Definition: GNENet.h:900
int getNumberOfDemandElements(SumoXMLTag type=SUMO_TAG_NOTHING) const
Returns the number of demand elements of the net.
Definition: GNENet.cpp:2293
bool additionalExist(GNEAdditional *additional) const
return true if additional exist (use pointer instead ID)
Definition: GNENet.cpp:2647
void requiereSaveDemandElements(bool value)
inform that demand elements has to be saved
Definition: GNENet.cpp:2342
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
void computeJunction(GNEJunction *junction)
trigger recomputation of junction shape and logic param[in] window The window to inform about delay ...
Definition: GNENet.cpp:1502
void requiereSaveAdditionals(bool value)
inform that additionals has to be saved
Definition: GNENet.cpp:2186
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:61
void initGNEConnections()
initialize GNEConnections
Definition: GNENet.cpp:3024
bool isAdditionalsSaved() const
check if additionals are saved
Definition: GNENet.cpp:2250
void updateDemandElementID(const std::string &oldID, GNEDemandElement *demandElement)
update demand element ID in container
Definition: GNENet.cpp:2305
std::map< SumoXMLTag, std::map< std::string, GNEDemandElement * > > demandElements
map with the name and pointer to demand elements of net
Definition: GNENet.h:105
void save(OptionsCont &oc)
save the network
Definition: GNENet.cpp:951
void cleanUnusedRoutes(GNEUndoList *undoList)
clean unused routes
Definition: GNENet.cpp:1756
void deleteCrossing(GNECrossing *crossing, GNEUndoList *undoList)
remove crossing
Definition: GNENet.cpp:599
void changeShapeID(GNEShape *s, const std::string &OldID)
change Shape ID
Definition: GNENet.cpp:2572
GNEJunction * createJunction(const Position &pos, GNEUndoList *undoList)
creates a new junction
Definition: GNENet.cpp:314
std::vector< GNEShape * > retrieveShapes(SumoXMLTag shapeTag, bool onlySelected=false)
return shape by type shapes
Definition: GNENet.cpp:1225
std::string generateDemandElementID(const std::string &prefix, SumoXMLTag type) const
generate demand element id
Definition: GNENet.cpp:2411
FXString undoName() const
undo name
Definition: GNENet.h:880
void insertShape(GNEShape *shape, bool updateViewAfterDeleting)
insert shape
Definition: GNENet.cpp:2943
SUMORTree & getVisualisationSpeedUp()
Returns the RTree used for visualisation speed-up.
Definition: GNENet.cpp:302
std::vector< GNEAttributeCarrier * > retrieveAttributeCarriers(SumoXMLTag type=SUMO_TAG_NOTHING)
get the attribute carriers based on Type
Definition: GNENet.cpp:1308
std::set< std::string > myExplicitTurnarounds
list of edge ids for which turn-arounds must be added explicitly
Definition: GNENet.h:750
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
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Definition: GNENet.cpp:290
void replaceJunctionByGeometry(GNEJunction *junction, GNEUndoList *undoList)
replace the selected junction by geometry node(s) and merge the edges
Definition: GNENet.cpp:1891
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:50
void undo()
undo action
Definition: GNENet.h:890
unsigned int GUIGlID
Definition: GUIGlObject.h:43
void reserveJunctionID(const std::string &id)
reserve junction ID (To avoid duplicates)
Definition: GNENet.cpp:3018
friend class GNEChange_CalibratorItem
Definition: GNENet.h:88
void duplicateLane(GNELane *lane, GNEUndoList *undoList, bool recomputeConnections)
duplicates lane
Definition: GNENet.cpp:656
void updateDemandElementBegin(const std::string &oldBegin, GNEDemandElement *demandElement)
update demand element begin in container
Definition: GNENet.cpp:2328
GNECrossing * retrieveCrossing(const std::string &id, bool failHard=true) const
get Crossing by id
Definition: GNENet.cpp:1115
Builds trigger objects for GNENet (busStops, chargingStations, detectors, etc..)
bool myDemandElementsSaved
Flag to check if demand elements has to be saved.
Definition: GNENet.h:765
~GNENet()
Destructor.
Definition: GNENet.cpp:134
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
std::string generateAdditionalID(SumoXMLTag type) const
generate additional id
Definition: GNENet.cpp:2256
void deleteEdge(GNEEdge *edge, GNEUndoList *undoList, bool recomputeConnections)
removes edge
Definition: GNENet.cpp:429
std::vector< GNEEdge * > retrieveEdges(bool onlySelected=false)
return all edges
Definition: GNENet.cpp:1151
GNEEdge * registerEdge(GNEEdge *edge)
registers an edge with GNENet containers
Definition: GNENet.cpp:2875
GNENet(NBNetBuilder *netBuilder)
Constructor.
Definition: GNENet.cpp:88
An Element which don&#39;t belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:47
std::vector< GNEAdditional * > retrieveAdditionals(bool onlySelected=false) const
return all additionals
Definition: GNENet.cpp:2145
Instance responsible for building networks.
Definition: NBNetBuilder.h:110
FXString redoName() const
get Redo name
Definition: GNENet.h:885
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
void removeSolitaryJunctions(GNEUndoList *undoList)
removes junctions that have no edges
Definition: GNENet.cpp:1739
bool myUpdateGeometryEnabled
Flag to enable or disable update geometry of elements after inserting or removing element in net...
Definition: GNENet.h:768
void requiereSaveNet(bool value)
inform that net has to be saved
Definition: GNENet.cpp:933
struct used for saving all attribute carriers of net, in different formats
Definition: GNENet.h:94
AttributeCarriers myAttributeCarriers
AttributeCarriers of net.
Definition: GNENet.h:741
A storage for options typed value containers)
Definition: OptionsCont.h:90
void deleteSingleJunction(GNEJunction *junction, bool updateViewAfterDeleting)
deletes a single junction
Definition: GNENet.cpp:2897
The popup menu of a globject.
void computeDemandElements(GNEApplicationWindow *window)
compute demand elements param[in] window The window to inform about delay
Definition: GNENet.cpp:1489
class for GNEChange_ReplaceEdgeInTLS
Definition: GNENet.h:867
void clearJunctionConnections(GNEJunction *junction, GNEUndoList *undoList)
clear junction&#39;s connections
Definition: GNENet.cpp:2021
void computeAndUpdate(OptionsCont &oc, bool volatileOptions)
recompute the network and update lane geometries
Definition: GNENet.cpp:3037
int getNumberOfShapes() const
get number of shapes
Definition: GNENet.cpp:2590
void renameEdge(GNEEdge *edge, const std::string &newID)
updates the map and reserves new id
Definition: GNENet.cpp:2044
static void replaceInListAttribute(GNEAttributeCarrier *ac, SumoXMLAttr key, const std::string &which, const std::string &by, GNEUndoList *undoList)
Definition: GNENet.cpp:3195
void deleteJunction(GNEJunction *junction, GNEUndoList *undoList)
removes junction and all incident edges
Definition: GNENet.cpp:384
bool myTLSProgramsSaved
Flag to check if shapes has to be saved.
Definition: GNENet.h:762
std::map< std::string, GNEJunction * > junctions
map with the name and pointer to junctions of net
Definition: GNENet.h:96
std::vector< GNECrossing * > retrieveCrossings(bool onlySelected=false) const
return all crossings
Definition: GNENet.cpp:1135
void removeExplicitTurnaround(std::string id)
remove edge id from the list of explicit turnarounds
Definition: GNENet.cpp:2127
void saveJoined(OptionsCont &oc)
save log of joined junctions (and nothing else)
Definition: GNENet.cpp:969
GNEEdge * addReversedEdge(GNEEdge *edge, GNEUndoList *undoList)
add reversed edge
Definition: GNENet.cpp:851
void saveDemandElements(const std::string &filename)
save demand element elements of the network
Definition: GNENet.cpp:2361
void reserveEdgeID(const std::string &id)
reserve edge ID (To avoid duplicates)
Definition: GNENet.cpp:3012
void disableUpdateGeometry()
disable update geometry of elements after inserting or removing an element in net ...
Definition: GNENet.cpp:2632
void redo()
redo action
Definition: GNENet.h:895
bool demandElementExist(GNEDemandElement *demandElement) const
return true if demand element exist (use pointer instead ID)
Definition: GNENet.cpp:2715
void removePolygonForEditShapes(GNEPoly *polygon)
remove Polygon for edit shapes
Definition: GNENet.cpp:2533
void mergeJunctions(GNEJunction *moved, GNEJunction *target, GNEUndoList *undoList)
merge the given junctions edges between the given junctions will be deleted
Definition: GNENet.cpp:886
void requiereSaveTLSPrograms()
Definition: GNENet.cpp:2596
void addGLObjectIntoGrid(GUIGlObject *o)
add GL Object into net
Definition: GNENet.cpp:1273
GNEChange_ReplaceEdgeInTLS(NBTrafficLightLogicCont &tllcont, NBEdge *replaced, NBEdge *by)
constructor
Definition: GNENet.h:872
GNELane * retrieveLane(const std::string &id, bool failHard=true, bool checkVolatileChange=false)
get lane by id
Definition: GNENet.cpp:1179
A window containing a gl-object&#39;s parameter.
void insertDemandElement(GNEDemandElement *demandElement)
Insert a demand element element int GNENet container.
Definition: GNENet.cpp:2727
void changeEdgeEndpoints(GNEEdge *edge, const std::string &newSourceID, const std::string &newDestID)
modifies endpoins of the given edge
Definition: GNENet.cpp:2057
NBTrafficLightLogicCont & getTLLogicCont()
returns the tllcont of the underlying netbuilder
Definition: GNENet.cpp:2097
int getNumberOfTLSPrograms() const
get number of TLS Programs
Definition: GNENet.cpp:2621
void saveAdditionals(const std::string &filename)
save additional elements of the network
Definition: GNENet.cpp:2205
bool myNetSaved
Flag to check if net has to be saved.
Definition: GNENet.h:756
void savePlain(OptionsCont &oc)
save plain xml representation of the network (and nothing else)
Definition: GNENet.cpp:961
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
void requireRecompute()
inform the net about the need for recomputation
Definition: GNENet.cpp:1520
bool isNetSaved() const
return if net has to be saved
Definition: GNENet.cpp:945
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
An Element which don&#39;t belongs to GNENet but has influency in the simulation.
NBEdge * myReplaced
replaced NBEdge
Definition: GNENet.h:909
GNEViewNet * getViewNet() const
get view net
Definition: GNENet.cpp:2067