Eclipse SUMO - Simulation of Urban MObility
GLHelper Class Reference

Some methods which help to draw certain geometrical objects in openGL. More...

#include <GLHelper.h>

Static Public Member Functions

static void debugVertices (const PositionVector &shape, double size, double layer=256)
 draw vertex numbers for the given shape (in a random color) More...
 
static void drawBoundary (const Boundary &b)
 Draw a boundary (used for debugging) More...
 
static void drawBoxLine (const Position &beg, double rot, double visLength, double width, double offset=0)
 Draws a thick line. More...
 
static void drawBoxLine (const Position &beg1, const Position &beg2, double rot, double visLength, double width)
 Draws a thick line using the mean of both given points as begin position. More...
 
static void drawBoxLines (const PositionVector &geom, const std::vector< double > &rots, const std::vector< double > &lengths, const std::vector< RGBColor > &cols, double width, int cornerDetail=0, double offset=0)
 Draws thick lines with varying color. More...
 
static void drawBoxLines (const PositionVector &geom, const std::vector< double > &rots, const std::vector< double > &lengths, double width, int cornerDetail=0, double offset=0)
 Draws thick lines. More...
 
static void drawBoxLines (const PositionVector &geom, double width)
 Draws thick lines. More...
 
static void drawBoxLines (const PositionVector &geom1, const PositionVector &geom2, const std::vector< double > &rots, const std::vector< double > &lengths, double width)
 Draws thick lines using the mean of the points given in the point lists as begin positions. More...
 
static void drawCrossTies (const PositionVector &geom, const std::vector< double > &rots, const std::vector< double > &lengths, double length, double spacing, double halfWidth, bool drawForRectangleSelection)
 draw crossties for railroads or pedestrian crossings More...
 
static void drawFilledCircle (double width, int steps, double beg, double end)
 Draws a filled circle around (0,0) More...
 
static void drawFilledCircle (double width, int steps=8)
 Draws a filled circle around (0,0) More...
 
static void drawFilledPoly (const PositionVector &v, bool close)
 Draws a filled polygon described by the list of points. More...
 
static void drawFilledPolyTesselated (const PositionVector &v, bool close)
 Draws a filled polygon described by the list of points. More...
 
static void drawLine (const Position &beg, const Position &end)
 Draws a thin line between the two points. More...
 
static void drawLine (const Position &beg, double rot, double visLength)
 Draws a thin line. More...
 
static void drawLine (const Position &beg1, const Position &beg2, double rot, double visLength)
 Draws a thin line using the mean of both given points as begin position. More...
 
static void drawLine (const PositionVector &v)
 Draws a thin line along the given position vector. More...
 
static void drawLine (const PositionVector &v, const std::vector< RGBColor > &cols)
 Draws a thin line along the given position vector with variable color. More...
 
static void drawOutlineCircle (double width, double iwidth, int steps, double beg, double end)
 Draws an unfilled circle around (0,0) More...
 
static void drawOutlineCircle (double width, double iwidth, int steps=8)
 Draws an unfilled circle around (0,0) More...
 
static void drawText (const std::string &text, const Position &pos, const double layer, const double size, const RGBColor &col=RGBColor::BLACK, const double angle=0, const int align=0, double width=-1)
 
static void drawTextAtEnd (const std::string &text, const PositionVector &shape, double x, const GUIVisualizationTextSettings &settings, const double scale)
 draw text and the end of shape More...
 
static void drawTextBox (const std::string &text, const Position &pos, const double layer, const double size, const RGBColor &txtColor=RGBColor::BLACK, const RGBColor &bgColor=RGBColor::WHITE, const RGBColor &borderColor=RGBColor::BLACK, const double angle=0, const double relBorder=0.05, const double relMargin=0.5, const int align=0)
 draw Text box with given parameters More...
 
static void drawTextSettings (const GUIVisualizationTextSettings &settings, const std::string &text, const Position &pos, const double scale, const double angle=0, const double layer=2048, const int align=0)
 
static void drawTriangleAtEnd (const Position &p1, const Position &p2, double tLength, double tWidth)
 Draws a triangle at the end of the given line. More...
 
static RGBColor getColor ()
 gets the gl-color More...
 
static void resetFont ()
 to be called when the font context is invalidated More...
 
static void setColor (const RGBColor &c)
 Sets the gl-color to this value. More...
 
static void setGL2PS (bool active=true)
 

