Skip to content

Commit

Permalink
Now network draws boundary. Refs #13894
Browse files Browse the repository at this point in the history
  • Loading branch information
palvarezlopez committed Dec 19, 2023
1 parent 647aad7 commit bd7e30c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
6 changes: 4 additions & 2 deletions src/netedit/GNENet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
#include <utils/gui/globjects/GUIGLObjectPopupMenu.h>
#include <utils/gui/globjects/GUIGlObjectStorage.h>
#include <utils/options/OptionsCont.h>
#include <utils/gui/div/GLHelper.h>

#include "GNEApplicationWindow.h"
#include "GNENet.h"
Expand Down Expand Up @@ -176,8 +177,9 @@ GNENet::getParameterWindow(GUIMainWindow& app, GUISUMOAbstractView&) {


void
GNENet::drawGL(const GUIVisualizationSettings& /*s*/) const {
// nothing to drawn
GNENet::drawGL(const GUIVisualizationSettings& s) const {
// draw boundaries
GLHelper::drawBoundary(s, getCenteringBoundary());
}


Expand Down
16 changes: 8 additions & 8 deletions src/netedit/GNEViewNet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1286,6 +1286,12 @@ GNEViewNet::doPaintGL(int mode, const Boundary& bound) {
// set lefthand and laneIcons
myVisualizationSettings->lefthand = OptionsCont::getOptions().getBool("lefthand");
myVisualizationSettings->disableLaneIcons = OptionsCont::getOptions().getBool("disable-laneIcons");
// check if force drawing for rectangle selection
if (myVisualizationSettings->forceDrawForRectangleSelection) {
myVisualizationSettings->drawForRectangleSelection = true;
}
// first step: update objects under cursor
updateObjectsUnderCursor(myNet->getViewNet()->getPositionInformation());
// set render modes
glRenderMode(mode);
glMatrixMode(GL_MODELVIEW);
Expand All @@ -1295,12 +1301,6 @@ GNEViewNet::doPaintGL(int mode, const Boundary& bound) {
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_DEPTH_TEST);
// first step: update objects under cursor
updateObjectsUnderCursor(myNet->getViewNet()->getPositionInformation());
// check if force drawing for rectangle selection
if (myVisualizationSettings->forceDrawForRectangleSelection) {
myVisualizationSettings->drawForRectangleSelection = true;
}
// visualize rectangular selection
mySelectingArea.drawRectangleSelection(myVisualizationSettings->colorSettings.selectionColor);
// draw certain elements only if we aren't in rectangle selection mode
Expand Down Expand Up @@ -1345,6 +1345,8 @@ GNEViewNet::doPaintGL(int mode, const Boundary& bound) {
}
// clear pathDraw
myNet->getPathManager()->getPathDraw()->clearPathDraw();
// draw network (boundary
myNet->drawGL(*myVisualizationSettings);
// draw all GL elements
int hits = drawGLElements(bound);
// force draw inspected and front elements (due parent/child lines)
Expand Down Expand Up @@ -3260,8 +3262,6 @@ GNEViewNet::updateObjectsUnderCursor(const Position &pos) {
gPostDrawing.clearElements();
// push matrix
GLHelper::pushMatrix();
// draw back (to avoid overlapping)
glTranslated(0, 0, -10);
// enable draw for object under cursor
myVisualizationSettings->drawForObjectUnderCursor = true;
// create an small boundary
Expand Down

0 comments on commit bd7e30c

Please sign in to comment.