Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GLHelper Class Reference

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

#include <GLHelper.h>

Static Public Member Functions

static int angleLookup (double angleDeg)
 normalize angle for lookup in myCircleCoords
 
static void checkCounterMatrix ()
 check counter matrix (for debug purposes)
 
static void checkCounterName ()
 check counter name (for debug purposes)
 
static void debugVertices (const PositionVector &shape, const GUIVisualizationTextSettings &settings, double scale, double layer=1024)
 draw vertex numbers for the given shape (in a random color)
 
static void drawBoundary (const GUIVisualizationSettings &s, const Boundary &b)
 Draw a boundary (used for debugging)
 
static void drawBoxLine (const Position &beg, double rot, double visLength, double width, double offset=0)
 Draws a thick line.
 
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.
 
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.
 
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.
 
static void drawBoxLines (const PositionVector &geom, double width)
 Draws thick lines.
 
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.
 
static void drawCrossTies (const PositionVector &geom, const std::vector< double > &rots, const std::vector< double > &lengths, double length, double spacing, double halfWidth, double offset, bool lessDetail)
 draw crossties for railroads or pedestrian crossings
 
static void drawFilledCircle (const double widradiusth, const int steps=8)
 Draws a filled circle around (0,0)
 
static void drawFilledCircle (double radius, int steps, double beg, double end)
 Draws a filled circle around (0,0)
 
static void drawFilledCircleDetailled (const GUIVisualizationSettings::Detail d, const double radius)
 Draws a filled circle around (0,0) depending of level of detail.
 
static void drawFilledCircleDetailled (const GUIVisualizationSettings::Detail d, const double radius, double beg, double end)
 Draws a filled circle around (0,0) depending of level of detail.
 
static void drawFilledPoly (const PositionVector &v, bool close)
 Draws a filled polygon described by the list of points.
 
static void drawFilledPolyTesselated (const PositionVector &v, bool close)
 Draws a filled polygon described by the list of points.
 
static void drawInverseMarkings (const PositionVector &geom, const std::vector< double > &rots, const std::vector< double > &lengths, double maxLength, double spacing, double halfWidth, bool cl, bool cr, bool lefthand, double scale)
 @bried draw the space between markings (in road color)
 
static void drawLine (const Position &beg, const Position &end)
 Draws a thin line between the two points.
 
static void drawLine (const Position &beg, double rot, double visLength)
 Draws a thin line.
 
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.
 
static void drawLine (const PositionVector &v)
 Draws a thin line along the given position vector.
 
static void drawLine (const PositionVector &v, const std::vector< RGBColor > &cols)
 Draws a thin line along the given position vector with variable color.
 
static void drawOutlineCircle (double radius, double iRadius, int steps, double beg, double end)
 Draws an unfilled circle around (0,0)
 
static void drawOutlineCircle (double radius, double iRadius, int steps=8)
 Draws an unfilled circle around (0,0)
 
static void drawRectangle (const Position &center, const double width, const double height)
 Draws a rectangle line.
 
static void drawSpaceOccupancies (const double exaggeration, const Position &pos, const double rotation, const double width, const double length, const bool vehicle)
 draw
 
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
 
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
 
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, const double extraOffset=0)
 Draws a triangle at the end of the given line.
 
static const std::vector< std::pair< double, double > > & getCircleCoords ()
 Storage for precomputed sin/cos-values describing a circle.
 
static RGBColor getColor ()
 gets the gl-color
 
static int getMatrixCounter ()
 get matrix counter
 
static double getTextWidth (const std::string &text, double size)
 get required width of text
 
static int getVertexCounter ()
 get vertex counter
 
static void popMatrix ()
 pop matrix
 
static void popName ()
 pop Name
 
static void pushMatrix ()
 push matrix
 
static void pushName (unsigned int name)
 push Name
 
static void resetFont ()
 to be called when the font context is invalidated
 
static void resetMatrixCounter ()
 reset matrix counter
 
static void resetVertexCounter ()
 reset vertex counter
 
static void setColor (const RGBColor &c)
 Sets the gl-color to this value.
 
static void setGL2PS (bool active=true)
 set GL2PS
 

Static Private Member Functions

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
 
static bool initFont ()
 init myFont
 
static bool rightTurn (double angle1, double angle2)
 whether the road makes a right turn (or goes straight)
 

Static Private Attributes

static std::vector< std::pair< double, double > > myCircleCoords
 Storage for precomputed sin/cos-values describing a circle.
 
static std::vector< RGBColormyDottedcontourColors
 static vector with a list of alternated black/white colors (used for contours)
 
static struct FONScontextmyFont = nullptr
 Font context.
 
static double myFontSize = 50.0
 
static bool myGL2PSActive = false
 whether we are currently rendering for gl2ps
 
static int myMatrixCounter = 0
 matrix counter (for debug purposes)
 
static int myMatrixCounterDebug = 0
 matrix counter (for debug purposes)
 
static int myNameCounter = 0
 name counter
 
static int myVertexCounter = 0
 matrix counter (for debug purposes)
 

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)
static

normalize angle for lookup in myCircleCoords

Definition at line 105 of file GLHelper.cpp.

References CIRCLE_RESOLUTION, and getCircleCoords().

Referenced by drawFilledCircle(), drawOutlineCircle(), and GNETAZRelData::updateGeometry().

Here is the caller graph for this function:

◆ checkCounterMatrix()

void GLHelper::checkCounterMatrix ( )
static

check counter matrix (for debug purposes)

Definition at line 181 of file GLHelper.cpp.

References myMatrixCounterDebug, and WRITE_WARNING.

Referenced by GUISUMOAbstractView::paintGL().

Here is the caller graph for this function:

◆ checkCounterName()

void GLHelper::checkCounterName ( )
static