Static Private Member Functions

static int angleLookup (double angleDeg)
 normalize angle for lookup in myCircleCoords More...
 
static const std::vector< RGBColor > & getDottedcontourColors (const int size)
 get dotted contour colors (black and white). Vector will be automatically increased if current size is minor than size More...
 
static bool initFont ()
 init myFont More...
 
static bool rightTurn (double angle1, double angle2)
 whether the road makes a right turn (or goes straight) More...
 

Static Private Attributes

static std::vector< std::pair< double, double > > myCircleCoords
 Storage for precomputed sin/cos-values describing a circle. More...
 
static std::vector< RGBColormyDottedcontourColors
 static vector with a list of alternated black/white colors (used for contourns) More...
 
static struct FONScontextmyFont = nullptr
 Font context. More...
 
static double myFontSize = 50.0
 
static bool myGL2PSActive = false
 whether we are currently rendering for gl2ps More...
 

Detailed Description

Some methods which help to draw certain geometrical objects in openGL.

This class offers some static methods for drawing primitives in openGL.

Definition at line 47 of file GLHelper.h.

Member Function Documentation

◆ angleLookup()

int GLHelper::angleLookup ( double  angleDeg)
staticprivate

normalize angle for lookup in myCircleCoords

Definition at line 335 of file GLHelper.cpp.

References CIRCLE_RESOLUTION, and myCircleCoords.

Referenced by drawFilledCircle().

Here is the caller graph for this function:

◆ debugVertices()

void GLHelper::debugVertices ( const PositionVector shape,
double  size,
double  layer = 256 
)
static

draw vertex numbers for the given shape (in a random color)

Definition at line 638 of file GLHelper.cpp.

References drawText(), RGBColor::randomHue(), and toString().

Referenced by GUIJunctionWrapper::drawGL(), GUILane::drawGL(), and GUIPolygon::drawInnerPolygon().

Here is the caller graph for this function:

◆ drawBoundary()

void GLHelper::drawBoundary ( const Boundary b)
static

Draw a boundary (used for debugging)

Definition at line 647 of file GLHelper.cpp.

References drawLine(), RGBColor::MAGENTA, setColor(), Boundary::xmax(), Boundary::xmin(), Boundary::ymax(), and Boundary::ymin().

Referenced by GNEDetectorE3::drawGL(), GNEParkingArea::drawGL(), GNEPOI::drawGL(), GNEPoly::drawGL(), GNERerouter::drawGL(), GNETAZ::drawGL(), GNEVariableSpeedSign::drawGL(), GNEConnection::drawGL(), GNEEdge::drawGL(), and GNEJunction::drawGL().

Here is the caller graph for this function:

◆ drawBoxLine() [1/2]

void GLHelper::drawBoxLine ( const Position beg,
double  rot,
double  visLength,
double  width,
double  offset = 0 
)
static

Draws a thick line.

The line is drawn as a GL_QUADS.

Parameters
[in]begThe begin position of the line
[in]rotThe direction the line shall be drawn to (in radiants)
[in]visLengthThe length of the line
[in]widthThe width of the line
[in]offsetThe orthogonal offset

Definition at line 135 of file GLHelper.cpp.

References Position::x(), and Position::y().

Referenced by GUIVehicle::drawAction_drawCarriageClass(), GUIBaseVehicleHelper::drawAction_drawVehicleAsPoly(), GUILane::drawArrows(), GNELane::drawArrows(), drawBoxLines(), GNEBusStop::drawConnectionAccess(), GNEVehicle::drawFlowLabel(), GNEGeometry::DottedGeometry::drawFrontDottedGeometry(), GUIBusStop::drawGL(), GNEDetectorE3::drawGL(), GNEDetectorEntryExit::drawGL(), GNEParkingSpace::drawGL(), GNEPOI::drawGL(), GNERerouter::drawGL(), GNERouteProbe::drawGL(), GNEVaporizer::drawGL(), GNEVariableSpeedSign::drawGL(), GNEPersonStop::drawGL(), GNEStop::drawGL(), GNEVehicle::drawGL(), GNEJunction::drawGL(), GNEGeometry::DottedGeometry::drawInspectedDottedGeometry(), GUIE3Collector::MyWrapper::drawSingleCrossing(), GNEVehicle::drawStackLabel(), and drawTextBox().

Here is the caller graph for this function:

◆ drawBoxLine() [2/2]

