Eclipse SUMO - Simulation of Urban MObility
GNEHierarchicalChildElements Class Referenceabstract

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

#include <GNEHierarchicalChildElements.h>

Inheritance diagram for GNEHierarchicalChildElements:
Collaboration diagram for GNEHierarchicalChildElements:

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...
 
 GNEHierarchicalChildElements (GNEAttributeCarrier *AC, const std::vector< GNEEdge * > &childEdges, const std::vector< GNELane * > &childLanes, const std::vector< GNEShape * > &childShapes, const std::vector< GNEAdditional * > &childAdditionals, const std::vector< GNEDemandElement * > &childDemandElements)
 Parameter Constructor. More...
 
void updateChildConnections ()
 update child connections More...
 
virtual void updateParentAdditional ()
 update parent after add or remove a child (can be reimplemented, for example used for statistics) More...
 
virtual void updateParentDemandElement ()
 update parent after add or remove a child (can be reimplemented, for example used for statistics) More...
 
 ~GNEHierarchicalChildElements ()
 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 child edges

add child edge

void addChildEdge (GNEEdge *edge)
 
void removeChildEdge (GNEEdge *edge)
 remove child edge More...
 
const std::vector< GNEEdge * > & getChildEdges () const
 get child edges More...
 
members and functions related to child lanes

add child lane

void addChildLane (GNELane *lane)
 
void removeChildLane (GNELane *lane)
 remove child lane More...
 
const std::vector< GNELane * > & getChildLanes () const
 get child lanes More...
 
members and functions related to child shapes

add child shape

void addChildShape (GNEShape *shape)
 
void removeChildShape (GNEShape *shape)
 remove child shape More...
 
const std::vector< GNEShape * > & getChildShapes () const
 get child shapes More...
 
members and functions related to child additionals

add child additional

void addChildAdditional (GNEAdditional *additional)
 
void removeChildAdditional (GNEAdditional *additional)
 remove child additional More...
 
const std::vector< GNEAdditional * > & getChildAdditionals () const
 return child additionals More...
 
void sortChildAdditionals ()
 sort child additionals (used by Rerouters, VSS, TAZs...) More...
 
bool checkChildAdditionalsOverlapping () const
 check if children are overlapped (Used by Rerouters) More...
 
members and functions related to child demand elements

add child demand element

void addChildDemandElement (GNEDemandElement *demandElement)
 
void removeChildDemandElement (GNEDemandElement *demandElement)
 remove child demand element More...
 
const std::vector< GNEDemandElement * > & getChildDemandElements () const
 return child demand elements More...
 
const std::set< GNEDemandElement * > & getChildDemandElementsSortedByType (SumoXMLTag tag) const
 return child demand elements sorted by type More...
 
void sortChildDemandElements ()
 sort child demand elements More...
 
bool checkChildDemandElementsOverlapping () const
 check if childs demand elements are overlapped More...
 
GNEDemandElementgetPreviousChildDemandElement (const GNEDemandElement *demandElement) const
 get previous child demand element to the given demand element More...
 
GNEDemandElementgetNextChildDemandElement (const GNEDemandElement *demandElement) const
 get next child demand element to the given demand element More...
 

Protected Member Functions

void changeChildEdges (GNEAdditional *elementChild, const std::string &newEdgeIDs)
 change child edges of an additional More...
 
void changeChildLanes (GNEAdditional *elementChild, const std::string &newEdgeIDs)
 change child edges of an additional More...
 

Protected Attributes

ChildConnections myChildConnections
 variable ChildConnections More...
 

Private Member Functions

 GNEHierarchicalChildElements (const GNEHierarchicalChildElements &)=delete
 Invalidated copy constructor. More...
 
GNEHierarchicalChildElementsoperator= (const GNEHierarchicalChildElements &)=delete
 Invalidated assignment operator. More...
 

Private Attributes

GNEAttributeCarriermyAC
 pointer to AC (needed to avoid diamond problem) More...
 
std::vector< GNEAdditional * > myChildAdditionals
 vector with the child additional More...
 
std::vector< GNEDemandElement * > myChildDemandElements
 vector with the demand elements children More...
 
std::vector< GNEEdge * > myChildEdges
 vector with the child edges of this element More...
 
std::vector< GNELane * > myChildLanes
 vector with the child lanes of this element More...
 
std::vector< GNEShape * > myChildShapes
 vector with the child lanes of this element More...
 
std::map< SumoXMLTag, std::set< GNEDemandElement * > > mySortedChildDemandElementsByType
 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 45 of file GNEHierarchicalChildElements.h.

Constructor & Destructor Documentation

◆ GNEHierarchicalChildElements() [1/2]

