48 myAllowUndoRedo(allowUndoRedo),
49 myOverwrite(overwrite) {
68 dataSet->
incRef(
"buildDataSet");
78 const std::string& dataSetID,
const double begin,
const double end) {
82 if (dataSet ==
nullptr) {
94 dataSet->
incRef(
"buildDataInterval");
97 dataInterval->
incRef(
"buildDataInterval");
108 dataInterval->
incRef(
"buildDataInterval");
119 if (dataSet !=
nullptr) {
124 if (dataInterval !=
nullptr) {
136 edgeData->
incRef(
"buildEdgeData");
155 if (dataSet !=
nullptr) {
160 if (dataInterval !=
nullptr) {
164 if (fromEdge ==
nullptr) {
166 }
else if (toEdge ==
nullptr) {
171 writeError(
TLF(
"There is already a edgeRel defined between '%' and '%'.", fromEdgeID, toEdgeID));
182 edgeData->
incRef(
"buildEdgeRelationData");
200 if (dataSet !=
nullptr) {
205 if (dataInterval !=
nullptr) {
209 if (fromTAZ ==
nullptr) {
211 }
else if (toTAZ ==
nullptr) {
213 }
else if ((fromTAZ != toTAZ) && dataInterval->
TAZRelExists(fromTAZ, toTAZ)) {
214 writeError(
TLF(
"There is already a TAZ rel defined between '%' and '%'.", fromTAZID, toTAZID));
215 }
else if ((fromTAZ == toTAZ) && dataInterval->
TAZRelExists(fromTAZ)) {
216 writeError(
TLF(
"There is already a TAZ rel defined in '%'.", toTAZID));
217 }
else if (fromTAZ == toTAZ) {
226 edgeData->
incRef(
"buildTAZRelationData");
238 edgeData->
incRef(
"buildTAZRelationData");
252 writeError(
TLF(
"Could not build % with ID '%'",
toString(tag),
id) + std::string(
"; ") +
TL(
"declared twice."));
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ SUMO_TAG_EDGEREL
a relation between two edges
@ SUMO_TAG_TAZ
a traffic assignment zone
@ SUMO_TAG_TAZREL
a relation between two TAZs
@ SUMO_TAG_EDGE
begin/end of the description of an edge
@ SUMO_ATTR_BEGIN
weights: time range begin
@ SUMO_ATTR_END
weights: time range end
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
SumoBaseObject * getParentSumoBaseObject() const
get pointer to mySumoBaseObjectParent SumoBaseObject (if is null, then is the root)
double getDoubleAttribute(const SumoXMLAttr attr) const
get double attribute
const std::string & getStringAttribute(const SumoXMLAttr attr) const
get string attribute
The XML-Handler for network loading.
void writeError(const std::string &error)
write error and enable error creating element
An Element which don't belong to GNENet but has influence in the simulation.
~GNEDataHandler()
Destructor.
void buildDataSet(const std::string &dataSetID)
Builds DataSet (exclusive of netedit)
void buildTAZRelationData(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &fromTAZID, const std::string &toTAZID, const Parameterised::Map ¶meters)
Builds TAZRelationData.
const bool myAllowUndoRedo
allow undo/redo
void writeErrorDuplicated(const SumoXMLTag tag, const std::string &id)
write error "duplicated additional"
GNEDataHandler(GNENet *net, const std::string &file, const bool allowUndoRedo, const bool overwrite)
Constructor.
void writeErrorInvalidParent(const SumoXMLTag tag, const SumoXMLTag parent)
write error "invalid parent element"
void buildEdgeData(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &edgeID, const Parameterised::Map ¶meters)
Builds edgeData.
void buildDataInterval(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &dataSetID, const double begin, const double end)
Builds DataInterval.
void buildEdgeRelationData(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &fromEdgeID, const std::string &toEdgeID, const Parameterised::Map ¶meters)
Builds edgeRelationData.
GNENet * myNet
pointer to GNENet
An Element which don't belong to GNENet but has influence in the simulation.
bool edgeRelExists(const GNEEdge *fromEdge, const GNEEdge *toEdge) const
check if there is already a edgeRel defined between two edges
bool TAZRelExists(const GNEAdditional *TAZ) const
check if there is already a TAZRel defined in one TAZ
void addGenericDataChild(GNEGenericData *genericData)
add generic data child
GNEDataInterval * retrieveInterval(const double begin, const double end) const
return interval
void addDataIntervalChild(GNEDataInterval *dataInterval)
add data interval child
An Element which don't belong to GNENet but has influence in the simulation.
A road/street connecting two junctions (netedit-version)
An Element which don't belong to GNENet but has influence in the simulation.
An Element which don't belong to GNENet but has influence in the simulation.
void addChildElement(T *element)
add child element
void insertDataSet(GNEDataSet *dataSet)
Insert a data set in container.
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
GNEDataSet * retrieveDataSet(const std::string &id, bool hardFail=true) const
Returns the named data set.
GNEEdge * retrieveEdge(const std::string &id, bool hardFail=true) const
get edge by id
A NBNetBuilder extended by visualisation and editing capabilities.
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
GNEViewNet * getViewNet() const
get view net
void incRef(const std::string &debugMsg="")
Increase reference.
An Element which don't belong to GNENet but has influence in the simulation.
void end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
void begin(GUIIcon icon, const std::string &description)
Begin undo command sub-group with current supermode. This begins a new group of commands that are tre...
void add(GNEChange *command, bool doit=false, bool merge=true)
Add new command, executing it if desired. The new command will be merged with the previous command if...
GNEUndoList * getUndoList() const
get the undoList object
std::map< std::string, std::string > Map
parameters map