45 const std::vector<GNEJunction*>& parentJunctions,
46 const std::vector<GNEEdge*>& parentEdges,
47 const std::vector<GNELane*>& parentLanes,
48 const std::vector<GNEAdditional*>& parentAdditionals,
49 const std::vector<GNEShape*>& parentShapes,
50 const std::vector<GNETAZElement*>& parentTAZElements,
51 const std::vector<GNEDemandElement*>& ParentDemandElements,
52 const std::vector<GNEGenericData*>& parentGenericDatas) :
53 myParentConnections(this),
54 myParentJunctions(parentJunctions),
55 myParentEdges(parentEdges),
56 myParentLanes(parentLanes),
57 myParentAdditionals(parentAdditionals),
58 myParentShapes(parentShapes),
59 myParentTAZElements(parentTAZElements),
60 myParentDemandElements(ParentDemandElements),
61 myParentGenericDatas(parentGenericDatas),
72 if (edge ==
nullptr) {
85 if (lane ==
nullptr) {
109 if (shape ==
nullptr) {
122 if (TAZElement ==
nullptr) {
157 if (edge ==
nullptr) {
174 if (lane ==
nullptr) {
199 if (shape ==
nullptr) {
212 if (TAZElement ==
nullptr) {
246 const std::vector<GNEEdge*>&
252 const std::vector<GNELane*>&
258 const std::vector<GNEAdditional*>&
264 const std::vector<GNEShape*>&
270 const std::vector<GNETAZElement*>&
276 const std::vector<GNEDemandElement*>&
282 const std::vector<GNEGenericData*>&
290 std::vector<std::string> solution;
297 solution.push_back(edge->getID());
299 if (edge == currentElement) {
300 solution.push_back(newNextElement->
getID());
309 solution.push_back(lane->getID());
311 if (lane == currentElement) {
312 solution.push_back(newNextElement->
getID());
317 solution.erase(std::unique(solution.begin(), solution.end()), solution.end());
363 std::vector<GNEEdge*>
365 std::vector<GNEEdge*> middleEdges;
372 middleEdges.push_back(*i);
386 edge->removeChildElement(elementChild);
389 myParentEdges = GNEAttributeCarrier::parse<std::vector<GNEEdge*> >(elementChild->
getNet(), newEdgeIDs);
391 if (myParentEdges.empty()) {
395 for (
const auto& edge : myParentEdges) {
396 edge->addChildElement(elementChild);
406 edge->removeChildElement(elementChild);
409 myParentEdges = GNEAttributeCarrier::parse<std::vector<GNEEdge*> >(elementChild->
getNet(), newEdgeIDs);
411 if (myParentEdges.empty()) {
415 for (
const auto& edge : myParentEdges) {
416 edge->addChildElement(elementChild);
426 edge->removeChildElement(elementChild);
429 myParentEdges = GNEAttributeCarrier::parse<std::vector<GNEEdge*> >(elementChild->
getNet(), newEdgeIDs);
431 if (myParentEdges.empty()) {
435 for (
const auto& edge : myParentEdges) {
436 edge->addChildElement(elementChild);
446 edge->removeChildElement(elementChild);
449 myParentEdges = newEdges;
451 if (myParentEdges.empty()) {
455 for (
const auto& edge : myParentEdges) {
456 edge->addChildElement(elementChild);
466 edge->removeChildElement(elementChild);
469 myParentEdges = newEdges;
471 if (myParentEdges.empty()) {
475 for (
const auto& edge : myParentEdges) {
476 edge->addChildElement(elementChild);
517 std::vector<GNEEdge*> newEdges;
523 for (
const auto& edge : newMiddleEdges) {
524 newEdges.push_back(edge);
531 if (updateChildReferences) {
577 lane->removeChildElement(elementChild);
580 myParentLanes = GNEAttributeCarrier::parse<std::vector<GNELane*> >(elementChild->
getNet(), newLaneIDs);
582 if (myParentLanes.empty()) {
586 for (
const auto& lane : myParentLanes) {
587 lane->addChildElement(elementChild);
597 lane->removeChildElement(elementChild);
600 myParentLanes = GNEAttributeCarrier::parse<std::vector<GNELane*> >(elementChild->
getNet(), newLaneIDs);
602 if (myParentLanes.empty()) {
606 for (
const auto& lane : myParentLanes) {
607 lane->addChildElement(elementChild);
617 lane->removeChildElement(elementChild);
620 myParentLanes = GNEAttributeCarrier::parse<std::vector<GNELane*> >(elementChild->
getNet(), newLaneIDs);
622 if (myParentLanes.empty()) {
626 for (
const auto& lane : myParentLanes) {
627 lane->addChildElement(elementChild);
673 myParentAdditionals.at(additionalParentIndex)->removeChildElement(demandElementTobeChanged);
677 myParentAdditionals.at(additionalParentIndex)->removeChildElement(demandElementTobeChanged);
const std::string & getID() const
get ID
std::vector< GNEJunction * > myParentJunctions
vector of junction parents
void replaceFirstParentTAZElement(GNEGenericData *elementChild, GNETAZElement *newFirstTAZElement)
replace the first parent TAZElement (used by generic data elements)
std::vector< GNEAdditional * > myParentAdditionals
vector of additional parents
void replaceLastParentTAZElement(GNEGenericData *elementChild, GNETAZElement *newLastTAZElement)
replace the last parent TAZElement (used by demand elements)
begin/end of the description of a single lane
An Element which don't belongs to GNENet but has influency in the simulation.
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
std::string getNewListOfParents(const GNENetworkElement *currentElement, const GNENetworkElement *newNextElement) const
if use edge/parent lanes as a list of consecutive elements, obtain a list of IDs of elements after in...
a traffic assignment zone
std::vector< GNEEdge * > myParentEdges
vector of edge parents
void updateSecondParentJunction(GNEJunction *junction)
update last parent junction
const std::vector< GNELane * > & getParentLanes() const
get parent lanes
std::vector< GNEGenericData * > myParentGenericDatas
vector of generic datas parents
GNEJunction * getSecondParentJunction() const
remove parent junction
virtual void updateGeometry()=0
update pre-computed geometry information
void updateFirstParentJunction(GNEJunction *junction)
update front parent junction
An Element which don't belongs to GNENet but has influency in the simulation.
~GNEHierarchicalParentElements()
Destructor.
std::vector< GNELane * > myParentLanes
vector of lane parents
const std::string & getID() const
get ID
const std::string & getID() const
get ID
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
const std::vector< GNEEdge * > & getParentEdges() const
get parent edges
GNEJunction * getFirstParentJunction() const
get front parent junction
const std::vector< GNEAdditional * > & getParentAdditionals() const
get parent additionals
std::vector< GNEDemandElement * > myParentDemandElements
vector of demand elements parents
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
std::vector< GNEEdge * > getMiddleParentEdges() const
get middle (via) parent edges
const GNEAttributeCarrier * myAC
pointer to AC (needed to avoid diamond problem)
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
GNEDemandElement * retrieveDemandElement(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named demand element.
const std::string & getID() const
get ID
void replaceMiddleParentEdges(GNEDemandElement *elementChild, const std::vector< GNEEdge *> &newMiddleEdges, const bool updateChildReferences)
replace middle (via) parent edges
virtual void updateGeometry()=0
update pre-computed geometry information
GNENet * getNet() const
get pointer to net
void replaceParentAdditional(GNEShape *shapeTobeChanged, const std::string &newParentAdditionalID, int additionalParentIndex)
replace the parent additional of a shape
const std::vector< GNEDemandElement * > & getParentDemandElements() const
get parent demand elements
std::vector< GNEShape * > myParentShapes
vector of shape parents
GNEHierarchicalParentElements(const GNEAttributeCarrier *AC, const std::vector< GNEJunction *> &parentJunctions, const std::vector< GNEEdge *> &parentEdges, const std::vector< GNELane *> &parentLanes, const std::vector< GNEAdditional *> &parentAdditionals, const std::vector< GNEShape *> &parentShapes, const std::vector< GNETAZElement *> &parentTAZElements, const std::vector< GNEDemandElement *> &parentDemandElements, const std::vector< GNEGenericData *> &parentGenericDatas)
Constructor used by elements that have another additionals as parent.
begin/end of the description of an edge
void addParentElement(T *element)
add child
A road/street connecting two junctions (netedit-version)
void replaceParentLanes(GNEShape *elementChild, const std::string &newLaneIDs)
replace the parent edges of a shape
const std::vector< GNEShape * > & getParentShapes() const
get parent shapes
An Element which don't belongs to GNENet but has influency in the simulation.
const std::string & getTagStr() const
get tag assigned to this object in string format
const GNETagProperties & getTagProperty() const
get Tag Property assigned to this object
std::vector< GNETAZElement * > myParentTAZElements
vector of TAZElement parents
virtual void updateGeometry()=0
update pre-computed geometry information
void removeParentElement(T *element)
remove child
void replaceFirstParentEdge(GNEDemandElement *elementChild, GNEEdge *newFirstEdge)
replace the first parent edge (used by demand elements)
void replaceLastParentEdge(GNEDemandElement *elementChild, GNEEdge *newLastEdge)
replace the last parent edge (used by demand elements)
const std::vector< GNEGenericData * > & getParentGenericDatas() const
get parent demand elements
void replaceParentDemandElement(GNEShape *shapeTobeChanged, const std::string &newParentDemandElementID, int demandElementParentIndex)
replace the parent demand element of a shape
virtual const std::string & getID() const =0
return ID of object
An Element which don't belongs to GNENet but has influency in the simulation.
void replaceParentEdges(GNEShape *elementChild, const std::string &newEdgeIDs)
replace the parent edges of a shape
const std::vector< GNETAZElement * > & getParentTAZElements() const
get parent TAZElements