void GLHelper::drawBoxLine ( const Position beg1,
const Position beg2,
double  rot,
double  visLength,
double  width 
)
static

Draws a thick line using the mean of both given points as begin position.

The line is drawn as a GL_QUADS.

Parameters
[in]beg1One of the begin positions of the line to use the mean of
[in]beg2One of the begin positions of the line to use the mean of
[in]rotThe direction the line shall be drawn to (in radiants)
[in]visLengthThe length of the line
[in]widthThe width of the line

Definition at line 151 of file GLHelper.cpp.

References Position::x(), and Position::y().

◆ drawBoxLines() [1/4]

void GLHelper::drawBoxLines ( const PositionVector geom,
const std::vector< double > &  rots,
const std::vector< double > &  lengths,
const std::vector< RGBColor > &  cols,
double  width,
int  cornerDetail = 0,
double  offset = 0 
)
static

Draws thick lines with varying color.

Each line is drawn using drawBoxLine.

Parameters
[in]geomThe list of begin positions of the lines
[in]rotsThe directions the lines shall be drawn to (in radiants)
[in]lengthsThe lengths of the lines
[in]colsThe colors of the lines
[in]widthThe width of the lines
[in]cornerDetailDetail level for filling the corners between angled segments
[in]theorthogonal offset
See also
drawBoxLine

Definition at line 222 of file GLHelper.cpp.

References drawBoxLine(), drawFilledCircle(), and setColor().

◆ drawBoxLines() [2/4]

void GLHelper::drawBoxLines ( const PositionVector geom,
const std::vector< double > &  rots,
const std::vector< double > &  lengths,
double  width,
int  cornerDetail = 0,
double  offset = 0 
)
static

Draws thick lines.

Each line is drawn using drawBoxLine.

Parameters
[in]geomThe list of begin positions of the lines
[in]rotsThe directions the lines shall be drawn to (in radiants)
[in]lengthsThe lengths of the lines
[in]widthThe width of the lines
[in]cornerDetailDetail level for filling the corners between angled segments
[in]theorthogonal offset
See also
drawBoxLine

Definition at line 181 of file GLHelper.cpp.

References drawBoxLine(), drawFilledCircle(), and rightTurn().

Referenced by GUIPerson::drawAction_drawWalkingareaPath(), GUIVehicle::drawBestLanes(), GNEGeometry::HierarchicalConnections::drawConnection(), GNEGeometry::drawGeometry(), GUIBusStop::drawGL(), GUIChargingStation::drawGL(), GUIContainerStop::drawGL(), GUIE2Collector::MyWrapper::drawGL(), GUILane::drawGL(), GUIOverheadWire::drawGL(), GUIOverheadWireClamp::drawGL(), GUIParkingArea::drawGL(), GNEPersonStop::drawGL(), GNEStop::drawGL(), GNEConnection::drawGL(), GNECrossing::drawGL(), GUIPerson::drawGLAdditional(), GNEViewNet::drawLaneCandidates(), GNEGeometry::drawLaneGeometry(), GUILane::drawMarkings(), GNEAdditional::drawPartialGL(), GNEEdgeRelData::drawPartialGL(), GNEDemandElement::drawPersonPlanPartialJunction(), GUIVehicle::drawRouteHelper(), GUIMEVehicle::drawRouteHelper(), GNEGeometry::drawSegmentGeometry(), GNEAdditionalFrame::E2MultilaneLaneSelector::drawTemporalE2Multilane(), GNEFrameModuls::PathCreator::drawTemporalRoute(), and GUIPolygon::performTesselation().

Here is the caller graph for this function:

◆ drawBoxLines() [3/4]

void GLHelper::drawBoxLines ( const PositionVector geom,
double  width 
)
static

Draws thick lines.

Widths and length are computed internally by this method, each line is then drawn using drawBoxLine.

Parameters
[in]geomThe list of begin positions of the lines
[in]widthThe width of the lines
See also
drawBoxLine

Definition at line 259 of file GLHelper.cpp.

References Position::distanceTo(), drawBoxLine(), RAD2DEG, Position::x(), and Position::y().

◆ drawBoxLines() [4/4]

void GLHelper::drawBoxLines ( const PositionVector geom1,
const PositionVector geom2,
const std::vector< double > &  rots,
const std::vector< double > &  lengths,
double  width 
)
static

Draws thick lines using the mean of the points given in the point lists as begin positions.