check counter name (for debug purposes)

Definition at line 192 of file GLHelper.cpp.

References myNameCounter, and WRITE_WARNING.

Referenced by GUISUMOAbstractView::paintGL().

Here is the caller graph for this function:

◆ debugVertices()

void GLHelper::debugVertices ( const PositionVector shape,
const GUIVisualizationTextSettings settings,
double  scale,
double  layer = 1024 
)
static

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

Definition at line 953 of file GLHelper.cpp.

References GUIVisualizationTextSettings::bgColor, GUIVisualizationTextSettings::color, drawTextBox(), RGBColor::INVISIBLE, GUIVisualizationTextSettings::scaledSize(), and toString().

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

Here is the caller graph for this function:

◆ drawBoundary()

◆ 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 295 of file GLHelper.cpp.

References myVertexCounter, popMatrix(), pushMatrix(), Position::x(), and Position::y().

Referenced by GUIVehicle::drawAction_drawCarriageClass(), GUIBaseVehicleHelper::drawAction_drawVehicleAsPoly(), GUILane::drawArrows(), GNELane::drawArrows(), GNEEntryExitDetector::drawBody(), drawBoxLines(), drawBoxLines(), drawBoxLines(), drawBoxLines(), GUIGeometry::drawChildLine(), GUIDottedGeometry::drawDottedGeometry(), GNEEdge::drawEdgeShape(), GNEEdge::drawEndGeometryPoint(), GNEEntryExitDetector::drawEntryLogo(), GNEDemandElementFlow::drawFlowLabel(), GUIBusStop::drawGL(), GNERouteProbe::drawGL(), GNEVaporizer::drawGL(), GNEVehicle::drawGL(), GUILane::drawGL(), GUIDottedGeometry::drawInnenGeometry(), GNEDemandElement::drawJunctionLine(), GNEVehicle::drawLanePartialGL(), GNEAdditional::drawListedAdditional(), GUIGeometry::drawParentLine(), GNERoute::drawRoutePartialLane(), GUIE3Collector::MyWrapper::drawSingleCrossing(), GNEDemandElement::drawStackLabel(), GNEEdge::drawStartGeometryPoint(), GNEStop::drawStopOverLane(), GNEPathCreator::drawTemporalRoute(), GNEPlanCreator::drawTemporalRoute(), 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 314 of file GLHelper.cpp.

References myVertexCounter, popMatrix(), pushMatrix(), 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 388 of file GLHelper.cpp.

References drawBoxLine(), drawFilledCircle(), popMatrix(), pushMatrix(), 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 347 of file GLHelper.cpp.

References drawBoxLine(), drawFilledCircle(), popMatrix(), pushMatrix(), rightTurn(), and std::swap().

Referenced by GUIBaseVehicle::drawAction_drawPersonsAndContainers(), GUIPerson::drawAction_drawWalkingareaPath(), GUIVehicle::drawBestLanes(), GNEConnection::drawConnection(), GUIGeometry::drawContourGeometry(), GNECrossing::drawCrossing(), GUIGeometry::drawGeometry(), GUIGeometry::drawGeometry(), GUIBusStop::drawGL(), GUIChargingStation::drawGL(), GUIOverheadWire::drawGL(), GUIOverheadWireClamp::drawGL(), GUIParkingArea::drawGL(), GUIE2Collector::MyWrapper::drawGL(), GUIInductLoop::MyWrapper::drawGL(), GUILane::drawGL(), GUIPerson::drawGLAdditional(), GUIPolygon::drawInnerPolygon(), GNEVehicle::drawJunctionPartialGL(), GNEEdgeRelData::drawLanePartialGL(), GUILane::drawMarkings(), GNEDemandElementPlan::drawPlanJunctionPartial(), GUIVehicle::drawRouteHelper(), GUIMEVehicle::drawRouteHelper(), GNEParkingSpace::drawSpace(), drawSpaceOccupancies(), GUIBaseVehicle::drawStopLabels(), GNEStop::drawStopOverLane(), GNEConsecutiveSelector::drawTemporalConsecutiveLanePath(), GNEPathCreator::drawTemporalRoute(), and GNEPlanCreator::drawTemporalRoute().

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 424 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 411 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,
double  offset,
bool  lessDetail 
)
static

draw crossties for railroads or pedestrian crossings

Definition at line 857 of file GLHelper.cpp.

References myVertexCounter, popMatrix(), and pushMatrix().

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

Here is the caller graph for this function:

◆ drawFilledCircle() [1/2]

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

◆ drawFilledCircle() [2/2]

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

Draws a filled circle around (0,0)

The circle is drawn use GL_TRIANGLES.

Parameters
[in]radiusThe radius of the circle
[in]stepsThe number of steps to divide the circle into
[in]begThe begin angle in degrees
[in]endThe end angle in degrees

Definition at line 575 of file GLHelper.cpp.

References angleLookup(), getCircleCoords(), and myVertexCounter.

◆ drawFilledCircleDetailled() [1/2]

void GLHelper::drawFilledCircleDetailled ( const GUIVisualizationSettings::Detail  d,
const double  radius 
)
static

◆ drawFilledCircleDetailled() [2/2]

void GLHelper::drawFilledCircleDetailled ( const GUIVisualizationSettings::Detail  d,
const double  radius,
double  beg,
double  end 
)
static

Draws a filled circle around (0,0) depending of level of detail.

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

Parameters
[in]begThe begin angle in degrees
[in]endThe end angle in degrees
[in]radiusThe radius of the circle

Definition at line 515 of file GLHelper.cpp.

References GUIVisualizationSettings::CircleResolution16, GUIVisualizationSettings::CircleResolution32, GUIVisualizationSettings::CircleResolution4, GUIVisualizationSettings::CircleResolution8, drawFilledCircle(), and drawFilledCircleDetailled().

