Eclipse SUMO - Simulation of Urban MObility
GNEHierarchicalElementChildren Class Referenceabstract

An special type of Attribute carrier that owns hierarchical elements. More...

#include <GNEHierarchicalElementChildren.h>

Inheritance diagram for GNEHierarchicalElementChildren:
Collaboration diagram for GNEHierarchicalElementChildren:

Data Structures

struct  ChildConnections
 struct for pack all variables and functions relative to connections between hierarchical element and their children More...
 

Public Member Functions

void drawChildConnections (const GUIVisualizationSettings &s, const GUIGlObjectType GLTypeParent) const
 
virtual std::string generateChildID (SumoXMLTag childTag)=0
 gererate a new ID for an element child More...
 
const PositiongetChildPosition (const GNELane *lane)
 get child position calculated in ChildConnections More...
 
double getChildRotation (const GNELane *lane)
 get child rotation calculated in ChildConnections More...
 
 GNEHierarchicalElementChildren (GNEAttributeCarrier *AC, const std::vector< GNEEdge * > &edgeChildren, const std::vector< GNELane * > &laneChildren, const std::vector< GNEShape * > &shapeChildren, const std::vector< GNEAdditional * > &additionalChildren, const std::vector< GNEDemandElement * > &demandElementChildren)
 Parameter Constructor. More...
 
virtual void updateAdditionalParent ()
 update parent after add or remove a child (can be reimplemented, for example used for statistics) More...
 
void updateChildConnections ()
 update child connections More...
 
virtual void updateDemandElementParent ()
 update parent after add or remove a child (can be reimplemented, for example used for statistics) More...
 
 ~GNEHierarchicalElementChildren ()
 Destructor. More...
 
Functions related with geometry of element

update pre-computed geometry information

virtual void updateGeometry ()=0
 
virtual Position getPositionInView () const =0
 Returns position of hierarchical element in view. More...
 
members and functions related to edge children

add edge child

void addEdgeChild (GNEEdge *edge)
 
void removeEdgeChild (GNEEdge *edge)
 remove edge child More...
 
const std::vector< GNEEdge * > & getEdgeChildren () const
 get edge chidls More...
 
members and functions related to lane children

add lane child

void addLaneChild (GNELane *lane)
 
void removeLaneChild (GNELane *lane)
 remove lane child More...
 
const std::vector< GNELane * > & getLaneChildren () const
 get lanes of VSS More...
 
members and functions related to shape children

add shape child

void addShapeChild (GNEShape *shape)
 
void removeShapeChild (GNEShape *shape)
 remove shape child More...
 
const std::vector< GNEShape * > & getShapeChildren () const
 get shapes of VSS More...
 
members and functions related to additional children

add additional child to this additional

void addAdditionalChild (GNEAdditional *additional)
 
void removeAdditionalChild (GNEAdditional *additional)
 remove additional child from this additional More...
 
const std::vector< GNEAdditional * > & getAdditionalChildren () const
 return vector of additionals that have as Parent this edge (For example, Calibrators) More...
 
void sortAdditionalChildren ()
 sort children (used by Rerouters, VSS, TAZs...) More...
 
bool checkAdditionalChildrenOverlapping () const
 check if children are overlapped (Used by Rerouters) More...
 
members and functions related to demand element children

add demand element child to this demand element

void addDemandElementChild (GNEDemandElement *demandElement)
 
void removeDemandElementChild (GNEDemandElement *demandElement)
 remove demand element child from this demand element More...
 
const std::vector< GNEDemandElement * > & getDemandElementChildren () const
 return vector of demand elements that have as Parent this edge (For example, Calibrators) More...
 
const std::set< GNEDemandElement * > & getSortedDemandElementChildrenByType (SumoXMLTag tag) const
 return vector of demand elements that have as Parent this edge (For example, Calibrators) More...
 
void sortDemandElementChildren ()
 sort children (used by Rerouters, VSS, TAZs...) More...
 
bool checkDemandElementChildrenOverlapping () const
 check if children are overlapped (Used by Rerouters) More...
 