Each line is drawn using drawBoxLine.

Parameters
[in]geom1One of the lists to obtain the lines' begin positions to use the mean of
[in]geom2One of the lists to obtain the lines' begin positions to use the mean of
[in]rotsThe directions the lines shall be drawn to (in radiants)
[in]lengthsThe lengths of the lines
[in]widthThe width of the lines
See also
drawBoxLine

Definition at line 246 of file GLHelper.cpp.

References drawBoxLine(), and MIN4().

◆ drawCrossTies()

void GLHelper::drawCrossTies ( const PositionVector geom,
const std::vector< double > &  rots,
const std::vector< double > &  lengths,
double  length,
double  spacing,
double  halfWidth,
bool  drawForRectangleSelection 
)
static

draw crossties for railroads or pedestrian crossings

Definition at line 598 of file GLHelper.cpp.

Referenced by GUILane::drawGL(), and GNELane::drawLaneAsRailway().

Here is the caller graph for this function:

◆ drawFilledCircle() [1/2]

void GLHelper::drawFilledCircle ( double  width,
int  steps,
double  beg,
double  end 
)
static

Draws a filled circle around (0,0)

The circle is drawn use GL_TRIANGLES.

Parameters
[in]widthThe width of the circle
[in]stepsThe number of steps to divide the circle into
[in]begThe begin angle in degress
[in]endThe end angle in degress

Definition at line 353 of file GLHelper.cpp.

References angleLookup(), CIRCLE_RESOLUTION, DEG2RAD, and myCircleCoords.

◆ drawFilledCircle() [2/2]

void GLHelper::drawFilledCircle ( double  width,
int  steps = 8 
)
static

Draws a filled circle around (0,0)

The circle is drawn by calling drawFilledCircle(width, steps, 0, 360).

Parameters
[in]widthThe width of the circle
[in]stepsThe number of steps to divide the circle into

Definition at line 347 of file GLHelper.cpp.

Referenced by GUIBasePersonHelper::drawAction_drawAsCircle(), GUIBasePersonHelper::drawAction_drawAsPoly(), drawAction_drawBlinker(), GUIBaseVehicleHelper::drawAction_drawVehicleAsPoly(), GUIVehicle::drawAction_drawVehicleBlueLight(), GUIVehicle::drawAction_drawVehicleBrakeLight(), drawBoxLines(), GNEEdge::drawEdgeGeometryPoints(), GNEGeometry::drawGeometry(), GNEGeometry::drawGeometryPoints(), GUIBusStop::drawGL(), GUIChargingStation::drawGL(), GUIContainerStop::drawGL(), GUIJunctionWrapper::drawGL(), GUILaneSpeedTrigger::drawGL(), GUIOverheadWire::drawGL(), GUIParkingArea::drawGL(), GUITrafficLightLogicWrapper::drawGL(), GUITriggeredRerouter::GUITriggeredRerouterEdge::drawGL(), GNEAccess::drawGL(), GNEPoly::drawGL(), GNETAZ::drawGL(), GNEVariableSpeedSignSymbol::drawGL(), GNEJunction::drawGL(), GUIPointOfInterest::drawInnerPOI(), GNEViewNet::drawLaneCandidates(), GNEGeometry::drawLaneGeometry(), GUIBaseVehicle::drawLinkItem(), GNEGeometry::drawMovingHint(), GNEDemandElement::drawPersonPlanPartialLane(), GNEGeometry::drawSegmentGeometry(), GNEStoppingPlace::drawSign(), GNELane::drawStartEndShapePoints(), and GNEViewNet::drawTemporalJunction().

Here is the caller graph for this function:

◆ drawFilledPoly()

void GLHelper::drawFilledPoly ( const PositionVector v,
bool  close 
)
static

Draws a filled polygon described by the list of points.

Note
this only works well for convex polygons
Parameters
[in]vThe polygon to draw
[in]closeWhether the first point shall be appended

Definition at line 81 of file GLHelper.cpp.

References Position::x(), and Position::y().

Referenced by GUIJunctionWrapper::drawGL(), GUILane::drawGL(), and GNEJunction::drawGL().

Here is the caller graph for this function:

◆ drawFilledPolyTesselated()

void GLHelper::drawFilledPolyTesselated ( const PositionVector v,
bool  close 
)
static

Draws a filled polygon described by the list of points.