◆ 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 203 of file GLHelper.cpp.

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

Referenced by GUIJunctionWrapper::drawGL(), GNEJunction::drawJunctionAsShape(), and GNEWalkingArea::drawTesselatedWalkingArea().

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 228 of file GLHelper.cpp.

References CALLBACK, and combCallback().

◆ drawInverseMarkings()

void GLHelper::drawInverseMarkings ( const PositionVector geom,
const std::vector< double > &  rots,
const std::vector< double > &  lengths,
double  maxLength,
double  spacing,
double  halfWidth,
bool  cl,
bool  cr,
bool  lefthand,
double  scale 
)
static

@bried draw the space between markings (in road color)

Definition at line 900 of file GLHelper.cpp.

References MIN2(), myVertexCounter, popMatrix(), pushMatrix(), and SUMO_const_laneMarkWidth.

Referenced by GUILane::drawMarkings(), and GNELane::drawMarkingsAndBoundings().

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 503 of file GLHelper.cpp.

References myVertexCounter, 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 438 of file GLHelper.cpp.

References myVertexCounter, popMatrix(), pushMatrix(), Position::x(), and Position::y().

Referenced by GUILane::debugDrawFoeIntersections(), GUIVehicle::drawBestLanes(), drawBoundary(), GNEConnection::drawConnection(), GUIGeometry::drawGeometry(), GUIGeometry::drawGeometry(), GUIE2Collector::MyWrapper::drawGL(), GUILane::drawGL(), GUIPolygon::drawInnerPolygon(), GNELane::drawStartEndGeometryPoints(), and GNEViewNet::drawTemporalDrawingShape().

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 454 of file GLHelper.cpp.

References myVertexCounter, popMatrix(), pushMatrix(), 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 472 of file GLHelper.cpp.

References myVertexCounter.

◆ 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 487 of file GLHelper.cpp.

References myVertexCounter, and setColor().

◆ drawOutlineCircle() [1/2]

void GLHelper::drawOutlineCircle ( double  radius,
double  iRadius,
int  steps,
double  beg,
double  end 
)
static

Draws an unfilled circle around (0,0)

The circle is drawn use GL_TRIANGLES.

Parameters
[in]radiusThe (outer) radius of the circle
[in]iRadiusThe inner radius of the circle
[in]stepsThe number of steps to divide the circle into
[in]begThe begin angle in degrees
[in]endThe end angle in degrees

Definition at line 602 of file GLHelper.cpp.

References angleLookup(), getCircleCoords(), and myVertexCounter.

◆ drawOutlineCircle() [2/2]

void GLHelper::drawOutlineCircle ( double  radius,
double  iRadius,
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]radiusThe (outer) radius of the circle
[in]iRadiusThe inner radius of the circle
[in]stepsThe number of steps to divide the circle into

Definition at line 596 of file GLHelper.cpp.

References drawOutlineCircle().

Referenced by GNELane::drawArrows(), GUIBaseVehicle::drawOnPos(), drawOutlineCircle(), GNEViewNet::drawTemporalJunction(), GNEViewNet::drawTemporalRoundabout(), and GNEViewNet::drawTemporalSplitJunction().

Here is the caller graph for this function:

◆ drawRectangle()

void GLHelper::drawRectangle ( const Position center,
const double  width,
const double  height 
)
static

Draws a rectangle line.

The line is drawn as a GL_QUADS.

Parameters
[in]centerrectangle center
[in]widthThe width of the rectangle
[in]heightThe height of the rectangle

Definition at line 277 of file GLHelper.cpp.

References myVertexCounter, popMatrix(), pushMatrix(), Position::x(), and Position::y().

◆ drawSpaceOccupancies()

void GLHelper::drawSpaceOccupancies ( const double  exaggeration,
const Position pos,
const double  rotation,
const double  width,
const double  length,
const bool  vehicle 
)
static

draw

Definition at line 684 of file GLHelper.cpp.

References drawBoxLines(), popMatrix(), pushMatrix(), setColor(), Position::x(), Position::y(), and Position::z().

Referenced by GUIParkingArea::drawGL(), and GNEParkingArea::drawGL().

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 756 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, popMatrix(), pushMatrix(), RGBColor::red(), Position::x(), and Position::y().

Referenced by GUISUMOAbstractView::displayColorLegend(), GUISUMOAbstractView::displayLegend(), GUIBaseVehicleHelper::drawAction_drawVehicleAsPoly(), GNEAdditional::drawAdditionalID(), GNEAdditional::drawAdditionalName(), GUITLLogicPhasesTrackerWindow::drawAdditionalStates(), GNEGenericData::drawAttribute(), GNECalibrator::drawCalibratorSymbol(), GNEDetector::drawE1DetectorLogo(), GNEDetector::drawE2DetectorLogo(), GNELaneAreaDetector::drawE2PartialLane(), GNEEntryExitDetector::drawE3Logo(), GNEEdge::drawEdgeGeometryPoints(), GNEJunction::drawElevation(), GNEEdge::drawEndGeometryPoint(), GNEEntryExitDetector::drawEntryLogo(), GNEGenericData::drawFilteredAttribute(), GNEDemandElementFlow::drawFlowLabel(), GUISUMOAbstractView::drawFPS(), GUIGeometry::drawGeometryPoints(), GUIBusStop::drawGL(), GUICalibrator::drawGL(), GUIChargingStation::drawGL(), GUILaneSpeedTrigger::drawGL(), GUIOverheadWire::drawGL(), GUIParkingArea::drawGL(), GUITriggeredRerouter::GUITriggeredRerouterEdge::drawGL(), GNEStoppingPlace::drawLines(), GUIBaseVehicle::drawLinkItem(), GNEAdditional::drawListedAdditional(), GUITLLogicPhasesTrackerWindow::drawNames(), GNELane::drawOverlappedRoutes(), GNERerouterSymbol::drawRerouterSymbol(), GNEStoppingPlace::drawSign(), GNEDemandElement::drawStackLabel(), GNELane::drawStartEndGeometryPoints(), GNEEdge::drawStartGeometryPoint(), GNEStop::drawStopOverLane(), GNEStop::drawStopOverStoppingPlace(), drawTextBox(), GUIParameterTracker::GUIParameterTrackerPanel::drawValue(), GUITLLogicPhasesTrackerWindow::drawValues(), and GNEVariableSpeedSignSymbol::drawVSSSymbol().

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 838 of file GLHelper.cpp.

