48 myAllowUndoRedo(allowUndoRedo),
49 myOverwrite(overwrite) {
79 dataSet->
incRef(
"buildDataSet");
88 const std::string& dataSetID,
const double begin,
const double end) {
92 if (dataSet ==
nullptr) {
104 dataSet->
incRef(
"buildDataInterval");
107 dataInterval->
incRef(
"buildDataInterval");
119 dataInterval->
incRef(
"buildDataInterval");
133 if (dataSet !=
nullptr) {
138 if (dataInterval !=
nullptr) {
150 edgeData->
incRef(
"buildEdgeData");
170 if (dataSet !=
nullptr) {
175 if (dataInterval !=
nullptr) {
179 if (fromEdge ==
nullptr) {
181 }
else if (toEdge ==
nullptr) {
186 return writeError(
TLF(
"There is already a edgeRel defined between '%' and '%'.", fromEdgeID, toEdgeID));
197 edgeData->
incRef(
"buildEdgeRelationData");
216 if (dataSet !=
nullptr) {
221 if (dataInterval !=
nullptr) {
225 if (fromTAZ ==
nullptr) {
227 }
else if (toTAZ ==
nullptr) {
229 }
else if ((fromTAZ != toTAZ) && dataInterval->
TAZRelExists(fromTAZ, toTAZ)) {
230 return writeError(
TLF(
"There is already a TAZ rel defined between '%' and '%'.", fromTAZID, toTAZID));
231 }
else if ((fromTAZ == toTAZ) && dataInterval->
TAZRelExists(fromTAZ)) {
232 return writeError(
TLF(
"There is already a TAZ rel defined in '%'.", toTAZID));
233 }
else if (fromTAZ == toTAZ) {
242 edgeData->
incRef(
"buildTAZRelationData");
255 edgeData->
incRef(
"buildTAZRelationData");
@ 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
bool writeError(const std::string &error)
write error and enable error creating element
bool writeErrorInvalidParent(const SumoXMLTag tag, const std::string &id, const SumoXMLTag parentTag, const std::string &parentID)
write error "invalid parent element" giving ids of current and parent element
bool writeErrorDuplicated(const SumoXMLTag tag, const std::string &id, const SumoXMLTag checkedTag)
write error "duplicated additional"
bool checkValidAdditionalID(const SumoXMLTag tag, const std::string &value)
check if the given additional ID is valid
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.
An Element which don't belong to GNENet but has influence in the simulation.
~GNEDataHandler()
Destructor.
bool buildDataInterval(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &dataSetID, const double begin, const double end)
Builds DataInterval.
bool buildTAZRelationData(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &fromTAZID, const std::string &toTAZID, const Parameterised::Map ¶meters)
Builds TAZRelationData.
bool buildDataSet(const std::string &id)
Builds DataSet (exclusive of netedit)
const bool myAllowUndoRedo
allow undo/redo
GNEDataHandler(GNENet *net, const std::string &file, const bool allowUndoRedo, const bool overwrite)
Constructor.
bool buildEdgeRelationData(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &fromEdgeID, const std::string &toEdgeID, const Parameterised::Map ¶meters)
Builds edgeRelationData.
bool buildEdgeData(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &edgeID, const Parameterised::Map ¶meters)
Builds edgeData.
const bool myOverwrite
check if overwrite
bool checkDuplicatedDataSet(const std::string &id)
check if given ID correspond to a duplicated dataSet
bool postParserTasks()
run post parser tasks
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
void deleteDataSet(GNEDataSet *dataSet, GNEUndoList *undoList)
remove data set
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