Note
this works for convex and concave polygons but is slower than drawFilledPoly
Parameters
[in]vThe polygon to draw
[in]closeWhether the first point shall be appended

Definition at line 100 of file GLHelper.cpp.

References combCallback().

Referenced by GUIJunctionWrapper::drawGL(), GUILane::drawGL(), and GNEJunction::drawGL().

Here is the caller graph for this function:

◆ drawLine() [1/5]

void GLHelper::drawLine ( const Position beg,
const Position end 
)
static

Draws a thin line between the two points.

The line is drawn as a GL_LINES.

Parameters
[in]begBegin of the line
[in]endEnd of the line

Definition at line 326 of file GLHelper.cpp.

References Position::x(), and Position::y().

◆ drawLine() [2/5]

void GLHelper::drawLine ( const Position beg,
double  rot,
double  visLength 
)
static

Draws a thin line.

The line is drawn as a GL_LINES.

Parameters
[in]begThe begin position of the line
[in]rotThe direction the line shall be drawn to (in radiants)
[in]visLengthThe length of the line

Definition at line 273 of file GLHelper.cpp.

References Position::x(), and Position::y().

Referenced by GUILane::debugDrawFoeIntersections(), GUIBaseVehicle::drawAction_drawPersonsAndContainers(), GUIVehicle::drawBestLanes(), drawBoundary(), GNEEdge::drawEdgeGeometryPoints(), GUIE2Collector::MyWrapper::drawGL(), GUILane::drawGL(), GNETAZ::drawGL(), GNEConnection::drawGL(), GNEInternalLane::drawGL(), GNELane::drawGL(), GNELane::drawStartEndShapePoints(), GNEViewNet::drawTemporalDrawShape(), and GUIPolygon::performTesselation().

Here is the caller graph for this function:

◆ drawLine() [3/5]

void GLHelper::drawLine ( const Position beg1,
const Position beg2,
double  rot,
double  visLength 
)
static

Draws a thin line using the mean of both given points as begin position.

The line is drawn as a GL_LINES.

Parameters
[in]beg1One of the begin positions of the line to use the mean of
[in]beg2One of the begin positions of the line to use the mean of
[in]rotThe direction the line shall be drawn to (in radiants)
[in]visLengthThe length of the line

Definition at line 286 of file GLHelper.cpp.

References Position::x(), and Position::y().

◆ drawLine() [4/5]

void GLHelper::drawLine ( const PositionVector v)
static

Draws a thin line along the given position vector.

The line is drawn as a GL_LINES.

Parameters
[in]vThe positions vector to use

Definition at line 301 of file GLHelper.cpp.

◆ drawLine() [5/5]

void GLHelper::drawLine ( const PositionVector v,
const std::vector< RGBColor > &  cols 
)
static

Draws a thin line along the given position vector with variable color.

The line is drawn as a GL_LINES.

Parameters
[in]vThe positions vector to use
[in]colsvector with the color of every line
Note
cols must have the same size as v

Definition at line 313 of file GLHelper.cpp.

References setColor().

◆ drawOutlineCircle() [1/2]

void GLHelper::drawOutlineCircle ( double  width,
double  iwidth,
int  steps,
double  beg,
double  end 
)
static

Draws an unfilled circle around (0,0)

The circle is drawn use GL_TRIANGLES.

Parameters
[in]widthThe (outer) width of the circle
[in]iwidthThe inner width of the circle
[in]stepsThe number of steps to divide the circle into
[in]begThe begin angle in degress
[in]endThe end angle in degress

Definition at line 384 of file GLHelper.cpp.

References DEG2RAD, and myCircleCoords.

◆ drawOutlineCircle() [2/2]

void GLHelper::drawOutlineCircle ( double  width,
double  iwidth,
int  steps = 8 
)
static

Draws an unfilled circle around (0,0)

The circle is drawn by calling drawOutlineCircle(width, iwidth, steps, 0, 360).

Parameters
[in]widthThe (outer) width of the circle
[in]iwidthThe inner width of the circle
[in]stepsThe number of steps to divide the circle into

Definition at line 378 of file GLHelper.cpp.

Referenced by GNELane::drawArrows(), and GUIBaseVehicle::drawOnPos().

Here is the caller graph for this function:

◆ drawText()

void GLHelper::drawText ( const std::string &  text,
const Position pos,
const double  layer,
const double  size,
const RGBColor col = RGBColor::BLACK,
const double  angle = 0,
const int  align = 0,
double  width = -1 
)
static