References GUIVisualizationTextSettings::bgColor, GUIVisualizationTextSettings::color, drawTextBox(), RGBColor::INVISIBLE, popMatrix(), pushMatrix(), 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 804 of file GLHelper.cpp.

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

Referenced by debugVertices(), drawTextAtEnd(), and drawTextSettings().

Here is the caller graph for this function:

◆ drawTextSettings()

◆ drawTriangleAtEnd()

void GLHelper::drawTriangleAtEnd ( const Position p1,
const Position p2,
double  tLength,
double  tWidth,
const double  extraOffset = 0 
)
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
[in]extraOffsetextra offset at end

Definition at line 629 of file GLHelper.cpp.

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

Referenced by GUILane::drawArrows(), GNELane::drawArrows(), GNEEntryExitDetector::drawBody(), GUIGeometry::drawChildLine(), GNEConnection::drawConnectionArrows(), GNEDetector::drawE1Shape(), GNELaneAreaDetector::drawE2(), GNELaneAreaDetector::drawE2PartialLane(), GNETAZRelData::drawGL(), GNELane::drawLane2LaneConnections(), GUILane::drawLane2LaneConnections(), GNENeteditAttributes::drawLaneReference(), GUIGeometry::drawParentLine(), GNEDemandElementPlan::drawPlanGL(), and GUIE3Collector::MyWrapper::drawSingleCrossing().

Here is the caller graph for this function:

◆ getCircleCoords()

const std::vector< std::pair< double, double > > & GLHelper::getCircleCoords ( )
static

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

Definition at line 91 of file GLHelper.cpp.

References CIRCLE_RESOLUTION, DEG2RAD, and myCircleCoords.

Referenced by angleLookup(), drawFilledCircle(), drawOutlineCircle(), and GNETAZRelData::updateGeometry().

Here is the caller graph for this function:

◆ getColor()

◆ 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 736 of file GLHelper.cpp.

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

◆ getMatrixCounter()

int GLHelper::getMatrixCounter ( )
static

get matrix counter

Definition at line 157 of file GLHelper.cpp.

References myMatrixCounter.

Referenced by GUISUMOAbstractView::drawFPS().

Here is the caller graph for this function:

◆ getTextWidth()

double GLHelper::getTextWidth ( const std::string &  text,
double  size 
)
static

get required width of text

Definition at line 750 of file GLHelper.cpp.

References fonsTextBounds(), myFont, and myFontSize.

Referenced by GUITLLogicPhasesTrackerWindow::drawValues().

Here is the caller graph for this function:

◆ getVertexCounter()

int GLHelper::getVertexCounter ( )
static

get vertex counter

Definition at line 169 of file GLHelper.cpp.

References myVertexCounter.

Referenced by GUISUMOAbstractView::drawFPS().

Here is the caller graph for this function:

◆ initFont()

bool GLHelper::initFont ( )
staticprivate

init myFont

Definition at line 722 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:

◆ popMatrix()

void GLHelper::popMatrix ( )
static

pop matrix

Definition at line 130 of file GLHelper.cpp.

References myMatrixCounterDebug.

