diff --git a/src/netedit/elements/demand/GNEContainer.cpp b/src/netedit/elements/demand/GNEContainer.cpp index 529107700511..2f9736e41329 100644 --- a/src/netedit/elements/demand/GNEContainer.cpp +++ b/src/netedit/elements/demand/GNEContainer.cpp @@ -390,7 +390,7 @@ GNEContainer::drawGL(const GUIVisualizationSettings& s) const { } // draw stack label if (myStackedLabelNumber > 0) { - drawStackLabel(myStackedLabelNumber, "container", Position(containerPosition.x() - 2.5, containerPosition.y() - 0.8), -90, 1.3, 5, getExaggeration(s), false); + drawStackLabel(myStackedLabelNumber, "container", Position(containerPosition.x() - 2.5, containerPosition.y() - 0.8), -90, 1.3, 5, getExaggeration(s)); } else if (getChildDemandElements().front()->getTagProperty().getTag() == GNE_TAG_STOPCONTAINER_CONTAINERSTOP) { // declare counter for stacked containers over stops int stackedCounter = 0; @@ -409,12 +409,12 @@ GNEContainer::drawGL(const GUIVisualizationSettings& s) const { } // if we have more than two stacked elements, draw label if (stackedCounter > 1) { - drawStackLabel(stackedCounter, "container", Position(containerPosition.x() - 2.5, containerPosition.y() - 0.8), -90, 1.3, 5, getExaggeration(s), false); + drawStackLabel(stackedCounter, "container", Position(containerPosition.x() - 2.5, containerPosition.y() - 0.8), -90, 1.3, 5, getExaggeration(s)); } } // draw flow label if (myTagProperty.isFlow()) { - drawFlowLabel(Position(containerPosition.x() - 1, containerPosition.y() - 4.25), -90, 1.8, 2, getExaggeration(s), false); + drawFlowLabel(Position(containerPosition.x() - 1, containerPosition.y() - 4.25), -90, 1.8, 2, getExaggeration(s)); } // draw name drawName(containerPosition, s.scale, s.containerName, s.angle); diff --git a/src/netedit/elements/demand/GNEDemandElement.cpp b/src/netedit/elements/demand/GNEDemandElement.cpp index 62eaf606190a..24b0f6d4867b 100644 --- a/src/netedit/elements/demand/GNEDemandElement.cpp +++ b/src/netedit/elements/demand/GNEDemandElement.cpp @@ -524,19 +524,15 @@ GNEDemandElement::drawJunctionLine(const GNEDemandElement* element) const { void GNEDemandElement::drawStackLabel(const int number, const std::string& element, const Position& position, const double rotation, - const double width, const double length, const double exaggeration, const bool contour) const { + const double width, const double length, const double exaggeration) const { // declare contour width const double contourWidth = (0.05 * exaggeration); // Push matrix GLHelper::pushMatrix(); // Traslate to top - glTranslated(position.x(), position.y(), GLO_ROUTE + getType() + 0.1 + GLO_PERSONFLOW); + glTranslated(position.x(), position.y(), GLO_VEHICLELABELS); glRotated(rotation, 0, 0, -1); - if (contour) { - glTranslated((width * exaggeration * 0.5) + (0.35 * exaggeration) + 0.4, 0, 0); - } else { - glTranslated((width * exaggeration * 0.5) + (0.35 * exaggeration), 0, 0); - } + glTranslated((width * exaggeration * 0.5) + (0.35 * exaggeration) + 0.05, 0, 0); // draw external box GLHelper::setColor(RGBColor::GREY); GLHelper::drawBoxLine(Position(), 0, (length * exaggeration), 0.3 * exaggeration); diff --git a/src/netedit/elements/demand/GNEDemandElement.h b/src/netedit/elements/demand/GNEDemandElement.h index ddc824c41bd0..dd8efc9bc685 100644 --- a/src/netedit/elements/demand/GNEDemandElement.h +++ b/src/netedit/elements/demand/GNEDemandElement.h @@ -374,7 +374,7 @@ class GNEDemandElement : public GNEPathElement, public GNEHierarchicalElement, p /// @brief draw stack label void drawStackLabel(const int number, const std::string& element, const Position& position, const double rotation, - const double width, const double length, const double exaggeration, const bool contour) const; + const double width, const double length, const double exaggeration) const; /// @name replace parent elements /// @{ diff --git a/src/netedit/elements/demand/GNEDemandElementFlow.cpp b/src/netedit/elements/demand/GNEDemandElementFlow.cpp index 4c50096ce197..51df197de44c 100644 --- a/src/netedit/elements/demand/GNEDemandElementFlow.cpp +++ b/src/netedit/elements/demand/GNEDemandElementFlow.cpp @@ -46,21 +46,17 @@ GNEDemandElementFlow::~GNEDemandElementFlow() {} void -GNEDemandElementFlow::drawFlowLabel(const Position& position, const double rotation, const double width, const double length, - const double exaggeration, const bool contour) const { +GNEDemandElementFlow::drawFlowLabel(const Position& position, const double rotation, const double width, + const double length, const double exaggeration) const { // declare contour width const double contourWidth = (0.05 * exaggeration); // Push matrix GLHelper::pushMatrix(); // Traslate to bot - glTranslated(position.x(), position.y(), GLO_PERSONFLOW + 0.1); + glTranslated(position.x(), position.y(), GLO_VEHICLELABELS); // glTranslated(position.x(), position.y(), GLO_ROUTE + getType() + 0.1 + GLO_PERSONFLOW + 0.1); glRotated(rotation, 0, 0, -1); - if (contour) { - glTranslated(-1 * ((width * 0.5 * exaggeration) + (0.35 * exaggeration)) - 0.4, 0, 0); - } else { - glTranslated(-1 * ((width * 0.5 * exaggeration) + (0.35 * exaggeration)), 0, 0); - } + glTranslated(-1 * ((width * 0.5 * exaggeration) + (0.35 * exaggeration)) - 0.05, 0, 0); // draw external box GLHelper::setColor(RGBColor::GREY); GLHelper::drawBoxLine(Position(), Position(), 0, (length * exaggeration), 0.3 * exaggeration); diff --git a/src/netedit/elements/demand/GNEDemandElementFlow.h b/src/netedit/elements/demand/GNEDemandElementFlow.h index 7a72a776c106..2c4220a26f1a 100644 --- a/src/netedit/elements/demand/GNEDemandElementFlow.h +++ b/src/netedit/elements/demand/GNEDemandElementFlow.h @@ -48,8 +48,8 @@ class GNEDemandElementFlow : public SUMOVehicleParameter { ~GNEDemandElementFlow(); /// @brief draw flow label - void drawFlowLabel(const Position& position, const double rotation, const double width, const double length, - const double exaggeration, const bool contour) const; + void drawFlowLabel(const Position& position, const double rotation, const double width, + const double length, const double exaggeration) const; /// @brief write flow attributes void writeFlowAttributes(const GNEDemandElement* flowElement, OutputDevice& device) const; diff --git a/src/netedit/elements/demand/GNEPerson.cpp b/src/netedit/elements/demand/GNEPerson.cpp index 80b3b726c7fc..1f7e287d529f 100644 --- a/src/netedit/elements/demand/GNEPerson.cpp +++ b/src/netedit/elements/demand/GNEPerson.cpp @@ -381,7 +381,7 @@ GNEPerson::drawGL(const GUIVisualizationSettings& s) const { GLHelper::popMatrix(); // draw stack label if (myStackedLabelNumber > 0) { - drawStackLabel(myStackedLabelNumber, "person", Position(personPosition.x() - 2.5, personPosition.y()), -90, 1.3, 5, getExaggeration(s), false); + drawStackLabel(myStackedLabelNumber, "person", Position(personPosition.x() - 2.5, personPosition.y()), -90, 1.3, 5, getExaggeration(s)); } else if ((getChildDemandElements().front()->getTagProperty().getTag() == GNE_TAG_STOPPERSON_BUSSTOP) || (getChildDemandElements().front()->getTagProperty().getTag() == GNE_TAG_STOPPERSON_TRAINSTOP)) { // declare counter for stacked persons over stops @@ -402,12 +402,12 @@ GNEPerson::drawGL(const GUIVisualizationSettings& s) const { } // if we have more than two stacked elements, draw label if (stackedCounter > 1) { - drawStackLabel(stackedCounter, "person", Position(personPosition.x() - 2.5, personPosition.y()), -90, 1.3, 5, getExaggeration(s), false); + drawStackLabel(stackedCounter, "person", Position(personPosition.x() - 2.5, personPosition.y()), -90, 1.3, 5, getExaggeration(s)); } } // draw flow label if (myTagProperty.isFlow()) { - drawFlowLabel(Position(personPosition.x() - 1, personPosition.y() - 0.25), -90, 1.8, 2, getExaggeration(s), false); + drawFlowLabel(Position(personPosition.x() - 1, personPosition.y() - 0.25), -90, 1.8, 2, getExaggeration(s)); } // draw lock icon GNEViewNetHelper::LockIcon::drawLockIcon(d, this, getType(), personPosition, exaggeration, s.dottedContourSettings.segmentWidth); diff --git a/src/netedit/elements/demand/GNEVehicle.cpp b/src/netedit/elements/demand/GNEVehicle.cpp index c46cc6ebbce7..f69936f00457 100644 --- a/src/netedit/elements/demand/GNEVehicle.cpp +++ b/src/netedit/elements/demand/GNEVehicle.cpp @@ -933,16 +933,16 @@ GNEVehicle::drawGL(const GUIVisualizationSettings& s) const { } // draw lock icon GNEViewNetHelper::LockIcon::drawLockIcon(d, this, getType(), vehiclePosition, exaggeration); - // draw dotted contour - const bool dottedContorDrawn = myVehicleContour.drawDottedContours(s, d, this, s.dottedContourSettings.segmentWidth, true); // draw stack label if ((myStackedLabelNumber > 0) && !drawSpreadVehicles) { - drawStackLabel(myStackedLabelNumber, "Vehicle", vehiclePosition, vehicleRotation, width, length, exaggeration, dottedContorDrawn); + drawStackLabel(myStackedLabelNumber, "Vehicle", vehiclePosition, vehicleRotation, width, length, exaggeration); } // draw flow label if (myTagProperty.isFlow()) { - drawFlowLabel(vehiclePosition, vehicleRotation, width, length, exaggeration, dottedContorDrawn); + drawFlowLabel(vehiclePosition, vehicleRotation, width, length, exaggeration); } + // draw dotted contour + myVehicleContour.drawDottedContours(s, d, this, s.dottedContourSettings.segmentWidth, true); } // draw squared shape myVehicleContour.calculateContourRectangleShape(s, d, this, vehiclePosition, length * 0.5, width * 0.5, getType(), diff --git a/src/utils/gui/globjects/GUIGlObject.cpp b/src/utils/gui/globjects/GUIGlObject.cpp index ced2fafabbc4..2f79c0a2eb3e 100644 --- a/src/utils/gui/globjects/GUIGlObject.cpp +++ b/src/utils/gui/globjects/GUIGlObject.cpp @@ -145,6 +145,7 @@ StringBijection::Entry GUIGlObject::GUIGlObjectTypeNamesInitial {"frontElement", GLO_FRONTELEMENT}, {"geometryPoint", GLO_GEOMETRYPOINT}, {"dottedContour", GLO_DOTTEDCONTOUR}, + {"vehicleLabels", GLO_VEHICLELABELS}, {"temporalShape", GLO_TEMPORALSHAPE}, {"rectangleSelection", GLO_RECTANGLESELECTION}, {"testElement", GLO_TESTELEMENT}, diff --git a/src/utils/gui/globjects/GUIGlObjectTypes.h b/src/utils/gui/globjects/GUIGlObjectTypes.h index 561e96212cc8..30e69b07b727 100644 --- a/src/utils/gui/globjects/GUIGlObjectTypes.h +++ b/src/utils/gui/globjects/GUIGlObjectTypes.h @@ -273,6 +273,9 @@ enum GUIGlObjectType { /// @brief dotted contour (used in netedit) GLO_DOTTEDCONTOUR = 1040, + /// @brief stack and flow labels (used in netedit) + GLO_VEHICLELABELS = 1045, + /// @brief temporal shape (used in netedit) GLO_TEMPORALSHAPE = 1050,