Definition at line 498 of file GLHelper.cpp.

References RGBColor::alpha(), RGBColor::blue(), FONS_ALIGN_CENTER, FONS_ALIGN_MIDDLE, fonsDrawText(), fonsSetAlign(), fonsSetColor(), glfonsRGBA(), RGBColor::green(), initFont(), myFont, myFontSize, myGL2PSActive, RGBColor::red(), Position::x(), and Position::y().

Referenced by debugVertices(), GUISUMOAbstractView::displayColorLegend(), GUISUMOAbstractView::displayLegend(), GNEAdditional::drawAdditionalID(), GNEAdditional::drawAdditionalName(), GNEGenericData::drawAttribute(), GNECalibrator::drawCalibratorSymbol(), GNEDetector::drawDetectorLogo(), GNEEdge::drawEdgeGeometryPoints(), GNEGenericData::drawFilteredAttribute(), GNEVehicle::drawFlowLabel(), GUISUMOAbstractView::drawFPS(), GNEGeometry::drawGeometryPoints(), GUIBusStop::drawGL(), GUICalibrator::drawGL(), GUIChargingStation::drawGL(), GUIContainerStop::drawGL(), GUILaneSpeedTrigger::drawGL(), GUIOverheadWire::drawGL(), GUIParkingArea::drawGL(), GUITriggeredRerouter::GUITriggeredRerouterEdge::drawGL(), GNEDetectorEntryExit::drawGL(), GNERerouterSymbol::drawGL(), GNEVariableSpeedSignSymbol::drawGL(), GNEPersonStop::drawGL(), GNEStop::drawGL(), GNEJunction::drawGL(), GNEViewNet::drawLaneCandidates(), GNEStoppingPlace::drawLines(), GUIBaseVehicle::drawLinkItem(), GNEStoppingPlace::drawSign(), GNEVehicle::drawStackLabel(), GNELane::drawStartEndShapePoints(), drawTextBox(), GUIParameterTracker::GUIParameterTrackerPanel::drawValue(), and GUITLLogicPhasesTrackerWindow::drawValues().

Here is the caller graph for this function:

◆ drawTextAtEnd()

void GLHelper::drawTextAtEnd ( const std::string &  text,
const PositionVector shape,
double  x,
const GUIVisualizationTextSettings settings,
const double  scale 
)
static

draw text and the end of shape

Definition at line 580 of file GLHelper.cpp.

References GUIVisualizationTextSettings::bgColor, GUIVisualizationTextSettings::color, drawTextBox(), RGBColor::INVISIBLE, RAD2DEG, GUIVisualizationTextSettings::scaledSize(), Position::x(), and Position::y().

Referenced by GUILane::drawLinkNo(), GNELane::drawLinkNo(), GNELane::drawTLSLinkNo(), GUILane::drawTLSLinkNo(), and GNECrossing::drawTLSLinkNo().

Here is the caller graph for this function:

◆ drawTextBox()

void GLHelper::drawTextBox ( const std::string &  text,
const Position pos,
const double  layer,
const double  size,
const RGBColor txtColor = RGBColor::BLACK,
const RGBColor bgColor = RGBColor::WHITE,
const RGBColor borderColor = RGBColor::BLACK,
const double  angle = 0,
const double  relBorder = 0.05,
const double  relMargin = 0.5,
const int  align = 0 
)
static

draw Text box with given parameters

Definition at line 546 of file GLHelper.cpp.

References Position::add(), RGBColor::alpha(), drawBoxLine(), drawText(), fonsTextBounds(), initFont(), myFont, myFontSize, setColor(), Position::x(), and Position::y().

Referenced by GNEViewNetHelper::TestingMode::drawTestingElements(), drawTextAtEnd(), drawTextSettings(), and GUISUMOAbstractView::showToolTipFor().

Here is the caller graph for this function:

◆ drawTextSettings()

void GLHelper::drawTextSettings ( const GUIVisualizationTextSettings settings,
const std::string &  text,
const Position pos,
const double  scale,
const double  angle = 0,
const double  layer = 2048,
const int  align = 0 
)
static

◆ drawTriangleAtEnd()

void GLHelper::drawTriangleAtEnd ( const Position p1,
const Position p2,
double  tLength,
double  tWidth 
)
static

Draws a triangle at the end of the given line.

