48 myAllowUndoRedo(allowUndoRedo) {
67 dataSet->
incRef(
"buildDataSet");
77 const std::string& dataSetID,
const double begin,
const double end) {
81 if (dataSet ==
nullptr) {
94 dataInterval->
incRef(
"buildDataInterval");
105 dataInterval->
incRef(
"buildDataInterval");
116 if (dataSet !=
nullptr) {
121 if (dataInterval !=
nullptr) {
133 edgeData->
incRef(
"buildEdgeData");
152 if (dataSet !=
nullptr) {
157 if (dataInterval !=
nullptr) {
161 if (fromEdge && toEdge) {
171 edgeData->
incRef(
"buildEdgeData");
190 if (dataSet !=
nullptr) {
195 if (dataInterval !=
nullptr) {
199 if (fromTAZ ==
nullptr) {
201 }
else if (toTAZ ==
nullptr) {
203 }
else if ((fromTAZ != toTAZ) && dataInterval->
TAZRelExists(fromTAZ, toTAZ)) {
205 }
else if ((fromTAZ == toTAZ) && dataInterval->
TAZRelExists(fromTAZ)) {
207 }
else if (fromTAZ == toTAZ) {
216 edgeData->
incRef(
"buildEdgeData");
228 edgeData->
incRef(
"buildEdgeData");
242 writeError(
"Could not build " +
toString(tag) +
" with ID '" +
id +
"' in netedit; 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_MEANDATA_EDGE
an edge based mean data detector
@ 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(GNENet *net, const std::string &file, const bool allowUndoRedo)
Constructor.
~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"
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 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 demand element element int GNENet 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