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 <fx.h>
41 #include <utils/geom/Boundary.h>
48 
49 
50 // ===========================================================================
51 // class declarations
52 // ===========================================================================
53 
54 class NBNetBuilder;
55 class GNEAdditional;
58 class GNEConnection;
59 class GNECrossing;
60 class GNEEdge;
61 class GNEJunction;
62 class GNELane;
63 class GNENetElement;
64 class GNEPOI;
65 class GNEPoly;
66 class GNEShape;
67 class GNEUndoList;
68 class GNEViewNet;
69 
70 // ===========================================================================
71 // class definitions
72 // ===========================================================================
77 class GNENet : public GUIGlObject, public ShapeContainer {
78 
80  friend class GNEAdditionalHandler;
81  friend class GNEChange_Junction;
82  friend class GNEChange_Edge;
83  friend class GNEChange_Lane;
84  friend class GNEChange_Connection;
85  friend class GNEChange_Shape;
87  friend class GNEChange_Additional;
88 
89 public:
94  GNENet(NBNetBuilder* netBuilder);
95 
97  ~GNENet();
98 
101 
109 
118 
125 
127  const Boundary& getZBoundary() const;
128 
133  void drawGL(const GUIVisualizationSettings& s) const;
135 
138 
153  bool addPolygon(const std::string& id, const std::string& type, const RGBColor& color, double layer,
154  double angle, const std::string& imgFile, bool relativePath, const PositionVector& shape,
155  bool geo, bool fill, double lineWidth, bool ignorePruning = false);
156 
174  bool addPOI(const std::string& id, const std::string& type, const RGBColor& color, const Position& pos, bool geo,
175  const std::string& lane, double posOverLane, double posLat, double layer, double angle,
176  const std::string& imgFile, bool relativePath, double width, double height, bool ignorePruning = false);
178 
180  const Boundary& getBoundary() const;
181 
186 
190  const SUMORTree& getVisualisationSpeedUp() const;
191 
197  GNEJunction* createJunction(const Position& pos, GNEUndoList* undoList);
198 
211  GNEEdge* createEdge(GNEJunction* src, GNEJunction* dest, GNEEdge* tpl, GNEUndoList* undoList,
212  const std::string& suggestedName = "", bool wasSplit = false, bool allowDuplicateGeom = false,
213  bool recomputeConnections = true);
214 
219  void deleteJunction(GNEJunction* junction, GNEUndoList* undoList);
220 
225  void deleteEdge(GNEEdge* edge, GNEUndoList* undoList, bool recomputeConnections);
226 
232  void replaceIncomingEdge(GNEEdge* which, GNEEdge* by, GNEUndoList* undoList);
233 
238  void deleteLane(GNELane* lane, GNEUndoList* undoList, bool recomputeConnections);
239 
244  void deleteConnection(GNEConnection* connection, GNEUndoList* undoList);
245 
250  void deleteCrossing(GNECrossing* crossing, GNEUndoList* undoList);
251 
256  void deleteShape(GNEShape* shape, GNEUndoList* undoList);
257 
262  void duplicateLane(GNELane* lane, GNEUndoList* undoList, bool recomputeConnections);
263 
269  bool restrictLane(SUMOVehicleClass vclass, GNELane* lane, GNEUndoList* undoList);
270 
276  bool addRestrictedLane(SUMOVehicleClass vclass, GNEEdge& edge, int index, GNEUndoList* undoList);
277 
283  bool removeRestrictedLane(SUMOVehicleClass vclass, GNEEdge& edge, GNEUndoList* undoList);
284 
290  GNEJunction* splitEdge(GNEEdge* edge, const Position& pos, GNEUndoList* undoList, GNEJunction* newJunction = 0);
291 
297  void splitEdgesBidi(GNEEdge* edge, GNEEdge* oppositeEdge, const Position& pos, GNEUndoList* undoList);
298 
302  void reverseEdge(GNEEdge* edge, GNEUndoList* undoList);
303 
308  GNEEdge* addReversedEdge(GNEEdge* edge, GNEUndoList* undoList);
309 
316  void mergeJunctions(GNEJunction* moved, GNEJunction* target, GNEUndoList* undoList);
317 
323  GNEJunction* retrieveJunction(const std::string& id, bool failHard = true);
324 
330  GNEEdge* retrieveEdge(const std::string& id, bool failHard = true);
331 
337  GNEEdge* retrieveEdge(GNEJunction* from, GNEJunction* to, bool failHard = true);
338 
344  GNEPoly* retrievePolygon(const std::string& id, bool failHard = true) const;
345 
351  GNEPOI* retrievePOI(const std::string& id, bool failHard = true) const;
352 
358  GNEConnection* retrieveConnection(const std::string& id, bool failHard = true) const;
359 
363  std::vector<GNEConnection*> retrieveConnections(bool onlySelected = false) const;
364 
370  GNECrossing* retrieveCrossing(const std::string& id, bool failHard = true) const;
371 
375  std::vector<GNECrossing*> retrieveCrossings(bool onlySelected = false) const;
376 
382  GNEAttributeCarrier* retrieveAttributeCarrier(const GUIGlID id, bool failHard = true);
383 
387  std::vector<GNEAttributeCarrier*> retrieveAttributeCarriers(SumoXMLTag type = SUMO_TAG_NOTHING);
388 
392  std::vector<GNEEdge*> retrieveEdges(bool onlySelected = false);
393 
397  std::vector<GNELane*> retrieveLanes(bool onlySelected = false);
398 
405  GNELane* retrieveLane(const std::string& id, bool failHard = true, bool checkVolatileChange = false);
406 
410  std::vector<GNEJunction*> retrieveJunctions(bool onlySelected = false);
411 
416  std::vector<GNEShape*> retrieveShapes(SumoXMLTag shapeTag, bool onlySelected = false);
417 
421  std::vector<GNEShape*> retrieveShapes(bool onlySelected = false);
422 
424  void requiereSaveNet(bool value);
425 
427  bool isNetSaved() const;
428 
432  void save(OptionsCont& oc);
433 
437  void savePlain(OptionsCont& oc);
438 
442  void saveJoined(OptionsCont& oc);
443 
445  void setViewNet(GNEViewNet* viewNet);
446 
449 
452 
454  void renameEdge(GNEEdge* edge, const std::string& newID);
455 
457  void renameJunction(GNEJunction* junction, const std::string& newID);
458 
460  void changeEdgeEndpoints(GNEEdge* edge, const std::string& newSourceID, const std::string& newDestID);
461 
463  GNEViewNet* getViewNet() const;
464 
466  std::vector<GNEAttributeCarrier*> getSelectedAttributeCarriers();
467 
470 
473 
475  void initGNEConnections();
476 
478  void computeAndUpdate(OptionsCont& oc, bool volatileOptions);
479 
487  void computeEverything(GNEApplicationWindow* window, bool force = false, bool volatileOptions = false, std::string additionalPath = "", std::string shapePath = "");
488 
495  bool joinSelectedJunctions(GNEUndoList* undoList);
496 
498  bool cleanInvalidCrossings(GNEUndoList* undoList);
499 
501  void removeSolitaryJunctions(GNEUndoList* undoList);
502 
504  void replaceJunctionByGeometry(GNEJunction* junction, GNEUndoList* undoList);
505 
507  void splitJunction(GNEJunction* junction, GNEUndoList* undoList);
508 
510  void clearJunctionConnections(GNEJunction* junction, GNEUndoList* undoList);
511 
513  void resetJunctionConnections(GNEJunction* junction, GNEUndoList* undoList);
514 
518  void computeJunction(GNEJunction* junction);
519 
521  void requireRecompute();
522 
524  bool netHasGNECrossings() const;
525 
527  FXApp* getApp();
528 
530  NBNetBuilder* getNetBuilder() const;
531 
533  void addExplicitTurnaround(std::string id);
534 
536  void removeExplicitTurnaround(std::string id);
537 
540 
546  GNEAdditional* retrieveAdditional(SumoXMLTag type, const std::string& id, bool hardFail = true) const;
547 
551  std::vector<GNEAdditional*> retrieveAdditionals(bool onlySelected = false) const;
552 
557  const std::map<std::string, GNEAdditional*>& getAdditionalByType(SumoXMLTag type) const;
558 
564 
568  void updateAdditionalID(const std::string& oldID, GNEAdditional* additional);
569 
571  void requiereSaveAdditionals(bool value);
572 
576  void saveAdditionals(const std::string& filename);
577 
579  std::string generateAdditionalID(SumoXMLTag type) const;
580 
582 
585 
594  GNEPoly* addPolygonForEditShapes(GNENetElement* netElement, const PositionVector& shape, bool fill, RGBColor col);
595 
597  void removePolygonForEditShapes(GNEPoly* polygon);
598 
600  std::string generateShapeID(SumoXMLTag shapeTag) const;
601 
603  void changeShapeID(GNEShape* s, const std::string& OldID);
604 
606  void requiereSaveShapes(bool value);
607 
611  void saveShapes(const std::string& filename);
612 
614  int getNumberOfShapes() const;
616 
621 
625  void saveTLSPrograms(const std::string& filename);
626 
628  int getNumberOfTLSPrograms() const;
630 
631 protected:
635  std::map<std::string, GNEJunction*> junctions;
636 
638  std::map<std::string, GNEEdge*> edges;
639 
641  std::map<SumoXMLTag, std::map<std::string, GNEAdditional*> > additionals;
642  };
643 
646 
649 
652 
655 
657  // @{
660  // @}
661 
663  std::set<std::string> myExplicitTurnarounds;
664 
667 
670 
673 
676 
679 
682 
684  bool additionalExist(GNEAdditional* additional);
685 
689  void insertAdditional(GNEAdditional* additional);
690 
694  bool deleteAdditional(GNEAdditional* additional);
695 
697 
698 private:
700  void initJunctionsAndEdges();
701 
703  void insertJunction(GNEJunction* junction);
704 
706  void insertEdge(GNEEdge* edge);
707 
710 
712  GNEEdge* registerEdge(GNEEdge* edge);
713 
715  void deleteSingleJunction(GNEJunction* junction);
716 
718  void deleteSingleEdge(GNEEdge* edge);
719 
721  void insertShape(GNEShape* shape);
722 
724  void removeShape(GNEShape* shape);
725 
727  void update();
728 
730  void reserveEdgeID(const std::string& id);
731 
733  void reserveJunctionID(const std::string& id);
734 
736  bool checkJunctionPosition(const Position& pos);
737 
739  void saveAdditionalsConfirmed(const std::string& filename);
740 
741  static void replaceInListAttribute(GNEAttributeCarrier* ac, SumoXMLAttr key, const std::string& which, const std::string& by, GNEUndoList* undoList);
742 
745 
747  static const double Z_INITIALIZED;
748 
750  std::map<std::string, int> myEdgesAndNumberOfLanes;
751 
754 
757  FXDECLARE_ABSTRACT(GNEChange_ReplaceEdgeInTLS)
758 
759  public:
762  GNEChange(0, true),
763  myTllcont(tllcont), myReplaced(replaced), myBy(by) { }
764 
767 
769  FXString undoName() const {
770  return "Redo replace in TLS";
771  }
772 
774  FXString redoName() const {
775  return "Undo replace in TLS";
776  }
777 
779  void undo() {
780  myTllcont.replaceRemoved(myBy, -1, myReplaced, -1);
781  }
782 
784  void redo() {
785  myTllcont.replaceRemoved(myReplaced, -1, myBy, -1);
786  }
787 
789  bool trueChange() {
790  return myReplaced != myBy;
791  }
792 
793  private:
796 
799 
802  };
803 
804 };
805 
806 #endif
807 
808 /****************************************************************************/
~GNEChange_ReplaceEdgeInTLS()
destructor
Definition: GNENet.h:766
void setViewNet(GNEViewNet *viewNet)
Set the viewNet to be notified of network changes.
Definition: GNENet.cpp:881
GNEJunction * splitEdge(GNEEdge *edge, const Position &pos, GNEUndoList *undoList, GNEJunction *newJunction=0)
split edge at position by inserting a new junction
Definition: GNENet.cpp:656
bool addRestrictedLane(SUMOVehicleClass vclass, GNEEdge &edge, int index, GNEUndoList *undoList)
add restricted lane to edge
Definition: GNENet.cpp:623
std::vector< GNEJunction * > retrieveJunctions(bool onlySelected=false)
return all junctions
Definition: GNENet.cpp:1092
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
Definition: GNENet.cpp:171
void initJunctionsAndEdges()
Init Junctions and edges.
Definition: GNENet.cpp:2207
void insertAdditional(GNEAdditional *additional)
Insert a additional element int GNENet container.
Definition: GNENet.cpp:2144
std::vector< GNELane * > retrieveLanes(bool onlySelected=false)
return all lanes
Definition: GNENet.cpp:1044
GNEViewNet * myViewNet
The viewNet to be notofied of about changes.
Definition: GNENet.h:648
SumoXMLTag
Numbers representing SUMO-XML - element names.
NBTrafficLightLogicCont & myTllcont
container for traffic light logic
Definition: GNENet.h:795
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:900
IDSupplier myEdgeIDSupplier
Definition: GNENet.h:658
SUMORTree myGrid
the rtree which contains all GUIGlObjects (so named for historical reasons)
Definition: GNENet.h:645
std::map< std::string, GNEEdge * > edges
map with the name and pointer to edges of net
Definition: GNENet.h:638
FXApp * getApp()
get pointer to the main App
Definition: GNENet.cpp:1386
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
The main window of the Netedit.
bool additionalExist(GNEAdditional *additional)
return true if additional exist (use pointer instead ID)
Definition: GNENet.cpp:2127
NBNetBuilder * getNetBuilder() const
get net builder
Definition: GNENet.cpp:1392
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:641
Definition: GNEPOI.h:45
GNEAttributeCarrier * retrieveAttributeCarrier(const GUIGlID id, bool failHard=true)
get a single attribute carrier based on a GLID
Definition: GNENet.cpp:1166
Stores the information about how to visualize structures.
void removeShape(GNEShape *shape)
remove created shape (but NOT delete)
Definition: GNENet.cpp:2370
GNEConnection * retrieveConnection(const std::string &id, bool failHard=true) const
get Connection by id
Definition: GNENet.cpp:959
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:946
void reverseEdge(GNEEdge *edge, GNEUndoList *undoList)
reverse edge
Definition: GNENet.cpp:742
void update()
notify myViewNet
Definition: GNENet.cpp:2398
void insertJunction(GNEJunction *junction)
inserts a single junction into the net and into the underlying netbuild-container ...
Definition: GNENet.cpp:2236
void deleteShape(GNEShape *shape, GNEUndoList *undoList)
remove shape
Definition: GNENet.cpp:572
GNEPoly * retrievePolygon(const std::string &id, bool failHard=true) const
get Polygon by id
Definition: GNENet.cpp:933
void deleteConnection(GNEConnection *connection, GNEUndoList *undoList)
remove connection
Definition: GNENet.cpp:540
void resetJunctionConnections(GNEJunction *junction, GNEUndoList *undoList)
reset junction&#39;s connections
Definition: GNENet.cpp:1696
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:77
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:303
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:979
void addExplicitTurnaround(std::string id)
add edge id to the list of explicit turnarounds
Definition: GNENet.cpp:1773
bool myAllowUndoShapes
flag used to indicate if shaped created can be undo
Definition: GNENet.h:753
bool cleanInvalidCrossings(GNEUndoList *undoList)
clear invalid crossings
Definition: GNENet.cpp:1538
int getNumberOfAdditionals(SumoXMLTag type=SUMO_TAG_NOTHING) const
Returns the number of additionals of the net.
Definition: GNENet.cpp:1818
Storage for geometrical objects.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GNENet.cpp:191
void insertEdge(GNEEdge *edge)
inserts a single edge into the net and into the underlying netbuild-container
Definition: GNENet.cpp:2243
const Boundary & getBoundary() const
returns the bounder of the network
Definition: GNENet.cpp:164
std::vector< GNEAttributeCarrier * > getSelectedAttributeCarriers()
get all selected attribute carriers
Definition: GNENet.cpp:1736
A RT-tree for efficient storing of SUMO&#39;s GL-objects.
Definition: SUMORTree.h:69
bool deleteAdditional(GNEAdditional *additional)
delete additional element of GNENet container
Definition: GNENet.cpp:2167
GNEJunction * registerJunction(GNEJunction *junction)
registers a junction with GNENet containers
Definition: GNENet.cpp:2254
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:42
bool myNeedRecompute
whether the net needs recomputation
Definition: GNENet.h:666
Builds trigger objects for GNENet (busStops, chargingStations, detectors, etc..)
NBNetBuilder * myNetBuilder
The internal netbuilder.
Definition: GNENet.h:651
bool netHasGNECrossings() const
check if net has GNECrossings
Definition: GNENet.cpp:1375
void saveTLSPrograms(const std::string &filename)
save TLS Programs elements of the network
Definition: GNENet.cpp:2106
bool restrictLane(SUMOVehicleClass vclass, GNELane *lane, GNEUndoList *undoList)
transform lane to restricted lane
Definition: GNENet.cpp:593
std::string generateShapeID(SumoXMLTag shapeTag) const
generate Shape ID
Definition: GNENet.cpp:2009
bool myAdditionalsSaved
Flag to check if additionals has to be saved.
Definition: GNENet.h:672
void renameJunction(GNEJunction *junction, const std::string &newID)
updates the map and reserves new id
Definition: GNENet.cpp:1761
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
Definition: GNENet.cpp:1785
IDSupplier myJunctionIDSupplier
Definition: GNENet.h:659
std::map< std::string, int > myEdgesAndNumberOfLanes
map with the Edges and their number of lanes
Definition: GNENet.h:750
static const double Z_INITIALIZED
marker for whether the z-boundary is initialized
Definition: GNENet.h:747
void updateAdditionalID(const std::string &oldID, GNEAdditional *additional)
update additional ID in container
Definition: GNENet.cpp:1830
void splitJunction(GNEJunction *junction, GNEUndoList *undoList)
replace the selected junction by a list of junctions for each unique edge endpoint ...
Definition: GNENet.cpp:1652
bool removeRestrictedLane(SUMOVehicleClass vclass, GNEEdge &edge, GNEUndoList *undoList)
remove restricted lane
Definition: GNENet.cpp:642
NBEdge * myBy
replaced by NBEdge
Definition: GNENet.h:801
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:1980
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:1912
void deleteLane(GNELane *lane, GNEUndoList *undoList, bool recomputeConnections)
removes lane
Definition: GNENet.cpp:504
NBEdgeCont & getEdgeCont()
returns the NBEdgeCont of the underlying netbuilder
Definition: GNENet.cpp:1755
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
Definition: GNENet.cpp:181
void insertShape(GNEShape *shape)
insert shape
Definition: GNENet.cpp:2342
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:887
A list of positions.
bool joinSelectedJunctions(GNEUndoList *undoList)
join selected junctions
Definition: GNENet.cpp:1398
Boundary myZBoundary
the z boundary (stored in the x-coordinate), values of 0 are ignored
Definition: GNENet.h:744
void removeGLObjectFromGrid(GUIGlObject *o)
add GL Object into net
Definition: GNENet.cpp:1160
void replaceIncomingEdge(GNEEdge *which, GNEEdge *by, GNEUndoList *undoList)
replaces edge
Definition: GNENet.cpp:459
bool trueChange()
wether original and new value differ
Definition: GNENet.h:789
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:219
void computeJunction(GNEJunction *junction)
trigger recomputation of junction shape and logic param[in] window The window to inform about delay ...
Definition: GNENet.cpp:1351
void requiereSaveAdditionals(bool value)
inform that additionals has to be saved
Definition: GNENet.cpp:1844
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:61
void initGNEConnections()
initialize GNEConnections
Definition: GNENet.cpp:2418
void save(OptionsCont &oc)
save the network
Definition: GNENet.cpp:855
void deleteCrossing(GNECrossing *crossing, GNEUndoList *undoList)
remove crossing
Definition: GNENet.cpp:555
void changeShapeID(GNEShape *s, const std::string &OldID)
change Shape ID
Definition: GNENet.cpp:2034
GNEJunction * createJunction(const Position &pos, GNEUndoList *undoList)
creates a new junction
Definition: GNENet.cpp:292
std::vector< GNEShape * > retrieveShapes(SumoXMLTag shapeTag, bool onlySelected=false)
return shape by type shapes
Definition: GNENet.cpp:1105
FXString undoName() const
undo name
Definition: GNENet.h:769
SUMORTree & getVisualisationSpeedUp()
Returns the RTree used for visualisation speed-up.
Definition: GNENet.cpp:280
std::vector< GNEAttributeCarrier * > retrieveAttributeCarriers(SumoXMLTag type=SUMO_TAG_NOTHING)
get the attribute carriers based on Type
Definition: GNENet.cpp:1189
std::set< std::string > myExplicitTurnarounds
list of edge ids for which turn-arounds must be added explicitly
Definition: GNENet.h:663
bool checkJunctionPosition(const Position &pos)
return true if there are already a Junction in the given position, false in other case ...
Definition: GNENet.cpp:825
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Definition: GNENet.cpp:268
void replaceJunctionByGeometry(GNEJunction *junction, GNEUndoList *undoList)
replace the selected junction by geometry node(s) and merge the edges
Definition: GNENet.cpp:1607
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:50
void undo()
undo action
Definition: GNENet.h:779
unsigned int GUIGlID
Definition: GUIGlObject.h:43
void reserveJunctionID(const std::string &id)
reserve junction ID (To avoid duplicates)
Definition: GNENet.cpp:2412
friend class GNEChange_CalibratorItem
Definition: GNENet.h:86
void duplicateLane(GNELane *lane, GNEUndoList *undoList, bool recomputeConnections)
duplicates lane
Definition: GNENet.cpp:581
GNECrossing * retrieveCrossing(const std::string &id, bool failHard=true) const
get Crossing by id
Definition: GNENet.cpp:995
void deleteSingleJunction(GNEJunction *junction)
deletes a single junction
Definition: GNENet.cpp:2301
~GNENet()
Destructor.
Definition: GNENet.cpp:124
const Boundary & getZBoundary() const
Returns the Z boundary (stored in the x() coordinate) values of 0 do not affect the boundary...
Definition: GNENet.cpp:274
std::string generateAdditionalID(SumoXMLTag type) const
generate additional id
Definition: GNENet.cpp:1902
void deleteEdge(GNEEdge *edge, GNEUndoList *undoList, bool recomputeConnections)
removes edge
Definition: GNENet.cpp:407
std::vector< GNEEdge * > retrieveEdges(bool onlySelected=false)
return all edges
Definition: GNENet.cpp:1031
GNEEdge * registerEdge(GNEEdge *edge)
registers an edge with GNENet containers
Definition: GNENet.cpp:2279
GNENet(NBNetBuilder *netBuilder)
Constructor.
Definition: GNENet.cpp:83
An Element which don&#39;t belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:48
std::vector< GNEAdditional * > retrieveAdditionals(bool onlySelected=false) const
return all additionals
Definition: GNENet.cpp:1797
Instance responsible for building networks.
Definition: NBNetBuilder.h:109
FXString redoName() const
get Redo name
Definition: GNENet.h:774
void removeSolitaryJunctions(GNEUndoList *undoList)
removes junctions that have no edges
Definition: GNENet.cpp:1590
void requiereSaveNet(bool value)
inform that net has to be saved
Definition: GNENet.cpp:837
struct used for saving all attribute carriers of net, in different formats
Definition: GNENet.h:633
AttributeCarriers myAttributeCarriers
AttributeCarriers of net.
Definition: GNENet.h:654
A storage for options typed value containers)
Definition: OptionsCont.h:92
The popup menu of a globject.
class for GNEChange_ReplaceEdgeInTLS
Definition: GNENet.h:756
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:1279
void clearJunctionConnections(GNEJunction *junction, GNEUndoList *undoList)
clear junction&#39;s connections
Definition: GNENet.cpp:1684
void computeAndUpdate(OptionsCont &oc, bool volatileOptions)
recompute the network and update lane geometries
Definition: GNENet.cpp:2431
int getNumberOfShapes() const
get number of shapes
Definition: GNENet.cpp:2090
void renameEdge(GNEEdge *edge, const std::string &newID)
updates the map and reserves new id
Definition: GNENet.cpp:1707
static void replaceInListAttribute(GNEAttributeCarrier *ac, SumoXMLAttr key, const std::string &which, const std::string &by, GNEUndoList *undoList)
Definition: GNENet.cpp:2558
void deleteJunction(GNEJunction *junction, GNEUndoList *undoList)
removes junction and all incident edges
Definition: GNENet.cpp:362
bool myTLSProgramsSaved
Flag to check if shapes has to be saved.
Definition: GNENet.h:678
std::map< std::string, GNEJunction * > junctions
map with the name and pointer to junctions of net
Definition: GNENet.h:635
std::vector< GNECrossing * > retrieveCrossings(bool onlySelected=false) const
return all crossings
Definition: GNENet.cpp:1015
void removeExplicitTurnaround(std::string id)
remove edge id from the list of explicit turnarounds
Definition: GNENet.cpp:1779
void saveJoined(OptionsCont &oc)
save log of joined junctions (and nothing else)
Definition: GNENet.cpp:873
const std::map< std::string, GNEAdditional * > & getAdditionalByType(SumoXMLTag type) const
get map with IDs and pointers to additionals
Definition: GNENet.cpp:1812
GNEEdge * addReversedEdge(GNEEdge *edge, GNEUndoList *undoList)
add reversed edge
Definition: GNENet.cpp:755
void reserveEdgeID(const std::string &id)
reserve edge ID (To avoid duplicates)
Definition: GNENet.cpp:2406
void deleteSingleEdge(GNEEdge *edge)
deletes a single edge
Definition: GNENet.cpp:2319
void redo()
redo action
Definition: GNENet.h:784
void removePolygonForEditShapes(GNEPoly *polygon)
remove Polygon for edit shapes
Definition: GNENet.cpp:1995
void mergeJunctions(GNEJunction *moved, GNEJunction *target, GNEUndoList *undoList)
merge the given junctions edges between the given junctions will be deleted
Definition: GNENet.cpp:790
void requiereSaveTLSPrograms()
Definition: GNENet.cpp:2096
void addGLObjectIntoGrid(GUIGlObject *o)
add GL Object into net
Definition: GNENet.cpp:1153
GNEChange_ReplaceEdgeInTLS(NBTrafficLightLogicCont &tllcont, NBEdge *replaced, NBEdge *by)
constructor
Definition: GNENet.h:761
GNELane * retrieveLane(const std::string &id, bool failHard=true, bool checkVolatileChange=false)
get lane by id
Definition: GNENet.cpp:1059
bool myShapesSaved
Flag to check if shapes has to be saved.
Definition: GNENet.h:675
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:1720
NBTrafficLightLogicCont & getTLLogicCont()
returns the tllcont of the underlying netbuilder
Definition: GNENet.cpp:1750
int getNumberOfTLSPrograms() const
get number of TLS Programs
Definition: GNENet.cpp:2121
void saveAdditionals(const std::string &filename)
save additional elements of the network
Definition: GNENet.cpp:1863
bool myNetSaved
Flag to check if net has to be saved.
Definition: GNENet.h:669
void savePlain(OptionsCont &oc)
save plain xml representation of the network (and nothing else)
Definition: GNENet.cpp:865
void splitEdgesBidi(GNEEdge *edge, GNEEdge *oppositeEdge, const Position &pos, GNEUndoList *undoList)
split all edges at position by inserting one new junction
Definition: GNENet.cpp:730
void requireRecompute()
inform the net about the need for recomputation
Definition: GNENet.cpp:1369
bool isNetSaved() const
return if net has to be saved
Definition: GNENet.cpp:849
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:196
void requiereSaveShapes(bool value)
inform that shapes has to be saved
Definition: GNENet.cpp:2052
NBEdge * myReplaced
replaced NBEdge
Definition: GNENet.h:798
GNEViewNet * getViewNet() const
get view net
Definition: GNENet.cpp:1730
void saveShapes(const std::string &filename)
save shapes elements of the network
Definition: GNENet.cpp:2069