Parameters
[in]p1The start of the line at which end the triangle shall be drawn
[in]p2The end of the line at which end the triangle shall be drawn
[in]tLengthThe length of the triangle
[in]tWidthThe width of the triangle

Definition at line 425 of file GLHelper.cpp.

References Position::angleTo2D(), Position::distanceTo(), GeomHelper::naviDegree(), PositionVector::positionAtOffset(), Position::x(), and Position::y().

Referenced by GUILane::drawArrows(), GNELane::drawArrows(), GNEDetectorEntryExit::drawGL(), GNELane::drawLane2LaneConnections(), GUILane::drawLane2LaneConnections(), and GUIE3Collector::MyWrapper::drawSingleCrossing().

Here is the caller graph for this function:

◆ getColor()

RGBColor GLHelper::getColor ( )
static

gets the gl-color

Definition at line 452 of file GLHelper.cpp.

Referenced by GUIBasePersonHelper::drawAction_drawAsPoly(), GUIContainer::drawAction_drawAsPoly(), GUIBasePersonHelper::drawAction_drawAsTriangle(), GUIVehicle::drawAction_drawCarriageClass(), GUIBaseVehicleHelper::drawAction_drawVehicleAsPoly(), GNEConnection::drawGL(), GUIPerson::drawGLAdditional(), and GNELane::drawLaneAsRailway().

Here is the caller graph for this function:

◆ getDottedcontourColors()

const std::vector< RGBColor > & GLHelper::getDottedcontourColors ( const int  size)
staticprivate

get dotted contour colors (black and white). Vector will be automatically increased if current size is minor than size

Definition at line 484 of file GLHelper.cpp.

References RGBColor::BLACK, myDottedcontourColors, and RGBColor::WHITE.

◆ initFont()

bool GLHelper::initFont ( )
staticprivate

init myFont

Definition at line 470 of file GLHelper.cpp.

References data_font_Roboto_Medium_ttf, data_font_Roboto_Medium_ttf_len, FONS_ZERO_BOTTOMLEFT, fonsAddFontMem(), fonsSetFont(), fonsSetSize(), glfonsCreate(), myFont, and myFontSize.

Referenced by drawText(), and drawTextBox().

Here is the caller graph for this function:

◆ resetFont()

void GLHelper::resetFont ( )
static

to be called when the font context is invalidated

Definition at line 463 of file GLHelper.cpp.

References glfonsDelete(), and myFont.

Referenced by GUIApplicationWindow::closeAllWindows(), and GNEApplicationWindow::closeAllWindows().

Here is the caller graph for this function:

◆ rightTurn()

bool GLHelper::rightTurn ( double  angle1,
double  angle2 
)
staticprivate

whether the road makes a right turn (or goes straight)

Definition at line 168 of file GLHelper.cpp.

Referenced by drawBoxLines().

Here is the caller graph for this function:

◆ setColor()

void GLHelper::setColor ( const RGBColor c)
static

Sets the gl-color to this value.

Definition at line 446 of file GLHelper.cpp.

References RGBColor::alpha(), RGBColor::blue(), RGBColor::green(), and RGBColor::red().

