![]() |
SUMO - Simulation of Urban MObility
|
#include <config.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <GL/gl.h>
#include "polyfonts.h"
#include "pfPSansBold16.h"
Go to the source code of this file.
Data Structures | |
struct | nameValue |
struct | vertex |
Macros | |
#define | abs(a) (((a)<0) ? -(a) : (a)) |
#define | DtoR (PI/180.0) |
#define | max(a, b) (((a) > (b)) ? (a) : (b)) |
#define | min(a, b) (((a) < (b)) ? (a) : (b)) |
#define | numWeights (sizeof(weightOffset) / sizeof(vertex)) |
#define | PI (3.1415926535897932384626433) |
#define | RtoD (180.0/PI) |
#define | sign(a) (((a)<0) ? -1 : (a)>0 ? 1 : 0) |
#define | unfix(value) ((double)(value)) / ((double)pfFixScale) |
Functions | |
static int | comp (const void *key, const void *target) |
static int | drawWideChar (wchar_t c) |
static double | getCharAdvance (wchar_t c) |
static int | getCharBBox (wchar_t c, double *minx, double *miny, double *maxx, double *maxy) |
static int | getStringBox (char *c, double *minx, double *miny, double *maxx, double *maxy) |
static int | getStringBoxW (wchar_t *c, double *minx, double *miny, double *maxx, double *maxy) |
static int | lookupGlOp (char *op) |
double | pfdkGetStringWidth (const char *c) |
int | pfDrawChar (wchar_t c) |
int | pfDrawString (const char *c) |
int | pfDrawStringW (wchar_t *c) |
static pfglyph * | pfFindGlyph (pfglyph *glyphs, int numglyphs, pfglyph *find) |
wchar_t | pfGetChar (int g) |
double | pfGetCharAdvance (wchar_t c) |
double | pfGetCharAscent (wchar_t c) |
int | pfGetCharBBox (wchar_t c, double *minx, double *miny, double *maxx, double *maxy) |
double | pfGetCharDescent (wchar_t c) |
double | pfGetCharHeight (wchar_t c) |
double | pfGetCharWidth (wchar_t c) |
pffont * | pfGetCurrentFont () |
double | pfGetFontAscent () |
int | pfGetFontBBox (double *minx, double *miny, double *maxx, double *maxy) |
double | pfGetFontDescent () |
double | pfGetFontHeight () |
char * | pfGetFontName () |
int | pfGetFontNumGlyphs () |
double | pfGetFontWidth () |
static pfglyph * | pfGetGlyph (wchar_t c) |
void | pfGetPosition (double *x, double *y) |
void | pfSetAngleD (double a) |
void | pfSetAngleR (double a) |
void | pfSetCenter (int onOff) |
int | pfSetFont (pffont *f) |
void | pfSetPosition (double x, double y) |
void | pfSetScale (double s) |
int | pfSetScaleBox (char *c, double w, double h) |
int | pfSetScaleBoxW (wchar_t *c, double w, double h) |
void | pfSetScaleXY (double sx, double sy) |
void | pfSetSkew (double s) |
void | pfSetWeight (int w) |
static double | pfSkew (double x, double y) |
void | pfUnloadFont (pffont *font) |
static void | validate (pffont *font) |
Variables | |
static nameValue | glPrims [] |
static int | pfCenter = 0 |
static pffont * | pfCurrentFont = &pfPSansBold16 |
static pffont * | pfDefaultFont = &pfPSansBold16 |
static double | pfScaleX = 20.0 |
static double | pfScaleY = 20.0 |
static double | pfTextCos = 1.0 |
static double | pfTextSin = 0.0 |
static double | pfTextSkew = 0.0 |
static int | pfTextWeight = 1 |
static double | pfTextX = 0.0 |
static double | pfTextY = 0.0 |
vertex | weightOffset [] |
#define abs | ( | a | ) | (((a)<0) ? -(a) : (a)) |
Definition at line 67 of file polyfonts.c.
Referenced by MSLCM_LC2013::_wantsChange(), MSLCM_SL2015::_wantsChangeSublane(), MSLCM_SL2015::checkStrategicChange(), MSLCM_DK2008::currentDistAllows(), MSLCM_SL2015::currentDistAllows(), MSLCM_LC2013::currentDistAllows(), MSLCM_DK2008::currentDistDisallows(), MSLCM_SL2015::currentDistDisallows(), MSLCM_LC2013::currentDistDisallows(), GUIVehicle::drawBestLanes(), AGCity::generatePopulation(), NBNode::getDirection(), PHEMlightdll::CEP::GetEmission(), MSVehicle::updateBestLanes(), GNEDetectorE3::updateGeometryConnections(), and MSPModel_Striping::PState::walk().
#define DtoR (PI/180.0) |
Definition at line 63 of file polyfonts.c.
Referenced by pfSetAngleD().
#define max | ( | a, | |
b | |||
) | (((a) > (b)) ? (a) : (b)) |
Definition at line 65 of file polyfonts.c.
Referenced by TplConvert::_2int(), TplConvert::_hex2int(), MSLCM_SL2015::_wantsChangeSublane(), NLHandler::addE2Detector(), SUMOVehicleParserHelper::beginVTypeParsing(), CHBuilder< E, V >::buildContractionHierarchy(), CHRouter< E, V, PF >::buildContractionHierarchy(), NLDetectorBuilder::buildE2Detector(), MSLaneChanger::changeOpposite(), MSLeaderDistanceInfo::clear(), MSCriticalFollowerDistanceInfo::clear(), CHRouterWrapper< E, V, PF >::compute(), DijkstraRouterTT< MSEdge, SUMOVehicle, prohibited_withPermissions< MSEdge, SUMOVehicle > >::compute(), DijkstraRouterEffort< MSEdge, SUMOVehicle, prohibited_withPermissions< MSEdge, SUMOVehicle > >::compute(), AStarRouter< MSEdge, SUMOVehicle, prohibited_withPermissions< MSEdge, SUMOVehicle > >::compute(), CHRouter< E, V, PF >::compute(), computeRoutes(), NIImporter_OpenDrive::computeShapes(), MSLCM_SL2015::computeSublaneShift(), TraCIServerAPI_Simulation::convertCartesianToRoadMap(), TraCI::convertCartesianToRoadMap(), MSAbstractLaneChangeModel::decideDirection(), SPTree< CHBuilder::CHInfo, CHBuilder::CHConnection >::dijkstraTT(), PositionVector::distance2D(), MSVehicle::executeMove(), MSLaneChanger::findCandidate(), NBEdge::firstIntersection(), MSActuatedTrafficLightLogic::gapControl(), GawronCalculator< R, E, V >::gawronF(), GawronCalculator< R, E, V >::gawronG(), LogitCalculator< R, E, V >::getBetaForCLogit(), MSLane::getCriticalLeader(), TraCI_Vehicle::getDistance(), MSRoute::getDistanceBetween(), MSVehicle::getDistanceToPosition(), TraCI_Vehicle::getDrivingDistance(), TraCI_Vehicle::getDrivingDistance2D(), MSE2Collector::getEstimateQueueLength(), MSLane::getFirstVehicleInformation(), MSLane::getFollowersOnConsecutive(), MSEdge::getFreeLane(), RODFDetectorFlows::getMaxDetectorFlow(), GUITexturesHelper::getMaxTextureSize(), NBContHelper::same_connection_edge_sorter::getMinMaxRelAngles(), MSLane::getMoveReminders(), GUISUMOAbstractView::getObjectAtPosition(), MSLCM_SL2015::getSlowest(), MSCFModel::getSpeedAfterMaxDecel(), getStringBox(), getStringBoxW(), LogitCalculator< R, E, V >::getThetaForCLogit(), PublicTransportEdge< E, L, N, V >::getTravelTime(), PositionVector::indexOfClosest(), MSLCM_LC2013::informLeader(), MSE2Collector::initAuxiliaries(), PositionVector::insertAtClosest(), MESegment::jamThresholdForSpeed(), NBNodeCont::joinJunctions(), NBContHelper::maxSpeed(), VectorHelper< T >::maxValue(), VectorHelper< T >::minValue(), MSE2Collector::MSE2Collector(), NIImporter_OpenStreetMap::EdgesHandler::myStartElement(), PositionVector::nearest_offset_to_point2D(), GUIParameterTracker::onCmdSave(), SUMOVehicleParserHelper::parseFlowAttributes(), pfSetSkew(), pfSetWeight(), MSVehicle::planMoveInternal(), MSLCM_SL2015::prepareStep(), TraCIServerAPI_Vehicle::processSet(), SPTree< CHBuilder::CHInfo, CHBuilder::CHConnection >::rebuildFrom(), NIImporter_OpenStreetMap::reconstructLayerElevation(), PositionVector::removeClosest(), MSDevice_Routing::reroute(), DijkstraRouterEffort< E, V, PF >::EdgeInfo::reset(), DijkstraRouterTT< E, V, PF >::EdgeInfo::reset(), CHRouter< E, V, PF >::EdgeInfo::reset(), AStarRouter< E, V, PF >::EdgeInfo::reset(), CHBuilder< E, V >::CHInfo::reset(), Distribution_Parameterized::sample(), MSE2Collector::selectLanes(), MSFrame::setMSGlobals(), MFXAddEditTypedTable::setNumberCellParams(), CHRouter< E, V, PF >::Unidirectional::step(), PositionVector::transformToVectorCoordinates(), MSActuatedTrafficLightLogic::trySwitch(), CHBuilder< E, V >::tryUpdateFront(), MSSwarmTrafficLightLogic::updateSensitivities(), SUMOVTypeParameter::write(), NWWriter_DlrNavteq::writeNodesUnsplitted(), and GeoConvHelper::x2cartesian_const().
#define min | ( | a, | |
b | |||
) | (((a) < (b)) ? (a) : (b)) |
Definition at line 66 of file polyfonts.c.
Referenced by TplConvert::_2int(), TplConvert::_hex2int(), AGTime::AGTime(), MSSwarmTrafficLightLogic::calculateEtaDiff(), MSSwarmTrafficLightLogic::calculateEtaRatio(), MSAbstractLaneChangeModel::decideDirection(), SPTree< CHBuilder::CHInfo, CHBuilder::CHConnection >::dijkstraTT(), LogitCalculator< R, E, V >::getBetaForCLogit(), NBContHelper::same_connection_edge_sorter::getMinMaxRelAngles(), getStringBox(), getStringBoxW(), LogitCalculator< R, E, V >::getThetaForCLogit(), GUIPropertyScheme< T >::interpolate(), MSLCM_DK2008::patchSpeed(), pfSetSkew(), pfSetWeight(), SPTree< CHBuilder::CHInfo, CHBuilder::CHConnection >::rebuildFrom(), Distribution_Parameterized::sample(), MFXAddEditTypedTable::setNumberCellParams(), CHBuilder< E, V >::CHInfo::updateLevel(), MSSwarmTrafficLightLogic::updateSensitivities(), and NWWriter_DlrNavteq::writeNodesUnsplitted().
#define numWeights (sizeof(weightOffset) / sizeof(vertex)) |
Definition at line 129 of file polyfonts.c.
Referenced by pfSetWeight().
#define PI (3.1415926535897932384626433) |
Definition at line 61 of file polyfonts.c.
Referenced by GUIPerson::drawAction_drawAsImage(), GUIContainer::drawAction_drawAsPoly(), GUIPerson::drawAction_drawAsTriangle(), GUIVehicle::drawAction_drawRailCarriages(), GNELane::drawArrows(), GUIBaseVehicle::drawOnPos(), MSParkingArea::getVehicleAngle(), GNEInternalLane::GNEInternalLane(), GUIBusStop::GUIBusStop(), GUIChargingStation::GUIChargingStation(), GUIContainerStop::GUIContainerStop(), GUIParkingArea::GUIParkingArea(), MSParkingArea::MSParkingArea(), GUIE2Collector::MyWrapper::MyWrapper(), GUIBaseVehicle::setFunctionalColor(), GNEConnection::updateGeometry(), GNECrossing::updateGeometry(), GNEChargingStation::updateGeometry(), GNEDetectorE2::updateGeometry(), GNEContainerStop::updateGeometry(), GNEBusStop::updateGeometry(), and GNELane::updateGeometry().
#define RtoD (180.0/PI) |
Definition at line 62 of file polyfonts.c.
#define sign | ( | a | ) | (((a)<0) ? -1 : (a)>0 ? 1 : 0) |
Definition at line 68 of file polyfonts.c.
Referenced by MSLaneChanger::computeOvertakingTime(), MSCFModel_Wiedemann::following(), EulerSpiral::get_fresnel_integral(), and PositionVector::transformToVectorCoordinates().
#define unfix | ( | value | ) | ((double)(value)) / ((double)pfFixScale) |
Definition at line 136 of file polyfonts.c.
Referenced by drawWideChar().
|
static |
|
static |
Definition at line 974 of file polyfonts.c.
References pfglyph::advance, pfglyph::maxx, pfglyph::maxy, pfglyph::minx, pfglyph::miny, pfglyph::numsegments, pfCenter, pfGetGlyph(), pfScaleX, pfScaleY, pfSkew(), pfTextCos, pfTextSin, pfTextWeight, pfTextX, pfTextY, pfglyph::segments, unfix, vertex::x, and vertex::y.
Referenced by pfDrawChar(), pfDrawString(), and pfDrawStringW().
|
static |
Definition at line 855 of file polyfonts.c.
References pfglyph::advance, and pfGetGlyph().
Referenced by getStringBox(), and getStringBoxW().
|
static |
Definition at line 532 of file polyfonts.c.
References pfglyph::maxx, pfglyph::maxy, pfglyph::minx, pfglyph::miny, and pfGetGlyph().
Referenced by getStringBox(), getStringBoxW(), and pfGetCharBBox().
|
static |
Definition at line 558 of file polyfonts.c.
References getCharAdvance(), getCharBBox(), max, and min.
Referenced by pfSetScaleBox().
|
static |
Definition at line 598 of file polyfonts.c.
References getCharAdvance(), getCharBBox(), max, and min.
Referenced by pfSetScaleBoxW().
|
static |
double pfdkGetStringWidth | ( | const char * | c | ) |
Definition at line 1113 of file polyfonts.c.
References pfGetCharAdvance().
Referenced by GUILaneSpeedTrigger::drawGL(), GUICalibrator::drawGL(), GNECalibrator::drawGL(), GUITriggeredRerouter::GUITriggeredRerouterEdge::drawGL(), GLHelper::drawText(), GLHelper::drawTextBox(), GUIParameterTracker::GUIParameterTrackerPanel::drawValue(), and GUITLLogicPhasesTrackerWindow::drawValues().
int pfDrawChar | ( | wchar_t | c | ) |
Definition at line 1058 of file polyfonts.c.
References drawWideChar().
int pfDrawString | ( | const char * | c | ) |
Definition at line 1074 of file polyfonts.c.
References drawWideChar().
Referenced by GUISUMOAbstractView::displayLegend(), GNEBusStop::drawGL(), GNEContainerStop::drawGL(), GUILaneSpeedTrigger::drawGL(), GUICalibrator::drawGL(), GNEChargingStation::drawGL(), GUIChargingStation::drawGL(), GUIContainerStop::drawGL(), GUIBusStop::drawGL(), GUIParkingArea::drawGL(), GNECalibrator::drawGL(), GUITriggeredRerouter::GUITriggeredRerouterEdge::drawGL(), GLHelper::drawText(), GLHelper::drawTextBox(), GUIParameterTracker::GUIParameterTrackerPanel::drawValue(), and GUITLLogicPhasesTrackerWindow::drawValues().
int pfDrawStringW | ( | wchar_t * | c | ) |
Definition at line 1093 of file polyfonts.c.
References drawWideChar().
wchar_t pfGetChar | ( | int | g | ) |
Definition at line 801 of file polyfonts.c.
References pfglyph::glyph, pffont::glyphs, and pffont::numglyphs.
double pfGetCharAdvance | ( | wchar_t | c | ) |
Definition at line 869 of file polyfonts.c.
References pfglyph::advance, pfGetGlyph(), and pfScaleX.
Referenced by pfdkGetStringWidth().
double pfGetCharAscent | ( | wchar_t | c | ) |
Definition at line 946 of file polyfonts.c.
References pfGetCharBBox().
int pfGetCharBBox | ( | wchar_t | c, |
double * | minx, | ||
double * | miny, | ||
double * | maxx, | ||
double * | maxy | ||
) |
Definition at line 883 of file polyfonts.c.
References getCharBBox(), pfScaleX, pfScaleY, pfSkew(), and pfTextSkew.
Referenced by pfGetCharAscent(), pfGetCharDescent(), pfGetCharHeight(), and pfGetCharWidth().
double pfGetCharDescent | ( | wchar_t | c | ) |
Definition at line 960 of file polyfonts.c.
References pfGetCharBBox().
double pfGetCharHeight | ( | wchar_t | c | ) |
Definition at line 918 of file polyfonts.c.
References pfGetCharBBox().
double pfGetCharWidth | ( | wchar_t | c | ) |
Definition at line 932 of file polyfonts.c.
References pfGetCharBBox().
pffont* pfGetCurrentFont | ( | ) |
Definition at line 692 of file polyfonts.c.
References pfCurrentFont.
double pfGetFontAscent | ( | ) |
Definition at line 761 of file polyfonts.c.
References pfGetFontBBox().
int pfGetFontBBox | ( | double * | minx, |
double * | miny, | ||
double * | maxx, | ||
double * | maxy | ||
) |
Definition at line 699 of file polyfonts.c.
References pffont::maxx, pffont::maxy, pffont::minx, pffont::miny, pfScaleX, pfScaleY, pfSkew(), and pfTextSkew.
Referenced by pfGetFontAscent(), pfGetFontDescent(), pfGetFontHeight(), and pfGetFontWidth().
double pfGetFontDescent | ( | ) |
Definition at line 775 of file polyfonts.c.
References pfGetFontBBox().
double pfGetFontHeight | ( | ) |
Definition at line 733 of file polyfonts.c.
References pfGetFontBBox().
char* pfGetFontName | ( | ) |
Definition at line 678 of file polyfonts.c.
References pffont::name.
int pfGetFontNumGlyphs | ( | ) |
Definition at line 789 of file polyfonts.c.
References pffont::numglyphs.
double pfGetFontWidth | ( | ) |
Definition at line 747 of file polyfonts.c.
References pfGetFontBBox().
|
static |
Definition at line 837 of file polyfonts.c.
References pfglyph::glyph, pffont::glyphs, pffont::numglyphs, and pfFindGlyph().
Referenced by drawWideChar(), getCharAdvance(), getCharBBox(), and pfGetCharAdvance().
void pfGetPosition | ( | double * | x, |
double * | y | ||
) |
Definition at line 488 of file polyfonts.c.
void pfSetAngleD | ( | double | a | ) |
Definition at line 518 of file polyfonts.c.
References DtoR, and pfSetAngleR().
void pfSetAngleR | ( | double | a | ) |
Definition at line 510 of file polyfonts.c.
References pfTextCos, and pfTextSin.
Referenced by pfSetAngleD().
void pfSetCenter | ( | int | onOff | ) |
Definition at line 525 of file polyfonts.c.
References pfCenter.
int pfSetFont | ( | pffont * | f | ) |
Definition at line 152 of file polyfonts.c.
void pfSetPosition | ( | double | x, |
double | y | ||
) |
Definition at line 480 of file polyfonts.c.
References pfTextX, and pfTextY.
Referenced by GUISUMOAbstractView::displayLegend(), GNEBusStop::drawGL(), GNEContainerStop::drawGL(), GUILaneSpeedTrigger::drawGL(), GUICalibrator::drawGL(), GNEChargingStation::drawGL(), GUIChargingStation::drawGL(), GUIContainerStop::drawGL(), GUIBusStop::drawGL(), GUIParkingArea::drawGL(), GNECalibrator::drawGL(), GUITriggeredRerouter::GUITriggeredRerouterEdge::drawGL(), GLHelper::drawText(), GLHelper::drawTextBox(), GUIParameterTracker::GUIParameterTrackerPanel::drawValue(), and GUITLLogicPhasesTrackerWindow::drawValues().
void pfSetScale | ( | double | s | ) |
Definition at line 465 of file polyfonts.c.
References pfScaleX, and pfScaleY.
Referenced by GNEBusStop::drawGL(), GNEContainerStop::drawGL(), GUILaneSpeedTrigger::drawGL(), GUICalibrator::drawGL(), GNEChargingStation::drawGL(), GUIChargingStation::drawGL(), GUIContainerStop::drawGL(), GUIBusStop::drawGL(), GUIParkingArea::drawGL(), GNECalibrator::drawGL(), GUITriggeredRerouter::GUITriggeredRerouterEdge::drawGL(), GLHelper::drawText(), GLHelper::drawTextBox(), and GUIParameterTracker::GUIParameterTrackerPanel::drawValues().
int pfSetScaleBox | ( | char * | c, |
double | w, | ||
double | h | ||
) |
Definition at line 638 of file polyfonts.c.
References getStringBox(), and pfSetScaleXY().
int pfSetScaleBoxW | ( | wchar_t * | c, |
double | w, | ||
double | h | ||
) |
Definition at line 658 of file polyfonts.c.
References getStringBoxW(), and pfSetScaleXY().
void pfSetScaleXY | ( | double | sx, |
double | sy | ||
) |
Definition at line 472 of file polyfonts.c.
References pfScaleX, and pfScaleY.
Referenced by GUISUMOAbstractView::displayLegend(), GUIParameterTracker::GUIParameterTrackerPanel::drawValues(), GUITLLogicPhasesTrackerWindow::drawValues(), pfSetScaleBox(), and pfSetScaleBoxW().
void pfSetSkew | ( | double | s | ) |
Definition at line 496 of file polyfonts.c.
References max, min, and pfTextSkew.
void pfSetWeight | ( | int | w | ) |
Definition at line 503 of file polyfonts.c.
References max, min, numWeights, and pfTextWeight.
|
static |
Definition at line 145 of file polyfonts.c.
References pfTextSkew.
Referenced by drawWideChar(), pfGetCharBBox(), and pfGetFontBBox().
void pfUnloadFont | ( | pffont * | font | ) |
Definition at line 256 of file polyfonts.c.
References pffont::glyphs, pffont::loaded, lookupGlOp(), pffont::maxx, pffont::maxy, pffont::minx, pffont::miny, pffont::name, pffont::numglyphs, and pfglyph::segments.
|
static |
Definition at line 205 of file polyfonts.c.
References pffont::glyphs, pffont::maxx, pffont::maxy, pffont::minx, pffont::miny, pffont::name, and pffont::numglyphs.
|
static |
Definition at line 172 of file polyfonts.c.
Referenced by lookupGlOp().
|
static |
Definition at line 134 of file polyfonts.c.
Referenced by drawWideChar(), and pfSetCenter().
|
static |
Definition at line 83 of file polyfonts.c.
Referenced by pfGetCurrentFont().
|
static |
Definition at line 84 of file polyfonts.c.
|
static |
Definition at line 102 of file polyfonts.c.
Referenced by drawWideChar(), pfGetCharAdvance(), pfGetCharBBox(), pfGetFontBBox(), pfSetScale(), and pfSetScaleXY().
|
static |
Definition at line 103 of file polyfonts.c.
Referenced by drawWideChar(), pfGetCharBBox(), pfGetFontBBox(), pfSetScale(), and pfSetScaleXY().
|
static |
Definition at line 132 of file polyfonts.c.
Referenced by drawWideChar(), and pfSetAngleR().
|
static |
Definition at line 131 of file polyfonts.c.
Referenced by drawWideChar(), and pfSetAngleR().
|
static |
Definition at line 108 of file polyfonts.c.
Referenced by pfGetCharBBox(), pfGetFontBBox(), pfSetSkew(), and pfSkew().
|
static |
Definition at line 109 of file polyfonts.c.
Referenced by drawWideChar(), and pfSetWeight().
|
static |
Definition at line 105 of file polyfonts.c.
Referenced by drawWideChar(), pfGetPosition(), and pfSetPosition().
|
static |
Definition at line 106 of file polyfonts.c.
Referenced by drawWideChar(), pfGetPosition(), and pfSetPosition().
vertex weightOffset[] |
Definition at line 116 of file polyfonts.c.