Referenced by GUILane::debugDrawFoeIntersections(), GUISUMOAbstractView::displayColorLegend(), GUISUMOAbstractView::displayLegend(), GUIViewTraffic::doPaintGL(), GNEViewNet::doPaintGL(), drawAction_drawBlinker(), GUIVehicle::drawAction_drawCarriageClass(), GUIBaseVehicle::drawAction_drawPersonsAndContainers(), GUIBaseVehicleHelper::drawAction_drawVehicleAsBoxPlus(), GUIBaseVehicleHelper::drawAction_drawVehicleAsPoly(), GUIBaseVehicleHelper::drawAction_drawVehicleAsTrianglePlus(), GUIVehicle::drawAction_drawVehicleBlueLight(), GUIVehicle::drawAction_drawVehicleBrakeLight(), GUIPerson::drawAction_drawWalkingareaPath(), GUILane::drawArrows(), GNELane::drawArrows(), GNEGenericData::drawAttribute(), GUILane::drawBikeMarkings(), GNEEntryExitDetector::drawBody(), drawBoundary(), drawBoxLine(), drawBoxLine(), drawBoxLines(), drawBoxLines(), GNECalibrator::drawCalibratorSymbol(), GUIGeometry::drawChildLine(), GNEConnection::drawConnection(), GNEConnection::drawConnectionArrows(), GNECrossing::drawCrossing(), GNECrossing::drawCrossingDetailed(), drawCrossTies(), GUISUMOAbstractView::drawDecals(), GNELane::drawDirectionIndicators(), GUILane::drawDirectionIndicators(), GNEContour::drawDottedContour(), GNEContour::drawDottedContourGeometryPoints(), GNEDetector::drawE1DetectorLogo(), GNEDetector::drawE1Shape(), GNELaneAreaDetector::drawE2(), GNEDetector::drawE2DetectorLogo(), GNELaneAreaDetector::drawE2PartialJunction(), GNELaneAreaDetector::drawE2PartialLane(), GNEEntryExitDetector::drawE3Logo(), GNEEdge::drawEdgeGeometryPoints(), GNEEdge::drawEdgeShape(), GNEJunction::drawElevation(), GNEEdge::drawEndGeometryPoint(), GNEDemandElementPlan::drawEndPosition(), GNEEntryExitDetector::drawEntryLogo(), drawFilledCircleDetailled(), GNEGenericData::drawFilteredAttribute(), GNEDemandElementFlow::drawFlowLabel(), GUISUMOAbstractView::drawFPS(), GNEDemandElementPlan::drawFromArrow(), GNEStop::drawGeometryPoints(), GUIGeometry::drawGeometryPoints(), GUIBusStop::drawGL(), GUICalibrator::drawGL(), GUIChargingStation::drawGL(), GUIE3Collector::MyWrapper::drawGL(), GUIInstantInductLoop::MyWrapper::drawGL(), GUIJunctionWrapper::drawGL(), GUILaneSpeedTrigger::drawGL(), GUIOverheadWire::drawGL(), GUIOverheadWireClamp::drawGL(), GUIParkingArea::drawGL(), GUITrafficLightLogicWrapper::drawGL(), GUITriggeredRerouter::GUITriggeredRerouterEdge::drawGL(), GUIMEInductLoop::MyWrapper::drawGL(), GNEAccess::drawGL(), GNEBusStop::drawGL(), GNECalibratorFlow::drawGL(), GNEChargingStation::drawGL(), GNEContainerStop::drawGL(), GNEEntryExitDetector::drawGL(), GNEInductionLoopDetector::drawGL(), GNEInstantInductionLoopDetector::drawGL(), GNEParkingArea::drawGL(), GNERouteProbe::drawGL(), GNETAZ::drawGL(), GNEVaporizer::drawGL(), GNETAZRelData::drawGL(), GNEContainer::drawGL(), GNEPerson::drawGL(), GNEStop::drawGL(), GNEStopPlan::drawGL(), GNEVehicle::drawGL(), GNEInternalLane::drawGL(), GNEJunction::drawGL(), GUIContainer::drawGL(), GUIE2Collector::MyWrapper::drawGL(), GUIInductLoop::MyWrapper::drawGL(), GUILane::drawGL(), GUIPerson::drawGL(), GNEPoly::drawGL(), GUIBaseVehicle::drawGLAdditional(), GUIContainer::drawGLAdditional(), GUIPerson::drawGLAdditional(), GNEContour::drawInnenContourClosed(), GUIPointOfInterest::drawInnerPOI(), GUIPolygon::drawInnerPolygon(), drawInverseMarkings(), GNEJunction::drawJunctionAsBubble(), GUILane::drawJunctionChangeProhibitions(), GNEDemandElement::drawJunctionLine(), GNEOverheadWire::drawJunctionPartialGL(), GNEVehicle::drawJunctionPartialGL(), GNELane::drawLane(), GNELane::drawLane2LaneConnections(), GNEOverheadWire::drawLanePartialGL(), GNEEdgeData::drawLanePartialGL(), GNEEdgeRelData::drawLanePartialGL(), GNEVehicle::drawLanePartialGL(), GNENeteditAttributes::drawLaneReference(), GNELane::drawLaneStopOffset(), GNEEdge::drawLaneStopOffset(), drawLine(), drawLine(), GNEStoppingPlace::drawLines(), GNELane::drawLinkNo(), GUILane::drawLinkRule(), GUILane::drawLinkRules(), GNEAdditional::drawListedAdditional(), GNEViewNetHelper::LockIcon::drawLockIcon(), GUILane::drawMarkings(), GNELane::drawMarkingsAndBoundings(), GUIEdge::drawMesoVehicles(), GUIBaseVehicle::drawOnPos(), GNELane::drawOverlappedRoutes(), GNEAdditional::drawParentChildLines(), GUIGeometry::drawParentLine(), GNEDemandElementPlan::drawPlanGL(), GNEDemandElementPlan::drawPlanJunctionPartial(), GNEDemandElementPlan::drawPlanLanePartial(), GUIBaseVehicleHelper::drawPoly(), GNEPoly::drawPolygon(), GNEPoly::drawPolygonContour(), drawRectangle(), GNEViewNetHelper::SelectingArea::drawRectangleSelection(), GNERerouterSymbol::drawRerouterSymbol(), GNERoute::drawRoutePartialJunction(), GNERoute::drawRoutePartialLane(), GNELane::drawSelectedLane(), GNEAdditional::drawSemiCircleGeometryPoint(), GNELane::drawShapeEdited(), GNEStoppingPlace::drawSign(), GUIE3Collector::MyWrapper::drawSingleCrossing(), GNEParkingSpace::drawSpace(), drawSpaceOccupancies(), GNEAdditional::drawSquaredAdditional(), GNEDemandElement::drawStackLabel(), GNELane::drawStartEndGeometryPoints(), GNEEdge::drawStartGeometryPoint(), GNEStop::drawStopOverLane(), GNEStop::drawStopOverStoppingPlace(), GNEEdge::drawTAZElements(), GNEConsecutiveSelector::drawTemporalConsecutiveLanePath(), GNEViewNet::drawTemporalDrawingShape(), GNEViewNet::drawTemporalE1TLSLines(), GNEViewNet::drawTemporalJunction(), GNEViewNet::drawTemporalJunctionTLSLines(), GNEViewNet::drawTemporalRoundabout(), GNEPathCreator::drawTemporalRoute(), GNEPlanCreator::drawTemporalRoute(), GNEViewNet::drawTemporalSplitJunction(), GNEViewNetHelper::TestingMode::drawTestingElements(), GNEViewNet::drawTestsCircle(), drawText(), drawTextAtEnd(), drawTextBox(), GNELane::drawTextures(), GNEJunction::drawTLSIcon(), GNELane::drawTLSLinkNo(), GNECrossing::drawTLSLinkNo(), GNEDemandElementPlan::drawToArrow(), drawTriangleAtEnd(), GUIParameterTracker::GUIParameterTrackerPanel::drawValue(), GNEVariableSpeedSignSymbol::drawVSSSymbol(), GNEWalkingArea::drawWalkingArea(), GNEViewNet::redrawPathElementContours(), GNEViewNet::updateObjectsInBoundary(), and GNEViewNet::updateObjectsInPosition().

