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-2018 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 // Workflow (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 <string>
36 #include <utility>
38 #include <netbuild/NBNetBuilder.h>
40 #include <utils/common/RGBColor.h>
42 #include <utils/geom/Boundary.h>
43 #include <utils/geom/Position.h>
52 
53 
54 // ===========================================================================
55 // class declarations
56 // ===========================================================================
57 
58 class GNEAdditional;
61 class GNEConnection;
62 class GNECrossing;
63 class GNEEdge;
64 class GNEJunction;
65 class GNELane;
66 class GNENetElement;
67 class GNEPOI;
68 class GNEPoly;
69 class GNEShape;
70 class GNEUndoList;
71 class GNEViewNet;
72 
73 // ===========================================================================
74 // class definitions
75 // ===========================================================================
80 class GNENet : public GUIGlObject, public ShapeContainer {
81 
83  friend class GNEAdditionalHandler;
84  friend class GNEChange_Junction;
85  friend class GNEChange_Edge;
86  friend class GNEChange_Lane;
87  friend class GNEChange_Connection;
88  friend class GNEChange_Shape;
90  friend class GNEChange_Additional;
91 
92 public:
96  static const RGBColor selectionColor;
97 
100 
103 
107 
112  GNENet(NBNetBuilder* netBuilder);
113 
115  ~GNENet();
116 
119 
127 
136 
143 
145  const Boundary& getZBoundary() const;
146 
151  void drawGL(const GUIVisualizationSettings& s) const;
153 
156 
170  bool addPolygon(const std::string& id, const std::string& type, const RGBColor& color, double layer,
171  double angle, const std::string& imgFile, bool relativePath, const PositionVector& shape, bool fill,
172  bool geo, bool ignorePruning = false);
173 
191  bool addPOI(const std::string& id, const std::string& type, const RGBColor& color, const Position& pos, bool geo,
192  const std::string& lane, double posOverLane, double posLat, double layer, double angle,
193  const std::string& imgFile, bool relativePath, double width, double height, bool ignorePruning = false);
195 
197  const Boundary& getBoundary() const;
198 
203 
207  const SUMORTree& getVisualisationSpeedUp() const;
208 
214  GNEJunction* createJunction(const Position& pos, GNEUndoList* undoList);
215 
228  GNEEdge* createEdge(GNEJunction* src, GNEJunction* dest, GNEEdge* tpl, GNEUndoList* undoList,
229  const std::string& suggestedName = "", bool wasSplit = false, bool allowDuplicateGeom = false,
230  bool recomputeConnections = true);
231 
236  void deleteJunction(GNEJunction* junction, GNEUndoList* undoList);
237 
242  void deleteEdge(GNEEdge* edge, GNEUndoList* undoList, bool recomputeConnections);
243 
249  void replaceIncomingEdge(GNEEdge* which, GNEEdge* by, GNEUndoList* undoList);
250 
255  void deleteLane(GNELane* lane, GNEUndoList* undoList, bool recomputeConnections);
256 
261  void deleteConnection(GNEConnection* connection, GNEUndoList* undoList);
262 
267  void deleteCrossing(GNECrossing* crossing, GNEUndoList* undoList);
268 
273  void deleteShape(GNEShape* shape, GNEUndoList* undoList);
274 
279  void duplicateLane(GNELane* lane, GNEUndoList* undoList, bool recomputeConnections);
280 
286  bool restrictLane(SUMOVehicleClass vclass, GNELane* lane, GNEUndoList* undoList);
287 
293  bool addSRestrictedLane(SUMOVehicleClass vclass, GNEEdge& edge, GNEUndoList* undoList);
294 
300  bool removeRestrictedLane(SUMOVehicleClass vclass, GNEEdge& edge, GNEUndoList* undoList);
301 
307  GNEJunction* splitEdge(GNEEdge* edge, const Position& pos, GNEUndoList* undoList, GNEJunction* newJunction = 0);
308 
313  void splitEdgesBidi(const std::set<GNEEdge*>& edges, const Position& pos, GNEUndoList* undoList);
314 
318  void reverseEdge(GNEEdge* edge, GNEUndoList* undoList);
319 
324  GNEEdge* addReversedEdge(GNEEdge* edge, GNEUndoList* undoList);
325 
332  void mergeJunctions(GNEJunction* moved, GNEJunction* target, GNEUndoList* undoList);
333 
339  GNEJunction* retrieveJunction(const std::string& id, bool failHard = true);
340 
346  GNEEdge* retrieveEdge(const std::string& id, bool failHard = true);
347 
353  GNEEdge* retrieveEdge(GNEJunction* from, GNEJunction* to, bool failHard = true);
354 
360  GNEPoly* retrievePolygon(const std::string& id, bool failHard = true) const;
361 
367  GNEPOI* retrievePOI(const std::string& id, bool failHard = true) const;
368 
374  GNEConnection* retrieveConnection(const std::string& id, bool failHard = true) const;
375 
379  std::vector<GNEConnection*> retrieveConnections(bool onlySelected = false) const;
380 
386  GNECrossing* retrieveCrossing(const std::string& id, bool failHard = true) const;
387 
391  std::vector<GNECrossing*> retrieveCrossings(bool onlySelected = false) const;
392 
398  GNEAttributeCarrier* retrieveAttributeCarrier(const GUIGlID id, bool failHard = true);
399 
403  std::vector<GNEAttributeCarrier*> retrieveAttributeCarriers(SumoXMLTag type = SUMO_TAG_NOTHING);
404 
408  std::vector<GNEEdge*> retrieveEdges(bool onlySelected = false);
409 
413  std::vector<GNELane*> retrieveLanes(bool onlySelected = false);
414 
421  GNELane* retrieveLane(const std::string& id, bool failHard = true, bool checkVolatileChange = false);
422 
426  std::vector<GNEJunction*> retrieveJunctions(bool onlySelected = false);
427 
432  std::vector<GNEShape*> retrieveShapes(SumoXMLTag shapeTag, bool onlySelected = false);
433 
437  std::vector<GNEShape*> retrieveShapes(bool onlySelected = false);
438 
440  void requiereSaveNet(bool value);
441 
443  bool isNetSaved() const;
444 
448  void save(OptionsCont& oc);
449 
453  void savePlain(OptionsCont& oc);
454 
458  void saveJoined(OptionsCont& oc);
459 
461  void setViewNet(GNEViewNet* viewNet);
462 
465 
468 
470  void renameEdge(GNEEdge* edge, const std::string& newID);
471 
473  void renameJunction(GNEJunction* junction, const std::string& newID);
474 
476  void changeEdgeEndpoints(GNEEdge* edge, const std::string& newSourceID, const std::string& newDestID);
477 
479  GNEViewNet* getViewNet() const;
480 
482  std::vector<GNEAttributeCarrier*> getSelectedAttributeCarriers();
483 
486 
488  void initGNEConnections();
489 
491  void computeAndUpdate(OptionsCont& oc, bool volatileOptions);
492 
500  void computeEverything(GNEApplicationWindow* window, bool force = false, bool volatileOptions = false, std::string additionalPath = "", std::string shapePath = "");
501 
508  bool joinSelectedJunctions(GNEUndoList* undoList);
509 
511  bool cleanInvalidCrossings(GNEUndoList* undoList);
512 
514  void removeSolitaryJunctions(GNEUndoList* undoList);
515 
517  void replaceJunctionByGeometry(GNEJunction* junction, GNEUndoList* undoList);
518 
520  void splitJunction(GNEJunction* junction, GNEUndoList* undoList);
521 
523  void clearJunctionConnections(GNEJunction* junction, GNEUndoList* undoList);
524 
526  void resetJunctionConnections(GNEJunction* junction, GNEUndoList* undoList);
527 
531  void computeJunction(GNEJunction* junction);
532 
534  void requireRecompute();
535 
537  bool netHasGNECrossings() const;
538 
540  FXApp* getApp();
541 
543  NBNetBuilder* getNetBuilder() const;
544 
546  void addExplicitTurnaround(std::string id);
547 
549  void removeExplicitTurnaround(std::string id);
550 
553 
559  GNEAdditional* retrieveAdditional(SumoXMLTag type, const std::string& id, bool hardFail = true) const;
560 
564  std::vector<GNEAdditional*> retrieveAdditionals(bool onlySelected = false) const;
565 
570  const std::map<std::string, GNEAdditional*>& getAdditionalByType(SumoXMLTag type) const;
571 
577 
581  void updateAdditionalID(const std::string& oldID, GNEAdditional* additional);
582 
584  void requiereSaveAdditionals(bool value);
585 
589  void saveAdditionals(const std::string& filename);
590 
592  std::string generateAdditionalID(SumoXMLTag type) const;
593 
595 
598 
607  GNEPoly* addPolygonForEditShapes(GNENetElement* netElement, const PositionVector& shape, bool fill, RGBColor col);
608 
610  void removePolygonForEditShapes(GNEPoly* polygon);
611 
613  std::string generateShapeID(SumoXMLTag shapeTag) const;
614 
616  void changeShapeID(GNEShape* s, const std::string& OldID);
617 
619  void requiereSaveShapes(bool value);
620 
624  void saveShapes(const std::string& filename);
625 
627  int getNumberOfShapes() const;
629 
634 
638  void saveTLSPrograms(const std::string& filename);
639 
641  int getNumberOfTLSPrograms() const;
643 
644 protected:
648  std::map<std::string, GNEJunction*> junctions;
649 
651  std::map<std::string, GNEEdge*> edges;
652 
654  std::map<SumoXMLTag, std::map<std::string, GNEAdditional*> > additionals;
655  };
656 
659 
662 
665 
668 
670  // @{
673  // @}
674 
676  std::set<std::string> myExplicitTurnarounds;
677 
680 
683 
686 
689 
692 
695 
699  void insertAdditional(GNEAdditional* additional);
700 
704  void deleteAdditional(GNEAdditional* additional);
705 
707 
708 private:
710  void initJunctionsAndEdges();
711 
713  void insertJunction(GNEJunction* junction);
714 
716  void insertEdge(GNEEdge* edge);
717 
720 
722  GNEEdge* registerEdge(GNEEdge* edge);
723 
725  void deleteSingleJunction(GNEJunction* junction);
726 
728  void deleteSingleEdge(GNEEdge* edge);
729 
731  void insertShape(GNEShape* shape);
732 
734  void removeShape(GNEShape* shape);
735 
737  void update();
738 
740  void reserveEdgeID(const std::string& id);
741 
743  void reserveJunctionID(const std::string& id);
744 
746  bool checkJunctionPosition(const Position& pos);
747 
749  void saveAdditionalsConfirmed(const std::string& filename);
750 
751  static void replaceInListAttribute(GNEAttributeCarrier* ac, SumoXMLAttr key, const std::string& which, const std::string& by, GNEUndoList* undoList);
752 
755 
757  static const double Z_INITIALIZED;
758 
760  std::map<std::string, int> myEdgesAndNumberOfLanes;
761 
764 
767  FXDECLARE_ABSTRACT(GNEChange_ReplaceEdgeInTLS)
768 
769  public:
772  GNEChange(0, true),
773  myTllcont(tllcont), myReplaced(replaced), myBy(by) { }
774 
777 
779  FXString undoName() const {
780  return "Redo replace in TLS";
781  }
782 
784  FXString redoName() const {
785  return "Undo replace in TLS";
786  }
787 
789  void undo() {
790  myTllcont.replaceRemoved(myBy, -1, myReplaced, -1);
791  }
792 
794  void redo() {
795  myTllcont.replaceRemoved(myReplaced, -1, myBy, -1);
796  }
797 
799  bool trueChange() {
800  return myReplaced != myBy;
801  }
802 
803  private:
806 
809 
812  };
813 
814 };
815 
816 #endif
817 
818 /****************************************************************************/
~GNEChange_ReplaceEdgeInTLS()
destructor
Definition: GNENet.h:776
void setViewNet(GNEViewNet *viewNet)
Set the viewNet to be notified of network changes.
Definition: GNENet.cpp:888
GNEJunction * splitEdge(GNEEdge *edge, const Position &pos, GNEUndoList *undoList, GNEJunction *newJunction=0)
split edge at position by inserting a new junction
Definition: GNENet.cpp:676
std::vector< GNEJunction * > retrieveJunctions(bool onlySelected=false)
return all junctions
Definition: GNENet.cpp:1099
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
Definition: GNENet.cpp:195
void initJunctionsAndEdges()
Init Junctions and edges.
Definition: GNENet.cpp:2185
void insertAdditional(GNEAdditional *additional)
Insert a additional element int GNENet container.
Definition: GNENet.cpp:2132
std::vector< GNELane * > retrieveLanes(bool onlySelected=false)
return all lanes
Definition: GNENet.cpp:1051
GNEViewNet * myViewNet
The viewNet to be notofied of about changes.
Definition: GNENet.h:661
SumoXMLTag
Numbers representing SUMO-XML - element names.
NBTrafficLightLogicCont & myTllcont
container for traffic light logic
Definition: GNENet.h:805
the function-object for an editing operation (abstract base)
Definition: GNEChange.h:42
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true)
get edge by id
Definition: GNENet.cpp:907
IDSupplier myEdgeIDSupplier
Definition: GNENet.h:671
SUMORTree myGrid
the rtree which contains all GUIGlObjects (so named for historical reasons)
Definition: GNENet.h:658
std::map< std::string, GNEEdge * > edges
map with the name and pointer to edges of net
Definition: GNENet.h:651
FXApp * getApp()
get pointer to the main App
Definition: GNENet.cpp:1393
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
The main window of the Netedit.
NBNetBuilder * getNetBuilder() const
get net builder
Definition: GNENet.cpp:1399
static const RGBColor selectedLaneColor
color of selected lane
Definition: GNENet.h:99
A container for traffic light definitions and built programs.
std::map< SumoXMLTag, std::map< std::string, GNEAdditional * > > additionals
map with the name and pointer to additional elements of net
Definition: GNENet.h:654
Definition: GNEPOI.h:44
GNEAttributeCarrier * retrieveAttributeCarrier(const GUIGlID id, bool failHard=true)
get a single attribute carrier based on a GLID
Definition: GNENet.cpp:1173
Stores the information about how to visualize structures.
void removeShape(GNEShape *shape)
remove created shape (but NOT delete)
Definition: GNENet.cpp:2348
GNEConnection * retrieveConnection(const std::string &id, bool failHard=true) const
get Connection by id
Definition: GNENet.cpp:966
The representation of a single edge during network building.
Definition: NBEdge.h:65
GNEPOI * retrievePOI(const std::string &id, bool failHard=true) const
get POI by id
Definition: GNENet.cpp:953
void reverseEdge(GNEEdge *edge, GNEUndoList *undoList)
reverse edge
Definition: GNENet.cpp:753
void update()
notify myViewNet
Definition: GNENet.cpp:2376
void insertJunction(GNEJunction *junction)
inserts a single junction into the net and into the underlying netbuild-container ...
Definition: GNENet.cpp:2214
void deleteShape(GNEShape *shape, GNEUndoList *undoList)
remove shape
Definition: GNENet.cpp:596
GNEPoly * retrievePolygon(const std::string &id, bool failHard=true) const
get Polygon by id
Definition: GNENet.cpp:940
void deleteConnection(GNEConnection *connection, GNEUndoList *undoList)
remove connection
Definition: GNENet.cpp:564
void resetJunctionConnections(GNEJunction *junction, GNEUndoList *undoList)
reset junction&#39;s connections
Definition: GNENet.cpp:1703
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:80
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:327
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:47
std::vector< GNEConnection * > retrieveConnections(bool onlySelected=false) const
return all connections
Definition: GNENet.cpp:986
void addExplicitTurnaround(std::string id)
add edge id to the list of explicit turnarounds
Definition: GNENet.cpp:1775
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 fill, bool geo, bool ignorePruning=false)
Builds a polygon using the given values and adds it to the container.
Definition: GNENet.cpp:220
bool myAllowUndoShapes
flag used to indicate if shaped created can be undo
Definition: GNENet.h:763
bool cleanInvalidCrossings(GNEUndoList *undoList)
clear invalid crossings
Definition: GNENet.cpp:1545
int getNumberOfAdditionals(SumoXMLTag type=SUMO_TAG_NOTHING) const
Returns the number of additionals of the net.
Definition: GNENet.cpp:1820
Storage for geometrical objects.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GNENet.cpp:215
void insertEdge(GNEEdge *edge)
inserts a single edge into the net and into the underlying netbuild-container
Definition: GNENet.cpp:2221
const Boundary & getBoundary() const
returns the bounder of the network
Definition: GNENet.cpp:188
std::vector< GNEAttributeCarrier * > getSelectedAttributeCarriers()
get all selected attribute carriers
Definition: GNENet.cpp:1743
A RT-tree for efficient storing of SUMO&#39;s GL-objects.
Definition: SUMORTree.h:69
GNEJunction * registerJunction(GNEJunction *junction)
registers a junction with GNENet containers
Definition: GNENet.cpp:2232
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:42
bool myNeedRecompute
whether the net needs recomputation
Definition: GNENet.h:679
Builds trigger objects for GNENet (busStops, chargingStations, detectors, etc..)
NBNetBuilder * myNetBuilder
The internal netbuilder.
Definition: GNENet.h:664
bool netHasGNECrossings() const
check if net has GNECrossings
Definition: GNENet.cpp:1382
void saveTLSPrograms(const std::string &filename)
save TLS Programs elements of the network
Definition: GNENet.cpp:2111
bool restrictLane(SUMOVehicleClass vclass, GNELane *lane, GNEUndoList *undoList)
transform lane to restricted lane
Definition: GNENet.cpp:617
std::string generateShapeID(SumoXMLTag shapeTag) const
generate Shape ID
Definition: GNENet.cpp:2014
bool myAdditionalsSaved
Flag to check if additionals has to be saved.
Definition: GNENet.h:685
void renameJunction(GNEJunction *junction, const std::string &newID)
updates the map and reserves new id
Definition: GNENet.cpp:1763
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
Definition: GNENet.cpp:1787
IDSupplier myJunctionIDSupplier
Definition: GNENet.h:672
std::map< std::string, int > myEdgesAndNumberOfLanes
map with the Edges and their number of lanes
Definition: GNENet.h:760
static const double Z_INITIALIZED
marker for whether the z-boundary is initialized
Definition: GNENet.h:757
static const RGBColor selectedAdditionalColor
color of selected additionals
Definition: GNENet.h:105
void updateAdditionalID(const std::string &oldID, GNEAdditional *additional)
update additional ID in container
Definition: GNENet.cpp:1832
void splitJunction(GNEJunction *junction, GNEUndoList *undoList)
replace the selected junction by a list of junctions for each unique edge endpoint ...
Definition: GNENet.cpp:1659
bool removeRestrictedLane(SUMOVehicleClass vclass, GNEEdge &edge, GNEUndoList *undoList)
remove restricted lane
Definition: GNENet.cpp:662
NBEdge * myBy
replaced by NBEdge
Definition: GNENet.h:811
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:1983
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:1915
void deleteLane(GNELane *lane, GNEUndoList *undoList, bool recomputeConnections)
removes lane
Definition: GNENet.cpp:528
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
Definition: GNENet.cpp:205
void insertShape(GNEShape *shape)
insert shape
Definition: GNENet.cpp:2320
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
GNEJunction * retrieveJunction(const std::string &id, bool failHard=true)
get junction by id
Definition: GNENet.cpp:894
A list of positions.
bool joinSelectedJunctions(GNEUndoList *undoList)
join selected junctions
Definition: GNENet.cpp:1405
Boundary myZBoundary
the z boundary (stored in the x-coordinate), values of 0 are ignored
Definition: GNENet.h:754
void removeGLObjectFromGrid(GUIGlObject *o)
add GL Object into net
Definition: GNENet.cpp:1167
void replaceIncomingEdge(GNEEdge *which, GNEEdge *by, GNEUndoList *undoList)
replaces edge
Definition: GNENet.cpp:483
bool trueChange()
wether original and new value differ
Definition: GNENet.h:799
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:243
void computeJunction(GNEJunction *junction)
trigger recomputation of junction shape and logic param[in] window The window to inform about delay ...
Definition: GNENet.cpp:1358
void requiereSaveAdditionals(bool value)
inform that additionals has to be saved
Definition: GNENet.cpp:1846
void initGNEConnections()
initialize GNEConnections
Definition: GNENet.cpp:2396
void save(OptionsCont &oc)
save the network
Definition: GNENet.cpp:862
void deleteCrossing(GNECrossing *crossing, GNEUndoList *undoList)
remove crossing
Definition: GNENet.cpp:579
void changeShapeID(GNEShape *s, const std::string &OldID)
change Shape ID
Definition: GNENet.cpp:2039
GNEJunction * createJunction(const Position &pos, GNEUndoList *undoList)
creates a new junction
Definition: GNENet.cpp:316
std::vector< GNEShape * > retrieveShapes(SumoXMLTag shapeTag, bool onlySelected=false)
return shape by type shapes
Definition: GNENet.cpp:1112
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:742
FXString undoName() const
undo name
Definition: GNENet.h:779
SUMORTree & getVisualisationSpeedUp()
Returns the RTree used for visualisation speed-up.
Definition: GNENet.cpp:304
std::vector< GNEAttributeCarrier * > retrieveAttributeCarriers(SumoXMLTag type=SUMO_TAG_NOTHING)
get the attribute carriers based on Type
Definition: GNENet.cpp:1196
std::set< std::string > myExplicitTurnarounds
list of edge ids for which turn-arounds must be added explicitly
Definition: GNENet.h:676
bool checkJunctionPosition(const Position &pos)
return true if there are already a Junction in the given position, false in other case ...
Definition: GNENet.cpp:832
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Definition: GNENet.cpp:292
void replaceJunctionByGeometry(GNEJunction *junction, GNEUndoList *undoList)
replace the selected junction by geometry node(s) and merge the edges
Definition: GNENet.cpp:1614
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:50
void undo()
undo action
Definition: GNENet.h:789
unsigned int GUIGlID
Definition: GUIGlObject.h:43
void reserveJunctionID(const std::string &id)
reserve junction ID (To avoid duplicates)
Definition: GNENet.cpp:2390
friend class GNEChange_CalibratorItem
Definition: GNENet.h:89
void duplicateLane(GNELane *lane, GNEUndoList *undoList, bool recomputeConnections)
duplicates lane
Definition: GNENet.cpp:605
GNECrossing * retrieveCrossing(const std::string &id, bool failHard=true) const
get Crossing by id
Definition: GNENet.cpp:1002
void deleteSingleJunction(GNEJunction *junction)
deletes a single junction
Definition: GNENet.cpp:2279
~GNENet()
Destructor.
Definition: GNENet.cpp:148
const Boundary & getZBoundary() const
Returns the Z boundary (stored in the x() coordinate) values of 0 do not affect the boundary...
Definition: GNENet.cpp:298
std::string generateAdditionalID(SumoXMLTag type) const
generate additional id
Definition: GNENet.cpp:1905
void deleteEdge(GNEEdge *edge, GNEUndoList *undoList, bool recomputeConnections)
removes edge
Definition: GNENet.cpp:431
std::vector< GNEEdge * > retrieveEdges(bool onlySelected=false)
return all edges
Definition: GNENet.cpp:1038
GNEEdge * registerEdge(GNEEdge *edge)
registers an edge with GNENet containers
Definition: GNENet.cpp:2257
GNENet(NBNetBuilder *netBuilder)
Constructor.
Definition: GNENet.cpp:112
An Element which don&#39;t belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:53
std::vector< GNEAdditional * > retrieveAdditionals(bool onlySelected=false) const
return all additionals
Definition: GNENet.cpp:1799
Instance responsible for building networks.
Definition: NBNetBuilder.h:109
FXString redoName() const
get Redo name
Definition: GNENet.h:784
void removeSolitaryJunctions(GNEUndoList *undoList)
removes junctions that have no edges
Definition: GNENet.cpp:1597
void requiereSaveNet(bool value)
inform that net has to be saved
Definition: GNENet.cpp:844
static const RGBColor selectedConnectionColor
color of selected connection
Definition: GNENet.h:102
struct used for saving all attribute carriers of net, in different formats
Definition: GNENet.h:646
AttributeCarriers myAttributeCarriers
AttributeCarriers of net.
Definition: GNENet.h:667
A storage for options typed value containers)
Definition: OptionsCont.h:92
The popup menu of a globject.
class for GNEChange_ReplaceEdgeInTLS
Definition: GNENet.h:766
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:1286
void clearJunctionConnections(GNEJunction *junction, GNEUndoList *undoList)
clear junction&#39;s connections
Definition: GNENet.cpp:1691
void computeAndUpdate(OptionsCont &oc, bool volatileOptions)
recompute the network and update lane geometries
Definition: GNENet.cpp:2407
int getNumberOfShapes() const
get number of shapes
Definition: GNENet.cpp:2095
void renameEdge(GNEEdge *edge, const std::string &newID)
updates the map and reserves new id
Definition: GNENet.cpp:1714
static void replaceInListAttribute(GNEAttributeCarrier *ac, SumoXMLAttr key, const std::string &which, const std::string &by, GNEUndoList *undoList)
Definition: GNENet.cpp:2534
void deleteJunction(GNEJunction *junction, GNEUndoList *undoList)
removes junction and all incident edges
Definition: GNENet.cpp:386
bool myTLSProgramsSaved
Flag to check if shapes has to be saved.
Definition: GNENet.h:691
std::map< std::string, GNEJunction * > junctions
map with the name and pointer to junctions of net
Definition: GNENet.h:648
std::vector< GNECrossing * > retrieveCrossings(bool onlySelected=false) const
return all crossings
Definition: GNENet.cpp:1022
void removeExplicitTurnaround(std::string id)
remove edge id from the list of explicit turnarounds
Definition: GNENet.cpp:1781
void saveJoined(OptionsCont &oc)
save log of joined junctions (and nothing else)
Definition: GNENet.cpp:880
const std::map< std::string, GNEAdditional * > & getAdditionalByType(SumoXMLTag type) const
get map with IDs and pointers to additionals
Definition: GNENet.cpp:1814
void deleteAdditional(GNEAdditional *additional)
delete additional element of GNENet container
Definition: GNENet.cpp:2155
GNEEdge * addReversedEdge(GNEEdge *edge, GNEUndoList *undoList)
add reversed edge
Definition: GNENet.cpp:764
static const RGBColor selectionColor
Definition: GNENet.h:96
void reserveEdgeID(const std::string &id)
reserve edge ID (To avoid duplicates)
Definition: GNENet.cpp:2384
void deleteSingleEdge(GNEEdge *edge)
deletes a single edge
Definition: GNENet.cpp:2297
void redo()
redo action
Definition: GNENet.h:794
void removePolygonForEditShapes(GNEPoly *polygon)
remove Polygon for edit shapes
Definition: GNENet.cpp:2000
void mergeJunctions(GNEJunction *moved, GNEJunction *target, GNEUndoList *undoList)
merge the given junctions edges between the given junctions will be deleted
Definition: GNENet.cpp:797
void requiereSaveTLSPrograms()
Definition: GNENet.cpp:2101
void addGLObjectIntoGrid(GUIGlObject *o)
add GL Object into net
Definition: GNENet.cpp:1160
bool addSRestrictedLane(SUMOVehicleClass vclass, GNEEdge &edge, GNEUndoList *undoList)
add restricted lane to edge
Definition: GNENet.cpp:647
GNEChange_ReplaceEdgeInTLS(NBTrafficLightLogicCont &tllcont, NBEdge *replaced, NBEdge *by)
constructor
Definition: GNENet.h:771
GNELane * retrieveLane(const std::string &id, bool failHard=true, bool checkVolatileChange=false)
get lane by id
Definition: GNENet.cpp:1066
bool myShapesSaved
Flag to check if shapes has to be saved.
Definition: GNENet.h:688
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:1727
NBTrafficLightLogicCont & getTLLogicCont()
returns the tllcont of the underlying netbuilder
Definition: GNENet.cpp:1757
int getNumberOfTLSPrograms() const
get number of TLS Programs
Definition: GNENet.cpp:2126
void saveAdditionals(const std::string &filename)
save additional elements of the network
Definition: GNENet.cpp:1865
bool myNetSaved
Flag to check if net has to be saved.
Definition: GNENet.h:682
void savePlain(OptionsCont &oc)
save plain xml representation of the network (and nothing else)
Definition: GNENet.cpp:872
void requireRecompute()
inform the net about the need for recomputation
Definition: GNENet.cpp:1376
bool isNetSaved() const
return if net has to be saved
Definition: GNENet.cpp:856
void requiereSaveShapes(bool value)
inform that shapes has to be saved
Definition: GNENet.cpp:2057
NBEdge * myReplaced
replaced NBEdge
Definition: GNENet.h:808
GNEViewNet * getViewNet() const
get view net
Definition: GNENet.cpp:1737
void saveShapes(const std::string &filename)
save shapes elements of the network
Definition: GNENet.cpp:2074