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-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
17 // The lop level container for GNE-network-components such as GNEEdge and
18 // GNEJunction. Contains an internal instances of NBNetBuilder GNE components
19 // wrap netbuild-components of this underlying NBNetBuilder and supply
20 // visualisation and editing capabilities (adapted from GUINet)
21 //
22 // Workflow (rough draft)
23 // wrap NB-components
24 // do netedit stuff
25 // call NBNetBuilder::buildLoaded to save results
26 //
27 /****************************************************************************/
28 #ifndef GNENet_h
29 #define GNENet_h
30 
31 
32 // ===========================================================================
33 // included modules
34 // ===========================================================================
35 #ifdef _MSC_VER
36 #include <windows_config.h>
37 #else
38 #include <config.h>
39 #endif
40 
41 #include <string>
42 #include <utility>
44 #include <netbuild/NBNetBuilder.h>
45 #include <utils/geom/Boundary.h>
46 #include <utils/geom/Position.h>
53 #include <utils/common/RGBColor.h>
57 #include "GNEChange.h"
58 
59 
60 // ===========================================================================
61 // class declarations
62 // ===========================================================================
63 
64 class GNEAdditional;
67 class GNECalibratorFlow;
68 class GNECalibratorRoute;
70 class GNEConnection;
71 class GNECrossing;
72 class GNEEdge;
73 class GNEJunction;
74 class GNELane;
75 class GNENetElement;
76 class GNEPOI;
77 class GNEPOILane;
78 class GNEPoly;
80 class GNEShape;
81 class GNEUndoList;
82 class GNEViewNet;
83 
84 // ===========================================================================
85 // class definitions
86 // ===========================================================================
91 class GNENet : public GUIGlObject, public ShapeContainer {
92 
94  friend class GNEAdditionalHandler;
95  friend class GNEChange_Junction;
96  friend class GNEChange_Edge;
97  friend class GNEChange_Lane;
98  friend class GNEChange_Connection;
99  friend class GNEChange_Shape;
101  friend class GNEChange_Additional;
102 
103 public:
107  static const RGBColor selectionColor;
108 
111 
114 
118 
123  GNENet(NBNetBuilder* netBuilder);
124 
126  ~GNENet();
127 
130 
138 
147 
154 
156  const Boundary& getZBoundary() const;
157 
162  void drawGL(const GUIVisualizationSettings& s) const;
164 
167 
180  bool addPolygon(const std::string& id, const std::string& type, const RGBColor& color, double layer,
181  double angle, const std::string& imgFile, const PositionVector& shape, bool fill,
182  bool geo, bool ignorePruning = false);
183 
200  bool addPOI(const std::string& id, const std::string& type, const RGBColor& color, const Position& pos, bool geo,
201  const std::string& lane, double posOverLane, double posLat, double layer, double angle,
202  const std::string& imgFile, double width, double height, bool ignorePruning = false);
204 
206  const Boundary& getBoundary() const;
207 
212 
216  const SUMORTree& getVisualisationSpeedUp() const;
217 
223  GNEJunction* createJunction(const Position& pos, GNEUndoList* undoList);
224 
236  GNEEdge* createEdge(GNEJunction* src, GNEJunction* dest, GNEEdge* tpl, GNEUndoList* undoList,
237  const std::string& suggestedName = "", bool wasSplit = false, bool allowDuplicateGeom = false);
238 
243  void deleteJunction(GNEJunction* junction, GNEUndoList* undoList);
244 
249  void deleteEdge(GNEEdge* edge, GNEUndoList* undoList);
250 
256  void replaceIncomingEdge(GNEEdge* which, GNEEdge* by, GNEUndoList* undoList);
257 
262  void deleteLane(GNELane* lane, GNEUndoList* undoList);
263 
268  void deleteConnection(GNEConnection* connection, GNEUndoList* undoList);
269 
274  void deleteCrossing(GNECrossing* crossing, GNEUndoList* undoList);
275 
280  void deleteShape(GNEShape* shape, GNEUndoList* undoList);
281 
286  void duplicateLane(GNELane* lane, GNEUndoList* undoList);
287 
293  bool restrictLane(SUMOVehicleClass vclass, GNELane* lane, GNEUndoList* undoList);
294 
300  bool addSRestrictedLane(SUMOVehicleClass vclass, GNEEdge& edge, GNEUndoList* undoList);
301 
307  bool removeRestrictedLane(SUMOVehicleClass vclass, GNEEdge& edge, GNEUndoList* undoList);
308 
314  GNEJunction* splitEdge(GNEEdge* edge, const Position& pos, GNEUndoList* undoList, GNEJunction* newJunction = 0);
315 
320  void splitEdgesBidi(const std::set<GNEEdge*>& edges, const Position& pos, GNEUndoList* undoList);
321 
325  void reverseEdge(GNEEdge* edge, GNEUndoList* undoList);
326 
331  GNEEdge* addReversedEdge(GNEEdge* edge, GNEUndoList* undoList);
332 
339  void mergeJunctions(GNEJunction* moved, GNEJunction* target, GNEUndoList* undoList);
340 
346  GNEJunction* retrieveJunction(const std::string& id, bool failHard = true);
347 
353  GNEEdge* retrieveEdge(const std::string& id, bool failHard = true);
354 
360  GNEEdge* retrieveEdge(GNEJunction* from, GNEJunction* to, bool failHard = true);
361 
367  GNEPoly* retrievePolygon(const std::string& id, bool failHard = true) const;
368 
374  GNEPOI* retrievePOI(const std::string& id, bool failHard = true) const;
375 
381  GNEPOILane* retrievePOILane(const std::string& id, bool failHard = true) const;
382 
388  GNEAttributeCarrier* retrieveAttributeCarrier(const GUIGlID id, bool failHard = true);
389 
395  std::vector<GNEAttributeCarrier*> retrieveAttributeCarriers(const std::set<GUIGlID>& ids, GUIGlObjectType type);
396 
400  std::vector<GNEEdge*> retrieveEdges(bool onlySelected = false);
401 
405  std::vector<GNELane*> retrieveLanes(bool onlySelected = false);
406 
413  GNELane* retrieveLane(const std::string& id, bool failHard = true, bool checkVolatileChange = false);
414 
418  std::vector<GNEJunction*> retrieveJunctions(bool onlySelected = false);
419 
424  std::vector<GNEShape*> retrieveShapes(SumoXMLTag shapeTag = SUMO_TAG_NOTHING, bool onlySelected = false);
425 
429  void save(OptionsCont& oc);
430 
434  void savePlain(OptionsCont& oc);
435 
439  void saveJoined(OptionsCont& oc);
440 
442  void setViewNet(GNEViewNet* viewNet);
443 
445  void refreshElement(GUIGlObject* o);
446 
448  std::string generateVaporizerID() const;
449 
451  void renameEdge(GNEEdge* edge, const std::string& newID);
452 
454  void renameJunction(GNEJunction* junction, const std::string& newID);
455 
457  void changeEdgeEndpoints(GNEEdge* edge, const std::string& newSourceID, const std::string& newDestID);
458 
460  GNEViewNet* getViewNet() const;
461 
464 
468  std::set<GUIGlID> getGlIDs(GUIGlObjectType type = GLO_MAX);
469 
471  void initGNEConnections();
472 
474  void computeAndUpdate(OptionsCont& oc, bool volatileOptions);
475 
483  void computeEverything(GNEApplicationWindow* window, bool force = false, bool volatileOptions = false, std::string additionalPath = "", std::string shapePath = "");
484 
491  bool joinSelectedJunctions(GNEUndoList* undoList);
492 
494  bool cleanInvalidCrossings(GNEUndoList* undoList);
495 
497  void removeSolitaryJunctions(GNEUndoList* undoList);
498 
500  void replaceJunctionByGeometry(GNEJunction* junction, GNEUndoList* undoList);
501 
503  void clearJunctionConnections(GNEJunction* junction, GNEUndoList* undoList);
504 
506  void resetJunctionConnections(GNEJunction* junction, GNEUndoList* undoList);
507 
511  void computeJunction(GNEJunction* junction);
512 
514  void requireRecompute();
515 
517  bool netHasGNECrossings() const;
518 
520  FXApp* getApp();
521 
523  NBNetBuilder* getNetBuilder() const;
524 
526  void addExplicitTurnaround(std::string id);
527 
529  void removeExplicitTurnaround(std::string id);
530 
533 
538  GNEAdditional* retrieveAdditional(const std::string& id, bool hardFail = true) const;
539 
543  std::vector<GNEAdditional*> retrieveAdditionals(bool onlySelected = false);
544 
550  GNEAdditional* getAdditional(SumoXMLTag type, const std::string& id) const;
551 
556  std::vector<GNEAdditional*> getAdditionals(SumoXMLTag type = SUMO_TAG_NOTHING) const;
557 
558  /* @brief retrieve Rerouter Interval
559  * @param rerouterIntervalID ID of rerouter interval
560  * @param rerouter interval if was found, or NULL in other case
561  */
562  GNERerouterInterval* getRerouterInterval(const std::string& rerouterIntervalID) const;
563 
569 
573  void updateAdditionalID(const std::string& oldID, GNEAdditional* additional);
574 
577 
581  void saveAdditionals(const std::string& filename);
582 
584 
588 
593  GNECalibratorRoute* retrieveCalibratorRoute(const std::string& id, bool hardFail = true) const;
594 
599  GNECalibratorVehicleType* retrieveCalibratorVehicleType(const std::string& id, bool hardFail = true) const;
600 
605  GNECalibratorFlow* retrieveCalibratorFlow(const std::string& id, bool hardFail = true) const;
606 
608  std::string generateCalibratorRouteID() const;
609 
611  std::string generateCalibratorVehicleTypeID() const;
612 
614  std::string generateCalibratorFlowID() const;
615 
617  void changeCalibratorRouteID(GNECalibratorRoute* route, const std::string& oldID);
618 
620  void changeCalibratorVehicleTypeID(GNECalibratorVehicleType* vehicleType, const std::string& oldID);
621 
623  void changeCalibratorFlowID(GNECalibratorFlow* flow, const std::string& oldID);
624 
626 
629 
637  GNEPoly* addPolygonForEditShapes(GNENetElement* netElement, const PositionVector& shape, bool fill);
638 
640  void removePolygonForEditShapes(GNEPoly* polygon);
641 
643  std::string generateShapeID(SumoXMLTag shapeTag) const;
644 
646  void changeShapeID(GNEShape* s, const std::string& OldID);
647 
649  void requiereSaveShapes();
650 
654  void saveShapes(const std::string& filename);
655 
657  int getNumberOfShapes() const;
659 
660 protected:
663 
666 
669 
671  std::map<std::string, GNEJunction*> myJunctions;
672 
674  std::map<std::string, GNEEdge*> myEdges;
675 
677  std::map<std::pair<std::string, SumoXMLTag>, GNEAdditional*> myAdditionals;
678 
680  std::map<std::string, GNECalibratorRoute*> myCalibratorRoutes;
681 
683  std::map<std::string, GNECalibratorVehicleType*> myCalibratorVehicleTypes;
684 
686  std::map<std::string, GNECalibratorFlow*> myCalibratorFlows;
687 
689  // @{
692  // @}
693 
695  std::set<std::string> myExplicitTurnarounds;
696 
699 
702 
705 
708 
712  void insertAdditional(GNEAdditional* additional);
713 
717  void deleteAdditional(GNEAdditional* additional);
718 
720 
723 
728 
733 
738 
743 
748 
753 
755 
756 private:
758  void initJunctionsAndEdges();
759 
761  void insertJunction(GNEJunction* junction);
762 
764  void insertEdge(GNEEdge* edge);
765 
768 
770  GNEEdge* registerEdge(GNEEdge* edge);
771 
773  void deleteSingleJunction(GNEJunction* junction);
774 
776  void deleteSingleEdge(GNEEdge* edge);
777 
779  void insertShape(GNEShape* shape);
780 
782  void removeShape(GNEShape* shape);
783 
785  void update();
786 
788  void reserveEdgeID(const std::string& id);
789 
791  void reserveJunctionID(const std::string& id);
792 
793  /* @brief helper function for changing the endpoints of a junction
794  * @param[in] keepEndpoints Whether to keep the original edge endpoints (influences junction shape)
795  */
796  void remapEdge(GNEEdge* oldEdge, GNEJunction* from, GNEJunction* to, GNEUndoList* undoList, bool preserveShapeStart, bool preserveShapeEnd);
797 
799  bool checkJunctionPosition(const Position& pos);
800 
801  static void replaceInListAttribute(GNEAttributeCarrier* ac, SumoXMLAttr key, const std::string& which, const std::string& by, GNEUndoList* undoList);
802 
805 
807  static const double Z_INITIALIZED;
808 
810  std::map<std::string, int> myEdgesAndNumberOfLanes;
811 
814  FXDECLARE_ABSTRACT(GNEChange_ReplaceEdgeInTLS)
815 
816  public:
819  GNEChange(0, true),
820  myTllcont(tllcont), myReplaced(replaced), myBy(by) { }
821 
824 
826  FXString undoName() const {
827  return "Redo replace in TLS";
828  }
829 
831  FXString redoName() const {
832  return "Undo replace in TLS";
833  }
834 
836  void undo() {
838  }
839 
841  void redo() {
843  }
844 
846  bool trueChange() {
847  return myReplaced != myBy;
848  }
849 
850  private:
853 
856 
859  };
860 
861 };
862 
863 #endif
864 
865 /****************************************************************************/
~GNEChange_ReplaceEdgeInTLS()
destructor
Definition: GNENet.h:823
void setViewNet(GNEViewNet *viewNet)
Set the viewNet to be notified of network changes.
Definition: GNENet.cpp:883
GNEJunction * splitEdge(GNEEdge *edge, const Position &pos, GNEUndoList *undoList, GNEJunction *newJunction=0)
split edge at position by inserting a new junction
Definition: GNENet.cpp:691
void insertCalibratorVehicleType(GNECalibratorVehicleType *vehicleType)
insert Calibrator VehicleType in net
Definition: GNENet.cpp:2095
std::vector< GNEJunction * > retrieveJunctions(bool onlySelected=false)
return all junctions
Definition: GNENet.cpp:1033
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
Definition: GNENet.cpp:209
void initJunctionsAndEdges()
Init Junctions and edges.
Definition: GNENet.cpp:2119
void insertAdditional(GNEAdditional *additional)
Insert a additional element int GNENet container.
Definition: GNENet.cpp:2020
std::vector< GNELane * > retrieveLanes(bool onlySelected=false)
return all lanes
Definition: GNENet.cpp:986
GNEViewNet * myViewNet
The viewNet to be notofied of about changes.
Definition: GNENet.h:665
SumoXMLTag
Numbers representing SUMO-XML - element names.
void requiereSaveAdditionals()
inform that additionals has to be saved
Definition: GNENet.cpp:1736
NBTrafficLightLogicCont & myTllcont
container for traffic light logic
Definition: GNENet.h:852
the function-object for an editing operation (abstract base)
Definition: GNEChange.h:48
std::map< std::string, GNECalibratorFlow * > myCalibratorFlows
map with the name and pointer to Calibrator Flows of net
Definition: GNENet.h:686
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true)
get edge by id
Definition: GNENet.cpp:902
IDSupplier myEdgeIDSupplier
Definition: GNENet.h:690
SUMORTree myGrid
the rtree which contains all GUIGlObjects (so named for historical reasons)
Definition: GNENet.h:662
GUIGlObjectType
FXApp * getApp()
get pointer to the main App
Definition: GNENet.cpp:1325
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
std::map< std::pair< std::string, SumoXMLTag >, GNEAdditional * > myAdditionals
map with the name and pointer to additional elements of net
Definition: GNENet.h:677
void refreshElement(GUIGlObject *o)
refreshes boundary information for o and update
Definition: GNENet.cpp:1082
The main window of the Netedit.
NBNetBuilder * getNetBuilder() const
get net builder
Definition: GNENet.cpp:1331
static const RGBColor selectedLaneColor
color of selected lane
Definition: GNENet.h:110
A container for traffic light definitions and built programs.
GNEAdditional * getAdditional(SumoXMLTag type, const std::string &id) const
Returns the named additional.
Definition: GNENet.cpp:1667
Definition: GNEPOI.h:46
GNEAttributeCarrier * retrieveAttributeCarrier(const GUIGlID id, bool failHard=true)
get a single attribute carrier based on a GLID
Definition: GNENet.cpp:1100
Stores the information about how to visualize structures.
std::set< GUIGlID > getGlIDs(GUIGlObjectType type=GLO_MAX)
get ids of currently active objects
Definition: GNENet.cpp:1138
void removeShape(GNEShape *shape)
remove created shape (but NOT delete)
Definition: GNENet.cpp:2252
void changeCalibratorVehicleTypeID(GNECalibratorVehicleType *vehicleType, const std::string &oldID)
change Calibrator Vehicle Type ID
Definition: GNENet.cpp:1889
The representation of a single edge during network building.
Definition: NBEdge.h:70
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, double width, double height, bool ignorePruning=false)
Builds a POI using the given values and adds it to the container.
Definition: GNENet.cpp:251
GNEPOI * retrievePOI(const std::string &id, bool failHard=true) const
get POI by id
Definition: GNENet.cpp:948
void reverseEdge(GNEEdge *edge, GNEUndoList *undoList)
reverse edge
Definition: GNENet.cpp:754
GNERerouterInterval * getRerouterInterval(const std::string &rerouterIntervalID) const
Definition: GNENet.cpp:1691
void update()
notify myViewNet
Definition: GNENet.cpp:2271
void insertJunction(GNEJunction *junction)
inserts a single junction into the net and into the underlying netbuild-container ...
Definition: GNENet.cpp:2148
void deleteShape(GNEShape *shape, GNEUndoList *undoList)
remove shape
Definition: GNENet.cpp:608
GNEPoly * retrievePolygon(const std::string &id, bool failHard=true) const
get Polygon by id
Definition: GNENet.cpp:935
void deleteConnection(GNEConnection *connection, GNEUndoList *undoList)
remove connection
Definition: GNENet.cpp:570
void resetJunctionConnections(GNEJunction *junction, GNEUndoList *undoList)
reset junction&#39;s connections
Definition: GNENet.cpp:1573
void deleteCalibratorRoute(GNECalibratorRoute *route)
delete Calibrator Route in net
Definition: GNENet.cpp:2063
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:91
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:53
GNEEdge * createEdge(GNEJunction *src, GNEJunction *dest, GNEEdge *tpl, GNEUndoList *undoList, const std::string &suggestedName="", bool wasSplit=false, bool allowDuplicateGeom=false)
creates a new edge (unless an edge with the same geometry already exists)
Definition: GNENet.cpp:323
void addExplicitTurnaround(std::string id)
add edge id to the list of explicit turnarounds
Definition: GNENet.cpp:1628
bool cleanInvalidCrossings(GNEUndoList *undoList)
clear invalid crossings
Definition: GNENet.cpp:1444
int getNumberOfAdditionals(SumoXMLTag type=SUMO_TAG_NOTHING) const
Returns the number of additionals of the net.
Definition: GNENet.cpp:1709
Storage for geometrical objects.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GNENet.cpp:229
void insertEdge(GNEEdge *edge)
inserts a single edge into the net and into the underlying netbuild-container
Definition: GNENet.cpp:2155
void deleteEdge(GNEEdge *edge, GNEUndoList *undoList)
removes edge
Definition: GNENet.cpp:430
const Boundary & getBoundary() const
returns the bounder of the network
Definition: GNENet.cpp:202
std::map< std::string, GNECalibratorVehicleType * > myCalibratorVehicleTypes
map with the name and pointer to Calibrator Vehicle Types of net
Definition: GNENet.h:683
A RT-tree for efficient storing of SUMO&#39;s GL-objects.
Definition: SUMORTree.h:73
GNEJunction * registerJunction(GNEJunction *junction)
registers a junction with GNENet containers
Definition: GNENet.cpp:2166
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:47
void deleteCalibratorVehicleType(GNECalibratorVehicleType *vehicleType)
delete Calibrator VehicleType in net
Definition: GNENet.cpp:2105
bool myNeedRecompute
whether the net needs recomputation
Definition: GNENet.h:698
Builds trigger objects for GNENet (busStops, chargingStations, detectors, etc..)
NBNetBuilder * myNetBuilder
The internal netbuilder.
Definition: GNENet.h:668
bool netHasGNECrossings() const
check if net has GNECrossings
Definition: GNENet.cpp:1314
bool restrictLane(SUMOVehicleClass vclass, GNELane *lane, GNEUndoList *undoList)
transform lane to restricted lane
Definition: GNENet.cpp:635
std::string generateShapeID(SumoXMLTag shapeTag) const
generate Shape ID
Definition: GNENet.cpp:1939
bool myAdditionalsSaved
Flag to check if additionals has to be saved.
Definition: GNENet.h:701
void renameJunction(GNEJunction *junction, const std::string &newID)
updates the map and reserves new id
Definition: GNENet.cpp:1619
GNEPOILane * retrievePOILane(const std::string &id, bool failHard=true) const
get POILane by id
Definition: GNENet.cpp:961
IDSupplier myJunctionIDSupplier
Definition: GNENet.h:691
std::map< std::string, int > myEdgesAndNumberOfLanes
map with the Edges and their number of lanes
Definition: GNENet.h:810
std::vector< GNEShape * > retrieveShapes(SumoXMLTag shapeTag=SUMO_TAG_NOTHING, bool onlySelected=false)
return all shapes
Definition: GNENet.cpp:1045
static const double Z_INITIALIZED
marker for whether the z-boundary is initialized
Definition: GNENet.h:807
static const RGBColor selectedAdditionalColor
color of selected additionals
Definition: GNENet.h:116
std::string generateCalibratorFlowID() const
generate a new Calibrator Flow ID
Definition: GNENet.cpp:1868
void updateAdditionalID(const std::string &oldID, GNEAdditional *additional)
update additional ID in container
Definition: GNENet.cpp:1721
std::string generateCalibratorRouteID() const
generate a new Calibrator Route ID
Definition: GNENet.cpp:1848
bool removeRestrictedLane(SUMOVehicleClass vclass, GNEEdge &edge, GNEUndoList *undoList)
remove restricted lane
Definition: GNENet.cpp:677
NBEdge * myBy
replaced by NBEdge
Definition: GNENet.h:858
This object is responsible for drawing a shape and for supplying a a popup menu. Messages are routete...
Definition: GNECrossing.h:51
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
Definition: GNENet.cpp:219
void insertShape(GNEShape *shape)
insert shape
Definition: GNENet.cpp:2233
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:45
GNEJunction * retrieveJunction(const std::string &id, bool failHard=true)
get junction by id
Definition: GNENet.cpp:889
A list of positions.
bool joinSelectedJunctions(GNEUndoList *undoList)
join selected junctions
Definition: GNENet.cpp:1337
Boundary myZBoundary
the z boundary (stored in the x-coordinate), values of 0 are ignored
Definition: GNENet.h:804
void deleteLane(GNELane *lane, GNEUndoList *undoList)
removes lane
Definition: GNENet.cpp:528
void replaceIncomingEdge(GNEEdge *which, GNEEdge *by, GNEUndoList *undoList)
replaces edge
Definition: GNENet.cpp:475
void insertCalibratorRoute(GNECalibratorRoute *route)
insert Calibrator Route in net
Definition: GNENet.cpp:2053
bool trueChange()
wether original and new value differ
Definition: GNENet.h:846
void changeCalibratorRouteID(GNECalibratorRoute *route, const std::string &oldID)
change Calibrator Route ID
Definition: GNENet.cpp:1878
void deleteCalibratorFlow(GNECalibratorFlow *flow)
delete Calibrator Flow in net
Definition: GNENet.cpp:2084
void computeJunction(GNEJunction *junction)
trigger recomputation of junction shape and logic param[in] window The window to inform about delay ...
Definition: GNENet.cpp:1292
void initGNEConnections()
initialize GNEConnections
Definition: GNENet.cpp:2291
bool addPolygon(const std::string &id, const std::string &type, const RGBColor &color, double layer, double angle, const std::string &imgFile, const PositionVector &shape, bool fill, bool geo, bool ignorePruning=false)
Builds a polygon using the given values and adds it to the container.
Definition: GNENet.cpp:234
void save(OptionsCont &oc)
save the network
Definition: GNENet.cpp:858
void insertCalibratorFlow(GNECalibratorFlow *flow)
insert Calibrator Flow in net
Definition: GNENet.cpp:2074
std::vector< GNEAttributeCarrier * > retrieveAttributeCarriers(const std::set< GUIGlID > &ids, GUIGlObjectType type)
get the attribute carriers based on GlIDs
Definition: GNENet.cpp:1123
void deleteCrossing(GNECrossing *crossing, GNEUndoList *undoList)
remove crossing
Definition: GNENet.cpp:590
void changeShapeID(GNEShape *s, const std::string &OldID)
change Shape ID
Definition: GNENet.cpp:1964
GNEJunction * createJunction(const Position &pos, GNEUndoList *undoList)
creates a new junction
Definition: GNENet.cpp:312
void splitEdgesBidi(const std::set< GNEEdge *> &edges, const Position &pos, GNEUndoList *undoList)
split all edges at position by inserting one new junction
Definition: GNENet.cpp:743
GNECalibratorRoute * retrieveCalibratorRoute(const std::string &id, bool hardFail=true) const
Returns the named calibrator route.
Definition: GNENet.cpp:1800
FXString undoName() const
undo name
Definition: GNENet.h:826
SUMORTree & getVisualisationSpeedUp()
Returns the RTree used for visualisation speed-up.
Definition: GNENet.cpp:300
std::set< std::string > myExplicitTurnarounds
list of edge ids for which turn-arounds must be added explicitly
Definition: GNENet.h:695
std::string generateVaporizerID() const
generate an ID for vaporizers
Definition: GNENet.cpp:1090
bool checkJunctionPosition(const Position &pos)
return true if there are already a Junction in the given position, false in other case ...
Definition: GNENet.cpp:846
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Definition: GNENet.cpp:288
void replaceJunctionByGeometry(GNEJunction *junction, GNEUndoList *undoList)
replace the selected junction by geometry node(s) and merge the edges
Definition: GNENet.cpp:1517
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:56
void undo()
undo action
Definition: GNENet.h:836
unsigned int GUIGlID
Definition: GUIGlObject.h:49
void reserveJunctionID(const std::string &id)
reserve junction ID (To avoid duplicates)
Definition: GNENet.cpp:2285
void changeCalibratorFlowID(GNECalibratorFlow *flow, const std::string &oldID)
change Calibrator Flow ID
Definition: GNENet.cpp:1900
void deleteSingleJunction(GNEJunction *junction)
deletes a single junction
Definition: GNENet.cpp:2201
~GNENet()
Destructor.
Definition: GNENet.cpp:142
const Boundary & getZBoundary() const
Returns the Z boundary (stored in the x() coordinate) values of 0 do not affect the boundary...
Definition: GNENet.cpp:294
std::vector< GNEEdge * > retrieveEdges(bool onlySelected=false)
return all edges
Definition: GNENet.cpp:974
GNEEdge * registerEdge(GNEEdge *edge)
registers an edge with GNENet containers
Definition: GNENet.cpp:2183
GNENet(NBNetBuilder *netBuilder)
Constructor.
Definition: GNENet.cpp:117
An Element which don&#39;t belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:59
Instance responsible for building networks.
Definition: NBNetBuilder.h:115
FXString redoName() const
get Redo name
Definition: GNENet.h:831
void removeSolitaryJunctions(GNEUndoList *undoList)
removes junctions that have no edges
Definition: GNENet.cpp:1500
GNEAdditional * retrieveAdditional(const std::string &id, bool hardFail=true) const
Returns the named additional.
Definition: GNENet.cpp:1640
static const RGBColor selectedConnectionColor
color of selected connection
Definition: GNENet.h:113
A storage for options typed value containers)
Definition: OptionsCont.h:98
std::vector< GNEAdditional * > getAdditionals(SumoXMLTag type=SUMO_TAG_NOTHING) const
get vector with additionals
Definition: GNENet.cpp:1679
The popup menu of a globject.
class for GNEChange_ReplaceEdgeInTLS
Definition: GNENet.h:813
std::string generateCalibratorVehicleTypeID() const
generate a new Calibrator Vehicle Type ID
Definition: GNENet.cpp:1858
void computeEverything(GNEApplicationWindow *window, bool force=false, bool volatileOptions=false, std::string additionalPath="", std::string shapePath="")
trigger full netbuild computation param[in] window The window to inform about delay param[in] force W...
Definition: GNENet.cpp:1235
void clearJunctionConnections(GNEJunction *junction, GNEUndoList *undoList)
clear junction&#39;s connections
Definition: GNENet.cpp:1561
GNECalibratorVehicleType * retrieveCalibratorVehicleType(const std::string &id, bool hardFail=true) const
Returns the named calibrator vehicle type.
Definition: GNENet.cpp:1816
void computeAndUpdate(OptionsCont &oc, bool volatileOptions)
recompute the network and update lane geometries
Definition: GNENet.cpp:2302
int getNumberOfShapes() const
get number of shapes
Definition: GNENet.cpp:2014
void renameEdge(GNEEdge *edge, const std::string &newID)
updates the map and reserves new id
Definition: GNENet.cpp:1584
static void replaceInListAttribute(GNEAttributeCarrier *ac, SumoXMLAttr key, const std::string &which, const std::string &by, GNEUndoList *undoList)
Definition: GNENet.cpp:2393
void deleteJunction(GNEJunction *junction, GNEUndoList *undoList)
removes junction and all incident edges
Definition: GNENet.cpp:378
void removeExplicitTurnaround(std::string id)
remove edge id from the list of explicit turnarounds
Definition: GNENet.cpp:1634
void saveJoined(OptionsCont &oc)
save log of joined junctions (and nothing else)
Definition: GNENet.cpp:875
std::vector< GNEAdditional * > retrieveAdditionals(bool onlySelected=false)
return all additionals
Definition: GNENet.cpp:1655
void deleteAdditional(GNEAdditional *additional)
delete additional element of GNENet container
Definition: GNENet.cpp:2036
GNEEdge * addReversedEdge(GNEEdge *edge, GNEUndoList *undoList)
add reversed edge
Definition: GNENet.cpp:765
void requiereSaveShapes()
inform that shapes has to be saved
Definition: GNENet.cpp:1982
static const RGBColor selectionColor
Definition: GNENet.h:107
empty max
std::map< std::string, GNEJunction * > myJunctions
map with the name and pointer to junctions of net
Definition: GNENet.h:671
void reserveEdgeID(const std::string &id)
reserve edge ID (To avoid duplicates)
Definition: GNENet.cpp:2279
void deleteSingleEdge(GNEEdge *edge)
deletes a single edge
Definition: GNENet.cpp:2214
void redo()
redo action
Definition: GNENet.h:841
void removePolygonForEditShapes(GNEPoly *polygon)
remove Polygon for edit shapes
Definition: GNENet.cpp:1928
void replaceRemoved(NBEdge *removed, int removedLane, NBEdge *by, int byLane)
Replaces occurences of the removed edge/lane in all definitions by the given edge.
GNEPoly * addPolygonForEditShapes(GNENetElement *netElement, const PositionVector &shape, bool fill)
Builds a special polygon used for edit Junctions&#39;s shapes.
Definition: GNENet.cpp:1911
void mergeJunctions(GNEJunction *moved, GNEJunction *target, GNEUndoList *undoList)
merge the given junctions edges between the given junctions will be deleted
Definition: GNENet.cpp:799
std::map< std::string, GNECalibratorRoute * > myCalibratorRoutes
map with the name and pointer to Calibrator Routes of net
Definition: GNENet.h:680
bool addSRestrictedLane(SUMOVehicleClass vclass, GNEEdge &edge, GNEUndoList *undoList)
add restricted lane to edge
Definition: GNENet.cpp:662
GNEChange_ReplaceEdgeInTLS(NBTrafficLightLogicCont &tllcont, NBEdge *replaced, NBEdge *by)
constructor
Definition: GNENet.h:818
GNELane * retrieveLane(const std::string &id, bool failHard=true, bool checkVolatileChange=false)
get lane by id
Definition: GNENet.cpp:1000
void remapEdge(GNEEdge *oldEdge, GNEJunction *from, GNEJunction *to, GNEUndoList *undoList, bool preserveShapeStart, bool preserveShapeEnd)
Definition: GNENet.cpp:822
bool myShapesSaved
Flag to check if shapes hast o be saved.
Definition: GNENet.h:704
A window containing a gl-object&#39;s parameter.
void changeEdgeEndpoints(GNEEdge *edge, const std::string &newSourceID, const std::string &newDestID)
modifies endpoins of the given edge
Definition: GNENet.cpp:1597
NBTrafficLightLogicCont & getTLLogicCont()
returns the tllcont of the underlying netbuilder
Definition: GNENet.cpp:1613
void saveAdditionals(const std::string &filename)
save additional elements of the network
Definition: GNENet.cpp:1746
std::map< std::string, GNEEdge * > myEdges
map with the name and pointer to edges of net
Definition: GNENet.h:674
void savePlain(OptionsCont &oc)
save plain xml representation of the network (and nothing else)
Definition: GNENet.cpp:867
void requireRecompute()
inform the net about the need for recomputation
Definition: GNENet.cpp:1308
void duplicateLane(GNELane *lane, GNEUndoList *undoList)
duplicates lane
Definition: GNENet.cpp:623
GNECalibratorFlow * retrieveCalibratorFlow(const std::string &id, bool hardFail=true) const
Returns the named calibrator flow.
Definition: GNENet.cpp:1832
NBEdge * myReplaced
replaced NBEdge
Definition: GNENet.h:855
GNEViewNet * getViewNet() const
get view net
Definition: GNENet.cpp:1607
void saveShapes(const std::string &filename)
save shapes elements of the network
Definition: GNENet.cpp:1991