Skip to content

Commit

Permalink
Fixed #15322
Browse files Browse the repository at this point in the history
  • Loading branch information
palvarezlopez committed Sep 11, 2024
1 parent c6eb753 commit a79689b
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 38 deletions.
61 changes: 33 additions & 28 deletions src/netedit/GNEViewNet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -601,36 +601,41 @@ GNEViewNet::openObjectDialogAtCursor(const FXEvent* /*ev*/) {
bool connections = false;
bool TLS = false;
// fill filtered objects
for (const auto& glObject : myViewObjectsSelector.getGLObjects()) {
// always avoid edges
if (glObject->getType() == GLO_EDGE) {
continue;
}
if (glObject->getType() == GLO_CONNECTION) {
connections = true;
}
if (glObject->getType() == GLO_TLLOGIC) {
TLS = true;
}
filteredGLObjects.push_back(glObject);
}
auto it = filteredGLObjects.begin();
if (connections) {
// filter junctions if there are connections
while (it != filteredGLObjects.end()) {
if ((*it)->getType() == GLO_JUNCTION) {
it = filteredGLObjects.erase(it);
} else {
it++;
if ((myViewObjectsSelector.getGLObjects().size() == 1) && (myViewObjectsSelector.getGLObjects().back()->getType() == GLO_EDGE)) {
// special case for edge geometry points (because edges uses the lane pop ups)
filteredGLObjects.push_back(myViewObjectsSelector.getGLObjects().back());
} else {
for (const auto& glObject : myViewObjectsSelector.getGLObjects()) {
// always avoid edges
if (glObject->getType() == GLO_EDGE) {
continue;
}
if (glObject->getType() == GLO_CONNECTION) {
connections = true;
}
if (glObject->getType() == GLO_TLLOGIC) {
TLS = true;
}
filteredGLObjects.push_back(glObject);
}
} else if (TLS) {
// filter all elements except TLLogic
while (it != filteredGLObjects.end()) {
if ((*it)->getType() != GLO_TLLOGIC) {
it = filteredGLObjects.erase(it);
} else {
it++;
auto it = filteredGLObjects.begin();
if (connections) {
// filter junctions if there are connections
while (it != filteredGLObjects.end()) {
if ((*it)->getType() == GLO_JUNCTION) {
it = filteredGLObjects.erase(it);
} else {
it++;
}
}
} else if (TLS) {
// filter all elements except TLLogic
while (it != filteredGLObjects.end()) {
if ((*it)->getType() != GLO_TLLOGIC) {
it = filteredGLObjects.erase(it);
} else {
it++;
}
}
}
}
Expand Down
13 changes: 3 additions & 10 deletions src/netedit/elements/network/GNEEdge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -677,16 +677,9 @@ GNEEdge::getOptionalName() const {

GUIGLObjectPopupMenu*
GNEEdge::getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent) {
GUIGLObjectPopupMenu* ret = new GUIGLObjectPopupMenu(app, parent, *this);
buildPopupHeader(ret, app);
buildCenterPopupEntry(ret);
buildNameCopyPopupEntry(ret);
// build selection and show parameters menu
myNet->getViewNet()->buildSelectionACPopupEntry(ret, this);
buildShowParamsPopupEntry(ret);
// build position copy entry
buildPositionCopyEntry(ret, app);
return ret;
// if we call this function, that's mean that we're clicked over a edge geometry point, then
// open the popup dialog of the lane[0] (back)
return myLanes.back()->getPopUpMenu(app, parent);
}


Expand Down

0 comments on commit a79689b

Please sign in to comment.