Skip to content

Commit

Permalink
removed mouseWithinGeometry calls in gne elements. Refs #13894
Browse files Browse the repository at this point in the history
  • Loading branch information
palvarezlopez committed Dec 19, 2023
1 parent d6f9210 commit 270ec3a
Show file tree
Hide file tree
Showing 38 changed files with 23 additions and 180 deletions.
2 changes: 0 additions & 2 deletions src/netedit/elements/additional/GNEAccess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,6 @@ GNEAccess::drawGL(const GUIVisualizationSettings& s) const {
GLHelper::popMatrix();
// pop gl identificator
GLHelper::popName();
// check if mouse is over access
mouseWithinGeometry(myAdditionalGeometry.getShape().front(), (radius * accessExaggeration));
// draw lock icon
GNEViewNetHelper::LockIcon::drawLockIcon(this, getType(), myAdditionalGeometry.getShape().front(), accessExaggeration, 0.3);
// draw dotted contour
Expand Down
2 changes: 0 additions & 2 deletions src/netedit/elements/additional/GNEAdditional.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -711,8 +711,6 @@ GNEAdditional::drawSquaredAdditional(const GUIVisualizationSettings& s, const Po
GLHelper::popName();
// draw lock icon
GNEViewNetHelper::LockIcon::drawLockIcon(this, getType(), pos, exaggeration, 0.4, 0.5, 0.5);
// check if mouse is over element
mouseWithinGeometry(pos, size, size, 0, 0, 0);
// draw squared shape
myContour.drawDottedContourRectangle(s, pos, size, size, 0, 0, 0, exaggeration,
s.dottedContourSettings.segmentWidth);
Expand Down
3 changes: 0 additions & 3 deletions src/netedit/elements/additional/GNEBusStop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,6 @@ GNEBusStop::drawGL(const GUIVisualizationSettings& s) const {
// draw lock icon
GNEViewNetHelper::LockIcon::drawLockIcon(this, getType(), myAdditionalGeometry.getShape().getCentroid(), busStopExaggeration, (myTagProperty.getTag() == SUMO_TAG_BUS_STOP) ? 0.5 : 0.25);
}
// check if mouse is over element
mouseWithinGeometry(myAdditionalGeometry.getShape(), stopWidth * MIN2(1.0, busStopExaggeration));
mouseWithinGeometry(mySignPos, myCircleWidth);
// draw dotted geometry (don't exaggerate contour)
myContour.drawDottedContourExtruded(s, myAdditionalGeometry.getShape(), stopWidth, 1, true, true,
s.dottedContourSettings.segmentWidth);
Expand Down
3 changes: 0 additions & 3 deletions src/netedit/elements/additional/GNECalibrator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -486,9 +486,6 @@ GNECalibrator::drawCalibratorSymbol(const GUIVisualizationSettings& s, const dou
// pop name
GLHelper::popName();
}
// check if mouse is over element
mouseWithinGeometry(pos, s.additionalSettings.calibratorWidth,
s.additionalSettings.calibratorHeight * 0.5, 0, s.additionalSettings.calibratorHeight * 0.5, rot);
// draw dotted contour
myContour.drawDottedContourRectangle(s, pos, s.additionalSettings.calibratorWidth, s.additionalSettings.calibratorHeight * 0.5, 0,
s.additionalSettings.calibratorHeight * 0.5, rot, exaggeration, s.dottedContourSettings.segmentWidth);
Expand Down
3 changes: 0 additions & 3 deletions src/netedit/elements/additional/GNEChargingStation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,6 @@ GNEChargingStation::drawGL(const GUIVisualizationSettings& s) const {
// draw lock icon
GNEViewNetHelper::LockIcon::drawLockIcon(this, getType(), myAdditionalGeometry.getShape().getCentroid(), chargingStationExaggeration);
}
// check if mouse is over element
mouseWithinGeometry(myAdditionalGeometry.getShape(), s.stoppingPlaceSettings.chargingStationWidth * MIN2(1.0, chargingStationExaggeration));
mouseWithinGeometry(mySignPos, myCircleWidth);
// draw dotted geometry (don't exaggerate contour)
myContour.drawDottedContourExtruded(s, myAdditionalGeometry.getShape(), s.stoppingPlaceSettings.chargingStationWidth, 1, true, true,
s.dottedContourSettings.segmentWidth);
Expand Down
3 changes: 0 additions & 3 deletions src/netedit/elements/additional/GNEContainerStop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,6 @@ GNEContainerStop::drawGL(const GUIVisualizationSettings& s) const {
}
// draw lock icon
GNEViewNetHelper::LockIcon::drawLockIcon(this, getType(), myAdditionalGeometry.getShape().getCentroid(), containerStopExaggeration);
// check if mouse is over element
mouseWithinGeometry(myAdditionalGeometry.getShape(), s.stoppingPlaceSettings.containerStopWidth * MIN2(1.0, containerStopExaggeration));
mouseWithinGeometry(mySignPos, myCircleWidth);
// draw dotted geometry (don't exaggerate contour)
myContour.drawDottedContourExtruded(s, myAdditionalGeometry.getShape(), s.stoppingPlaceSettings.containerStopWidth, 1, true, true,
s.dottedContourSettings.segmentWidth);
Expand Down
4 changes: 0 additions & 4 deletions src/netedit/elements/additional/GNEEntryExitDetector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,6 @@ GNEEntryExitDetector::drawGL(const GUIVisualizationSettings& s) const {
// draw lock icon
GNEViewNetHelper::LockIcon::drawLockIcon(this, getType(), myAdditionalGeometry.getShape().getCentroid(), entryExitExaggeration);
}
// check if mouse is over element
mouseWithinGeometry(myAdditionalGeometry.getShape().front(), 2.7, 1.6, 2, 0,
myAdditionalGeometry.getShapeRotations().front());

// draw dotted contour
myContour.drawDottedContourRectangle(s, myAdditionalGeometry.getShape().front(), 2.7, 1.6, 2, 0,
myAdditionalGeometry.getShapeRotations().front(), entryExitExaggeration,
Expand Down
3 changes: 0 additions & 3 deletions src/netedit/elements/additional/GNEInductionLoopDetector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,6 @@ GNEInductionLoopDetector::drawGL(const GUIVisualizationSettings& s) const {
// draw lock icon
GNEViewNetHelper::LockIcon::drawLockIcon(this, getType(), myAdditionalGeometry.getShape().getCentroid(), E1Exaggeration);
}
// check if mouse is over element
mouseWithinGeometry(myAdditionalGeometry.getShape().front(),
2, 1, 0, 0, myAdditionalGeometry.getShapeRotations().front());
// draw dotted contour
myContour.drawDottedContourRectangle(s, myAdditionalGeometry.getShape().front(), 2, 1, 0, 0,
myAdditionalGeometry.getShapeRotations().front(), E1Exaggeration,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,6 @@ GNEInstantInductionLoopDetector::drawGL(const GUIVisualizationSettings& s) const
// draw lock icon
GNEViewNetHelper::LockIcon::drawLockIcon(this, getType(), myAdditionalGeometry.getShape().getCentroid(), E1InstantExaggeration);
}
// check if mouse is over element
mouseWithinGeometry(myAdditionalGeometry.getShape().front(), 2, 1, 0, 0,
myAdditionalGeometry.getShapeRotations().front());
// draw dotted contour
myContour.drawDottedContourRectangle(s, myAdditionalGeometry.getShape().front(), 2, 1, 0, 0,
myAdditionalGeometry.getShapeRotations().front(), E1InstantExaggeration,
Expand Down
6 changes: 0 additions & 6 deletions src/netedit/elements/additional/GNELaneAreaDetector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,6 @@ GNELaneAreaDetector::drawGL(const GUIVisualizationSettings& s) const {
// draw lock icon
GNEViewNetHelper::LockIcon::drawLockIcon(this, getType(), myAdditionalGeometry.getShape().getCentroid(), E2Exaggeration);
}
// check if mouse is over element
mouseWithinGeometry(myAdditionalGeometry.getShape(), s.detectorSettings.E2Width);
// draw dotted geometry
myContour.drawDottedContourExtruded(s, myAdditionalGeometry.getShape(), s.detectorSettings.E2Width, E2Exaggeration, true, true,
s.dottedContourSettings.segmentWidth);
Expand Down Expand Up @@ -442,8 +440,6 @@ GNELaneAreaDetector::drawLanePartialGL(const GUIVisualizationSettings& s, const
}
// declare trim geometry to draw
const auto shape = (segment->isFirstSegment() || segment->isLastSegment()) ? E2Geometry.getShape() : segment->getLane()->getLaneShape();
// check if mouse is over element
mouseWithinGeometry(shape, s.detectorSettings.E2Width);
// draw dotted geometry
myContour.drawDottedContourExtruded(s, E2Geometry.getShape(), E2DetectorWidth, 1, segment->isFirstSegment(), segment->isLastSegment(),
s.dottedContourSettings.segmentWidth);
Expand Down Expand Up @@ -483,8 +479,6 @@ GNELaneAreaDetector::drawJunctionPartialGL(const GUIVisualizationSettings& s, co
} else {
GUIGeometry::drawGeometry(s, myNet->getViewNet()->getPositionInformation(), connectionGeometry, E2DetectorWidth);
}
// check if mouse is over element
mouseWithinGeometry(connectionGeometry.getShape(), s.detectorSettings.E2Width);
// draw dotted geometry
myContour.drawDottedContourExtruded(s, connectionGeometry.getShape(), E2DetectorWidth, 1, false, false,
s.dottedContourSettings.segmentWidth);
Expand Down
4 changes: 0 additions & 4 deletions src/netedit/elements/additional/GNEOverheadWire.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,6 @@ GNEOverheadWire::drawLanePartialGL(const GUIVisualizationSettings& s, const GNEP
}
// declare trim geometry to draw
const auto shape = (segment->isFirstSegment() || segment->isLastSegment()) ? overheadWireGeometry.getShape() : segment->getLane()->getLaneShape();
// check if mouse is over element
mouseWithinGeometry(shape, overheadWireWidth);
// draw dotted geometry
myContour.drawDottedContourExtruded(s, shape, overheadWireWidth, 1, true, true,
s.dottedContourSettings.segmentWidth);
Expand Down Expand Up @@ -369,8 +367,6 @@ GNEOverheadWire::drawJunctionPartialGL(const GUIVisualizationSettings& s, const
if (segment->getPreviousLane()->getLane2laneConnections().exist(segment->getNextLane())) {
// get shape
const auto& shape = segment->getPreviousLane()->getLane2laneConnections().getLane2laneGeometry(segment->getNextLane()).getShape();
// check if mouse is over element
mouseWithinGeometry(shape, overheadWireWidth);
// draw dotted geometry
myContour.drawDottedContourExtruded(s, shape, overheadWireWidth, 1, true, true,
s.dottedContourSettings.segmentWidth);
Expand Down
6 changes: 0 additions & 6 deletions src/netedit/elements/additional/GNEPOI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -378,12 +378,6 @@ GNEPOI::drawGL(const GUIVisualizationSettings& s) const {
GLHelper::popName();
// draw lock icon
GNEViewNetHelper::LockIcon::drawLockIcon(this, getType(), getPositionInView(), POIExaggeration);
// check if mouse is over element
if (getShapeImgFile().empty()) {
mouseWithinGeometry(*this, 1.3);
} else {
mouseWithinGeometry(*this, getHeight() * 0.5, getWidth() * 0.5, 0, 0, getShapeNaviDegree());
}
// draw contour
if (getShapeImgFile().empty()) {
myContour.drawDottedContourCircle(s, *this, 1.3, POIExaggeration,
Expand Down
3 changes: 0 additions & 3 deletions src/netedit/elements/additional/GNEParkingArea.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,6 @@ GNEParkingArea::drawGL(const GUIVisualizationSettings& s) const {
// draw lock icon
GNEViewNetHelper::LockIcon::drawLockIcon(this, getType(), getPositionInView(), parkingAreaExaggeration);
}
// check if mouse is over element
mouseWithinGeometry(myAdditionalGeometry.getShape(), myWidth * 0.5 * MIN2(1.0, parkingAreaExaggeration));
mouseWithinGeometry(mySignPos, myCircleWidth);
// draw dotted geometry (don't exaggerate contour)
myContour.drawDottedContourExtruded(s, myAdditionalGeometry.getShape(), myWidth * 0.5, 1, true, true,
s.dottedContourSettings.segmentWidth);
Expand Down
2 changes: 0 additions & 2 deletions src/netedit/elements/additional/GNEParkingSpace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,6 @@ GNEParkingSpace::drawGL(const GUIVisualizationSettings& s) const {
// draw lock icon
GNEViewNetHelper::LockIcon::drawLockIcon(this, getType(), myShapeLength.getPolygonCenter(), parkingAreaExaggeration);
}
// check if mouse is over element
mouseWithinGeometry(myShapeLength, width);
// draw dotted geometry
myContour.drawDottedContourExtruded(s, myShapeLength, width, parkingAreaExaggeration, true, true,
s.dottedContourSettings.segmentWidth);
Expand Down
6 changes: 0 additions & 6 deletions src/netedit/elements/additional/GNEPoly.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,12 +370,6 @@ GNEPoly::drawGL(const GUIVisualizationSettings& s) const {
}
}
}
// check if mouse is over element
if (getFill() || myPolygonGeometry.getShape().isClosed()) {
mouseWithinGeometry(myPolygonGeometry.getShape());
} else {
mouseWithinGeometry(myPolygonGeometry.getShape(), s.neteditSizeSettings.polylineWidth);
}
// draw lock icon
GNEViewNetHelper::LockIcon::drawLockIcon(this, getType(), getPositionInView(), polyExaggeration);
// pop layer matrix
Expand Down
2 changes: 0 additions & 2 deletions src/netedit/elements/additional/GNERouteProbe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,6 @@ GNERouteProbe::drawGL(const GUIVisualizationSettings& s) const {
}
// draw additional name
drawAdditionalName(s);
// check if mouse is over element
mouseWithinGeometry(myAdditionalGeometry.getShape(), 0.5);
// draw dotted geometry
myContour.drawDottedContourExtruded(s, myAdditionalGeometry.getShape(), 0.5, routeProbeExaggeration, true, true,
s.dottedContourSettings.segmentWidth);
Expand Down
2 changes: 0 additions & 2 deletions src/netedit/elements/additional/GNETAZ.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,6 @@ GNETAZ::drawGL(const GUIVisualizationSettings& s) const {
}
// draw name
drawName(myTAZCenter, s.scale, s.polyName, s.angle);
// check if mouse is over element
mouseWithinGeometry(myAdditionalGeometry.getShape());
// get contour width
const double contourWidth = (checkDrawFromContour() || checkDrawToContour()) ? s.dottedContourSettings.segmentWidthLarge : s.dottedContourSettings.segmentWidth;
// draw dotted contours
Expand Down
2 changes: 0 additions & 2 deletions src/netedit/elements/additional/GNEVaporizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,6 @@ GNEVaporizer::drawGL(const GUIVisualizationSettings& s) const {
}
// draw additional name
drawAdditionalName(s);
// check if mouse is over element
mouseWithinGeometry(myAdditionalGeometry.getShape(), 0.5);
// draw dotted geometry
myContour.drawDottedContourExtruded(s, myAdditionalGeometry.getShape(), 0.5, vaporizerExaggeration, true, true,
s.dottedContourSettings.segmentWidth);
Expand Down
6 changes: 0 additions & 6 deletions src/netedit/elements/data/GNEEdgeData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,12 +235,6 @@ GNEEdgeData::drawLanePartialGL(const GUIVisualizationSettings& s, const GNEPathM
GLHelper::popMatrix();
// draw lock icon
GNEViewNetHelper::LockIcon::drawLockIcon(this, getType(), getPositionInView(), 1);
// check if mouse is over element
for (const auto& laneEdgeParent : laneEdge->getParentEdge()->getLanes()) {
// get lane drawing constants
GNELane::LaneDrawingConstants laneDrawingConstants(s, laneEdgeParent);
mouseWithinGeometry(laneEdgeParent->getLaneShape(), laneDrawingConstants.halfWidth * s.edgeRelWidthExaggeration);
}
// draw filtered attribute
if (getParentEdges().front()->getLanes().front() == laneEdge) {
drawFilteredAttribute(s, laneEdge->getLaneShape(),
Expand Down
6 changes: 0 additions & 6 deletions src/netedit/elements/data/GNEEdgeRelData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,6 @@ GNEEdgeRelData::drawLanePartialGL(const GUIVisualizationSettings& s, const GNEPa
GLHelper::popMatrix();
// draw lock icon
GNEViewNetHelper::LockIcon::drawLockIcon(this, getType(), getPositionInView(), 1);
// check if mouse is over element
for (const auto& laneEdgeParent : laneEdge->getParentEdge()->getLanes()) {
// get lane drawing constants
GNELane::LaneDrawingConstants laneDrawingConstants(s, laneEdgeParent);
mouseWithinGeometry(laneEdgeParent->getLaneShape(), laneDrawingConstants.halfWidth * s.edgeRelWidthExaggeration);
}
// draw filtered attribute
if (getParentEdges().front()->getLanes().front() == laneEdge) {
drawFilteredAttribute(s, laneEdge->getLaneShape(),
Expand Down
2 changes: 0 additions & 2 deletions src/netedit/elements/data/GNETAZRelData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,12 +300,10 @@ GNETAZRelData::drawGL(const GUIVisualizationSettings& s) const {
GLHelper::popName();
}
if (myNet->getViewNet()->getDataViewOptions().TAZRelDrawing()) {
mouseWithinGeometry(myTAZRelGeometryCenter.getShape(), 0.5);
// draw dotted geometry
myContour.drawDottedContourExtruded(s, myTAZRelGeometryCenter.getShape(), 0.5, 1, true, true,
s.dottedContourSettings.segmentWidth);
} else {
mouseWithinGeometry(myTAZRelGeometry.getShape(), 0.5);
// draw dotted geometry
myContour.drawDottedContourExtruded(s, myTAZRelGeometry.getShape(), 0.5, 1, true, true,
s.dottedContourSettings.segmentWidth);
Expand Down
2 changes: 0 additions & 2 deletions src/netedit/elements/demand/GNEContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,6 @@ GNEContainer::drawGL(const GUIVisualizationSettings& s) const {
const double value = getColorValue(s, s.containerColorer.getActive());
GLHelper::drawTextSettings(s.personValue, toString(value), containerValuePosition, s.scale, s.angle, GLO_MAX - getType());
}
// check if mouse is over element
mouseWithinGeometry(containerPosition, 0.5, 0.2, -2.5, 0, 0);
// draw lock icon
GNEViewNetHelper::LockIcon::drawLockIcon(this, getType(), getPositionInView(), exaggeration);
// draw dotted contour
Expand Down
4 changes: 0 additions & 4 deletions src/netedit/elements/demand/GNEDemandElementPlan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1209,8 +1209,6 @@ GNEDemandElementPlan::drawPlanLanePartial(const bool drawPlan, const GUIVisualiz
GLHelper::popName();
// declare trim geometry to draw
const auto shape = (segment->isFirstSegment() || segment->isLastSegment()) ? planGeometry.getShape() : segment->getLane()->getLaneShape();
// check if mouse is over element
myPlanElement->mouseWithinGeometry(shape, pathWidth);
// draw dotted geometry
if (duplicateWidth) {
myPlanElement->getContour().drawDottedContourExtruded(s, shape, pathWidth, 1, true, true,
Expand Down Expand Up @@ -1284,8 +1282,6 @@ GNEDemandElementPlan::drawPlanJunctionPartial(const bool drawPlan, const GUIVisu
if (segment->getPreviousLane()->getLane2laneConnections().exist(segment->getNextLane())) {
// get shape
const auto& shape = segment->getPreviousLane()->getLane2laneConnections().getLane2laneGeometry(segment->getNextLane()).getShape();
// check if mouse is over element
myPlanElement->mouseWithinGeometry(shape, pathWidth);
// draw dotted geometry
if (duplicateWidth) {
myPlanElement->getContour().drawDottedContourExtruded(s, shape, pathWidth, 1, true, true,
Expand Down
2 changes: 0 additions & 2 deletions src/netedit/elements/demand/GNEPerson.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -419,8 +419,6 @@ GNEPerson::drawGL(const GUIVisualizationSettings& s) const {
}
// draw lock icon
GNEViewNetHelper::LockIcon::drawLockIcon(this, getType(), personPosition, exaggeration, s.dottedContourSettings.segmentWidth);
// check if mouse is over element
mouseWithinGeometry(personPosition, 0.5, 0.5, 0, 0, 0);
// draw dotted contour
myContour.drawDottedContourRectangle(s, personPosition, 0.5, 0.5, 0, 0, 0, exaggeration,
s.dottedContourSettings.segmentWidth);
Expand Down
4 changes: 0 additions & 4 deletions src/netedit/elements/demand/GNERoute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -503,8 +503,6 @@ GNERoute::drawLanePartialGL(const GUIVisualizationSettings& s, const GNEPathMana
}
// declare trim geometry to draw
const auto shape = (segment->isFirstSegment() || segment->isLastSegment() ? routeGeometry.getShape() : segment->getLane()->getLaneShape());
// check if mouse is over element
mouseWithinGeometry(shape, routeWidth);
// draw dotted geometry
myContour.drawDottedContourExtruded(s, shape, routeWidth, 1, segment->isFirstSegment(), segment->isLastSegment(),
s.dottedContourSettings.segmentWidth);
Expand Down Expand Up @@ -559,8 +557,6 @@ GNERoute::drawJunctionPartialGL(const GUIVisualizationSettings& s, const GNEPath
templateAC->getTagProperty().vehicleRoute() && (geometry.getShape().distance2D(myNet->getViewNet()->getPositionInformation()) <= routeWidth)) {
gPostDrawing.markedRoute = this;
}
// check if mouse is over element
mouseWithinGeometry(geometry.getShape(), routeWidth);
// draw dotted geometry
myContour.drawDottedContourExtruded(s, geometry.getShape(), routeWidth, 1, false, false,
s.dottedContourSettings.segmentWidth);
Expand Down

0 comments on commit 270ec3a

Please sign in to comment.