Skip to content

Commit

Permalink
Updated GUIGeometry::drawGeometry. Refs #13894
Browse files Browse the repository at this point in the history
  • Loading branch information
palvarezlopez committed Dec 19, 2023
1 parent 83e0e43 commit 62127b7
Show file tree
Hide file tree
Showing 25 changed files with 58 additions and 57 deletions.
4 changes: 2 additions & 2 deletions src/netedit/GNEViewNet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5328,15 +5328,15 @@ GNEViewNet::drawTemporalJunction() const {
// set color
GLHelper::setColor(temporalEdgeColor);
// draw temporal edge
GUIGeometry::drawGeometry(*myVisualizationSettings, getPositionInformation(), temporalEdgeGeometry, 0.75);
GUIGeometry::drawGeometry(GUIVisualizationSettings::Detail::Level0, temporalEdgeGeometry, 0.75);
// check if we have to draw opposite edge
if (myNetworkViewOptions.menuCheckAutoOppositeEdge->amChecked() == TRUE) {
// move temporal edge to opposite edge
temporalEdge.move2side(2);
// update geometry
temporalEdgeGeometry.updateGeometry(temporalEdge);
// draw temporal edge
GUIGeometry::drawGeometry(*myVisualizationSettings, getPositionInformation(), temporalEdgeGeometry, 0.75);
GUIGeometry::drawGeometry(GUIVisualizationSettings::Detail::Level0, temporalEdgeGeometry, 0.75);
}
// pop temporal edge matrix
GLHelper::popMatrix();
Expand Down
2 changes: 1 addition & 1 deletion src/netedit/elements/additional/GNEBusStop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ GNEBusStop::drawGL(const GUIVisualizationSettings& s) const {
// set base color
GLHelper::setColor(baseColor);
// Draw the area using shape, shapeRotations, shapeLengths and value of exaggeration
GUIGeometry::drawGeometry(s, myNet->getViewNet()->getPositionInformation(), myAdditionalGeometry, stopWidth * MIN2(1.0, busStopExaggeration));
GUIGeometry::drawGeometry(d, myAdditionalGeometry, stopWidth * MIN2(1.0, busStopExaggeration));
// draw lines
drawLines(s, d, myLines, baseColor);
// draw sign
Expand Down
2 changes: 1 addition & 1 deletion src/netedit/elements/additional/GNEChargingStation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ GNEChargingStation::drawGL(const GUIVisualizationSettings& s) const {
// set base color
GLHelper::setColor(baseColor);
// Draw the area using shape, shapeRotations, shapeLengths and value of exaggeration
GUIGeometry::drawGeometry(s, myNet->getViewNet()->getPositionInformation(), myAdditionalGeometry, s.stoppingPlaceSettings.chargingStationWidth * MIN2(1.0, chargingStationExaggeration));
GUIGeometry::drawGeometry(d, myAdditionalGeometry, s.stoppingPlaceSettings.chargingStationWidth * MIN2(1.0, chargingStationExaggeration));
// draw charging power and efficiency
drawLines(s, d, {toString(myChargingPower)}, baseColor);
// draw sign
Expand Down
2 changes: 1 addition & 1 deletion src/netedit/elements/additional/GNEContainerStop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ GNEContainerStop::drawGL(const GUIVisualizationSettings& s) const {
// set base color
GLHelper::setColor(baseColor);
// Draw the area using shape, shapeRotations, shapeLengths and value of exaggeration
GUIGeometry::drawGeometry(s, myNet->getViewNet()->getPositionInformation(), myAdditionalGeometry, s.stoppingPlaceSettings.containerStopWidth * MIN2(1.0, containerStopExaggeration));
GUIGeometry::drawGeometry(d, myAdditionalGeometry, s.stoppingPlaceSettings.containerStopWidth * MIN2(1.0, containerStopExaggeration));
// draw lines
drawLines(s, d, myLines, baseColor);
// draw sign
Expand Down
8 changes: 4 additions & 4 deletions src/netedit/elements/additional/GNELaneAreaDetector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ GNELaneAreaDetector::drawGL(const GUIVisualizationSettings& s) const {
// set color
GLHelper::setColor(E2Color);
// draw geometry
GUIGeometry::drawGeometry(s, myNet->getViewNet()->getPositionInformation(), myAdditionalGeometry, s.detectorSettings.E2Width * E2Exaggeration);
GUIGeometry::drawGeometry(d, myAdditionalGeometry, s.detectorSettings.E2Width * E2Exaggeration);
// arrow
if (myAdditionalGeometry.getShape().size() > 1) {
glTranslated(0, 0, 0.1);
Expand Down Expand Up @@ -380,7 +380,7 @@ GNELaneAreaDetector::drawLanePartialGL(const GUIVisualizationSettings& s, const
// Set color
GLHelper::setColor(E2Color);
// draw geometry
GUIGeometry::drawGeometry(s, myNet->getViewNet()->getPositionInformation(), E2Geometry, E2DetectorWidth);
GUIGeometry::drawGeometry(d, E2Geometry, E2DetectorWidth);
// draw geometry points
if (segment->isFirstSegment() && segment->isLastSegment()) {
drawLeftGeometryPoint(s, d, E2Geometry.getShape().front(), E2Geometry.getShapeRotations().front(), E2Color, true);
Expand Down Expand Up @@ -463,7 +463,7 @@ GNELaneAreaDetector::drawJunctionPartialGL(const GUIVisualizationSettings& s, co
if (onlyContour) {
GUIGeometry::drawContourGeometry(connectionGeometry, E2DetectorWidth);
} else {
GUIGeometry::drawGeometry(s, myNet->getViewNet()->getPositionInformation(), connectionGeometry, E2DetectorWidth);
GUIGeometry::drawGeometry(d, connectionGeometry, E2DetectorWidth);
}
}
// draw dotted geometry
Expand All @@ -481,7 +481,7 @@ GNELaneAreaDetector::drawJunctionPartialGL(const GUIVisualizationSettings& s, co
GUIGeometry::drawContourGeometry(invalidGeometry, (0.5 * E2DetectorWidth));
} else {
// draw invalid geometry
GUIGeometry::drawGeometry(s, myNet->getViewNet()->getPositionInformation(), invalidGeometry, (0.5 * E2DetectorWidth));
GUIGeometry::drawGeometry(d, invalidGeometry, (0.5 * E2DetectorWidth));
}
}
// draw dotted geometry
Expand Down
8 changes: 4 additions & 4 deletions src/netedit/elements/additional/GNEOverheadWire.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,11 +287,11 @@ GNEOverheadWire::drawLanePartialGL(const GUIVisualizationSettings& s, const GNEP
// Set top color
GLHelper::setColor(overheadWireColorTop);
// draw top geometry
GUIGeometry::drawGeometry(s, myNet->getViewNet()->getPositionInformation(), overheadWireGeometryTop, 0.2);
GUIGeometry::drawGeometry(d, overheadWireGeometryTop, 0.2);
// Set bot color
GLHelper::setColor(overheadWireColorBot);
// draw bot geometry
GUIGeometry::drawGeometry(s, myNet->getViewNet()->getPositionInformation(), overheadWireGeometryBot, 0.2);
GUIGeometry::drawGeometry(d, overheadWireGeometryBot, 0.2);
// draw geometry points
if (segment->isFirstSegment() && segment->isLastSegment()) {
drawLeftGeometryPoint(s, d, overheadWireGeometry.getShape().front(), overheadWireGeometry.getShapeRotations().front(), overheadWireColorTop, true);
Expand Down Expand Up @@ -342,11 +342,11 @@ GNEOverheadWire::drawJunctionPartialGL(const GUIVisualizationSettings& s, const
// Set top color
GLHelper::setColor(overheadWireColorTop);
// draw top geometry
GUIGeometry::drawGeometry(s, myNet->getViewNet()->getPositionInformation(), overheadWireGeometryTop, 0.2);
GUIGeometry::drawGeometry(d, overheadWireGeometryTop, 0.2);
// Set bot color
GLHelper::setColor(overheadWireColorBot);
// draw bot geometry
GUIGeometry::drawGeometry(s, myNet->getViewNet()->getPositionInformation(), overheadWireGeometryBot, 0.2);
GUIGeometry::drawGeometry(d, overheadWireGeometryBot, 0.2);
// Pop last matrix
GLHelper::popMatrix();
// draw contours
Expand Down
2 changes: 1 addition & 1 deletion src/netedit/elements/additional/GNEParkingArea.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ GNEParkingArea::drawGL(const GUIVisualizationSettings& s) const {
// set base color
GLHelper::setColor(baseColor);
// Draw the area using shape, shapeRotations, shapeLengths and value of exaggeration
GUIGeometry::drawGeometry(s, myNet->getViewNet()->getPositionInformation(), myAdditionalGeometry, myWidth * 0.5 * MIN2(1.0, parkingAreaExaggeration));
GUIGeometry::drawGeometry(d, myAdditionalGeometry, myWidth * 0.5 * MIN2(1.0, parkingAreaExaggeration));
// draw sign
drawSign(s, d, parkingAreaExaggeration, baseColor, signColor, "P");
// Traslate to front
Expand Down
4 changes: 2 additions & 2 deletions src/netedit/elements/additional/GNEPoly.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ GNEPoly::drawGL(const GUIVisualizationSettings& s) const {
// set color
GLHelper::setColor(color);
// draw geometry (polyline)
GUIGeometry::drawGeometry(s, myNet->getViewNet()->getPositionInformation(), myPolygonGeometry, s.neteditSizeSettings.polylineWidth * polyExaggeration);
GUIGeometry::drawGeometry(d, myPolygonGeometry, s.neteditSizeSettings.polylineWidth * polyExaggeration);
// pop matrix
GLHelper::popMatrix();
}
Expand All @@ -332,7 +332,7 @@ GNEPoly::drawGL(const GUIVisualizationSettings& s) const {
// set color
GLHelper::setColor(darkerColor);
// draw polygon contour
GUIGeometry::drawGeometry(s, myNet->getViewNet()->getPositionInformation(), myPolygonGeometry, s.neteditSizeSettings.polygonContourWidth * polyExaggeration);
GUIGeometry::drawGeometry(d, myPolygonGeometry, s.neteditSizeSettings.polygonContourWidth * polyExaggeration);
// pop contour matrix
GLHelper::popMatrix();
// draw shape points only in Network supemode
Expand Down
4 changes: 2 additions & 2 deletions src/netedit/elements/additional/GNERouteProbe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,13 @@ GNERouteProbe::drawGL(const GUIVisualizationSettings& s) const {
// set base color
GLHelper::setColor(routeProbeColor);
// Draw the area using shape, shapeRotations, shapeLengths and value of exaggeration
GUIGeometry::drawGeometry(s, myNet->getViewNet()->getPositionInformation(), myAdditionalGeometry, 0.3 * routeProbeExaggeration);
GUIGeometry::drawGeometry(d, myAdditionalGeometry, 0.3 * routeProbeExaggeration);
// move to front
glTranslated(0, 0, .1);
// set central color
GLHelper::setColor(centralLineColor);
// Draw the area using shape, shapeRotations, shapeLengths and value of exaggeration
GUIGeometry::drawGeometry(s, myNet->getViewNet()->getPositionInformation(), myAdditionalGeometry, 0.05 * routeProbeExaggeration);
GUIGeometry::drawGeometry(d, myAdditionalGeometry, 0.05 * routeProbeExaggeration);
// move to icon position and front
glTranslated(myAdditionalGeometry.getShape().front().x(), myAdditionalGeometry.getShape().front().y(), .1);
// rotate over lane
Expand Down
4 changes: 2 additions & 2 deletions src/netedit/elements/additional/GNETAZ.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ GNETAZ::drawGL(const GUIVisualizationSettings& s) const {
// set color
GLHelper::setColor(color);
// draw geometry (polyline)
GUIGeometry::drawGeometry(s, myNet->getViewNet()->getPositionInformation(), myAdditionalGeometry, s.neteditSizeSettings.polylineWidth * TAZExaggeration);
GUIGeometry::drawGeometry(d, myAdditionalGeometry, s.neteditSizeSettings.polylineWidth * TAZExaggeration);
// pop matrix
GLHelper::popMatrix();
}
Expand All @@ -335,7 +335,7 @@ GNETAZ::drawGL(const GUIVisualizationSettings& s) const {
// set color
GLHelper::setColor(darkerColor);
// draw polygon contour
GUIGeometry::drawGeometry(s, myNet->getViewNet()->getPositionInformation(), myAdditionalGeometry, s.neteditSizeSettings.polygonContourWidth * TAZExaggeration);
GUIGeometry::drawGeometry(d, myAdditionalGeometry, s.neteditSizeSettings.polygonContourWidth * TAZExaggeration);
// pop contour matrix
GLHelper::popMatrix();
// draw shape points only in Network supemode
Expand Down
4 changes: 2 additions & 2 deletions src/netedit/elements/additional/GNEVaporizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,13 @@ GNEVaporizer::drawGL(const GUIVisualizationSettings& s) const {
// set base color
GLHelper::setColor(vaporizerColor);
// Draw the area using shape, shapeRotations, shapeLengths and value of exaggeration
GUIGeometry::drawGeometry(s, myNet->getViewNet()->getPositionInformation(), myAdditionalGeometry, 0.3 * vaporizerExaggeration);
GUIGeometry::drawGeometry(d, myAdditionalGeometry, 0.3 * vaporizerExaggeration);
// move to front
glTranslated(0, 0, .1);
// set central color
GLHelper::setColor(centralLineColor);
// Draw the area using shape, shapeRotations, shapeLengths and value of exaggeration
GUIGeometry::drawGeometry(s, myNet->getViewNet()->getPositionInformation(), myAdditionalGeometry, 0.05 * vaporizerExaggeration);
GUIGeometry::drawGeometry(d, myAdditionalGeometry, 0.05 * vaporizerExaggeration);
// move to icon position and front
glTranslated(myAdditionalGeometry.getShape().front().x(), myAdditionalGeometry.getShape().front().y(), .1);
// rotate over lane
Expand Down
6 changes: 3 additions & 3 deletions src/netedit/elements/data/GNETAZRelData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,15 +276,15 @@ GNETAZRelData::drawGL(const GUIVisualizationSettings& s) const {
if (onlyDrawContour) {
// draw depending of TAZRelDrawing
if (myNet->getViewNet()->getDataViewOptions().TAZRelDrawing()) {
GUIGeometry::drawGeometry(s, myNet->getViewNet()->getPositionInformation(), myTAZRelGeometryCenter, width);
GUIGeometry::drawGeometry(d, myTAZRelGeometryCenter, width);
} else {
GUIGeometry::drawGeometry(s, myNet->getViewNet()->getPositionInformation(), myTAZRelGeometry, width);
GUIGeometry::drawGeometry(d, myTAZRelGeometry, width);
}
} else {
// draw depending of TAZRelDrawing
const GUIGeometry& geom = (myNet->getViewNet()->getDataViewOptions().TAZRelDrawing()
? myTAZRelGeometryCenter : myTAZRelGeometry);
GUIGeometry::drawGeometry(s, myNet->getViewNet()->getPositionInformation(), geom, width);
GUIGeometry::drawGeometry(d, geom, width);
GLHelper::drawTriangleAtEnd(
*(geom.getShape().end() - 2),
*(geom.getShape().end() - 1),
Expand Down
6 changes: 3 additions & 3 deletions src/netedit/elements/demand/GNEDemandElementPlan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1119,7 +1119,7 @@ GNEDemandElementPlan::drawPlanGL(const bool drawPlan, const GUIVisualizationSett
// set color
GLHelper::setColor(myPlanElement->drawUsingSelectColor() ? planSelectedColor : planColor);
// draw line
GUIGeometry::drawGeometry(s, viewNet->getPositionInformation(), planGeometry, pathWidth);
GUIGeometry::drawGeometry(d, planGeometry, pathWidth);
GLHelper::drawTriangleAtEnd(
*(planGeometry.getShape().end() - 2),
*(planGeometry.getShape().end() - 1),
Expand Down Expand Up @@ -1190,7 +1190,7 @@ GNEDemandElementPlan::drawPlanLanePartial(const bool drawPlan, const GUIVisualiz
// Set color
GLHelper::setColor(myPlanElement->drawUsingSelectColor() ? planSelectedColor : planColor);
// draw geometry
GUIGeometry::drawGeometry(s, viewNet->getPositionInformation(), planGeometry, pathWidth);
GUIGeometry::drawGeometry(d, planGeometry, pathWidth);
// draw red arrows
drawFromArrow(s, segment->getLane(), segment, dottedElement);
drawToArrow(s, segment->getLane(), segment, dottedElement);
Expand Down Expand Up @@ -1251,7 +1251,7 @@ GNEDemandElementPlan::drawPlanJunctionPartial(const bool drawPlan, const GUIVisu
// obtain lane2lane geometry
const GUIGeometry& lane2laneGeometry = segment->getPreviousLane()->getLane2laneConnections().getLane2laneGeometry(segment->getNextLane());
// draw lane2lane
GUIGeometry::drawGeometry(s, viewNet->getPositionInformation(), lane2laneGeometry, pathWidth);
GUIGeometry::drawGeometry(d, lane2laneGeometry, pathWidth);
} else {
// Set invalid plan color
GLHelper::setColor(RGBColor::RED);
Expand Down
4 changes: 2 additions & 2 deletions src/netedit/elements/demand/GNERoute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ GNERoute::drawLanePartialGL(const GUIVisualizationSettings& s, const GNEPathMana
// Set color
GLHelper::setColor(drawUsingSelectColor() ? s.colorSettings.selectedRouteColor : getColor());
// draw route geometry
GUIGeometry::drawGeometry(s, myNet->getViewNet()->getPositionInformation(), routeGeometry, routeWidth);
GUIGeometry::drawGeometry(d, routeGeometry, routeWidth);
// Pop last matrix
GLHelper::popMatrix();
// Draw name if isn't being drawn for selecting
Expand Down Expand Up @@ -538,7 +538,7 @@ GNERoute::drawJunctionPartialGL(const GUIVisualizationSettings& s, const GNEPath
// Set color
GLHelper::setColor(drawUsingSelectColor() ? s.colorSettings.selectedRouteColor : getColor());
// draw lane2lane
GUIGeometry::drawGeometry(s, myNet->getViewNet()->getPositionInformation(), geometry, routeWidth);
GUIGeometry::drawGeometry(d, geometry, routeWidth);
// Pop last matrix
GLHelper::popMatrix();
// draw lock icon
Expand Down
2 changes: 1 addition & 1 deletion src/netedit/elements/demand/GNEStop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1069,7 +1069,7 @@ void
GNEStop::drawStopOverStoppingPlace(const GUIVisualizationSettings& s, const GUIVisualizationSettings::Detail d, const RGBColor &color,
const double width, const double exaggeration) const {
// Draw the area using shape, shapeRotations, shapeLengths and value of exaggeration taked from stoppingPlace parent
GUIGeometry::drawGeometry(s, myNet->getViewNet()->getPositionInformation(), myDemandElementGeometry, width);
GUIGeometry::drawGeometry(d, myDemandElementGeometry, width);
// only draw text if isn't being drawn for selecting
if ((d <= GUIVisualizationSettings::Detail::Text) && drawIndex()) {
// Add a detail matrix
Expand Down
8 changes: 4 additions & 4 deletions src/netedit/elements/demand/GNEStopPlan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -408,13 +408,13 @@ GNEStopPlan::drawStopOverEdge(const GUIVisualizationSettings& s, const GUIVisual
// set base color
GLHelper::setColor(stopColor);
// Draw the area using shape, shapeRotations, shapeLengths and value of exaggeration
GUIGeometry::drawGeometry(s, myNet->getViewNet()->getPositionInformation(), myDemandElementGeometry, 0.3 * exaggeration);
GUIGeometry::drawGeometry(d, myDemandElementGeometry, 0.3 * exaggeration);
// move to front
glTranslated(0, 0, .1);
// set central color
GLHelper::setColor(centralLineColor);
// Draw the area using shape, shapeRotations, shapeLengths and value of exaggeration
GUIGeometry::drawGeometry(s, myNet->getViewNet()->getPositionInformation(), myDemandElementGeometry, 0.05 * exaggeration);
GUIGeometry::drawGeometry(d, myDemandElementGeometry, 0.05 * exaggeration);
// move to icon position and front
glTranslated(myDemandElementGeometry.getShape().front().x(), myDemandElementGeometry.getShape().front().y(), .1);
// rotate over lane
Expand Down Expand Up @@ -468,9 +468,9 @@ GNEStopPlan::drawStopOverStoppingPlace(const GUIVisualizationSettings& s, const
GLHelper::setColor(stopColor);
// Draw the area using shape, shapeRotations, shapeLengths and value of exaggeration
if (getParentAdditionals().front()->getTagProperty().getTag() == SUMO_TAG_TRAIN_STOP) {
GUIGeometry::drawGeometry(s, myNet->getViewNet()->getPositionInformation(), myDemandElementGeometry, s.stoppingPlaceSettings.trainStopWidth * exaggeration);
GUIGeometry::drawGeometry(d, myDemandElementGeometry, s.stoppingPlaceSettings.trainStopWidth * exaggeration);
} else {
GUIGeometry::drawGeometry(s, myNet->getViewNet()->getPositionInformation(), myDemandElementGeometry, s.stoppingPlaceSettings.busStopWidth * exaggeration);
GUIGeometry::drawGeometry(d, myDemandElementGeometry, s.stoppingPlaceSettings.busStopWidth * exaggeration);
}
// move to icon position and front
glTranslated(myDemandElementGeometry.getShape().getLineCenter().x(), myDemandElementGeometry.getShape().getLineCenter().y(), .1);
Expand Down

0 comments on commit 62127b7

Please sign in to comment.