Skip to content

Commit

Permalink
Updated Junctions. Refs #13894
Browse files Browse the repository at this point in the history
  • Loading branch information
palvarezlopez committed Dec 19, 2023
1 parent b1d9528 commit 9c73f26
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 29 deletions.
4 changes: 2 additions & 2 deletions src/netedit/elements/network/GNECrossing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ GNECrossing::drawGL(const GUIVisualizationSettings& s) const {
// get detail level
const auto d = s.getDetailLevel(selectionScale);
// check if draw geometry
if (!s.drawForObjectUnderCursor && (d <= GUIVisualizationSettings::Detail::Crossing)) {
if (!s.drawForObjectUnderCursor) {
// get color
RGBColor crossingColor = getCrossingColor(s, NBCrossing);
// don't draw crossing in TLS Mode (but draw the TLS links)
Expand All @@ -238,7 +238,7 @@ GNECrossing::drawGL(const GUIVisualizationSettings& s) const {
// set color
GLHelper::setColor(crossingColor);
// draw depending of level of detail
if (d <= GUIVisualizationSettings::Detail::CrossingDetails) {
if (d <= GUIVisualizationSettings::Detail::JunctionElementDetails) {
drawCrossingDetailed(selectionScale, crossingWidth);
} else {
GLHelper::drawBoxLines(myCrossingGeometry.getShape(), crossingWidth);
Expand Down
41 changes: 21 additions & 20 deletions src/netedit/elements/network/GNEJunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1727,27 +1727,28 @@ GNEJunction::drawJunctionName(const GUIVisualizationSettings& s, const GUIVisual

void
GNEJunction::drawJunctionChildren(const GUIVisualizationSettings& s, const GUIVisualizationSettings::Detail d) const {
// draw crossings
for (const auto& crossing : myGNECrossings) {
crossing->drawGL(s);
}
// draw walkingAreas
for (const auto& walkingArea : myGNEWalkingAreas) {
walkingArea->drawGL(s);
}
// draw internalLanes
for (const auto& internalLanes : myInternalLanes) {
internalLanes->drawGL(s);
}
// draw connections and route elements connections (Only for incoming edges)
for (const auto& incomingEdge : myGNEIncomingEdges) {
for (const auto& connection : incomingEdge->getGNEConnections()) {
connection->drawGL(s);
// check if draw junction elements
if (s.drawForObjectUnderCursor || (d <= GUIVisualizationSettings::Detail::JunctionElement)) {
// draw crossings
for (const auto& crossing : myGNECrossings) {
crossing->drawGL(s);
}
for (const auto& walkingArea : myGNEWalkingAreas) {
walkingArea->drawGL(s);
}
// draw internalLanes
for (const auto& internalLanes : myInternalLanes) {
internalLanes->drawGL(s);
}
for (const auto& incomingEdge : myGNEIncomingEdges) {
for (const auto& connection : incomingEdge->getGNEConnections()) {
connection->drawGL(s);
}
}
// draw child demand elements
for (const auto& demandElement : getChildDemandElements()) {
demandElement->drawGL(s);
}
}
// draw child demand elements
for (const auto& demandElement : getChildDemandElements()) {
demandElement->drawGL(s);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/netedit/elements/network/GNEWalkingArea.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ GNEWalkingArea::drawGL(const GUIVisualizationSettings& s) const {
// get detail level
const auto d = s.getDetailLevel(walkingAreaExaggeration);
// draw geometry only if we'rent in drawForObjectUnderCursor mode
if (!s.drawForObjectUnderCursor && (d <= GUIVisualizationSettings::Detail::WalkingArea)) {
if (!s.drawForObjectUnderCursor) {
// set shape color
const RGBColor walkingAreaColor = myShapeEdited ? s.colorSettings.editShapeColor : isAttributeCarrierSelected() ? RGBColor::BLUE : s.junctionColorer.getScheme().getColor(6);
// adjust shape to exaggeration
Expand Down Expand Up @@ -351,7 +351,7 @@ GNEWalkingArea::drawTesselatedWalkingArea(const GUIVisualizationSettings& s, con
// set color
GLHelper::setColor(color);
// check if draw polygon or tesselation
if (d <= GUIVisualizationSettings::Detail::WalkingAreaDetails) {
if (d <= GUIVisualizationSettings::Detail::JunctionElementDetails) {
// draw shape with high detail
myTesselation.drawTesselation(myTesselation.getShape());
} else {
Expand Down
8 changes: 3 additions & 5 deletions src/utils/gui/settings/GUIVisualizationSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -547,17 +547,15 @@ class GUIVisualizationSettings {
LaneDetails = 0, // offset, icons, indicators...
Text = 0,
VehiclePoly = 0,
CrossingDetails = 0,
WalkingAreaDetails = 0,
JunctionElementDetails = 0,

Level1 = 1, // circle resolution = 8, polygons, no lane details
CircleResolution16 = 1,
DrawPolygon = 1,
VehicleBox = 1,
AdditionalDetails = 1, // stoppingPlace signs, EntryExit arrows...
GeometryPoint = 1,
Crossing = 1,
WalkingArea = 1,
JunctionElement = 1, // crossings, walking area, connections and internal lanes

Level2 = 2, // circle as squares, squares instead polygons, no text, no geometry points and no junction/lane paths
CircleResolution8 = 2,
Expand All @@ -571,11 +569,11 @@ class GUIVisualizationSettings {

Level3 = 3,
CircleResolutionSquare = 3,
DrawPolygonBoundary = 3,
LaneSimple = 3,

Level4 = 4,
LaneSimpleOnlyFirst = 4,
DrawPolygonBoundary = 4,
};

/// @brief constructor
Expand Down

0 comments on commit 9c73f26

Please sign in to comment.