Eclipse SUMO - Simulation of Urban MObility
GNENet.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2020 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials are made available under the
5 // terms of the Eclipse Public License 2.0 which is available at
6 // https://www.eclipse.org/legal/epl-2.0/
7 // This Source Code may also be made available under the following Secondary
8 // Licenses when the conditions for such availability set forth in the Eclipse
9 // Public License 2.0 are satisfied: GNU General Public License, version 2
10 // or later which is available at
11 // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12 // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13 /****************************************************************************/
18 // The lop level container for GNE-network-components such as GNEEdge and
19 // GNEJunction. Contains an internal instances of NBNetBuilder GNE components
20 // wrap netbuild-components of this underlying NBNetBuilder and supply
21 // visualisation and editing capabilities (adapted from GUINet)
22 //
23 // WorkrouteFlow (rough draft)
24 // wrap NB-components
25 // do netedit stuff
26 // call NBNetBuilder::buildLoaded to save results
27 //
28 /****************************************************************************/
29 #pragma once
30 
31 #include "GNENetHelper.h"
32 
33 // ===========================================================================
34 // class definitions
35 // ===========================================================================
40 class GNENet : public GUIGlObject {
41 
42 public:
47  GNENet(NBNetBuilder* netBuilder);
48 
50  ~GNENet();
51 
54 
57 
60 
68 
77 
84 
86  void expandBoundary(const Boundary& newBoundary);
87 
89  const Boundary& getZBoundary() const;
90 
92  void addZValueInBoundary(const double z);
93 
98  void drawGL(const GUIVisualizationSettings& s) const;
100 
102  const Boundary& getBoundary() const;
103 
108  SUMORTree& getGrid();
109 
115  GNEJunction* createJunction(const Position& pos, GNEUndoList* undoList);
116 
129  GNEEdge* createEdge(GNEJunction* src, GNEJunction* dest, GNEEdge* edgeTemplate, GNEUndoList* undoList,
130  const std::string& suggestedName = "", bool wasSplit = false, bool allowDuplicateGeom = false,
131  bool recomputeConnections = true);
132 
137  void deleteJunction(GNEJunction* junction, GNEUndoList* undoList);
138 
143  void deleteEdge(GNEEdge* edge, GNEUndoList* undoList, bool recomputeConnections);
144 
150  void replaceIncomingEdge(GNEEdge* which, GNEEdge* by, GNEUndoList* undoList);
151 
156  void deleteLane(GNELane* lane, GNEUndoList* undoList, bool recomputeConnections);
157 
162  void deleteConnection(GNEConnection* connection, GNEUndoList* undoList);
163 
168  void deleteCrossing(GNECrossing* crossing, GNEUndoList* undoList);
169 
174  void deleteAdditional(GNEAdditional* additional, GNEUndoList* undoList);
175 
180  void deleteShape(GNEShape* shape, GNEUndoList* undoList);
181 
186  void deleteTAZElement(GNETAZElement* TAZElement, GNEUndoList* undoList);
187 
192  void deleteDemandElement(GNEDemandElement* demandElement, GNEUndoList* undoList);
193 
198  void deleteDataSet(GNEDataSet* dataSet, GNEUndoList* undoList);
199 
204  void deleteDataInterval(GNEDataInterval* dataInterval, GNEUndoList* undoList);
205 
210  void deleteGenericData(GNEGenericData* genericData, GNEUndoList* undoList);
211 
216  void duplicateLane(GNELane* lane, GNEUndoList* undoList, bool recomputeConnections);
217 
223  bool restrictLane(SUMOVehicleClass vclass, GNELane* lane, GNEUndoList* undoList);
224 
230  bool addRestrictedLane(SUMOVehicleClass vclass, GNEEdge* edge, int index, GNEUndoList* undoList);
231 
237  bool removeRestrictedLane(SUMOVehicleClass vclass, GNEEdge* edge, GNEUndoList* undoList);
238 
244  GNEJunction* splitEdge(GNEEdge* edge, const Position& pos, GNEUndoList* undoList, GNEJunction* newJunction = 0);
245 
251  void splitEdgesBidi(GNEEdge* edge, GNEEdge* oppositeEdge, const Position& pos, GNEUndoList* undoList);
252 
256  void reverseEdge(GNEEdge* edge, GNEUndoList* undoList);
257 
262  GNEEdge* addReversedEdge(GNEEdge* edge, GNEUndoList* undoList);
263 
270  void mergeJunctions(GNEJunction* moved, GNEJunction* target, GNEUndoList* undoList);
271 
273  void selectRoundabout(GNEJunction* junction, GNEUndoList* undoList);
274 
276  void createRoundabout(GNEJunction* junction, GNEUndoList* undoList);
277 
283  GNEJunction* retrieveJunction(const std::string& id, bool failHard = true) const;
284 
290  GNEEdgeType* retrieveEdgeType(const std::string& id, bool failHard = true) const;
291 
297  GNEEdge* retrieveEdge(const std::string& id, bool failHard = true) const;
298 
304  GNEEdge* retrieveEdge(GNEJunction* from, GNEJunction* to, bool failHard = true) const;
305 
311  GNEConnection* retrieveConnection(const std::string& id, bool failHard = true) const;
312 
316  std::vector<GNEConnection*> retrieveConnections(bool onlySelected = false) const;
317 
323  GNECrossing* retrieveCrossing(const std::string& id, bool failHard = true) const;
324 
328  std::vector<GNECrossing*> retrieveCrossings(bool onlySelected = false) const;
329 
335  GNEAttributeCarrier* retrieveAttributeCarrier(const GUIGlID id, bool failHard = true) const;
336 
340  std::vector<GNEAttributeCarrier*> retrieveAttributeCarriers(SumoXMLTag type = SUMO_TAG_NOTHING);
341 
345  std::vector<GNEEdge*> retrieveEdges(bool onlySelected = false);
346 
350  std::vector<GNEEdge*> retrieve000180AngleEdges(bool onlySelected = false) const;
351 
355  std::vector<GNEEdge*> retrieve180360AngleEdges(bool onlySelected = false) const;
356 
360  std::vector<GNELane*> retrieveLanes(bool onlySelected = false);
361 
368  GNELane* retrieveLane(const std::string& id, bool failHard = true, bool checkVolatileChange = false);
369 
373  std::vector<GNEJunction*> retrieveJunctions(bool onlySelected = false);
374 
379  std::vector<GNEShape*> retrieveShapes(SumoXMLTag shapeTag, bool onlySelected = false);
380 
384  std::vector<GNEShape*> retrieveShapes(bool onlySelected = false);
385 
387  void requireSaveNet(bool value);
388 
390  bool isNetSaved() const;
391 
395  void save(OptionsCont& oc);
396 
400  void savePlain(OptionsCont& oc);
401 
405  void saveJoined(OptionsCont& oc);
406 
408  void setViewNet(GNEViewNet* viewNet);
409 
412 
415 
417  void changeEdgeEndpoints(GNEEdge* edge, const std::string& newSourceID, const std::string& newDestID);
418 
420  GNEViewNet* getViewNet() const;
421 
423  std::vector<GNEAttributeCarrier*> getSelectedAttributeCarriers(bool ignoreCurrentSupermode);
424 
427 
430 
432  void initGNEConnections();
433 
435  void computeAndUpdate(OptionsCont& oc, bool volatileOptions);
436 
445  void computeNetwork(GNEApplicationWindow* window, bool force = false, bool volatileOptions = false, std::string additionalPath = "", std::string demandPath = "", std::string dataPath = "");
446 
451 
456 
463  bool joinSelectedJunctions(GNEUndoList* undoList);
464 
466  bool cleanInvalidCrossings(GNEUndoList* undoList);
467 
469  void removeSolitaryJunctions(GNEUndoList* undoList);
470 
472  void cleanUnusedRoutes(GNEUndoList* undoList);
473 
475  void joinRoutes(GNEUndoList* undoList);
476 
478  void cleanInvalidDemandElements(GNEUndoList* undoList);
479 
481  void replaceJunctionByGeometry(GNEJunction* junction, GNEUndoList* undoList);
482 
484  void splitJunction(GNEJunction* junction, bool reconnect, GNEUndoList* undoList);
485 
487  void clearJunctionConnections(GNEJunction* junction, GNEUndoList* undoList);
488 
490  void resetJunctionConnections(GNEJunction* junction, GNEUndoList* undoList);
491 
495  void computeJunction(GNEJunction* junction);
496 
498  void requireRecompute();
499 
501  bool isNetRecomputed() const;
502 
504  bool netHasGNECrossings() const;
505 
507  FXApp* getApp();
508 
510  NBNetBuilder* getNetBuilder() const;
511 
513  void addExplicitTurnaround(std::string id);
514 
516  void removeExplicitTurnaround(std::string id);
517 
519  std::string generateEdgeTypeID() const;
520 
523 
529  GNEAdditional* retrieveAdditional(SumoXMLTag type, const std::string& id, bool hardFail = true) const;
530 
534  std::vector<GNEAdditional*> retrieveAdditionals(bool onlySelected = false) const;
535 
541 
543  void requireSaveAdditionals(bool value);
544 
548  void saveAdditionals(const std::string& filename);
549 
551  bool isAdditionalsSaved() const;
552 
554  std::string generateAdditionalID(SumoXMLTag type) const;
555 
557 
560 
566  GNEDemandElement* retrieveDemandElement(SumoXMLTag type, const std::string& id, bool hardFail = true) const;
567 
571  std::vector<GNEDemandElement*> retrieveDemandElements(bool onlySelected = false) const;
572 
578 
580  void requireSaveDemandElements(bool value);
581 
585  void saveDemandElements(const std::string& filename);
586 
588  bool isDemandElementsSaved() const;
589 
591  std::string generateDemandElementID(SumoXMLTag tag) const;
592 
594 
597 
602  GNEDataSet* retrieveDataSet(const std::string& id, bool hardFail = true) const;
603 
605  std::vector<GNEDataSet*> retrieveDataSets() const;
606 
610  std::vector<GNEGenericData*> retrieveGenericDatas(bool onlySelected = false) const;
611 
615  int getNumberOfDataSets() const;
616 
618  void requireSaveDataElements(bool value);
619 
623  void saveDataElements(const std::string& filename);
624 
626  bool isDataElementsSaved() const;
627 
629  std::string generateDataSetID(const std::string& prefix) const;
630 
632  std::set<std::string> retrieveGenericDataParameters(const std::string& genericDataTag, const double begin, const double end) const;
633 
635  std::set<std::string> retrieveGenericDataParameters(const std::string& dataSetID, const std::string& genericDataTag,
636  const std::string& beginStr, const std::string& endStr) const;
637 
639  double getDataSetIntervalMinimumBegin() const;
640 
642  double getDataSetIntervalMaximumEnd() const;
643 
645 
648 
654  GNEShape* retrieveShape(SumoXMLTag type, const std::string& id, bool hardFail = true) const;
655 
659  std::vector<GNEShape*> retrieveShapes(bool onlySelected = false) const;
660 
662  std::string generateShapeID(SumoXMLTag shapeTag) const;
663 
670 
673 
679  GNETAZElement* retrieveTAZElement(SumoXMLTag type, const std::string& id, bool hardFail = true) const;
680 
684  std::vector<GNETAZElement*> retrieveTAZElements(bool onlySelected = false) const;
685 
687  std::string generateTAZElementID(SumoXMLTag TAZElementTag) const;
688 
695 
699  void requireSaveTLSPrograms();
700 
704  void saveTLSPrograms(const std::string& filename);
705 
707  int getNumberOfTLSPrograms() const;
708 
710 
713 
716  void saveEdgeTypes(const std::string& filename);
717 
719 
723  void enableUpdateGeometry();
724 
726  void disableUpdateGeometry();
727 
729  bool isUpdateGeometryEnabled() const;
730 
732 
736  void enableUpdateData();
737 
739  void disableUpdateData();
740 
742  bool isUpdateDataEnabled() const;
743 
745 
746 protected:
749 
752 
755 
758 
761 
763  // @{
766  // @}
767 
769  std::set<std::string> myExplicitTurnarounds;
770 
773 
776 
779 
782 
785 
788 
791 
794 
795 private:
797  void initJunctionsAndEdges();
798 
800  void reserveEdgeID(const std::string& id);
801 
803  void reserveJunctionID(const std::string& id);
804 
806  bool checkJunctionPosition(const Position& pos);
807 
809  void saveAdditionalsConfirmed(const std::string& filename);
810 
812  void saveDemandElementsConfirmed(const std::string& filename);
813 
815  void saveDataElementsConfirmed(const std::string& filename);
816 
817  static void replaceInListAttribute(GNEAttributeCarrier* ac, SumoXMLAttr key, const std::string& which, const std::string& by, GNEUndoList* undoList);
818 
821 
823  static const double Z_INITIALIZED;
824 
826  std::map<std::string, int> myEdgesAndNumberOfLanes;
827 
829  GNENet(const GNENet&) = delete;
830 
832  GNENet& operator=(const GNENet&) = delete;
833 };
unsigned int GUIGlID
Definition: GUIGlObject.h:40
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ SUMO_TAG_NOTHING
invalid tag
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:39
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:47
The main window of the Netedit.
This object is responsible for drawing a shape and for supplying a a popup menu. Messages are routete...
Definition: GNECrossing.h:41
An Element which don't belongs to GNENet but has influency in the simulation.
An Element which don't belongs to GNENet but has influency in the simulation.
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:49
An Element which don't belongs to GNENet but has influency in the simulation.
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:45
struct used for saving all attribute carriers of net, in different formats
Definition: GNENetHelper.h:74
class used to calculate paths in nets
Definition: GNENetHelper.h:431
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:40
void removeSolitaryJunctions(GNEUndoList *undoList)
removes junctions that have no edges
Definition: GNENet.cpp:1933
void deleteEdge(GNEEdge *edge, GNEUndoList *undoList, bool recomputeConnections)
removes edge
Definition: GNENet.cpp:316
int getNumberOfAdditionals(SumoXMLTag type=SUMO_TAG_NOTHING) const
Returns the number of additionals of the net.
Definition: GNENet.cpp:2349
GNECrossing * retrieveCrossing(const std::string &id, bool failHard=true) const
get Crossing by id
Definition: GNENet.cpp:1213
std::vector< GNEDataSet * > retrieveDataSets() const
return all data sets
Definition: GNENet.cpp:2602
bool joinSelectedJunctions(GNEUndoList *undoList)
join selected junctions
Definition: GNENet.cpp:1744
double getDataSetIntervalMaximumEnd() const
get maximum interval
Definition: GNENet.cpp:2809
void save(OptionsCont &oc)
save the network
Definition: GNENet.cpp:1059
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Definition: GNENet.cpp:181
void saveDemandElements(const std::string &filename)
save demand element elements of the network
Definition: GNENet.cpp:2487
void deleteLane(GNELane *lane, GNEUndoList *undoList, bool recomputeConnections)
removes lane
Definition: GNENet.cpp:450
static const double Z_INITIALIZED
marker for whether the z-boundary is initialized
Definition: GNENet.h:823
void deleteCrossing(GNECrossing *crossing, GNEUndoList *undoList)
remove crossing
Definition: GNENet.cpp:509
int getNumberOfTAZElements(SumoXMLTag type=SUMO_TAG_NOTHING) const
Returns the number of TAZElements of the net.
Definition: GNENet.cpp:3038
SUMORTree & getGrid()
Returns the RTree used for visualisation speed-up.
Definition: GNENet.cpp:149
GNEViewNet * myViewNet
The net to be notofied of about changes.
Definition: GNENet.h:751
void deleteAdditional(GNEAdditional *additional, GNEUndoList *undoList)
remove additional
Definition: GNENet.cpp:527
bool myDataElementsSaved
Flag to check if data elements has to be saved.
Definition: GNENet.h:787
void disableUpdateGeometry()
disable update geometry of elements after inserting or removing an element in net
Definition: GNENet.cpp:3115
void saveTLSPrograms(const std::string &filename)
save TLS Programs elements of the network
Definition: GNENet.cpp:3060
NBNetBuilder * getNetBuilder() const
get net builder
Definition: GNENet.cpp:1738
void addGLObjectIntoGrid(GNEAttributeCarrier *AC)
add GL Object into net
Definition: GNENet.cpp:1411
void reverseEdge(GNEEdge *edge, GNEUndoList *undoList)
reverse edge
Definition: GNENet.cpp:873
GNEEdge * addReversedEdge(GNEEdge *edge, GNEUndoList *undoList)
add reversed edge
Definition: GNENet.cpp:886
std::string generateTAZElementID(SumoXMLTag TAZElementTag) const
generate TAZElement ID
Definition: GNENet.cpp:3028
int getNumberOfDemandElements(SumoXMLTag type=SUMO_TAG_NOTHING) const
Returns the number of demand elements of the net.
Definition: GNENet.cpp:2462
void removeGLObjectFromGrid(GNEAttributeCarrier *AC)
add GL Object into net
Definition: GNENet.cpp:1423
void deleteTAZElement(GNETAZElement *TAZElement, GNEUndoList *undoList)
remove TAZElement
Definition: GNENet.cpp:557
std::string generateAdditionalID(SumoXMLTag type) const
generate additional id
Definition: GNENet.cpp:2425
NBTrafficLightLogicCont & getTLLogicCont()
returns the tllcont of the underlying netbuilder
Definition: GNENet.cpp:2282
GNELane * retrieveLane(const std::string &id, bool failHard=true, bool checkVolatileChange=false)
get lane by id
Definition: GNENet.cpp:1337
std::vector< GNEGenericData * > retrieveGenericDatas(bool onlySelected=false) const
return all generic datas
Definition: GNENet.cpp:2614
bool restrictLane(SUMOVehicleClass vclass, GNELane *lane, GNEUndoList *undoList)
transform lane to restricted lane
Definition: GNENet.cpp:676
bool isNetSaved() const
return if net has to be saved
Definition: GNENet.cpp:1053
bool myNetSaved
Flag to check if net has to be saved.
Definition: GNENet.h:775
bool myTLSProgramsSaved
Flag to check if shapes has to be saved.
Definition: GNENet.h:781
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true) const
get edge by id
Definition: GNENet.cpp:1141
void enableUpdateData()
Definition: GNENet.cpp:3127
void requireSaveNet(bool value)
inform that net has to be saved
Definition: GNENet.cpp:1047
std::vector< GNELane * > retrieveLanes(bool onlySelected=false)
return all lanes
Definition: GNENet.cpp:1322
GNEJunction * splitEdge(GNEEdge *edge, const Position &pos, GNEUndoList *undoList, GNEJunction *newJunction=0)
split edge at position by inserting a new junction
Definition: GNENet.cpp:756
GNEAttributeCarrier * retrieveAttributeCarrier(const GUIGlID id, bool failHard=true) const
get a single attribute carrier based on a GLID
Definition: GNENet.cpp:1435
void setViewNet(GNEViewNet *viewNet)
Set the net to be notified of network changes.
Definition: GNENet.cpp:1098
GNEDataSet * retrieveDataSet(const std::string &id, bool hardFail=true) const
Returns the named data set.
Definition: GNENet.cpp:2590
std::vector< GNEAdditional * > retrieveAdditionals(bool onlySelected=false) const
return all additionals
Definition: GNENet.cpp:2328
bool myNeedRecompute
whether the net needs recomputation
Definition: GNENet.h:772
void saveAdditionalsConfirmed(const std::string &filename)
save additionals after confirming invalid objects
Definition: GNENet.cpp:2829
void deleteDemandElement(GNEDemandElement *demandElement, GNEUndoList *undoList)
remove demand element
Definition: GNENet.cpp:578
void duplicateLane(GNELane *lane, GNEUndoList *undoList, bool recomputeConnections)
duplicates lane
Definition: GNENet.cpp:660
const Boundary & getZBoundary() const
Returns the Z boundary (stored in the x() coordinate) values of 0 do not affect the boundary.
Definition: GNENet.cpp:193
const Boundary & getBoundary() const
returns the bounder of the network
Definition: GNENet.cpp:142
void saveEdgeTypes(const std::string &filename)
save edgeTypes elements of the network
Definition: GNENet.cpp:3081
IDSupplier myEdgeIDSupplier
Definition: GNENet.h:764
GNENet(const GNENet &)=delete
Invalidated copy constructor.
void reserveEdgeID(const std::string &id)
reserve edge ID (To avoid duplicates)
Definition: GNENet.cpp:3196
void computeAndUpdate(OptionsCont &oc, bool volatileOptions)
recompute the network and update lane geometries
Definition: GNENet.cpp:3221
GNENetHelper::PathCalculator * myPathCalculator
PathCalculator instance.
Definition: GNENet.h:760
SUMORTree myGrid
the rtree which contains all GUIGlObjects (so named for historical reasons)
Definition: GNENet.h:748
std::vector< GNEEdge * > retrieve000180AngleEdges(bool onlySelected=false) const
return edges with junction angle between 0 (inclusive) and 180 (exclusive) degrees
Definition: GNENet.cpp:1262
void savePlain(OptionsCont &oc)
save plain xml representation of the network (and nothing else)
Definition: GNENet.cpp:1082
std::vector< GNEAttributeCarrier * > getSelectedAttributeCarriers(bool ignoreCurrentSupermode)
get all selected attribute carriers (or only relative to current supermode
Definition: GNENet.cpp:2251
GNENet & operator=(const GNENet &)=delete
Invalidated assignment operator.
void deleteDataInterval(GNEDataInterval *dataInterval, GNEUndoList *undoList)
remove data interval
Definition: GNENet.cpp:617
void deleteConnection(GNEConnection *connection, GNEUndoList *undoList)
remove connection
Definition: GNENet.cpp:494
std::vector< GNEDemandElement * > retrieveDemandElements(bool onlySelected=false) const
return all demand elements
Definition: GNENet.cpp:2447
void requireSaveAdditionals(bool value)
inform that additionals has to be saved
Definition: GNENet.cpp:2361
void cleanInvalidDemandElements(GNEUndoList *undoList)
clean invalid demand elements
Definition: GNENet.cpp:2040
bool myUpdateDataEnabled
Flag to enable or disable update data elements after inserting or removing element in net.
Definition: GNENet.h:793
void cleanUnusedRoutes(GNEUndoList *undoList)
clean unused routes
Definition: GNENet.cpp:1950
NBNetBuilder * myNetBuilder
The internal netbuilder.
Definition: GNENet.h:754
GNETAZElement * retrieveTAZElement(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named TAZElement.
Definition: GNENet.cpp:3001
void removeExplicitTurnaround(std::string id)
remove edge id from the list of explicit turnarounds
Definition: GNENet.cpp:2300
void computeJunction(GNEJunction *junction)
trigger recomputation of junction shape and logic param[in] window The window to inform about delay
Definition: GNENet.cpp:1691
void resetJunctionConnections(GNEJunction *junction, GNEUndoList *undoList)
reset junction's connections
Definition: GNENet.cpp:2225
GNEEdgeType * retrieveEdgeType(const std::string &id, bool failHard=true) const
get edge type by id
Definition: GNENet.cpp:1126
void replaceIncomingEdge(GNEEdge *which, GNEEdge *by, GNEUndoList *undoList)
replaces edge
Definition: GNENet.cpp:384
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GNENet.cpp:175
void deleteGenericData(GNEGenericData *genericData, GNEUndoList *undoList)
remove generic data
Definition: GNENet.cpp:630
GNENetHelper::PathCalculator * getPathCalculator()
obtain instance of PathCalculator
Definition: GNENet.cpp:136
std::string generateDataSetID(const std::string &prefix) const
generate data set id
Definition: GNENet.cpp:2677
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
retrieve all attribute carriers of Net
Definition: GNENet.cpp:130
void computeNetwork(GNEApplicationWindow *window, bool force=false, bool volatileOptions=false, std::string additionalPath="", std::string demandPath="", std::string dataPath="")
trigger full netbuild computation param[in] window The window to inform about delay param[in] force W...
Definition: GNENet.cpp:1603
std::vector< GNEConnection * > retrieveConnections(bool onlySelected=false) const
return all connections
Definition: GNENet.cpp:1197
void changeEdgeEndpoints(GNEEdge *edge, const std::string &newSourceID, const std::string &newDestID)
modifies endpoins of the given edge
Definition: GNENet.cpp:2236
bool myUpdateGeometryEnabled
Flag to enable or disable update geometry of elements after inserting or removing element in net.
Definition: GNENet.h:790
std::vector< GNEJunction * > retrieveJunctions(bool onlySelected=false)
return all junctions
Definition: GNENet.cpp:1370
bool isAdditionalsSaved() const
check if additionals are saved
Definition: GNENet.cpp:2419
void initJunctionsAndEdges()
Init Junctions and edges.
Definition: GNENet.cpp:3155
void splitEdgesBidi(GNEEdge *edge, GNEEdge *oppositeEdge, const Position &pos, GNEUndoList *undoList)
split all edges at position by inserting one new junction
Definition: GNENet.cpp:861
IDSupplier myJunctionIDSupplier
Definition: GNENet.h:765
void requireSaveTLSPrograms()
Definition: GNENet.cpp:3050
std::string generateShapeID(SumoXMLTag shapeTag) const
generate Shape ID
Definition: GNENet.cpp:2971
void expandBoundary(const Boundary &newBoundary)
expand boundary
Definition: GNENet.cpp:187
void deleteShape(GNEShape *shape, GNEUndoList *undoList)
remove shape
Definition: GNENet.cpp:548
void disableUpdateData()
disable update data elements after inserting or removing an element in net
Definition: GNENet.cpp:3140
std::vector< GNEEdge * > retrieve180360AngleEdges(bool onlySelected=false) const
return edges with junction angle between 180 (inclusive) and 360 (exclusive) degrees
Definition: GNENet.cpp:1292
bool removeRestrictedLane(SUMOVehicleClass vclass, GNEEdge *edge, GNEUndoList *undoList)
remove restricted lane
Definition: GNENet.cpp:742
std::string generateDemandElementID(SumoXMLTag tag) const
generate demand element id
Definition: GNENet.cpp:2539
~GNENet()
Destructor.
Definition: GNENet.cpp:118
void mergeJunctions(GNEJunction *moved, GNEJunction *target, GNEUndoList *undoList)
merge the given junctions edges between the given junctions will be deleted
Definition: GNENet.cpp:921
GNEEdge * createEdge(GNEJunction *src, GNEJunction *dest, GNEEdge *edgeTemplate, 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:219
std::set< std::string > myExplicitTurnarounds
list of edge ids for which turn-arounds must be added explicitly
Definition: GNENet.h:769
std::set< std::string > retrieveGenericDataParameters(const std::string &genericDataTag, const double begin, const double end) const
return a set of parameters for the given data Interval
Definition: GNENet.cpp:2688
bool myAdditionalsSaved
Flag to check if additionals has to be saved.
Definition: GNENet.h:778
void addZValueInBoundary(const double z)
add Z in net boundary
Definition: GNENet.cpp:199
bool isUpdateGeometryEnabled() const
check if update geometry after inserting or removing has to be updated
Definition: GNENet.cpp:3121
bool addRestrictedLane(SUMOVehicleClass vclass, GNEEdge *edge, int index, GNEUndoList *undoList)
add restricted lane to edge
Definition: GNENet.cpp:706
int getNumberOfDataSets() const
Returns the number of data sets of the net.
Definition: GNENet.cpp:2639
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
Definition: GNENet.cpp:2316
bool checkJunctionPosition(const Position &pos)
return true if there are already a Junction in the given position, false in other case
Definition: GNENet.cpp:1035
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
Definition: GNENet.cpp:165
void reserveJunctionID(const std::string &id)
reserve junction ID (To avoid duplicates)
Definition: GNENet.cpp:3202
bool isNetRecomputed() const
check if net requiere recomputing
Definition: GNENet.cpp:1715
bool isUpdateDataEnabled() const
check if update data after inserting or removing has to be updated
Definition: GNENet.cpp:3146
void deleteDataSet(GNEDataSet *dataSet, GNEUndoList *undoList)
remove data set
Definition: GNENet.cpp:604
static void replaceInListAttribute(GNEAttributeCarrier *ac, SumoXMLAttr key, const std::string &which, const std::string &by, GNEUndoList *undoList)
Definition: GNENet.cpp:3322
bool cleanInvalidCrossings(GNEUndoList *undoList)
clear invalid crossings
Definition: GNENet.cpp:1881
void splitJunction(GNEJunction *junction, bool reconnect, GNEUndoList *undoList)
replace the selected junction by a list of junctions for each unique edge endpoint
Definition: GNENet.cpp:2129
void selectRoundabout(GNEJunction *junction, GNEUndoList *undoList)
select all roundabout edges and junctions for the current roundabout
Definition: GNENet.cpp:954
void joinRoutes(GNEUndoList *undoList)
join routes
Definition: GNENet.cpp:1976
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
Definition: GNENet.cpp:155
std::vector< GNEShape * > retrieveShapes(SumoXMLTag shapeTag, bool onlySelected=false)
return shape by type shapes
Definition: GNENet.cpp:1383
void replaceJunctionByGeometry(GNEJunction *junction, GNEUndoList *undoList)
replace the selected junction by geometry node(s) and merge the edges
Definition: GNENet.cpp:2079
void requireSaveDemandElements(bool value)
inform that demand elements has to be saved
Definition: GNENet.cpp:2474
std::vector< GNEEdge * > retrieveEdges(bool onlySelected=false)
return all edges
Definition: GNENet.cpp:1249
int getNumberOfShapes(SumoXMLTag type=SUMO_TAG_NOTHING) const
Returns the number of shapes of the net.
Definition: GNENet.cpp:2989
void createRoundabout(GNEJunction *junction, GNEUndoList *undoList)
transform the given junction into a roundabout
Definition: GNENet.cpp:973
bool netHasGNECrossings() const
check if net has GNECrossings
Definition: GNENet.cpp:1721
std::string generateEdgeTypeID() const
generate edgeType id
Definition: GNENet.cpp:2306
void requireSaveDataElements(bool value)
inform that data sets has to be saved
Definition: GNENet.cpp:2645
void requireRecompute()
inform the net about the need for recomputation
Definition: GNENet.cpp:1709
GNEJunction * createJunction(const Position &pos, GNEUndoList *undoList)
creates a new junction
Definition: GNENet.cpp:208
void saveJoined(OptionsCont &oc)
save log of joined junctions (and nothing else)
Definition: GNENet.cpp:1090
GNEShape * retrieveShape(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named shape.
Definition: GNENet.cpp:2944
std::map< std::string, int > myEdgesAndNumberOfLanes
map with the Edges and their number of lanes
Definition: GNENet.h:826
void addExplicitTurnaround(std::string id)
add edge id to the list of explicit turnarounds
Definition: GNENet.cpp:2294
void saveDataElements(const std::string &filename)
save data set elements of the network
Definition: GNENet.cpp:2658
void initGNEConnections()
initialize GNEConnections
Definition: GNENet.cpp:3208
void saveAdditionals(const std::string &filename)
save additional elements of the network
Definition: GNENet.cpp:2374
void deleteJunction(GNEJunction *junction, GNEUndoList *undoList)
removes junction and all incident edges
Definition: GNENet.cpp:275
NBEdgeCont & getEdgeCont()
returns the NBEdgeCont of the underlying netbuilder
Definition: GNENet.cpp:2288
std::vector< GNETAZElement * > retrieveTAZElements(bool onlySelected=false) const
return all TAZElements
Definition: GNENet.cpp:3013
GNEDemandElement * retrieveDemandElement(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named demand element.
Definition: GNENet.cpp:2435
GNENetHelper::AttributeCarriers * myAttributeCarriers
AttributeCarriers of net.
Definition: GNENet.h:757
void computeDataElements(GNEApplicationWindow *window)
compute data elements param[in] window The window to inform about delay
Definition: GNENet.cpp:1676
FXApp * getApp()
get pointer to the main App
Definition: GNENet.cpp:1732
bool isDataElementsSaved() const
check if data sets are saved
Definition: GNENet.cpp:2671
void saveDataElementsConfirmed(const std::string &filename)
save data elements after confirming invalid objects
Definition: GNENet.cpp:2931
bool myDemandElementsSaved
Flag to check if demand elements has to be saved.
Definition: GNENet.h:784
int getNumberOfTLSPrograms() const
get number of TLS Programs
Definition: GNENet.cpp:3075
GNEViewNet * getViewNet() const
get view net
Definition: GNENet.cpp:2245
GNEJunction * retrieveJunction(const std::string &id, bool failHard=true) const
get junction by id
Definition: GNENet.cpp:1113
void saveDemandElementsConfirmed(const std::string &filename)
save demand elements after confirming invalid objects
Definition: GNENet.cpp:2895
std::vector< GNECrossing * > retrieveCrossings(bool onlySelected=false) const
return all crossings
Definition: GNENet.cpp:1233
GNENet(NBNetBuilder *netBuilder)
Constructor.
Definition: GNENet.cpp:88
void enableUpdateGeometry()
Definition: GNENet.cpp:3109
void clearJunctionConnections(GNEJunction *junction, GNEUndoList *undoList)
clear junction's connections
Definition: GNENet.cpp:2213
std::vector< GNEAttributeCarrier * > retrieveAttributeCarriers(SumoXMLTag type=SUMO_TAG_NOTHING)
get the attribute carriers based on Type
Definition: GNENet.cpp:1458
Boundary myZBoundary
the z boundary (stored in the x-coordinate), values of 0 are ignored
Definition: GNENet.h:820
double getDataSetIntervalMinimumBegin() const
get minimum interval
Definition: GNENet.cpp:2789
GNEConnection * retrieveConnection(const std::string &id, bool failHard=true) const
get Connection by id
Definition: GNENet.cpp:1177
void computeDemandElements(GNEApplicationWindow *window)
compute demand elements param[in] window The window to inform about delay
Definition: GNENet.cpp:1659
bool isDemandElementsSaved() const
check if demand elements are saved
Definition: GNENet.cpp:2533
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNETAZElement.h:45
The popup menu of a globject.
A window containing a gl-object's parameter.
Stores the information about how to visualize structures.
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:59
Instance responsible for building networks.
Definition: NBNetBuilder.h:107
A container for traffic light definitions and built programs.
A storage for options typed value containers)
Definition: OptionsCont.h:89
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:36
A RT-tree for efficient storing of SUMO's GL-objects.
Definition: SUMORTree.h:66