GNEDemandElementgetPreviousemandElement (const GNEDemandElement *demandElement) const
 get previous demand element to the given demand element More...
 
GNEDemandElementgetNextDemandElement (const GNEDemandElement *demandElement) const
 get next demand element to the given demand element More...
 

Protected Member Functions

void changeEdgeChildren (GNEAdditional *elementChild, const std::string &newEdgeIDs)
 change edge children of an additional More...
 
void changeLaneChildren (GNEAdditional *elementChild, const std::string &newEdgeIDs)
 change edge children of an additional More...
 

Protected Attributes

ChildConnections myChildConnections
 variable ChildConnections More...
 

Private Member Functions

 GNEHierarchicalElementChildren (const GNEHierarchicalElementChildren &)=delete
 Invalidated copy constructor. More...
 
GNEHierarchicalElementChildrenoperator= (const GNEHierarchicalElementChildren &)=delete
 Invalidated assignment operator. More...
 

Private Attributes

GNEAttributeCarriermyAC
 pointer to AC (needed to avoid diamond problem) More...
 
std::vector< GNEAdditional * > myAdditionalChildren
 vector with the additional children More...
 
std::vector< GNEDemandElement * > myDemandElementChildren
 vector with the demand elements children More...
 
std::vector< GNEEdge * > myEdgeChildren
 vector with the edge children of this element More...
 
std::vector< GNELane * > myLaneChildren
 vector with the lane children of this element More...
 
std::vector< GNEShape * > myShapeChildren
 vector with the lane children of this element More...
 
