void GUIPerson::drawGLAdditional(GUISUMOAbstractView* const parent, const GUIVisualizationSettings& s) const { glPushName(getGlID()); glPushMatrix(); glTranslated(0, 0, getType() - .1); // don't draw on top of other cars if (hasActiveAddVisualisation(parent, VO_SHOW_WALKINGAREA_PATH)) { drawAction_drawWalkingareaPath(s); } if (hasActiveAddVisualisation(parent, VO_SHOW_ROUTE)) { if (getCurrentStageType() == MOVING_WITHOUT_VEHICLE) { setColor(s); RGBColor current = GLHelper::getColor(); RGBColor darker = current.changedBrightness(-51); GLHelper::setColor(darker); MSPersonStage_Walking* stage = dynamic_cast<MSPersonStage_Walking*>(getCurrentStage()); assert(stage != 0); const SUMOReal exaggeration = s.personSize.getExaggeration(s); const ConstMSEdgeVector& edges = stage->getRoute(); for (ConstMSEdgeVector::const_iterator it = edges.begin(); it != edges.end(); ++it) { GUILane* lane = static_cast<GUILane*>((*it)->getLanes()[0]); GLHelper::drawBoxLines(lane->getShape(), lane->getShapeRotations(), lane->getShapeLengths(), exaggeration); } } } glPopMatrix(); glPopName(); }
void GUIPerson::drawGL(const GUIVisualizationSettings& s) const { glPushName(getGlID()); glPushMatrix(); Position p1 = getPosition(); if (getCurrentStageType() == DRIVING && !isWaiting4Vehicle()) { p1 = myPositionInVehicle; } glTranslated(p1.x(), p1.y(), getType()); glRotated(90, 0, 0, 1); // set person color setColor(s); // scale const SUMOReal upscale = s.personSize.getExaggeration(s, 80); glScaled(upscale, upscale, 1); switch (s.personQuality) { case 0: case 1: drawAction_drawAsTriangle(s); break; case 2: drawAction_drawAsPoly(s); break; case 3: default: drawAction_drawAsImage(s); break; } glPopMatrix(); #ifdef GUIPerson_DEBUG_DRAW_WALKINGAREA_PATHS drawAction_drawWalkingareaPath(s); #endif drawName(p1, s.scale, s.personName); glPopName(); }
const MSEdge* MSPerson::getNextEdgePtr() const { if (getCurrentStageType() == MOVING_WITHOUT_VEHICLE) { MSPersonStage_Walking* walkingStage = dynamic_cast<MSPersonStage_Walking*>(*myStep); assert(walkingStage != 0); return walkingStage->getPedestrianState()->getNextEdge(*walkingStage); } return 0; }
SUMOReal GUIPerson::getColorValue(int activeScheme) const { switch (activeScheme) { case 4: return getSpeed(); case 5: if (isWaiting4Vehicle()) { return 3; } else { return (SUMOReal)getCurrentStageType(); } case 6: return getWaitingSeconds(); case 7: return gSelected.isSelected(GLO_PERSON, getGlID()); } return 0; }