37 const std::vector<GNEJunction*>& parentJunctions,
38 const std::vector<GNEEdge*>& parentEdges,
39 const std::vector<GNELane*>& parentLanes,
40 const std::vector<GNEAdditional*>& parentAdditionals,
41 const std::vector<GNEShape*>& parentShapes,
42 const std::vector<GNETAZElement*>& parentTAZElements,
43 const std::vector<GNEDemandElement*>& ParentDemandElements,
44 const std::vector<GNEGenericData*>& parentGenericDatas) :
46 myHierarchicalConnections(this),
47 myHierarchicalContainer(parentJunctions, parentEdges, parentLanes, parentAdditionals, parentShapes, parentTAZElements, ParentDemandElements, parentGenericDatas) {
66 std::vector<GNEHierarchicalElement*>
69 std::vector<GNEHierarchicalElement*> result;
74 result.push_back(element);
77 result.push_back(element);
80 result.push_back(element);
83 result.push_back(element);
86 result.push_back(element);
89 result.push_back(element);
92 result.push_back(element);
95 result.push_back(element);
99 result.push_back(element);
102 result.push_back(element);
105 result.push_back(element);
108 result.push_back(element);
111 result.push_back(element);
114 result.push_back(element);
117 result.push_back(element);
120 result.push_back(element);
126 const std::vector<GNEJunction*>&
132 const std::vector<GNEEdge*>&
138 const std::vector<GNELane*>&
144 const std::vector<GNEAdditional*>&
150 const std::vector<GNEShape*>&
156 const std::vector<GNETAZElement*>&
162 const std::vector<GNEDemandElement*>&
168 const std::vector<GNEGenericData*>&
174 const std::vector<GNEJunction*>&
180 const std::vector<GNEEdge*>&
186 const std::vector<GNELane*>&
192 const std::vector<GNEAdditional*>&
198 const std::vector<GNEShape*>&
204 const std::vector<GNETAZElement*>&
210 const std::vector<GNEDemandElement*>&
216 const std::vector<GNEGenericData*>&
460 std::vector<std::string> solution;
467 solution.push_back(edge->getID());
469 if (edge == currentElement) {
470 solution.push_back(newNextElement->
getID());
479 solution.push_back(lane->getID());
481 if (lane == currentElement) {
482 solution.push_back(newNextElement->
getID());
487 solution.erase(std::unique(solution.begin(), solution.end()), solution.end());
519 std::vector<std::pair<std::pair<double, double>,
GNEAdditional*> > sortedChildren;
522 sortedChildren.push_back(std::make_pair(std::make_pair(0., 0.), additional));
524 if (additional->getTagProperty().hasAttribute(
SUMO_ATTR_TIME) && GNEAttributeCarrier::canParse<double>(additional->getAttribute(
SUMO_ATTR_TIME))) {
526 }
else if (additional->getTagProperty().hasAttribute(
SUMO_ATTR_BEGIN) && GNEAttributeCarrier::canParse<double>(additional->getAttribute(
SUMO_ATTR_BEGIN))) {
527 sortedChildren.back().first.first = additional->getAttributeDouble(
SUMO_ATTR_BEGIN);
530 if (additional->getTagProperty().hasAttribute(
SUMO_ATTR_END) && GNEAttributeCarrier::canParse<double>(additional->getAttribute(
SUMO_ATTR_END))) {
531 sortedChildren.back().first.second = additional->getAttributeDouble(
SUMO_ATTR_END);
533 sortedChildren.back().first.second = sortedChildren.back().first.first;
537 std::sort(sortedChildren.begin(), sortedChildren.end());
540 if (sortedChildren.size() <= 1) {
544 for (
int i = 0; i < (int)sortedChildren.size() - 1; i++) {
545 if (sortedChildren.at(i).first.second > sortedChildren.at(i + 1).first.first) {
552 throw ProcessError(
"Some child additional were lost during sorting");
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ SUMO_TAG_LANE
begin/end of the description of a single lane
@ 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
@ SUMO_ATTR_TIME
trigger: the time of the step
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
An Element which don't belongs to GNENet but has influency in the simulation.
virtual double getAttributeDouble(SumoXMLAttr key) const =0
const GNETagProperties & getTagProperty() const
get Tag Property assigned to this object
GNENet * getNet() const
get pointer to net
An Element which don't belongs to GNENet but has influency in the simulation.
A road/street connecting two junctions (netedit-version)
An Element which don't belongs to GNENet but has influency in the simulation.
void drawConnection(const GUIVisualizationSettings &s, const GNEAttributeCarrier *AC, const double exaggeration) const
draw connections between Parent and childrens
void update()
update Connection's geometry
void drawDottedConnection(const DottedContourType type, const GUIVisualizationSettings &s, const double exaggeration) const
draw dotted connections between Parent and childrens
Hierarchical container (used for keep myParent and myChildren.
void addParentElement(const GNEHierarchicalElement *hierarchicalElement, T *element)
add parent element
size_t getContainerSize() const
get container size
const T & getParents() const
get parents
void addChildElement(const GNEHierarchicalElement *hierarchicalElement, T *element)
add child element
const T & getChildren() const
get children
void removeParentElement(const GNEHierarchicalElement *hierarchicalElement, T *element)
remove parent element
void removeChildElement(const GNEHierarchicalElement *hierarchicalElement, T *element)
remove child element
const std::vector< GNEJunction * > & getParentJunctions() const
get parent junctions
void addChildElement(T *element)
add child element
void drawHierarchicalConnections(const GUIVisualizationSettings &s, const GNEAttributeCarrier *AC, const double exaggeration) const
Draw hierarchical connections between parent and children.
const std::vector< GNETAZElement * > & getChildTAZElements() const
get child TAZElements
const std::vector< GNEDemandElement * > & getChildDemandElements() const
return child demand elements
~GNEHierarchicalElement()
Destructor.
const std::vector< GNEGenericData * > & getParentGenericDatas() const
get parent demand elements
bool checkChildAdditionalsOverlapping() const
check if children are overlapped (Used by Rerouters)
const std::vector< GNELane * > & getChildLanes() const
get child lanes
void updateHierarchicalConnections()
update child connections
virtual void updateParentAdditional()
update parent after add or remove a child (can be reimplemented, for example used for statistics)
const GNEHierarchicalContainer & getHierarchicalContainer() const
get hierarchicalcontainer with parents and children
const std::vector< GNEDemandElement * > & getParentDemandElements() const
get parent demand elements
GNEHierarchicalContainer myHierarchicalContainer
hierarchical container with parents and children
bool checkChildDemandElementsOverlapping() const
check if childs demand elements are overlapped
GNEGeometry::HierarchicalConnections myHierarchicalConnections
hierarchical connections
const std::vector< GNEAdditional * > & getParentAdditionals() const
get parent additionals
void addParentElement(T *element)
add parent element
const std::vector< GNEShape * > & getParentShapes() const
get parent shapes
const std::vector< GNEEdge * > & getChildEdges() const
get child edges
const std::vector< GNEEdge * > & getParentEdges() const
get parent edges
std::vector< GNEHierarchicalElement * > getAllHierarchicalElements() const
get all parents and children
void removeChildElement(T *element)
remove child element
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...
const std::vector< GNEJunction * > & getChildJunctions() const
get child junctions
GNEHierarchicalElement(GNENet *net, SumoXMLTag tag, 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.
const std::vector< GNELane * > & getParentLanes() const
get parent lanes
const std::vector< GNEShape * > & getChildShapes() const
get child shapes
const std::vector< GNETAZElement * > & getParentTAZElements() const
get parent TAZElements
const std::vector< GNEAdditional * > & getChildAdditionals() const
return child additionals
const std::vector< GNEGenericData * > & getChildGenericDatas() const
return child generic data elements
void removeParentElement(T *element)
remove parent element
void restoreHierarchicalContainer(const GNEHierarchicalContainer &container)
restore hierarchical container
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
A NBNetBuilder extended by visualisation and editing capabilities.
GNEViewNet * getViewNet() const
get view net
const std::string & getID() const
get ID
An Element which don't belongs to GNENet but has influency in the simulation.
bool isSlave() const
return true if tag correspond to an element slave of another element (I.e. doesn't have their own ID)
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
const GNEAttributeCarrier * getFrontAttributeCarrier() const
get front attributeCarrier
bool isAttributeCarrierInspected(const GNEAttributeCarrier *AC) const
check if attribute carrier is being inspected
Stores the information about how to visualize structures.
bool drawForRectangleSelection
whether drawing is performed for the purpose of selecting objects using a rectangle
bool drawForPositionSelection
whether drawing is performed for the purpose of selecting objects with a single click
bool drawDottedContour() const
check if dotted contour can be drawn