GNEHierarchicalChildElements::GNEHierarchicalChildElements ( GNEAttributeCarrier AC,
const std::vector< GNEEdge * > &  childEdges,
const std::vector< GNELane * > &  childLanes,
const std::vector< GNEShape * > &  childShapes,
const std::vector< GNEAdditional * > &  childAdditionals,
const std::vector< GNEDemandElement * > &  childDemandElements 
)

Parameter Constructor.

Parameters
[in]childEdgesvector of child edges
[in]childLanesvector of child lanes
[in]childShapesvector of child shapes
[in]childAdditionalsvector of child additional
[in]childDemandElementsvector of child demand elements

Definition at line 36 of file GNEHierarchicalChildElements.cpp.

References GNEAttributeCarrier::allowedTagsByCategory(), and mySortedChildDemandElementsByType.

◆ ~GNEHierarchicalChildElements()

GNEHierarchicalChildElements::~GNEHierarchicalChildElements ( )

Destructor.

Definition at line 57 of file GNEHierarchicalChildElements.cpp.

◆ GNEHierarchicalChildElements() [2/2]

GNEHierarchicalChildElements::GNEHierarchicalChildElements ( const GNEHierarchicalChildElements )
privatedelete

Invalidated copy constructor.

Member Function Documentation

◆ addChildAdditional()

◆ addChildDemandElement()

◆ addChildEdge()

void GNEHierarchicalChildElements::addChildEdge ( GNEEdge edge)

◆ addChildLane()

◆ addChildShape()

◆ changeChildEdges()

void GNEHierarchicalChildElements::changeChildEdges ( GNEAdditional elementChild,
const std::string &  newEdgeIDs 
)
protected

◆ changeChildLanes()

void GNEHierarchicalChildElements::changeChildLanes ( GNEAdditional elementChild,
const std::string &  newEdgeIDs 
)
protected

◆ checkChildAdditionalsOverlapping()

bool GNEHierarchicalChildElements::checkChildAdditionalsOverlapping ( ) const

check if children are overlapped (Used by Rerouters)

Definition at line 215 of file GNEHierarchicalChildElements.cpp.

References GNEAdditional::getAttributeDouble(), myChildAdditionals, SUMO_ATTR_BEGIN, SUMO_ATTR_END, and SUMO_ATTR_TIME.

Referenced by GNERerouterDialog::onCmdAccept().

◆ checkChildDemandElementsOverlapping()

bool GNEHierarchicalChildElements::checkChildDemandElementsOverlapping ( ) const

check if childs demand elements are overlapped

Definition at line 314 of file GNEHierarchicalChildElements.cpp.

◆ drawChildConnections()

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

◆ generateChildID()

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

gererate a new ID for an element child

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

◆ getChildAdditionals()

const std::vector< GNEAdditional * > & GNEHierarchicalChildElements::getChildAdditionals ( ) const

return child additionals

Definition at line 131 of file GNEHierarchicalChildElements.cpp.

References myChildAdditionals.

Referenced by GNEAdditionalHandler::accessCanBeCreated(), GNEEdge::addConnection(), GNEAdditionalHandler::buildTAZSink(), GNEAdditionalHandler::buildTAZSource(), GNEDetectorE3::checkChildAdditionalRestriction(), GNEAdditionalHandler::checkOverlappingRerouterIntervals(), GNENet::deleteAdditional(), GNENet::deleteEdge(), GNENet::deleteLane(), GNEBusStop::drawGL(), GNEEdge::drawGL(), GNELane::drawGL(), GNEEdge::endGeometryMoving(), GNELane::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(), GNEDetectorE3::setAttribute(), GNEParkingArea::setAttribute(), GNERerouter::setAttribute(), GNERerouterInterval::setAttribute(), GNEVariableSpeedSign::setAttribute(), GNEFrameModuls::AttributeCarrierHierarchy::showAttributeCarrierChildren(), GNENet::splitEdge(), GNEEdge::startGeometryMoving(), GNELane::startGeometryMoving(), GNEDeleteFrame::SubordinatedElements::SubordinatedElements(), GNECalibratorDialog::updateFlowTable(), GNEEdge::updateGeometry(), GNELane::updateGeometry(), GNERerouterDialog::updateIntervalTable(), GNETAZ::updateParentAdditional(), GNEVariableSpeedSignDialog::updateTableSteps(), and GNEAdditional::writeAdditional().

◆ getChildDemandElements()

const std::vector< GNEDemandElement * > & GNEHierarchicalChildElements::getChildDemandElements ( ) const

return child demand elements

Definition at line 296 of file GNEHierarchicalChildElements.cpp.

References myChildDemandElements.

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

