Skip to content

Commit

Permalink
Updated editing of connection, crossing and junctions. Refs #13894
Browse files Browse the repository at this point in the history
  • Loading branch information
palvarezlopez committed Dec 19, 2023
1 parent 04e7b3d commit 5ac27b7
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 8 deletions.
7 changes: 6 additions & 1 deletion src/netedit/elements/network/GNEConnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -393,13 +393,18 @@ GNEConnection::drawGL(const GUIVisualizationSettings& s) const {
if (!s.drawForObjectUnderCursor) {
// draw connection
drawConnection(s, d, shapeSuperposed, connectionExaggeration);

// draw lock icon
GNEViewNetHelper::LockIcon::drawLockIcon(d, this, getType(), getPositionInView(), 0.1);
}
// draw dotted geometry
myContour.drawDottedContourExtruded(s, d, shapeSuperposed, s.connectionSettings.connectionWidth, connectionExaggeration, true, true, 0,
s.dottedContourSettings.segmentWidthSmall);
// check geometry points if we're editing shape
if (myShapeEdited) {
myContour.drawDottedContourGeometryPoints(s, d, shapeSuperposed, GNEContour::GeometryPoint::ALL,
s.neteditSizeSettings.connectionGeometryPointRadius, connectionExaggeration,
s.dottedContourSettings.segmentWidth);
}
}
}

Expand Down
20 changes: 13 additions & 7 deletions src/netedit/elements/network/GNECrossing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,11 @@ GNECrossing::drawGL(const GUIVisualizationSettings& s) const {
// get NBCrossing
const auto NBCrossing = getNBCrossing();
// get scaling depending if attribute carrier is selected
const double selectionScale = isAttributeCarrierSelected() ? s.selectorFrameScale : 1;
const double crossingExaggeration = isAttributeCarrierSelected() ? s.selectorFrameScale : 1;
// get width
const double crossingWidth = NBCrossing->width * 0.5 * selectionScale;
const double crossingWidth = NBCrossing->width * 0.5 * crossingExaggeration;
// get detail level
const auto d = s.getDetailLevel(selectionScale);
const auto d = s.getDetailLevel(crossingExaggeration);
// check if draw geometry
if (!s.drawForObjectUnderCursor) {
// get color
Expand All @@ -235,13 +235,13 @@ GNECrossing::drawGL(const GUIVisualizationSettings& s) const {
GLHelper::setColor(crossingColor);
// draw depending of level of detail
if (d <= GUIVisualizationSettings::Detail::JunctionElementDetails) {
drawCrossingDetailed(selectionScale, crossingWidth);
drawCrossingDetailed(crossingExaggeration, crossingWidth);
} else {
GLHelper::drawBoxLines(myCrossingGeometry.getShape(), crossingWidth);
}
// draw shape points only in Network supemode
if (myShapeEdited && myNet->getViewNet()->getEditModes().isCurrentSupermodeNetwork() &&
s.drawMovingGeometryPoint(selectionScale, s.neteditSizeSettings.crossingGeometryPointRadius)) {
s.drawMovingGeometryPoint(crossingExaggeration, s.neteditSizeSettings.crossingGeometryPointRadius)) {
// get edit modes
const auto& editModes = myNet->getViewNet()->getEditModes();
// check if draw start und end
Expand All @@ -251,7 +251,7 @@ GNECrossing::drawGL(const GUIVisualizationSettings& s) const {
const RGBColor darkerColor = crossingColor.changedBrightness(-32);
// draw geometry points
GUIGeometry::drawGeometryPoints(s, d, this, myCrossingGeometry.getShape(), darkerColor,
s.neteditSizeSettings.crossingGeometryPointRadius, selectionScale,
s.neteditSizeSettings.crossingGeometryPointRadius, crossingExaggeration,
myNet->getViewNet()->getNetworkViewOptions().editingElevation(),
myNet->getViewNet()->getEditModes().networkEditMode == NetworkEditMode::NETWORK_MOVE);
}
Expand All @@ -268,8 +268,14 @@ GNECrossing::drawGL(const GUIVisualizationSettings& s) const {
GNEViewNetHelper::LockIcon::drawLockIcon(d, this, getType(), getPositionInView(), 1);
}
// draw dotted geometry
myContour.drawDottedContourExtruded(s, d, myCrossingGeometry.getShape(), crossingWidth, selectionScale, true, true, 0,
myContour.drawDottedContourExtruded(s, d, myCrossingGeometry.getShape(), crossingWidth, crossingExaggeration, true, true, 0,
s.dottedContourSettings.segmentWidth);
// check geometry points if we're editing shape
if (myShapeEdited) {
myContour.drawDottedContourGeometryPoints(s, d, myCrossingGeometry.getShape(), GNEContour::GeometryPoint::ALL,
s.neteditSizeSettings.connectionGeometryPointRadius, crossingExaggeration,
s.dottedContourSettings.segmentWidth);
}
}
}

Expand Down
6 changes: 6 additions & 0 deletions src/netedit/elements/network/GNEJunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,12 @@ GNEJunction::drawGL(const GUIVisualizationSettings& s) const {
myCircleContour.drawDottedContourCircle(s, d, myNBNode->getCenter(), s.neteditSizeSettings.junctionBubbleRadius, junctionExaggeration,
s.dottedContourSettings.segmentWidth);
}
// check geometry points if we're editing shape
if (myShapeEdited) {
myContour.drawDottedContourGeometryPoints(s, d, myNBNode->getShape(), GNEContour::GeometryPoint::ALL,
s.neteditSizeSettings.connectionGeometryPointRadius, junctionExaggeration,
s.dottedContourSettings.segmentWidth);
}
}
}

Expand Down

0 comments on commit 5ac27b7

Please sign in to comment.