◆ popName()

◆ pushMatrix()

void GLHelper::pushMatrix ( )
static

push matrix

Definition at line 117 of file GLHelper.cpp.

References myMatrixCounter, and myMatrixCounterDebug.

Referenced by GUILane::debugDrawFoeIntersections(), GUISUMOAbstractView::displayColorLegend(), GUISUMOAbstractView::displayLegend(), GUIViewTraffic::doPaintGL(), GNEViewNet::doPaintGL(), drawAction_drawBlinker(), GUIVehicle::drawAction_drawCarriageClass(), GUIBaseVehicle::drawAction_drawPersonsAndContainers(), GUIBaseVehicleHelper::drawAction_drawVehicleAsBoxPlus(), GUIBaseVehicleHelper::drawAction_drawVehicleAsPoly(), GUIBaseVehicleHelper::drawAction_drawVehicleAsTrianglePlus(), GUIVehicle::drawAction_drawVehicleBlueLight(), GUIVehicle::drawAction_drawVehicleBrakeLight(), GUIPerson::drawAction_drawWalkingareaPath(), GUILane::drawArrows(), GNELane::drawArrows(), GNEGenericData::drawAttribute(), GUILane::drawBikeMarkings(), GNEEntryExitDetector::drawBody(), drawBoundary(), drawBoxLine(), drawBoxLine(), drawBoxLines(), drawBoxLines(), GNECalibrator::drawCalibratorSymbol(), GUIGeometry::drawChildLine(), GNEConnection::drawConnection(), GNEConnection::drawConnectionArrows(), GNECrossing::drawCrossing(), GNECrossing::drawCrossingDetailed(), drawCrossTies(), GUISUMOAbstractView::drawDecals(), GNELane::drawDirectionIndicators(), GUILane::drawDirectionIndicators(), GNEContour::drawDottedContour(), GNEContour::drawDottedContourGeometryPoints(), GNEDetector::drawE1DetectorLogo(), GNEDetector::drawE1Shape(), GNELaneAreaDetector::drawE2(), GNEDetector::drawE2DetectorLogo(), GNELaneAreaDetector::drawE2PartialJunction(), GNELaneAreaDetector::drawE2PartialLane(), GNEEntryExitDetector::drawE3Logo(), GNEEdge::drawEdgeGeometryPoints(), GNEEdge::drawEdgeShape(), GNEJunction::drawElevation(), GNEEdge::drawEndGeometryPoint(), GNEDemandElementPlan::drawEndPosition(), GNEEntryExitDetector::drawEntryLogo(), drawFilledCircleDetailled(), GNEGenericData::drawFilteredAttribute(), GNEDemandElementFlow::drawFlowLabel(), GUISUMOAbstractView::drawFPS(), GNEDemandElementPlan::drawFromArrow(), GNEStop::drawGeometryPoints(), GUIGeometry::drawGeometryPoints(), GUIBusStop::drawGL(), GUICalibrator::drawGL(), GUIChargingStation::drawGL(), GUIE3Collector::MyWrapper::drawGL(), GUIInstantInductLoop::MyWrapper::drawGL(), GUIJunctionWrapper::drawGL(), GUILaneSpeedTrigger::drawGL(), GUIOverheadWire::drawGL(), GUIOverheadWireClamp::drawGL(), GUIParkingArea::drawGL(), GUITrafficLightLogicWrapper::drawGL(), GUITriggeredRerouter::GUITriggeredRerouterEdge::drawGL(), GUIMEInductLoop::MyWrapper::drawGL(), GNEAccess::drawGL(), GNEBusStop::drawGL(), GNECalibratorFlow::drawGL(), GNEChargingStation::drawGL(), GNEContainerStop::drawGL(), GNEEntryExitDetector::drawGL(), GNEInductionLoopDetector::drawGL(), GNEInstantInductionLoopDetector::drawGL(), GNEParkingArea::drawGL(), GNERouteProbe::drawGL(), GNETAZ::drawGL(), GNEVaporizer::drawGL(), GNETAZRelData::drawGL(), GNEContainer::drawGL(), GNEPerson::drawGL(), GNEStop::drawGL(), GNEStopPlan::drawGL(), GNEVehicle::drawGL(), GNEInternalLane::drawGL(), GNEJunction::drawGL(), GUIContainer::drawGL(), GUIE2Collector::MyWrapper::drawGL(), GUIInductLoop::MyWrapper::drawGL(), GUILane::drawGL(), GUIPerson::drawGL(), GNEPoly::drawGL(), GUIBaseVehicle::drawGLAdditional(), GUIContainer::drawGLAdditional(), GUIPerson::drawGLAdditional(), GNEContour::drawInnenContourClosed(), GUIPointOfInterest::drawInnerPOI(), GUIPolygon::drawInnerPolygon(), drawInverseMarkings(), GNEJunction::drawJunctionAsBubble(), GUILane::drawJunctionChangeProhibitions(), GNEDemandElement::drawJunctionLine(), GNEOverheadWire::drawJunctionPartialGL(), GNEVehicle::drawJunctionPartialGL(), GNELane::drawLane(), GNELane::drawLane2LaneConnections(), GNEOverheadWire::drawLanePartialGL(), GNEEdgeData::drawLanePartialGL(), GNEEdgeRelData::drawLanePartialGL(), GNEVehicle::drawLanePartialGL(), GNENeteditAttributes::drawLaneReference(), GNELane::drawLaneStopOffset(), GNEEdge::drawLaneStopOffset(), drawLine(), drawLine(), GNEStoppingPlace::drawLines(), GNELane::drawLinkNo(), GUILane::drawLinkRule(), GUILane::drawLinkRules(), GNEAdditional::drawListedAdditional(), GNEViewNetHelper::LockIcon::drawLockIcon(), GUILane::drawMarkings(), GNELane::drawMarkingsAndBoundings(), GUIBaseVehicle::drawOnPos(), GNELane::drawOverlappedRoutes(), GNEAdditional::drawParentChildLines(), GUIGeometry::drawParentLine(), GNEDemandElementPlan::drawPlanGL(), GNEDemandElementPlan::drawPlanJunctionPartial(), GNEDemandElementPlan::drawPlanLanePartial(), GUIBaseVehicleHelper::drawPoly(), GNEPoly::drawPolygon(), GNEPoly::drawPolygonContour(), drawRectangle(), GNEViewNetHelper::SelectingArea::drawRectangleSelection(), GNERerouterSymbol::drawRerouterSymbol(), GNERoute::drawRoutePartialJunction(), GNERoute::drawRoutePartialLane(), GNELane::drawSelectedLane(), GNEAdditional::drawSemiCircleGeometryPoint(), GNELane::drawShapeEdited(), GNEStoppingPlace::drawSign(), GUIE3Collector::MyWrapper::drawSingleCrossing(), GNEParkingSpace::drawSpace(), drawSpaceOccupancies(), GNEAdditional::drawSquaredAdditional(), GNEDemandElement::drawStackLabel(), GNELane::drawStartEndGeometryPoints(), GNEEdge::drawStartGeometryPoint(), GNEStop::drawStopOverLane(), GNEStop::drawStopOverStoppingPlace(), GNEEdge::drawTAZElements(), GNEConsecutiveSelector::drawTemporalConsecutiveLanePath(), GNEViewNet::drawTemporalDrawingShape(), GNEViewNet::drawTemporalE1TLSLines(), GNEViewNet::drawTemporalJunction(), GNEViewNet::drawTemporalJunctionTLSLines(), GNEViewNet::drawTemporalRoundabout(), GNEPathCreator::drawTemporalRoute(), GNEPlanCreator::drawTemporalRoute(), GNEViewNet::drawTemporalSplitJunction(), GNEViewNetHelper::TestingMode::drawTestingElements(), GNEViewNet::drawTestsCircle(), drawText(), drawTextAtEnd(), drawTextBox(), GNELane::drawTextures(), GNEJunction::drawTLSIcon(), GNELane::drawTLSLinkNo(), GNECrossing::drawTLSLinkNo(), GNEDemandElementPlan::drawToArrow(), drawTriangleAtEnd(), GUIParameterTracker::GUIParameterTrackerPanel::drawValue(), GNEVariableSpeedSignSymbol::drawVSSSymbol(), GNEWalkingArea::drawWalkingArea(), GUISUMOAbstractView::makeSnapshot(), GNEViewNet::redrawPathElementContours(), GNEViewNet::updateObjectsInBoundary(), and GNEViewNet::updateObjectsInPosition().

◆ pushName()

◆ resetFont()

void GLHelper::resetFont ( )
static

to be called when the font context is invalidated

Definition at line 671 of file GLHelper.cpp.

References glfonsDelete(), and myFont.

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

Here is the caller graph for this function:

◆ resetMatrixCounter()

void GLHelper::resetMatrixCounter ( )
static

reset matrix counter

Definition at line 163 of file GLHelper.cpp.

References myMatrixCounter.

Referenced by GUISUMOAbstractView::paintGL().

Here is the caller graph for this function:

◆ resetVertexCounter()

void GLHelper::resetVertexCounter ( )
static

reset vertex counter

Definition at line 175 of file GLHelper.cpp.

References myVertexCounter.

Referenced by GUISUMOAbstractView::paintGL().

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 334 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 654 of file GLHelper.cpp.

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

Referenced by GUISUMOAbstractView::displayColorLegend(), GNEContainer::drawAction_drawAsPoly(), GUIBasePersonHelper::drawAction_drawAsPoly(), GUIContainer::drawAction_drawAsPoly(), GUIBasePersonHelper::drawAction_drawAsTriangle(), GUIVehicle::drawAction_drawCarriageClass(), GUIBaseVehicleHelper::drawAction_drawVehicleAsPoly(), GNELane::drawArrows(), GNEEntryExitDetector::drawBody(), drawBoundary(), drawBoxLines(), GNECalibrator::drawCalibratorSymbol(), GUIGeometry::drawChildLine(), GNEConnection::drawConnection(), GNEConnection::drawConnectionArrows(), GNECrossing::drawCrossing(), GUIDottedGeometry::drawDottedGeometry(), GNEDetector::drawE1Shape(), GNELaneAreaDetector::drawE2(), GNELaneAreaDetector::drawE2PartialJunction(), GNELaneAreaDetector::drawE2PartialLane(), GNEEntryExitDetector::drawE3Logo(), GNEEdge::drawEdgeGeometryPoints(), GNEEdge::drawEdgeShape(), GNEEdge::drawEndGeometryPoint(), GNEEntryExitDetector::drawEntryLogo(), GNEDemandElementFlow::drawFlowLabel(), GUIGeometry::drawGeometry(), GNEStop::drawGeometryPoints(), GUIGeometry::drawGeometryPoints(), GUIBusStop::drawGL(), GUIChargingStation::drawGL(), GUIE3Collector::MyWrapper::drawGL(), GUIJunctionWrapper::drawGL(), GUIOverheadWire::drawGL(), GUIOverheadWireClamp::drawGL(), GUIParkingArea::drawGL(), GUITrafficLightLogicWrapper::drawGL(), GNEAccess::drawGL(), GNEBusStop::drawGL(), GNEChargingStation::drawGL(), GNEContainerStop::drawGL(), GNEParkingArea::drawGL(), GNERouteProbe::drawGL(), GNETAZ::drawGL(), GNEVaporizer::drawGL(), GNETAZRelData::drawGL(), GNEContainer::drawGL(), GNEPerson::drawGL(), GNEStop::drawGL(), GNEStopPlan::drawGL(), GNEVehicle::drawGL(), GNEInternalLane::drawGL(), GUILane::drawGL(), GUIPerson::drawGLAdditional(), GNEJunction::drawJunctionAsBubble(), GNEJunction::drawJunctionAsShape(), GNEDemandElement::drawJunctionLine(), GNEOverheadWire::drawJunctionPartialGL(), GNEVehicle::drawJunctionPartialGL(), GUILane::drawLane2LaneConnections(), GNELane::drawLaneAsRailway(), GNEOverheadWire::drawLanePartialGL(), GNEEdgeData::drawLanePartialGL(), GNEEdgeRelData::drawLanePartialGL(), GNEVehicle::drawLanePartialGL(), GNENeteditAttributes::drawLaneReference(), GNELane::drawLaneStopOffset(), drawLine(), GUILane::drawLinkRule(), GUILane::drawLinkRules(), GNEAdditional::drawListedAdditional(), GNELane::drawMarkingsAndBoundings(), GUIGeometry::drawParentLine(), GNEDemandElementPlan::drawPlanGL(), GNEDemandElementPlan::drawPlanJunctionPartial(), GNEDemandElementPlan::drawPlanLanePartial(), GNEPoly::drawPolygon(), GNEPoly::drawPolygonContour(), GNEViewNetHelper::SelectingArea::drawRectangleSelection(), GNERerouterSymbol::drawRerouterSymbol(), GUIBaseVehicle::drawRoute(), GUIVehicle::drawRouteHelper(), GNERoute::drawRoutePartialJunction(), GNERoute::drawRoutePartialLane(), GNELane::drawSelectedLane(), GNEAdditional::drawSemiCircleGeometryPoint(), GNELane::drawShapeEdited(), GNEStoppingPlace::drawSign(), GNEParkingSpace::drawSpace(), drawSpaceOccupancies(), GNEDemandElement::drawStackLabel(), GNELane::drawStartEndGeometryPoints(), GNEEdge::drawStartGeometryPoint(), GUIBaseVehicle::drawStopLabels(), GNEEdge::drawTAZElements(), GNEConsecutiveSelector::drawTemporalConsecutiveLanePath(), GNEViewNet::drawTemporalDrawingShape(), GNEViewNet::drawTemporalJunction(), GNEViewNet::drawTemporalRoundabout(), GNEPathCreator::drawTemporalRoute(), GNEPlanCreator::drawTemporalRoute(), GNEViewNet::drawTemporalSplitJunction(), GNEViewNetHelper::TestingMode::drawTestingElements(), GNEViewNet::drawTestsCircle(), drawTextBox(), GUIParameterTracker::GUIParameterTrackerPanel::drawValue(), GUITLLogicPhasesTrackerWindow::drawValues(), GNEVariableSpeedSignSymbol::drawVSSSymbol(), GNEWalkingArea::drawWalkingArea(), GUIBaseVehicle::setColor(), GUIContainer::setColor(), GUILane::setColor(), GUIPerson::setColor(), GUIPointOfInterest::setColor(), GUIPolygon::setColor(), GUILane::setFunctionalColor(), GUIContainer::setFunctionalColor(), GNELane::setLaneColor(), and GUIInductLoop::MyWrapper::setOutlineColor().

◆ setGL2PS()

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

set GL2PS

Definition at line 678 of file GLHelper.cpp.

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 436 of file GLHelper.h.

Referenced by getCircleCoords().

◆ myDottedcontourColors

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

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

Definition at line 446 of file GLHelper.h.

Referenced by getDottedcontourColors().

◆ myFont

FONScontext * GLHelper::myFont = nullptr
staticprivate

Font context.

Definition at line 439 of file GLHelper.h.

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

◆ myFontSize

double GLHelper::myFontSize = 50.0
staticprivate

Definition at line 440 of file GLHelper.h.

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

◆ myGL2PSActive

bool GLHelper::myGL2PSActive = false
staticprivate

whether we are currently rendering for gl2ps

Definition at line 443 of file GLHelper.h.

Referenced by drawText(), and setGL2PS().

◆ myMatrixCounter

int GLHelper::myMatrixCounter = 0
staticprivate

matrix counter (for debug purposes)

Definition at line 424 of file GLHelper.h.

Referenced by getMatrixCounter(), pushMatrix(), and resetMatrixCounter().

◆ myMatrixCounterDebug

int GLHelper::myMatrixCounterDebug = 0
staticprivate

matrix counter (for debug purposes)

Definition at line 430 of file GLHelper.h.

Referenced by checkCounterMatrix(), popMatrix(), and pushMatrix().

◆ myNameCounter

int GLHelper::myNameCounter = 0
staticprivate

name counter

Definition at line 433 of file GLHelper.h.

Referenced by checkCounterName(), popName(), and pushName().

◆ myVertexCounter


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