◆ getChildDemandElementsSortedByType()

const std::set< GNEDemandElement * > & GNEHierarchicalChildElements::getChildDemandElementsSortedByType ( SumoXMLTag  tag) const

return child demand elements sorted by type

Definition at line 302 of file GNEHierarchicalChildElements.cpp.

References mySortedChildDemandElementsByType.

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

◆ getChildEdges()

const std::vector< GNEEdge * > & GNEHierarchicalChildElements::getChildEdges ( ) const

◆ getChildLanes()

const std::vector< GNELane * > & GNEHierarchicalChildElements::getChildLanes ( ) const

◆ getChildPosition()

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

◆ getChildRotation()

double GNEHierarchicalChildElements::getChildRotation ( const GNELane lane)

◆ getChildShapes()

◆ getNextChildDemandElement()

GNEDemandElement * GNEHierarchicalChildElements::getNextChildDemandElement ( const GNEDemandElement demandElement) const

get next child demand element to the given demand element

Definition at line 335 of file GNEHierarchicalChildElements.cpp.

References myChildDemandElements.

◆ getPositionInView()

◆ getPreviousChildDemandElement()

GNEDemandElement * GNEHierarchicalChildElements::getPreviousChildDemandElement ( const GNEDemandElement demandElement) const

get previous child demand element to the given demand element

Definition at line 320 of file GNEHierarchicalChildElements.cpp.

References myChildDemandElements.

◆ operator=()

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

Invalidated assignment operator.

◆ removeChildAdditional()

◆ removeChildDemandElement()

◆ removeChildEdge()

void GNEHierarchicalChildElements::removeChildEdge ( GNEEdge edge)

◆ removeChildLane()

void GNEHierarchicalChildElements::removeChildLane ( GNELane lane)

◆ removeChildShape()

void GNEHierarchicalChildElements::removeChildShape ( GNEShape shape)

◆ sortChildAdditionals()

◆ sortChildDemandElements()

void GNEHierarchicalChildElements::sortChildDemandElements ( )

sort child demand elements

Definition at line 308 of file GNEHierarchicalChildElements.cpp.

Referenced by addChildDemandElement(), and removeChildDemandElement().

◆ updateChildConnections()

void GNEHierarchicalChildElements::updateChildConnections ( )

update child connections

Definition at line 83 of file GNEHierarchicalChildElements.cpp.

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

◆ updateGeometry()

◆ updateParentAdditional()

void GNEHierarchicalChildElements::updateParentAdditional ( )
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 450 of file GNEHierarchicalChildElements.cpp.

Referenced by addChildAdditional(), and removeChildAdditional().

◆ updateParentDemandElement()

void GNEHierarchicalChildElements::updateParentDemandElement ( )
virtual

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

Definition at line 456 of file GNEHierarchicalChildElements.cpp.

Friends And Related Function Documentation

◆ GNEChange_Children

friend class GNEChange_Children
friend

declare GNEChange_Children as friend class

Definition at line 50 of file GNEHierarchicalChildElements.h.

Field Documentation

◆ myAC

◆ myChildAdditionals

std::vector<GNEAdditional*> GNEHierarchicalChildElements::myChildAdditionals
private

◆ myChildConnections

◆ myChildDemandElements

std::vector<GNEDemandElement*> GNEHierarchicalChildElements::myChildDemandElements
private

◆ myChildEdges

std::vector<GNEEdge*> GNEHierarchicalChildElements::myChildEdges
private

vector with the child edges of this element

Definition at line 241 of file GNEHierarchicalChildElements.h.

Referenced by addChildEdge(), changeChildEdges(), getChildEdges(), and removeChildEdge().

◆ myChildLanes

std::vector<GNELane*> GNEHierarchicalChildElements::myChildLanes
private

vector with the child lanes of this element

Definition at line 244 of file GNEHierarchicalChildElements.h.

Referenced by addChildLane(), changeChildLanes(), getChildLanes(), and removeChildLane().

◆ myChildShapes

std::vector<GNEShape*> GNEHierarchicalChildElements::myChildShapes
private

vector with the child lanes of this element

Definition at line 247 of file GNEHierarchicalChildElements.h.

Referenced by addChildShape(), getChildShapes(), and removeChildShape().

◆ mySortedChildDemandElementsByType

std::map<SumoXMLTag, std::set<GNEDemandElement*> > GNEHierarchicalChildElements::mySortedChildDemandElementsByType
private

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

Definition at line 256 of file GNEHierarchicalChildElements.h.

Referenced by addChildDemandElement(), getChildDemandElementsSortedByType(), GNEHierarchicalChildElements(), and removeChildDemandElement().


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