Skip to content

Commit

Permalink
Updated GNETAZ. Refs #13894
Browse files Browse the repository at this point in the history
  • Loading branch information
palvarezlopez committed Dec 19, 2023
1 parent fd223e4 commit 82416f1
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 26 deletions.
39 changes: 20 additions & 19 deletions src/netedit/elements/GNEContour.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,27 +237,28 @@ GNEContour::drawDottedContourGeometryPoints(const GUIVisualizationSettings& s, c
if (!s.disableDottedContours && (d <= GUIVisualizationSettings::Detail::DottedContours)) {
// get geometry points
const auto &geometryPoints = gViewObjectsHandler.getGeometryPoints(glObject);
// draw every geometry point
for (const auto &geometryPoint : geometryPoints) {
// create circle shape
const auto circleShape = GUIGeometry::getVertexCircleAroundPosition(shape[geometryPoint], radius * scale, 16);
// calculate dotted geometry
const auto dottedGeometry = GUIDottedGeometry(s, d, circleShape, true);
// reset dotted geometry color
myDottedGeometryColor.reset();
// Push draw matrix
GLHelper::pushMatrix();
// translate to front
glTranslated(0, 0, GLO_DOTTEDCONTOUR);
// draw dotted geometries
dottedGeometry.drawDottedGeometry(s, GUIDottedGeometry::DottedContourType::MOVE, myDottedGeometryColor, lineWidth, 0);
// pop matrix
GLHelper::popMatrix();
}
// get temporal position over shape
const auto &posOverShape = gViewObjectsHandler.getPositionOverShape(glObject);
// draw if is defined
if (posOverShape != Position::INVALID) {
// either draw geometry points or position over shape
if (geometryPoints.size() > 0) {
// draw every geometry point
for (const auto &geometryPoint : geometryPoints) {
// create circle shape
const auto circleShape = GUIGeometry::getVertexCircleAroundPosition(shape[geometryPoint], radius * scale, 16);
// calculate dotted geometry
const auto dottedGeometry = GUIDottedGeometry(s, d, circleShape, true);
// reset dotted geometry color
myDottedGeometryColor.reset();
// Push draw matrix
GLHelper::pushMatrix();
// translate to front
glTranslated(0, 0, GLO_DOTTEDCONTOUR);
// draw dotted geometries
dottedGeometry.drawDottedGeometry(s, GUIDottedGeometry::DottedContourType::MOVE, myDottedGeometryColor, lineWidth, 0);
// pop matrix
GLHelper::popMatrix();
}
} else if (posOverShape != Position::INVALID) {
// create circle shape
const auto circleShape = GUIGeometry::getVertexCircleAroundPosition(posOverShape, radius * scale, 16);
// calculate dotted geometry
Expand Down
17 changes: 10 additions & 7 deletions src/netedit/elements/additional/GNETAZ.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,6 @@ GNETAZ::drawGL(const GUIVisualizationSettings& s) const {
const auto d = s.getDetailLevel(TAZExaggeration);
// draw geometry only if we'rent in drawForObjectUnderCursor mode
if (!s.drawForObjectUnderCursor) {
// check if draw start und end
const bool drawExtremeSymbols = myNet->getViewNet()->getEditModes().isCurrentSupermodeNetwork() &&
myNet->getViewNet()->getEditModes().networkEditMode == NetworkEditMode::NETWORK_MOVE;
// Obtain constants
const Position mousePosition = myNet->getViewNet()->getPositionInformation();
const bool drawFill = (myNet->getViewNet()->getEditModes().isCurrentSupermodeData() && myNet->getViewNet()->getDataViewOptions().TAZDrawFill()) ? true : getFill();
Expand Down Expand Up @@ -339,13 +336,19 @@ GNETAZ::drawGL(const GUIVisualizationSettings& s) const {
// pop contour matrix
GLHelper::popMatrix();
// draw shape points only in Network supemode
if (s.drawMovingGeometryPoint(TAZExaggeration, s.neteditSizeSettings.polygonGeometryPointRadius) && myNet->getViewNet()->getEditModes().isCurrentSupermodeNetwork()) {
// check move mode flag
if (myNet->getViewNet()->getEditModes().isCurrentSupermodeNetwork()) {
// check if we're in move mode
const bool moveMode = (myNet->getViewNet()->getEditModes().networkEditMode == NetworkEditMode::NETWORK_MOVE);
// get geometry point sizes
const double geometryPointSize = s.neteditSizeSettings.polygonGeometryPointRadius * (moveMode ? 1 : 0.5);
// draw geometry points
GUIGeometry::drawGeometryPoints(s, d, myAdditionalGeometry.getShape(), darkerColor,
s.neteditSizeSettings.polygonGeometryPointRadius * (moveMode ? 1 : 0.5), TAZExaggeration,
GUIGeometry::drawGeometryPoints(s, d, myAdditionalGeometry.getShape(), darkerColor, geometryPointSize, TAZExaggeration,
myNet->getViewNet()->getNetworkViewOptions().editingElevation());
// draw dotted contours for geometry points if we're in move mode
if (moveMode) {
myAdditionalContour.drawDottedContourGeometryPoints(s, d, this, myAdditionalGeometry.getShape(), geometryPointSize,
TAZExaggeration, s.dottedContourSettings.segmentWidthSmall);
}
}
}
// draw center
Expand Down

0 comments on commit 82416f1

Please sign in to comment.