std::map< SumoXMLTag, std::set< GNEDemandElement * > > mySortedDemandElementChildrenByType
 vector with the demand elements children sorted by type and filtered (to avoid duplicated More...
 

Friends

class GNEChange_Children
 declare GNEChange_Children as friend class More...
 

Detailed Description

An special type of Attribute carrier that owns hierarchical elements.

Definition at line 46 of file GNEHierarchicalElementChildren.h.

Constructor & Destructor Documentation

◆ GNEHierarchicalElementChildren() [1/2]

GNEHierarchicalElementChildren::GNEHierarchicalElementChildren ( GNEAttributeCarrier AC,
const std::vector< GNEEdge * > &  edgeChildren,
const std::vector< GNELane * > &  laneChildren,
const std::vector< GNEShape * > &  shapeChildren,
const std::vector< GNEAdditional * > &  additionalChildren,
const std::vector< GNEDemandElement * > &  demandElementChildren 
)

Parameter Constructor.

Parameters
[in]edgeChildrenvector of edge children
[in]laneChildrenvector of lane children
[in]shapeChildrenvector of shape children
[in]additionalChildrenvector of additional children
[in]demandElementChildrenvector of demand element children

Definition at line 37 of file GNEHierarchicalElementChildren.cpp.

References GNEAttributeCarrier::allowedTagsByCategory(), and mySortedDemandElementChildrenByType.

◆ ~GNEHierarchicalElementChildren()

GNEHierarchicalElementChildren::~GNEHierarchicalElementChildren ( )

Destructor.

Definition at line 58 of file GNEHierarchicalElementChildren.cpp.

◆ GNEHierarchicalElementChildren() [2/2]

GNEHierarchicalElementChildren::GNEHierarchicalElementChildren ( const GNEHierarchicalElementChildren )
privatedelete

Invalidated copy constructor.

Member Function Documentation

◆ addAdditionalChild()

◆ addDemandElementChild()

◆ addEdgeChild()

void GNEHierarchicalElementChildren::addEdgeChild ( GNEEdge edge)

◆ addLaneChild()

◆ addShapeChild()

◆ changeEdgeChildren()

void GNEHierarchicalElementChildren::changeEdgeChildren ( GNEAdditional elementChild,
const std::string &  newEdgeIDs 
)
protected

◆ changeLaneChildren()

void GNEHierarchicalElementChildren::changeLaneChildren ( GNEAdditional elementChild,
const std::string &  newEdgeIDs 
)
protected

◆ checkAdditionalChildrenOverlapping()

bool GNEHierarchicalElementChildren::checkAdditionalChildrenOverlapping ( ) const

check if children are overlapped (Used by Rerouters)

Definition at line 216 of file GNEHierarchicalElementChildren.cpp.

References myAdditionalChildren, SUMO_ATTR_BEGIN, SUMO_ATTR_END, and SUMO_ATTR_TIME.

Referenced by GNERerouterDialog::onCmdAccept().

◆ checkDemandElementChildrenOverlapping()

bool GNEHierarchicalElementChildren::checkDemandElementChildrenOverlapping ( ) const

check if children are overlapped (Used by Rerouters)

Definition at line 315 of file GNEHierarchicalElementChildren.cpp.

◆ drawChildConnections()

void GNEHierarchicalElementChildren::drawChildConnections ( const GUIVisualizationSettings s,
const GUIGlObjectType  GLTypeParent 
) const

◆ generateChildID()

virtual std::string GNEHierarchicalElementChildren::generateChildID ( SumoXMLTag  childTag)
pure virtual

gererate a new ID for an element child

Implemented in GNENetElement, GNEShape, GNEDemandElement, GNEAdditional, GNEPOI, GNEPoly, GNEEdge, GNEJunction, GNELane, GNECrossing, and GNEConnection.

◆ getAdditionalChildren()

const std::vector< GNEAdditional * > & GNEHierarchicalElementChildren::getAdditionalChildren ( ) const

return vector of additionals that have as Parent this edge (For example, Calibrators)

Definition at line 132 of file GNEHierarchicalElementChildren.cpp.

References myAdditionalChildren.

Referenced by GNEAdditionalHandler::accessCanBeCreated(), GNEEdge::addConnection(), GNEAdditionalHandler::buildTAZSink(), GNEAdditionalHandler::buildTAZSource(), GNEDetectorE3::checkAdditionalChildRestriction(), GNEAdditionalHandler::checkOverlappingRerouterIntervals(), GNENet::deleteAdditional(), GNENet::deleteEdge(), GNENet::deleteLane(), GNEBusStop::drawGL(), GNELane::drawGL(), GNEEdge::drawGL(), GNELane::endGeometryMoving(), GNEEdge::endGeometryMoving(), GNEAdditional::generateChildID(), GNETAZ::getAttribute(), GNEEdge::getRouteProbeRelativePosition(), GNEVariableSpeedSignStep::isValid(), GNEAdditionalHandler::myEndElement(), GNECalibratorDialog::onCmdClickedFlow(), GNERerouterDialog::onCmdClickedInterval(), GNECalibratorDialog::onCmdClickedRoute(), GNEVariableSpeedSignDialog::onCmdClickedStep(), GNECalibratorDialog::onCmdClickedVehicleType(), GNEVariableSpeedSignDialog::onCmdEditStep(), GNEEdge::removeConnection(), GNENet::replaceIncomingEdge(), GNEEdge::retrieveGNEConnection(), GNEBusStop::setAttribute(), GNEParkingArea::setAttribute(), GNEDetectorE3::setAttribute(), GNERerouterInterval::setAttribute(), GNEVariableSpeedSign::setAttribute(), GNERerouter::setAttribute(), GNEFrameModuls::AttributeCarrierHierarchy::showAttributeCarrierChildren(), GNELane::startGeometryMoving(), GNEEdge::startGeometryMoving(), GNEDeleteFrame::SubordinatedElements::SubordinatedElements(), GNETAZ::updateAdditionalParent(), GNECalibratorDialog::updateFlowTable(), GNELane::updateGeometry(), GNEEdge::updateGeometry(), GNERerouterDialog::updateIntervalTable(), GNEVariableSpeedSignDialog::updateTableSteps(), and GNEAdditional::writeAdditional().

◆ getChildPosition()

const Position & GNEHierarchicalElementChildren::getChildPosition ( const GNELane lane)

◆ getChildRotation()

double GNEHierarchicalElementChildren::getChildRotation ( const GNELane lane)

◆ getDemandElementChildren()

const std::vector< GNEDemandElement * > & GNEHierarchicalElementChildren::getDemandElementChildren ( ) const

return vector of demand elements that have as Parent this edge (For example, Calibrators)

Definition at line 297 of file GNEHierarchicalElementChildren.cpp.

References myDemandElementChildren.

Referenced by GNEStoppingPlace::commitGeometryMoving(), GNENet::deleteDemandElement(), GNENet::deleteEdge(), GNENet::deleteLane(), GNEChargingStation::drawGL(), GNEBusStop::drawGL(), GNEContainerStop::drawGL(), GNEParkingArea::drawGL(), GNEStop::drawGL(), GNELane::drawGL(), GNEPerson::drawGL(), GNEVehicle::drawGL(), GNEEdge::drawPartialPersonPlan(), GNEEdge::drawPartialRoute(), GNELane::endGeometryMoving(), GNEEdge::endGeometryMoving(), GNEAdditional::endGeometryMoving(), GNEDemandElement::generateChildID(), GNEPerson::getCenteringBoundary(), GNEPerson::getFromEdge(), GNEVehicle::getFromEdge(), GNEPerson::getPositionInView(), GNEPerson::getToEdge(), GNEVehicle::getToEdge(), GNEStoppingPlace::moveGeometry(), GNEPersonPlanFrame::PersonPlanCreator::refreshPersonPlanCreator(), GNENet::replaceIncomingEdge(), GNERouteHandler::separateEmbeddedRoute(), GNEFrameModuls::AttributeCarrierHierarchy::showAttributeCarrierChildren(), GNEViewNetHelper::DemandViewOptions::showNonInspectedDemandElements(), GNELane::startGeometryMoving(), GNEEdge::startGeometryMoving(), GNEAdditional::startGeometryMoving(), GNEDeleteFrame::SubordinatedElements::SubordinatedElements(), GNEBusStop::updateGeometry(), GNELane::updateGeometry(), GNEEdge::updateGeometry(), GNERide::updateGeometry(), GNEPersonTrip::updateGeometry(), GNEWalk::updateGeometry(), GNERoute::updateGeometry(), GNEPerson::updateGeometry(), GNEVehicle::updateGeometry(), GNERide::writeDemandElement(), GNEPersonTrip::writeDemandElement(), GNEWalk::writeDemandElement(), GNERoute::writeDemandElement(), GNEPerson::writeDemandElement(), and GNEVehicle::writeDemandElement().

◆ getEdgeChildren()

const std::vector< GNEEdge * > & GNEHierarchicalElementChildren::getEdgeChildren ( ) const

◆ getLaneChildren()

const std::vector< GNELane * > & GNEHierarchicalElementChildren::getLaneChildren ( ) const

◆ getNextDemandElement()

GNEDemandElement * GNEHierarchicalElementChildren::getNextDemandElement ( const GNEDemandElement demandElement) const

get next demand element to the given demand element

Definition at line 336 of file GNEHierarchicalElementChildren.cpp.

References myDemandElementChildren.

◆ getPositionInView()

◆ getPreviousemandElement()

GNEDemandElement * GNEHierarchicalElementChildren::getPreviousemandElement ( const GNEDemandElement demandElement) const

get previous demand element to the given demand element

Definition at line 321 of file GNEHierarchicalElementChildren.cpp.

References myDemandElementChildren.

◆ getShapeChildren()

◆ getSortedDemandElementChildrenByType()

const std::set< GNEDemandElement * > & GNEHierarchicalElementChildren::getSortedDemandElementChildrenByType ( SumoXMLTag  tag) const

return vector of demand elements that have as Parent this edge (For example, Calibrators)

Definition at line 303 of file GNEHierarchicalElementChildren.cpp.

References mySortedDemandElementChildrenByType.

Referenced by GNEEdge::drawGL(), and GNEFrameModuls::AttributeCarrierHierarchy::showAttributeCarrierChildren().

◆ operator=()

GNEHierarchicalElementChildren& GNEHierarchicalElementChildren::operator= ( const GNEHierarchicalElementChildren )
privatedelete

Invalidated assignment operator.

◆ removeAdditionalChild()

◆ removeDemandElementChild()

◆ removeEdgeChild()

void GNEHierarchicalElementChildren::removeEdgeChild ( GNEEdge edge)

◆ removeLaneChild()

void GNEHierarchicalElementChildren::removeLaneChild ( GNELane lane)

◆ removeShapeChild()

void GNEHierarchicalElementChildren::removeShapeChild ( GNEShape shape)

◆ sortAdditionalChildren()

◆ sortDemandElementChildren()

void GNEHierarchicalElementChildren::sortDemandElementChildren ( )

sort children (used by Rerouters, VSS, TAZs...)

Definition at line 309 of file GNEHierarchicalElementChildren.cpp.

Referenced by addDemandElementChild(), and removeDemandElementChild().

◆ updateAdditionalParent()

void GNEHierarchicalElementChildren::updateAdditionalParent ( )
virtual

update parent after add or remove a child (can be reimplemented, for example used for statistics)

Reimplemented in GNETAZ, and GNEDetectorE3.

Definition at line 451 of file GNEHierarchicalElementChildren.cpp.

Referenced by addAdditionalChild(), and removeAdditionalChild().

◆ updateChildConnections()

void GNEHierarchicalElementChildren::updateChildConnections ( )

update child connections

Definition at line 84 of file GNEHierarchicalElementChildren.cpp.

References myChildConnections, and GNEHierarchicalElementChildren::ChildConnections::update().

◆ updateDemandElementParent()

void GNEHierarchicalElementChildren::updateDemandElementParent ( )
virtual

update parent after add or remove a child (can be reimplemented, for example used for statistics)

Definition at line 457 of file GNEHierarchicalElementChildren.cpp.

◆ updateGeometry()

Friends And Related Function Documentation

◆ GNEChange_Children

friend class GNEChange_Children
friend

declare GNEChange_Children as friend class

Definition at line 51 of file GNEHierarchicalElementChildren.h.

Field Documentation

◆ myAC

◆ myAdditionalChildren

std::vector<GNEAdditional*> GNEHierarchicalElementChildren::myAdditionalChildren
private

◆ myChildConnections

◆ myDemandElementChildren

std::vector<GNEDemandElement*> GNEHierarchicalElementChildren::myDemandElementChildren
private

◆ myEdgeChildren

std::vector<GNEEdge*> GNEHierarchicalElementChildren::myEdgeChildren
private

vector with the edge children of this element

Definition at line 242 of file GNEHierarchicalElementChildren.h.

Referenced by addEdgeChild(), changeEdgeChildren(), getEdgeChildren(), and removeEdgeChild().

◆ myLaneChildren

std::vector<GNELane*> GNEHierarchicalElementChildren::myLaneChildren
private

vector with the lane children of this element

Definition at line 245 of file GNEHierarchicalElementChildren.h.

Referenced by addLaneChild(), changeLaneChildren(), getLaneChildren(), and removeLaneChild().

◆ myShapeChildren

std::vector<GNEShape*> GNEHierarchicalElementChildren::myShapeChildren
private

vector with the lane children of this element

Definition at line 248 of file GNEHierarchicalElementChildren.h.

Referenced by addShapeChild(), getShapeChildren(), and removeShapeChild().

◆ mySortedDemandElementChildrenByType

std::map<SumoXMLTag, std::set<GNEDemandElement*> > GNEHierarchicalElementChildren::mySortedDemandElementChildrenByType
private

vector with the demand elements children sorted by type and filtered (to avoid duplicated

Definition at line 257 of file GNEHierarchicalElementChildren.h.

Referenced by addDemandElementChild(), getSortedDemandElementChildrenByType(), GNEHierarchicalElementChildren(), and removeDemandElementChild().


The documentation for this class was generated from the following files: