Eclipse SUMO - Simulation of Urban MObility
GNEGeometry Struct Reference

#include <GNEGeometry.h>

Collaboration diagram for GNEGeometry:
[legend]

Data Structures

class  DottedGeometry
 class for pack all variables related with DottedGeometry More...
 
class  DottedGeometryColor
 class for pack all variables related with DottedGeometry color More...
 
class  Geometry
 class for NETEDIT geometries over lanes More...
 
class  Lane2laneConnection
 class lane2lane connection geometry More...
 

Public Types

enum  DottedContourType {
  DottedContourType::INSPECT, DottedContourType::FRONT, DottedContourType::MOVE, DottedContourType::GREEN,
  DottedContourType::MAGENTA
}
 

Static Public Member Functions

static void adjustStartPosGeometricPath (double &startPos, const GNELane *startLane, double &endPos, const GNELane *endLane)
 adjust start and end positions in geometric path More...
 
static double calculateLength (const Position &first, const Position &second)
 return length between two points (used in geometric calculations) More...
 
static double calculateRotation (const Position &first, const Position &second)
 return angle between two points (used in geometric calculations) More...
 
static void drawChildLine (const GUIVisualizationSettings &s, const Position &child, const Position &parent, const RGBColor &color, const bool drawEntire)
 draw line between child and parent (used in NETEDIT) More...
 
static void drawContourGeometry (const Geometry &geometry, const double width, const bool drawExtremes=false)
 draw contour geometry More...
 
static void drawDottedContourCircle (const DottedContourType type, const GUIVisualizationSettings &s, const Position &pos, const double radius, const double exaggeration)
 draw dotted contour for the given Position and radius (used by Juctions and POIs) More...
 
static void drawDottedContourClosedShape (const DottedContourType type, const GUIVisualizationSettings &s, const PositionVector &shape, const double exaggeration, const double lineWidth=-1)
 draw dotted contour for the given closed shape (used by Juctions, shapes and TAZs) More...
 
static void drawDottedContourEdge (const DottedContourType type, const GUIVisualizationSettings &s, const GNEEdge *edge, const bool drawFrontExtreme, const bool drawBackExtreme)
 draw dotted contour for the given dottedGeometries (used by edges) More...
 
static void drawDottedContourShape (const DottedContourType type, const GUIVisualizationSettings &s, const PositionVector &shape, const double width, const double exaggeration, const bool drawFirstExtrem, const bool drawLastExtrem, const double lineWidth=-1)
 draw dotted contour for the given shape (used by additionals) More...
 
static void drawDottedSquaredShape (const DottedContourType type, const GUIVisualizationSettings &s, const Position &pos, const double width, const double height, const double offsetX, const double offsetY, const double rot, const double exaggeration)
 draw dotted squared contour (used by additionals and demand elements) More...
 
static void drawGeometry (const GNEViewNet *viewNet, const Geometry &geometry, const double width)
 draw geometry More...
 
static void drawGeometryPoints (const GUIVisualizationSettings &s, const GNEViewNet *viewNet, const PositionVector &shape, const RGBColor &geometryPointColor, const RGBColor &textColor, const double radius, const double exaggeration)
 draw geometry points More...
 
static void drawLaneGeometry (const GNEViewNet *viewNet, const PositionVector &shape, const std::vector< double > &rotations, const std::vector< double > &lengths, const std::vector< RGBColor > &colors, double width, const bool onlyContour=false)
 draw lane geometry (use their own function due colors) More...
 
static void drawMovingHint (const GUIVisualizationSettings &s, const GNEViewNet *viewNet, const PositionVector &shape, const RGBColor &hintColor, const double radius, const double exaggeration)
 draw moving hint More...
 
static void drawParentLine (const GUIVisualizationSettings &s, const Position &parent, const Position &child, const RGBColor &color, const bool drawEntire)
 draw line between parent and children (used in NETEDIT) More...
 
static PositionVector getVertexCircleAroundPosition (const Position &pos, const double width, const int steps=8)
 get a circle around the given position More...
 
static void rotateOverLane (const double rot)
 rotate over lane (used by Lock icons, detector logos, etc.) More...
 

Static Private Member Functions

static int angleLookup (const double angleDeg)
 normalize angle for lookup in myCircleCoords More...
 

Static Private Attributes

static PositionVector myCircleCoords
 Storage for precomputed sin/cos-values describing a circle. More...
 

Detailed Description

Definition at line 53 of file GNEGeometry.h.

Member Enumeration Documentation

◆ DottedContourType

Enumerator
INSPECT 
FRONT 
MOVE 
GREEN 
MAGENTA 

Definition at line 116 of file GNEGeometry.h.

Member Function Documentation

◆ adjustStartPosGeometricPath()

void GNEGeometry::adjustStartPosGeometricPath ( double &  startPos,
const GNELane startLane,
double &  endPos,
const GNELane endLane 
)
static

adjust start and end positions in geometric path

Definition at line 581 of file GNEGeometry.cpp.

References GNELane::getLaneShape(), PositionVector::length(), and POSITION_EPS.

◆ angleLookup()

int GNEGeometry::angleLookup ( const double  angleDeg)
staticprivate

normalize angle for lookup in myCircleCoords

Definition at line 1117 of file GNEGeometry.cpp.

References CIRCLE_RESOLUTION, and myCircleCoords.

Referenced by getVertexCircleAroundPosition().

Here is the caller graph for this function:

◆ calculateLength()

double GNEGeometry::calculateLength ( const Position first,
const Position second 
)
static

return length between two points (used in geometric calculations)

Definition at line 574 of file GNEGeometry.cpp.

References Position::distanceTo2D().

Referenced by GNEGeometry::Geometry::calculateShapeRotationsAndLengths(), GNEGeometry::DottedGeometry::calculateShapeRotationsAndLengths(), and GNEViewNet::drawLaneCandidates().

Here is the caller graph for this function:

◆ calculateRotation()

double GNEGeometry::calculateRotation ( const Position first,
const Position second 
)
static

return angle between two points (used in geometric calculations)

Definition at line 567 of file GNEGeometry.cpp.

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

Referenced by GNEGeometry::Geometry::calculateShapeRotationsAndLengths(), GNEGeometry::DottedGeometry::calculateShapeRotationsAndLengths(), GNELane::drawArrows(), and GNEViewNet::drawLaneCandidates().

Here is the caller graph for this function:

◆ drawChildLine()

◆ drawContourGeometry()

void GNEGeometry::drawContourGeometry ( const Geometry geometry,
const double  width,
const bool  drawExtremes = false 
)
static

draw contour geometry

Definition at line 638 of file GNEGeometry.cpp.

References PositionVector::append(), PositionVector::closePolygon(), GLHelper::drawBoxLines(), GNEGeometry::Geometry::getShape(), PositionVector::move2side(), and PositionVector::reverse().

Referenced by GNEEdgeRelData::drawPartialGL(), and GNEAdditional::drawPartialGL().

Here is the caller graph for this function:

◆ drawDottedContourCircle()

void GNEGeometry::drawDottedContourCircle ( const DottedContourType  type,
const GUIVisualizationSettings s,
const Position pos,
const double  radius,
const double  exaggeration 
)
static

draw dotted contour for the given Position and radius (used by Juctions and POIs)

Definition at line 934 of file GNEGeometry.cpp.

References drawDottedContourClosedShape(), and getVertexCircleAroundPosition().

Referenced by GNEVariableSpeedSignSymbol::drawGL(), GNEAccess::drawGL(), GNEJunction::drawGL(), and GNEPOI::drawGL().

Here is the caller graph for this function:

◆ drawDottedContourClosedShape()

void GNEGeometry::drawDottedContourClosedShape ( const DottedContourType  type,
const GUIVisualizationSettings s,
const PositionVector shape,
const double  exaggeration,
const double  lineWidth = -1 
)
static

draw dotted contour for the given closed shape (used by Juctions, shapes and TAZs)

Definition at line 861 of file GNEGeometry.cpp.

References GNEGeometry::DottedGeometry::drawDottedGeometry(), FRONT, GLO_DOTTEDCONTOUR_INSPECTED, GLHelper::popMatrix(), GLHelper::pushMatrix(), and PositionVector::scaleRelative().

Referenced by drawDottedContourCircle(), GNETAZ::drawDottedContours(), drawDottedSquaredShape(), GNEJunction::drawGL(), and GNEPoly::drawGL().

Here is the caller graph for this function:

◆ drawDottedContourEdge()

void GNEGeometry::drawDottedContourEdge ( const DottedContourType  type,
const GUIVisualizationSettings s,
const GNEEdge edge,
const bool  drawFrontExtreme,
const bool  drawBackExtreme 
)
static

◆ drawDottedContourShape()

◆ drawDottedSquaredShape()

void GNEGeometry::drawDottedSquaredShape ( const DottedContourType  type,
const GUIVisualizationSettings s,
const Position pos,
const double  width,
const double  height,
const double  offsetX,
const double  offsetY,
const double  rot,
const double  exaggeration 
)
static

draw dotted squared contour (used by additionals and demand elements)

Definition at line 945 of file GNEGeometry.cpp.

References PositionVector::add(), DEG2RAD, drawDottedContourClosedShape(), and PositionVector::rotate2D().

Referenced by GNECalibrator::drawCalibratorSymbol(), GNEDetectorE1::drawGL(), GNERerouterSymbol::drawGL(), GNEDetectorE1Instant::drawGL(), GNEParkingSpace::drawGL(), GNEPOI::drawGL(), GNEContainer::drawGL(), GNEPerson::drawGL(), GNEVehicle::drawGL(), and GNEAdditional::drawSquaredAdditional().

Here is the caller graph for this function:

◆ drawGeometry()

void GNEGeometry::drawGeometry ( const GNEViewNet viewNet,
const Geometry geometry,
const double  width 
)
static

draw geometry

Definition at line 610 of file GNEGeometry.cpp.

References Position::distanceSquaredTo2D(), GLHelper::drawBoxLines(), GLHelper::drawFilledCircle(), GUIVisualizationSettings::drawForPositionSelection, GLHelper::drawLine(), GUIVisualizationSettings::getCircleResolution(), GUISUMOAbstractView::getPositionInformation(), GNEGeometry::Geometry::getShape(), GNEGeometry::Geometry::getShapeLengths(), GNEGeometry::Geometry::getShapeRotations(), GUISUMOAbstractView::getVisualisationSettings(), PositionVector::nearest_offset_to_point2D(), GLHelper::popMatrix(), PositionVector::positionAtOffset2D(), GLHelper::pushMatrix(), GUIVisualizationSettings::scale, Position::x(), and Position::y().

Referenced by GNEChargingStation::drawGL(), GNEContainerStop::drawGL(), GNEBusStop::drawGL(), GNEParkingArea::drawGL(), GNEVaporizer::drawGL(), GNERouteProbe::drawGL(), GNETAZRelData::drawGL(), GNEDetectorE2::drawGL(), GNEInternalLane::drawGL(), GNEJunction::drawGL(), GNEStop::drawGL(), GNETAZ::drawGL(), GNEPoly::drawGL(), GNELane::drawMarkings(), GNERoute::drawPartialGL(), GNEAdditional::drawPartialGL(), GNEVehicle::drawPartialGL(), GNEDemandElement::drawPersonPlanPartial(), GNEStopContainer::drawStopContainerOverLane(), GNEStopContainer::drawStopContainerOverStopContainer(), GNEStopPerson::drawStopPersonOverBusStop(), GNEStopPerson::drawStopPersonOverLane(), and GNEViewNet::drawTemporalJunction().

Here is the caller graph for this function:

◆ drawGeometryPoints()

◆ drawLaneGeometry()

void GNEGeometry::drawLaneGeometry ( const GNEViewNet viewNet,
const PositionVector shape,
const std::vector< double > &  rotations,
const std::vector< double > &  lengths,
const std::vector< RGBColor > &  colors,
double  width,
const bool  onlyContour = false 
)
static

◆ drawMovingHint()

void GNEGeometry::drawMovingHint ( const GUIVisualizationSettings s,
const GNEViewNet viewNet,
const PositionVector shape,
const RGBColor hintColor,
const double  radius,
const double  exaggeration 
)
static

◆ drawParentLine()

void GNEGeometry::drawParentLine ( const GUIVisualizationSettings s,
const Position parent,
const Position child,
const RGBColor color,
const bool  drawEntire 
)
static

◆ getVertexCircleAroundPosition()

PositionVector GNEGeometry::getVertexCircleAroundPosition ( const Position pos,
const double  width,
const int  steps = 8 
)
static

get a circle around the given position

Definition at line 1087 of file GNEGeometry.cpp.

References PositionVector::add(), angleLookup(), CIRCLE_RESOLUTION, DEG2RAD, myCircleCoords, Position::x(), and Position::y().

Referenced by drawDottedContourCircle().

Here is the caller graph for this function:

◆ rotateOverLane()

Field Documentation

◆ myCircleCoords

PositionVector GNEGeometry::myCircleCoords
staticprivate

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

Definition at line 316 of file GNEGeometry.h.

Referenced by angleLookup(), and getVertexCircleAroundPosition().


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