Referenced by GUISUMOAbstractView::displayColorLegend(), GUIBasePersonHelper::drawAction_drawAsPoly(), GUIContainer::drawAction_drawAsPoly(), GUIBasePersonHelper::drawAction_drawAsTriangle(), GUIVehicle::drawAction_drawCarriageClass(), GUIBaseVehicleHelper::drawAction_drawVehicleAsPoly(), GNELane::drawArrows(), drawBoundary(), drawBoxLines(), GNECalibrator::drawCalibratorSymbol(), GNEGeometry::HierarchicalConnections::drawConnection(), GNEBusStop::drawConnectionAccess(), GNEDetector::drawE1Shape(), GNEEdge::drawEdgeGeometryPoints(), GNEVehicle::drawFlowLabel(), GNEGeometry::DottedGeometry::drawFrontDottedGeometry(), GNEGeometry::drawGeometryPoints(), GUIBusStop::drawGL(), GUIChargingStation::drawGL(), GUIContainerStop::drawGL(), GUIE3Collector::MyWrapper::drawGL(), GUIInductLoop::MyWrapper::drawGL(), GUIJunctionWrapper::drawGL(), GUILane::drawGL(), GUIOverheadWire::drawGL(), GUIOverheadWireClamp::drawGL(), GUIParkingArea::drawGL(), GUITrafficLightLogicWrapper::drawGL(), GNEAccess::drawGL(), GNEBusStop::drawGL(), GNEChargingStation::drawGL(), GNEContainerStop::drawGL(), GNEDetectorE2::drawGL(), GNEDetectorE3::drawGL(), GNEDetectorEntryExit::drawGL(), GNEParkingArea::drawGL(), GNEParkingSpace::drawGL(), GNEPOI::drawGL(), GNEPoly::drawGL(), GNERerouter::drawGL(), GNERerouterSymbol::drawGL(), GNERouteProbe::drawGL(), GNETAZ::drawGL(), GNEVaporizer::drawGL(), GNEVariableSpeedSign::drawGL(), GNEVariableSpeedSignSymbol::drawGL(), GNEPersonStop::drawGL(), GNEStop::drawGL(), GNEConnection::drawGL(), GNECrossing::drawGL(), GNEInternalLane::drawGL(), GNEJunction::drawGL(), GNELane::drawGL(), GUIPerson::drawGLAdditional(), GNEGeometry::DottedGeometry::drawInspectedDottedGeometry(), GUILane::drawLane2LaneConnections(), GNELane::drawLaneAsRailway(), GNEViewNet::drawLaneCandidates(), drawLine(), GUILane::drawLinkRule(), GUILane::drawLinkRules(), GNELane::drawMarkings(), GNEGeometry::drawMovingHint(), GNEAdditional::drawPartialGL(), GNEEdgeData::drawPartialGL(), GNEEdgeRelData::drawPartialGL(), GNERoute::drawPartialGL(), GNEVehicle::drawPartialGL(), GNEDemandElement::drawPersonPlanPartialJunction(), GNEDemandElement::drawPersonPlanPartialLane(), GNEViewNetHelper::SelectingArea::drawRectangleSelection(), GUIBaseVehicle::drawRoute(), GUIVehicle::drawRouteHelper(), GNEStoppingPlace::drawSign(), GNEVehicle::drawStackLabel(), GNELane::drawStartEndShapePoints(), GNEViewNet::drawTemporalDrawShape(), GNEAdditionalFrame::E2MultilaneLaneSelector::drawTemporalE2Multilane(), GNEViewNet::drawTemporalJunction(), GNEFrameModuls::PathCreator::drawTemporalRoute(), GNEViewNetHelper::TestingMode::drawTestingElements(), drawTextBox(), GUITLLogicPhasesTrackerWindow::drawValues(), GUIBaseVehicle::setColor(), GUIContainer::setColor(), GUILane::setColor(), GUIPerson::setColor(), GNEPerson::setColor(), GNEVehicle::setColor(), GUIPointOfInterest::setColor(), GUIPolygon::setColor(), GUILane::setFunctionalColor(), GUIContainer::setFunctionalColor(), GUIPerson::setFunctionalColor(), and GNELane::setLaneColor().

◆ setGL2PS()

static void GLHelper::setGL2PS ( bool  active = true)
inlinestatic

Definition at line 331 of file GLHelper.h.

References myGL2PSActive.

Referenced by GUISUMOAbstractView::makeSnapshot().

Here is the caller graph for this function:

Field Documentation

◆ myCircleCoords

std::vector< std::pair< double, double > > GLHelper::myCircleCoords
staticprivate

Storage for precomputed sin/cos-values describing a circle.

Definition at line 349 of file GLHelper.h.

Referenced by angleLookup(), drawFilledCircle(), and drawOutlineCircle().

◆ myDottedcontourColors

std::vector< RGBColor > GLHelper::myDottedcontourColors
staticprivate

static vector with a list of alternated black/white colors (used for contourns)

Definition at line 359 of file GLHelper.h.

Referenced by getDottedcontourColors().

◆ myFont

FONScontext * GLHelper::myFont = nullptr
staticprivate

Font context.

Definition at line 352 of file GLHelper.h.

Referenced by drawText(), drawTextBox(), initFont(), and resetFont().

◆ myFontSize

double GLHelper::myFontSize = 50.0
staticprivate

Definition at line 353 of file GLHelper.h.

Referenced by drawText(), drawTextBox(), and initFont().

◆ myGL2PSActive

bool GLHelper::myGL2PSActive = false
staticprivate

whether we are currently rendering for gl2ps

Definition at line 356 of file GLHelper.h.

Referenced by drawText(), and setGL2PS().


The documentation for this class was generated from the following files: