58 #ifdef CHECK_MEMORY_LEAKS 70 for (
int i = 0; i < (int)additionalChilds.size(); i++) {
74 for (
int i = 0; i < (int)edgeChilds.size(); i++) {
75 edgeChilds.at(i)->addAdditionalSet(
this);
77 myEdgeChild.
edge = edgeChilds.at(i);
81 for (
int i = 0; i < (int)laneChilds.size(); i++) {
82 laneChilds.at(i)->addAdditionalSet(
this);
84 myLaneChild.
lane = laneChilds.at(i);
95 for (childEdges::iterator i = childEdgesToRemove.begin(); i != childEdgesToRemove.end(); i++) {
96 (i->edge->removeAdditionalSet(
this));
100 for (childLanes::iterator i = childLanesToRemove.begin(); i != childLanesToRemove.end(); i++) {
101 (i->lane->removeAdditionalSet(
this));
109 if ((*i) == additional) {
122 if ((*i) == additional) {
136 if (i->edge == edge) {
142 myEdgeChild.
edge = edge;
152 if (i->edge == edge) {
166 if (i->lane == lane) {
172 myLaneChild.
lane = lane;
182 if (i->lane == lane) {
200 Position PositionOfChild = (*i)->getPositionInView();
210 i->positionsOverLanes.clear();
211 i->rotationsOverLanes.clear();
213 for (
int j = 0; j < (int)i->edge->getLanes().size(); j++) {
214 i->positionsOverLanes.push_back(i->edge->getLanes().at(j)->getShape().positionAtOffset(i->edge->getLanes().at(j)->getShape().length() - 10));
215 i->rotationsOverLanes.push_back(i->edge->getLanes().at(j)->getShape().rotationDegreeAtOffset(i->edge->getLanes().at(j)->getShape().length() - 10) * -1);
218 Position middlePoint((i->positionsOverLanes.front().x() + i->positionsOverLanes.back().x()) / 2, (i->positionsOverLanes.front().y() + i->positionsOverLanes.back().y()) / 2);
228 i->positionOverLane = i->lane->getShape().positionAtOffset(i->lane->getShape().length() - 10);
229 i->rotationOverLane = i->lane->getShape().rotationDegreeAtOffset(i->lane->getShape().length() - 10) * -1;
245 glTranslated(0, 0,
getType() - 0.01);
259 glTranslated(0, 0,
getType() - 0.01);
264 Position middlePoint((i->positionsOverLanes.front().x() + i->positionsOverLanes.back().x()) / 2, (i->positionsOverLanes.front().y() + i->positionsOverLanes.back().y()) / 2);
276 glTranslated(0, 0,
getType() - 0.01);
291 (*i)->writeAdditional(device, currentDirectory);
314 std::vector<std::string>
317 std::vector<std::string> vectorOfAdditionalsIds;
323 return vectorOfAdditionalsIds;
327 std::vector<std::string>
330 std::vector<std::string> vectorOfEdgesIds;
336 return vectorOfEdgesIds;
340 std::vector<std::string>
343 std::vector<std::string> vectorOfLanesIds;
349 return vectorOfLanesIds;
357 i->edge->removeAdditionalSet(
this);
362 for (std::vector<GNEEdge*>::iterator i = edges.begin(); i != edges.end(); i++) {
363 (*i)->addAdditionalSet(
this);
375 i->lane->removeAdditionalSet(
this);
380 for (std::vector<GNELane*>::iterator i = lanes.begin(); i != lanes.end(); i++) {
381 (*i)->addAdditionalSet(
this);
bool removeLaneChild(GNELane *lane)
remove lane element to this set
bool addEdgeChild(GNEEdge *edge)
add edge element to this set
SumoXMLTag
Numbers representing SUMO-XML - element names.
void setLaneChilds(std::vector< GNELane * > lanes)
set lane childs
bool addLaneChild(GNELane *lane)
add lane element to this set
int getNumberOfAdditionalChilds() const
get number of additional childs of this additionalSet
~GNEAdditionalSet()
Destructor.
childEdges myChildEdges
map of child edges and their positions and rotation
childLanes myChildLanes
list of child lanes and their positions and rotation
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
GNEAdditionalSet(const std::string &id, GNEViewNet *viewNet, Position pos, SumoXMLTag tag, bool blocked=false, std::vector< GNEAdditional * > additionalChilds=std::vector< GNEAdditional * >(), std::vector< GNEEdge * > edgeChilds=std::vector< GNEEdge * >(), std::vector< GNELane * > laneChilds=std::vector< GNELane * >())
Constructor.
SUMOReal x() const
Returns the x-position.
bool removeEdgeChild(GNEEdge *edge)
remove edge element to this set
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
std::map< GUIGlObject *, Position > myConnectionMiddlePosition
map to keep the middle position of connection
void updateConnections()
update connections.
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
A point in 2D or 3D with translation and scaling methods.
void setEdgeChilds(std::vector< GNEEdge * > edges)
set edge childs
bool addAdditionalChild(GNEAdditional *additional)
add additional element to this set
bool removeAdditionalChild(GNEAdditional *additional)
remove additional element to this set
void drawConnections() const
draw connections.
A road/street connecting two junctions (netedit-version)
std::vector< GNEAdditional * > myChildAdditionals
list of additional childs (Position and rotations is derived from additional)
int getNumberOfEdgeChilds() const
get number of edge childs of this additionalSet
std::vector< std::string > getAdditionalChildIds() const
get ids of additional childs
int getNumberOfLaneChilds() const
get number of lane childs of this additionalSet
An Element which don't belongs to GNENet but has influency in the simulation.
SUMOReal y() const
Returns the y-position.
virtual void updateGeometry()=0
update pre-computed geometry information
std::vector< laneChild > childLanes
void writeAdditionalChildrens(OutputDevice &device, const std::string ¤tDirectory)
writte children of this additionalSet
std::vector< std::string > getEdgeChildIds() const
get ids of edge childs
SUMOReal distanceTo2D(const Position &p2) const
returns the euclidean distance in the x-y-plane
static void drawLine(const Position &beg, SUMOReal rot, SUMOReal visLength)
Draws a thin line.
Static storage of an output device and its base (abstract) implementation.
Position myPosition
The position in which this additional element is located.
std::vector< std::string > getLaneChildIds() const
get ids of lane childs
std::vector< edgeChild > childEdges
SUMOReal angleTo2D(const Position &other) const
returns the angle in the plane of the vector pointing from here to the other position ...