Eclipse SUMO - Simulation of Urban MObility
GUISUMOAbstractView Class Reference

#include <GUISUMOAbstractView.h>

Inheritance diagram for GUISUMOAbstractView:
Collaboration diagram for GUISUMOAbstractView:

Data Structures

struct  Decal
 A decal (an image) that can be shown. More...
 

Public Member Functions

void addDecals (const std::vector< Decal > &decals)
 add decals More...
 
virtual void buildColorRainbow (const GUIVisualizationSettings &, GUIColorScheme &, int, GUIGlObjectType, bool hide=false, double hideThreshold=0)
 recalibrate color scheme according to the current value range More...
 
virtual void buildViewToolBars (GUIGlChildWindow &)
 builds the view toolbars More...
 
void centerTo (const Boundary &bound)
 centers to the chosen artifact More...
 
virtual void centerTo (const Position &pos, bool applyZoom, double zoomDist=20)
 centers to the chosen position More...
 
virtual void centerTo (GUIGlID id, bool applyZoom, double zoomDist=20)
 centers to the chosen artifact More...
 
virtual void copyViewportTo (GUISUMOAbstractView *view)
 copy the viewport to the given view More...
 
void destroyPopup ()
 destoys the popup More...
 
GUIPerspectiveChangergetChanger () const
 get changer More...
 
FXComboBox * getColoringSchemesCombo ()
 get coloring schemes combo More...
 
double getDelay () const
 Returns the delay of the parent application. More...
 
virtual std::vector< std::string > getEdgeDataAttrs () const
 return list of loaded edgeData attributes More...
 
virtual std::vector< std::string > getEdgeLaneParamKeys (bool) const
 return list of available edge parameters More...
 
double getFPS () const
 retrieve FPS More...
 
double getGridHeight () const
 get grid height More...
 
double getGridWidth () const
 get grid width More...
 
const PositiongetPopupPosition () const
 get position of current popup More...
 
Position getPositionInformation () const
 Returns the cursor's x/y position within the network. More...
 
virtual GUIGlID getTrackedID () const
 get tracked id More...
 
virtual std::vector< std::string > getVehicleParamKeys (bool) const
 return list of available vehicle parameters More...
 
GUIDialog_EditViewportgetViewportEditor ()
 get the viewport and create it on first access More...
 
Boundary getVisibleBoundary () const
 get visible boundary More...
 
GUIVisualizationSettingsgetVisualisationSettings ()
 get visualisation settings More...
 
GUIVisualizationSettingsgetVisualisationSettings () const
 get visualitation settings More...
 
Position getWindowCursorPosition () const
 Returns the information whether rotation is allowd. More...
 
 GUISUMOAbstractView (FXComposite *p, GUIMainWindow &app, GUIGlChildWindow *parent, const SUMORTree &grid, FXGLVisual *glVis, FXGLCanvas *share)
 constructor More...
 
bool isInEditMode ()
 returns true, if the edit button was pressed More...
 
double m2p (double meter) const
 meter-to-pixels conversion method More...
 
FXbool makeCurrent ()
 A reimplementation due to some internal reasons. More...
 
virtual long onConfigure (FXObject *, FXSelector, void *)
 mouse functions More...
 
virtual long onDoubleClicked (FXObject *, FXSelector, void *)
 
virtual void onGamingClick (Position)
 on gaming click More...
 
virtual void onGamingRightClick (Position)
 
virtual long onKeyPress (FXObject *o, FXSelector sel, void *data)
 keyboard functions More...
 
virtual long onKeyRelease (FXObject *o, FXSelector sel, void *data)
 
virtual long onLeftBtnPress (FXObject *, FXSelector, void *)
 
virtual long onLeftBtnRelease (FXObject *, FXSelector, void *)
 
virtual long onMiddleBtnPress (FXObject *, FXSelector, void *)
 
virtual long onMiddleBtnRelease (FXObject *, FXSelector, void *)
 
virtual long onMouseLeft (FXObject *, FXSelector, void *)
 
virtual long onMouseMove (FXObject *, FXSelector, void *)
 
virtual long onMouseWheel (FXObject *, FXSelector, void *)
 
virtual long onPaint (FXObject *, FXSelector, void *)
 
virtual long onRightBtnPress (FXObject *, FXSelector, void *)
 
virtual long onRightBtnRelease (FXObject *, FXSelector, void *)
 
virtual void openObjectDialog ()
 
double p2m (double pixel) const
 pixels-to-meters conversion method More...
 
virtual void recenterView ()
 recenters the view More...
 
void remove (GUIDialog_EditViewport *)
 remove viewport More...
 
void remove (GUIDialog_ViewSettings *)
 remove view settings More...
 
virtual const std::vector< SUMOTimeretrieveBreakpoints () const
 retrieve breakpoints if provided by the application More...
 
Position screenPos2NetPos (int x, int y) const
 Translate screen position to network position. More...
 
void setBreakpoints (const std::vector< SUMOTime > &breakpoints)
 Sets the breakpoints of the parent application. More...
 
virtual bool setColorScheme (const std::string &)
 set color scheme More...
 
void setDelay (double delay)
 Sets the delay of the parent application. More...
 
virtual void setViewportFromToRot (const Position &lookFrom, const Position &lookAt, double rotation)
 applies the given viewport settings More...
 
void setWindowCursorPosition (FXint x, FXint y)
 Returns the gl-id of the object under the given coordinates. More...
 
void showToolTips (bool val)
 show tool tips More...
 
virtual void showViewportEditor ()
 show viewport editor More...
 
void showViewschemeEditor ()
 show viewsscheme editor More...
 
Position snapToActiveGrid (const Position &pos, bool snapXY=true) const
 Returns a position that is mapped to the closest grid point if the grid is active. More...
 
virtual void startTrack (int)
 star track More...
 
virtual void stopTrack ()
 stop track More...
 
void updateToolTip ()
 A method that updates the tooltip. More...
 
virtual ~GUISUMOAbstractView ()
 destructor More...
 

Protected Member Functions

Boundary applyGLTransform (bool fixRatio=true)
 applies gl-transformations to fit the Boundary given by myChanger onto the canvas. If fixRatio is true, this boundary will be enlarged to prevent anisotropic stretching. (this should be set to false when doing selections) More...
 
FXImage * checkGDALImage (Decal &d)
 check whether we can read image data or position with gdal More...
 
void displayColorLegend ()
 Draws a legend for the current edge coloring scheme. More...
 
void displayLegend ()
 Draws a line with ticks, and the length information. More...
 
virtual void doInit ()
 doInit More...
 
virtual int doPaintGL (int, const Boundary &)
 paint GL More...
 
void drawDecals ()
 Draws the stored decals. More...
 
void drawFPS ()
 Draws frames-per-second indicator. More...
 
std::vector< GUIGlObject * > getGUIGlObjectsAtPosition (Position pos, double radius)
 returns the GUIGlObjects at position within the given (rectangular) radius using GL_SELECT More...
 
std::vector< GUIGlObject * > getGUIGlObjectsUnderCursor ()
 returns the GUIGlObject under the cursor using GL_SELECT (including overlapped objects) More...
 
std::vector< GUIGlObject * > getGUIGlObjectsUnderGrippedCursor ()
 returns the GUIGlObject under the gripped cursor using GL_SELECT (including overlapped objects) More...
 
GUIGlID getObjectAtPosition (Position pos)
 returns the id of the object at position using GL_SELECT More...
 
std::vector< GUIGlIDgetObjectsAtPosition (Position pos, double radius)
 returns the ids of the object at position within the given (rectangular) radius using GL_SELECT More...
 
std::vector< GUIGlIDgetObjectsInBoundary (Boundary bound, bool singlePosition)
 returns the ids of all objects in the given boundary More...
 
std::vector< GUIGlIDgetObjectsUnderCursor ()
 returns the id of the objects under the cursor using GL_SELECT (including overlapped objects) More...
 
GUIGlID getObjectUnderCursor ()
 returns the id of the front object under the cursor using GL_SELECT More...
 
void paintGL ()
 performs the painting of the simulation More...
 
void paintGLGrid ()
 paints a grid More...
 
void showToolTipFor (const GUIGlID id)
 invokes the tooltip for the given object More...
 
void updatePositionInformation () const
 update position information More...
 

Protected Attributes

std::map< GUIGlObject *, int > myAdditionallyDrawn
 List of objects for which GUIGlObject::drawGLAdditional is called. More...
 
bool myAmInitialised
 Internal information whether doInit() was called. More...
 
GUIMainWindowmyApp
 The application. More...
 
GUIPerspectiveChangermyChanger
 The perspective changer. More...
 
long myFrameDrawTime
 counter for measuring rendering time More...
 
SUMORTreemyGrid
 The visualization speed-up. More...
 
bool myInEditMode
 Information whether too-tip informations shall be generated. More...
 
int myMouseHotspotX
 Offset to the mouse-hotspot from the mouse position. More...
 
int myMouseHotspotY
 
GUIGlChildWindowmyParent
 The parent window. More...
 
FXMutex myPolyDrawLock
 poly draw lock More...
 
GUIGLObjectPopupMenumyPopup
 The current popup-menu. More...
 
Position myPopupPosition
 The current popup-menu position. More...
 
FXCondition mySnapshotCondition
 the semaphore when waiting for snapshots to finish More...
 
std::map< SUMOTime, std::vector< std::tuple< std::string, int, int > > > mySnapshots
 Snapshots. More...
 
FXMutex mySnapshotsMutex
 The mutex to use before accessing the decals list in order to avoid thread conflicts. More...
 
bool myUseToolTips
 use tool tips More...
 
GUIDialog_EditViewportmyViewportChooser
 viewport chooser More...
 
GUIDialog_ViewSettingsmyVisualizationChanger
 Visualization changer. More...
 
GUIVisualizationSettingsmyVisualizationSettings
 visualization settings More...
 
FXint myWindowCursorPositionX
 Position of the cursor relative to the window. More...
 
FXint myWindowCursorPositionY
 

Static Private Attributes

static const double SENSITIVITY = 0.1
 

Dealing with snapshots

void addSnapshot (SUMOTime time, const std::string &file, const int w=-1, const int h=-1)
 Sets the snapshot time to file map. More...
 
std::string makeSnapshot (const std::string &destFile, const int w=-1, const int h=-1)
 Takes a snapshots and writes it into the given file. More...
 
virtual void saveFrame (const std::string &destFile, FXColor *buf)
 Adds a frame to a video snapshot which will be initialized if neccessary. More...
 
virtual void endSnapshot ()
 Ends a video snapshot. More...
 
virtual void checkSnapshots ()
 Checks whether it is time for a snapshot. More...
 
void waitForSnapshots (const SUMOTime snapshotTime)
 
virtual SUMOTime getCurrentTimeStep () const
 get the current simulation time More...
 

Detailed Description

This class is meant to be pure virtual later; It shall be the main class to inherit views of the simulation (micro- or macroscopic ones) from it.

Definition at line 72 of file GUISUMOAbstractView.h.

Constructor & Destructor Documentation

◆ GUISUMOAbstractView()

GUISUMOAbstractView::GUISUMOAbstractView ( FXComposite *  p,
GUIMainWindow app,
GUIGlChildWindow parent,
const SUMORTree grid,
FXGLVisual *  glVis,
FXGLCanvas *  share 
)

◆ ~GUISUMOAbstractView()

Member Function Documentation

◆ addAdditionalGLVisualisation()

bool GUISUMOAbstractView::addAdditionalGLVisualisation ( GUIGlObject *const  which)

Adds an object to call its additional visualisation method.

Parameters
[in]whichThe object to add
Returns
Always true
See also
GUIGlObject::drawGLAdditional

Definition at line 1583 of file GUISUMOAbstractView.cpp.

References myAdditionallyDrawn.

Referenced by GUIBaseVehicle::addActiveAddVisualisation(), GUIPerson::addActiveAddVisualisation(), and GUIVehicle::drawOutsideNetwork().

◆ addDecals()

void GUISUMOAbstractView::addDecals ( const std::vector< Decal > &  decals)

◆ addSnapshot()

void GUISUMOAbstractView::addSnapshot ( SUMOTime  time,
const std::string &  file,
const int  w = -1,
const int  h = -1 
)

Sets the snapshot time to file map.

Parameters
[in]snapsThe snapshots to take at certain times
[in]wThe snapshot image width
[in]wThe snapshot image height

Definition at line 1097 of file GUISUMOAbstractView.cpp.

References mySnapshots, and mySnapshotsMutex.

Referenced by GUIViewTraffic::checkSnapshots(), TraCIServerAPI_GUI::processSet(), and GUISettingsHandler::setSnapshots().

◆ applyGLTransform()

Boundary GUISUMOAbstractView::applyGLTransform ( bool  fixRatio = true)
protected

applies gl-transformations to fit the Boundary given by myChanger onto the canvas. If fixRatio is true, this boundary will be enlarged to prevent anisotropic stretching. (this should be set to false when doing selections)

Definition at line 1621 of file GUISUMOAbstractView.cpp.

References Boundary::add(), GUIVisualizationSettings::angle, DEG2RAD, Boundary::getCenter(), Boundary::getHeight(), GUIPerspectiveChanger::getRotation(), GUIPerspectiveChanger::getViewport(), Boundary::getWidth(), GLO_MAX, myChanger, myVisualizationSettings, Position::rotateAround2D(), Position::x(), Boundary::xmax(), Boundary::xmin(), Position::y(), Boundary::ymax(), and Boundary::ymin().

Referenced by getObjectsInBoundary(), makeSnapshot(), and paintGL().

◆ buildColorRainbow()

virtual void GUISUMOAbstractView::buildColorRainbow ( const GUIVisualizationSettings ,
GUIColorScheme ,
int  ,
GUIGlObjectType  ,
bool  hide = false,
double  hideThreshold = 0 
)
inlinevirtual

recalibrate color scheme according to the current value range

Reimplemented in GNEViewNet, and GUIViewTraffic.

Definition at line 223 of file GUISUMOAbstractView.h.

References UNUSED_PARAMETER.

Referenced by GUIDialog_ViewSettings::onCmdColorChange().

◆ buildViewToolBars()

virtual void GUISUMOAbstractView::buildViewToolBars ( GUIGlChildWindow )
inlinevirtual

builds the view toolbars

Reimplemented in GNEViewNet, and GUIViewTraffic.

Definition at line 83 of file GUISUMOAbstractView.h.

Referenced by GUISUMOViewParent::init().

◆ centerTo() [1/3]

void GUISUMOAbstractView::centerTo ( const Boundary bound)

centers to the chosen artifact

Definition at line 814 of file GUISUMOAbstractView.cpp.

References myChanger, and GUIPerspectiveChanger::setViewport().

◆ centerTo() [2/3]

void GUISUMOAbstractView::centerTo ( const Position pos,
bool  applyZoom,
double  zoomDist = 20 
)
virtual

centers to the chosen position

Parameters
[in]posPosition to center view
[in]applyZoomWhether to zoom in
[in]zoomDistThe distance in m to use for the zoom, values < 0 means: use the centeringBoundary
Note
caller is responsible for calling update

Definition at line 806 of file GUISUMOAbstractView.cpp.

References GUIPerspectiveChanger::centerTo(), myChanger, and updatePositionInformation().

◆ centerTo() [3/3]

void GUISUMOAbstractView::centerTo ( GUIGlID  id,
bool  applyZoom,
double  zoomDist = 20 
)
virtual

centers to the chosen artifact

Parameters
[in]idThe id of the artifact to center to
[in]applyZoomWhether to zoom in
[in]zoomDistThe distance in m to use for the zoom, values < 0 means: use the centeringBoundary
Note
caller is responsible for calling update

Definition at line 789 of file GUISUMOAbstractView.cpp.

References GUIPerspectiveChanger::centerTo(), Boundary::getCenter(), GUIGlObject::getCenteringBoundary(), GUIGlObjectStorage::getObjectBlocking(), GUIGlObjectStorage::gIDStorage, myChanger, GUIPerspectiveChanger::setViewport(), GUIGlObjectStorage::unblockObject(), and updatePositionInformation().

Referenced by GNEAdditionalHandler::buildCalibrator(), GNEAdditionalHandler::buildRouteProbe(), GNEAdditionalHandler::buildVaporizer(), GUIGLObjectPopupMenu::onCmdCenter(), paintGL(), TraCIServerAPI_GUI::processSet(), and GUIGlChildWindow::setView().

◆ checkGDALImage()

◆ checkSnapshots()

void GUISUMOAbstractView::checkSnapshots ( )
virtual

◆ copyViewportTo()

void GUISUMOAbstractView::copyViewportTo ( GUISUMOAbstractView view)
virtual

◆ destroyPopup()

◆ displayColorLegend()

◆ displayLegend()

void GUISUMOAbstractView::displayLegend ( )
protected

Draws a line with ticks, and the length information.

Definition at line 582 of file GUISUMOAbstractView.cpp.

References RGBColor::BLACK, GLHelper::drawText(), FONS_ALIGN_LEFT, and m2p().

Referenced by makeSnapshot(), and paintGL().

◆ doInit()

void GUISUMOAbstractView::doInit ( )
protectedvirtual

doInit

Reimplemented in GNEViewNet.

Definition at line 263 of file GUISUMOAbstractView.cpp.

Referenced by onConfigure().

◆ doPaintGL()

int GUISUMOAbstractView::doPaintGL ( int  ,
const Boundary  
)
protectedvirtual

paint GL

Reimplemented in GNEViewNet, and GUIViewTraffic.

Definition at line 257 of file GUISUMOAbstractView.cpp.

Referenced by getObjectsInBoundary(), makeSnapshot(), and paintGL().

◆ drawDecals()

◆ drawFPS()

void GUISUMOAbstractView::drawFPS ( )
protected

Draws frames-per-second indicator.

Definition at line 751 of file GUISUMOAbstractView.cpp.

References GLHelper::drawText(), FONS_ALIGN_LEFT, getFPS(), RGBColor::RED, and toString().

Referenced by paintGL().

◆ endSnapshot()

virtual void GUISUMOAbstractView::endSnapshot ( )
inlinevirtual

Ends a video snapshot.

Reimplemented in GUIViewTraffic.

Definition at line 193 of file GUISUMOAbstractView.h.

Referenced by GUISUMOViewParent::onCmdMakeSnapshot().

◆ getChanger()

◆ getColoringSchemesCombo()

FXComboBox * GUISUMOAbstractView::getColoringSchemesCombo ( )

◆ getCurrentTimeStep()

SUMOTime GUISUMOAbstractView::getCurrentTimeStep ( ) const
virtual

get the current simulation time

Reimplemented in GUIViewTraffic.

Definition at line 1315 of file GUISUMOAbstractView.cpp.

Referenced by checkSnapshots().

◆ getDelay()

double GUISUMOAbstractView::getDelay ( ) const

Returns the delay of the parent application.

Definition at line 1655 of file GUISUMOAbstractView.cpp.

References GUIMainWindow::getDelay(), and myApp.

Referenced by GUIDialog_ViewSettings::onCmdExportSetting().

◆ getEdgeDataAttrs()

virtual std::vector<std::string> GUISUMOAbstractView::getEdgeDataAttrs ( ) const
inlinevirtual

return list of loaded edgeData attributes

Reimplemented in GUIViewTraffic.

Definition at line 230 of file GUISUMOAbstractView.h.

Referenced by GUIDialog_ViewSettings::rebuildColorMatrices().

◆ getEdgeLaneParamKeys()

virtual std::vector<std::string> GUISUMOAbstractView::getEdgeLaneParamKeys ( bool  ) const
inlinevirtual

return list of available edge parameters

Reimplemented in GUIViewTraffic, and GNEViewNet.

Definition at line 235 of file GUISUMOAbstractView.h.

Referenced by GUIDialog_ViewSettings::rebuildColorMatrices().

◆ getFPS()

double GUISUMOAbstractView::getFPS ( ) const

retrieve FPS

Definition at line 746 of file GUISUMOAbstractView.cpp.

References MAX2(), and myFrameDrawTime.

Referenced by drawFPS(), and GUINet::getParameterWindow().

◆ getGridHeight()

double GUISUMOAbstractView::getGridHeight ( ) const

get grid height

Definition at line 1419 of file GUISUMOAbstractView.cpp.

References Boundary::getHeight(), and myGrid.

Referenced by checkGDALImage(), and GUIDialog_ViewSettings::onCmdEditTable().

◆ getGridWidth()

double GUISUMOAbstractView::getGridWidth ( ) const

get grid width

Definition at line 1413 of file GUISUMOAbstractView.cpp.

References Boundary::getWidth(), and myGrid.

Referenced by checkGDALImage(), and GUIDialog_ViewSettings::onCmdEditTable().

◆ getGUIGlObjectsAtPosition()

std::vector< GUIGlObject * > GUISUMOAbstractView::getGUIGlObjectsAtPosition ( Position  pos,
double  radius 
)
protected

◆ getGUIGlObjectsUnderCursor()

std::vector< GUIGlObject * > GUISUMOAbstractView::getGUIGlObjectsUnderCursor ( )
protected

returns the GUIGlObject under the cursor using GL_SELECT (including overlapped objects)

Definition at line 351 of file GUISUMOAbstractView.cpp.

References getGUIGlObjectsAtPosition(), getPositionInformation(), and SENSITIVITY.

Referenced by GNEViewNet::onLeftBtnPress(), and GNEViewNet::processLeftButtonReleaseNetwork().

◆ getGUIGlObjectsUnderGrippedCursor()

std::vector< GUIGlObject * > GUISUMOAbstractView::getGUIGlObjectsUnderGrippedCursor ( )
protected

returns the GUIGlObject under the gripped cursor using GL_SELECT (including overlapped objects)

Definition at line 341 of file GUISUMOAbstractView.cpp.

References getGUIGlObjectsAtPosition(), getPositionInformation(), myVisualizationSettings, SENSITIVITY, GUIVisualizationSettings::showGrid, and snapToActiveGrid().

Referenced by GNEViewNet::onLeftBtnPress().

◆ getObjectAtPosition()

◆ getObjectsAtPosition()

std::vector< GUIGlID > GUISUMOAbstractView::getObjectsAtPosition ( Position  pos,
double  radius 
)
protected

returns the ids of the object at position within the given (rectangular) radius using GL_SELECT

Definition at line 407 of file GUISUMOAbstractView.cpp.

References Boundary::add(), GUIGlObject::getGlID(), GUIGlObjectStorage::getObjectBlocking(), getObjectsInBoundary(), GUIGlObject::getType(), GUIGlObjectStorage::gIDStorage, GLO_NETWORK, Boundary::grow(), and GUIGlObjectStorage::unblockObject().

Referenced by getObjectsUnderCursor().

◆ getObjectsInBoundary()

◆ getObjectsUnderCursor()

std::vector< GUIGlID > GUISUMOAbstractView::getObjectsUnderCursor ( )
protected

returns the id of the objects under the cursor using GL_SELECT (including overlapped objects)

Definition at line 335 of file GUISUMOAbstractView.cpp.

References getObjectsAtPosition(), getPositionInformation(), and SENSITIVITY.

◆ getObjectUnderCursor()

GUIGlID GUISUMOAbstractView::getObjectUnderCursor ( )
protected

returns the id of the front object under the cursor using GL_SELECT

Definition at line 329 of file GUISUMOAbstractView.cpp.

References getObjectAtPosition(), and getPositionInformation().

Referenced by GUIViewTraffic::getLaneUnderCursor(), onLeftBtnPress(), GNEViewNet::openObjectDialog(), openObjectDialog(), and paintGL().

◆ getPopupPosition()

◆ getPositionInformation()

Position GUISUMOAbstractView::getPositionInformation ( ) const

◆ getTrackedID()

◆ getVehicleParamKeys()

virtual std::vector<std::string> GUISUMOAbstractView::getVehicleParamKeys ( bool  ) const
inlinevirtual

return list of available vehicle parameters

Reimplemented in GUIViewTraffic.

Definition at line 240 of file GUISUMOAbstractView.h.

Referenced by GUIDialog_ViewSettings::updateVehicleParams().

◆ getViewportEditor()

◆ getVisibleBoundary()

Boundary GUISUMOAbstractView::getVisibleBoundary ( ) const

get visible boundary

Definition at line 268 of file GUISUMOAbstractView.cpp.

References GUIPerspectiveChanger::getViewport(), and myChanger.

Referenced by TraCIServerAPI_GUI::processGet().

◆ getVisualisationSettings() [1/2]

GUIVisualizationSettings* GUISUMOAbstractView::getVisualisationSettings ( )

get visualisation settings

◆ getVisualisationSettings() [2/2]

◆ getWindowCursorPosition()

Position GUISUMOAbstractView::getWindowCursorPosition ( ) const

Returns the information whether rotation is allowd.

Note
disabled

return windows cursor position

Definition at line 828 of file GUISUMOAbstractView.cpp.

References myWindowCursorPositionX, and myWindowCursorPositionY.

◆ isAdditionalGLVisualisationEnabled()

bool GUISUMOAbstractView::isAdditionalGLVisualisationEnabled ( GUIGlObject *const  which) const

Check if an object is added in the additional GL visualitation.

Parameters
[in]whichThe object to check
See also
GUIGlObject::drawGLAdditional

Definition at line 1611 of file GUISUMOAbstractView.cpp.

References myAdditionallyDrawn.

◆ isInEditMode()

bool GUISUMOAbstractView::isInEditMode ( )

returns true, if the edit button was pressed

Definition at line 169 of file GUISUMOAbstractView.cpp.

References myInEditMode.

◆ m2p()

double GUISUMOAbstractView::m2p ( double  meter) const

◆ makeCurrent()

◆ makeSnapshot()

std::string GUISUMOAbstractView::makeSnapshot ( const std::string &  destFile,
const int  w = -1,
const int  h = -1 
)

Takes a snapshots and writes it into the given file.

The format to use is determined from the extension. If compiled with ffmpeg and a video format is requested it will instantiate a video encoder.

Parameters
[in]destFileThe name of the file to write the snapshot into
[in]wThe snapshot image width
[in]wThe snapshot image height
Returns
The error message, if an error occcured; "" otherwise

Definition at line 1107 of file GUISUMOAbstractView.cpp.

References RGBColor::alpha(), applyGLTransform(), GUIVisualizationSettings::backgroundColor, RGBColor::blue(), displayColorLegend(), displayLegend(), GUIVisualizationSettings::dither, doPaintGL(), drawDecals(), GUIPerspectiveChanger::getViewport(), RGBColor::green(), m2p(), makeCurrent(), myChanger, myGrid, myUseToolTips, myVisualizationSettings, paintGLGrid(), RGBColor::red(), saveFrame(), MFXImageHelper::saveImage(), GUIVisualizationSettings::scale, SUMORTree::Search(), GLHelper::setGL2PS(), GUIVisualizationSettings::showColorLegend, GUIVisualizationSettings::showGrid, GUIVisualizationSettings::showSizeLegend, FXSingleEventThread::sleep(), SUMO_const_laneWidth, Boundary::xmax(), Boundary::xmin(), Boundary::ymax(), and Boundary::ymin().

Referenced by checkSnapshots(), GUISUMOViewParent::onCmdMakeSnapshot(), and GNEViewParent::onCmdMakeSnapshot().

◆ onConfigure()

long GUISUMOAbstractView::onConfigure ( FXObject *  ,
FXSelector  ,
void *   
)
virtual

◆ onDoubleClicked()

long GUISUMOAbstractView::onDoubleClicked ( FXObject *  ,
FXSelector  ,
void *   
)
virtual

Reimplemented in GUIViewTraffic.

Definition at line 991 of file GUISUMOAbstractView.cpp.

◆ onGamingClick()

void GUISUMOAbstractView::onGamingClick ( Position  )
virtual

on gaming click

Reimplemented in GUIViewTraffic.

Definition at line 1441 of file GUISUMOAbstractView.cpp.

Referenced by onLeftBtnRelease().

◆ onGamingRightClick()

void GUISUMOAbstractView::onGamingRightClick ( Position  )
virtual

Reimplemented in GUIViewTraffic.

Definition at line 1445 of file GUISUMOAbstractView.cpp.

Referenced by onRightBtnRelease().

◆ onKeyPress()

long GUISUMOAbstractView::onKeyPress ( FXObject *  o,
FXSelector  sel,
void *  data 
)
virtual

keyboard functions

Reimplemented in GNEViewNet.

Definition at line 1074 of file GUISUMOAbstractView.cpp.

References myChanger, myPopup, and GUIPerspectiveChanger::onKeyPress().

Referenced by GUISUMOViewParent::onKeyPress(), GNEViewNet::onKeyPress(), and GNEViewParent::onKeyPress().

◆ onKeyRelease()

long GUISUMOAbstractView::onKeyRelease ( FXObject *  o,
FXSelector  sel,
void *  data 
)
virtual

◆ onLeftBtnPress()

◆ onLeftBtnRelease()

long GUISUMOAbstractView::onLeftBtnRelease ( FXObject *  ,
FXSelector  ,
void *  data 
)
virtual

◆ onMiddleBtnPress()

long GUISUMOAbstractView::onMiddleBtnPress ( FXObject *  ,
FXSelector  ,
void *   
)
virtual

Definition at line 955 of file GUISUMOAbstractView.cpp.

◆ onMiddleBtnRelease()

long GUISUMOAbstractView::onMiddleBtnRelease ( FXObject *  ,
FXSelector  ,
void *   
)
virtual

Definition at line 961 of file GUISUMOAbstractView.cpp.

◆ onMouseLeft()

long GUISUMOAbstractView::onMouseLeft ( FXObject *  ,
FXSelector  ,
void *   
)
virtual

Definition at line 1034 of file GUISUMOAbstractView.cpp.

◆ onMouseMove()

◆ onMouseWheel()

◆ onPaint()

long GUISUMOAbstractView::onPaint ( FXObject *  ,
FXSelector  ,
void *   
)
virtual

◆ onRightBtnPress()

long GUISUMOAbstractView::onRightBtnPress ( FXObject *  ,
FXSelector  ,
void *  data 
)
virtual

Reimplemented in GNEViewNet.

Definition at line 967 of file GUISUMOAbstractView.cpp.

References destroyPopup(), myChanger, and GUIPerspectiveChanger::onRightBtnPress().

Referenced by GNEViewNet::onRightBtnPress().

◆ onRightBtnRelease()

long GUISUMOAbstractView::onRightBtnRelease ( FXObject *  o,
FXSelector  sel,
void *  data 
)
virtual

◆ openObjectDialog()

◆ p2m()

double GUISUMOAbstractView::p2m ( double  pixel) const

◆ paintGL()

◆ paintGLGrid()

◆ recenterView()

void GUISUMOAbstractView::recenterView ( )
virtual

◆ remove() [1/2]

void GUISUMOAbstractView::remove ( GUIDialog_EditViewport )

remove viewport

Definition at line 1401 of file GUISUMOAbstractView.cpp.

References myViewportChooser.

Referenced by GUIDialog_ViewSettings::~GUIDialog_ViewSettings().

◆ remove() [2/2]

void GUISUMOAbstractView::remove ( GUIDialog_ViewSettings )

remove view settings

Definition at line 1407 of file GUISUMOAbstractView.cpp.

References myVisualizationChanger.

◆ removeAdditionalGLVisualisation()

bool GUISUMOAbstractView::removeAdditionalGLVisualisation ( GUIGlObject *const  which)

Removes an object from the list of objects that show additional things.

Parameters
[in]whichThe object to remoe
Returns
True if the object was known, false otherwise
See also
GUIGlObject::drawGLAdditional

Definition at line 1595 of file GUISUMOAbstractView.cpp.

References myAdditionallyDrawn.

Referenced by GUIVehicle::drawOutsideNetwork(), GUIBaseVehicle::removeActiveAddVisualisation(), and GUIPerson::removeActiveAddVisualisation().

◆ retrieveBreakpoints()

virtual const std::vector<SUMOTime> GUISUMOAbstractView::retrieveBreakpoints ( ) const
inlinevirtual

retrieve breakpoints if provided by the application

Reimplemented in GUIViewTraffic.

Definition at line 372 of file GUISUMOAbstractView.h.

Referenced by GUIDialog_ViewSettings::onCmdExportSetting().

◆ saveFrame()

void GUISUMOAbstractView::saveFrame ( const std::string &  destFile,
FXColor *  buf 
)
virtual

Adds a frame to a video snapshot which will be initialized if neccessary.

Reimplemented in GUIViewTraffic.

Definition at line 1266 of file GUISUMOAbstractView.cpp.

References UNUSED_PARAMETER.

Referenced by makeSnapshot().

◆ screenPos2NetPos()

Position GUISUMOAbstractView::screenPos2NetPos ( int  x,
int  y 
) const

◆ setBreakpoints()

void GUISUMOAbstractView::setBreakpoints ( const std::vector< SUMOTime > &  breakpoints)

Sets the breakpoints of the parent application.

Definition at line 1667 of file GUISUMOAbstractView.cpp.

References myApp, and GUIMainWindow::setBreakpoints().

Referenced by GUIDialog_ViewSettings::loadSettings().

◆ setColorScheme()

◆ setDelay()

void GUISUMOAbstractView::setDelay ( double  delay)

Sets the delay of the parent application.

Definition at line 1661 of file GUISUMOAbstractView.cpp.

References myApp, and GUIMainWindow::setDelay().

Referenced by GUIDialog_ViewSettings::loadSettings().

◆ setViewportFromToRot()

◆ setWindowCursorPosition()

void GUISUMOAbstractView::setWindowCursorPosition ( FXint  x,
FXint  y 
)

Returns the gl-id of the object under the given coordinates.

Definition at line 834 of file GUISUMOAbstractView.cpp.

References myMouseHotspotX, myMouseHotspotY, myWindowCursorPositionX, and myWindowCursorPositionY.

Referenced by GUIDanielPerspectiveChanger::onMouseMove().

◆ showToolTipFor()

◆ showToolTips()

void GUISUMOAbstractView::showToolTips ( bool  val)

show tool tips

Definition at line 1383 of file GUISUMOAbstractView.cpp.

References myUseToolTips.

Referenced by GUIGlChildWindow::onCmdShowToolTips().

◆ showViewportEditor()

◆ showViewschemeEditor()

◆ snapToActiveGrid()

Position GUISUMOAbstractView::snapToActiveGrid ( const Position pos,
bool  snapXY = true 
) const

◆ startTrack()

void GUISUMOAbstractView::startTrack ( int  )
virtual

star track

Reimplemented in GUIViewTraffic.

Definition at line 1425 of file GUISUMOAbstractView.cpp.

Referenced by GUIDialog_GLObjChooser::onCmdTrack(), onLeftBtnPress(), and TraCIServerAPI_GUI::processSet().

◆ stopTrack()

void GUISUMOAbstractView::stopTrack ( )
virtual

stop track

Reimplemented in GUIViewTraffic.

Definition at line 1430 of file GUISUMOAbstractView.cpp.

Referenced by GUIDialog_GLObjChooser::onCmdCenter(), and TraCIServerAPI_GUI::processSet().

◆ updatePositionInformation()

void GUISUMOAbstractView::updatePositionInformation ( ) const
protected

◆ updateToolTip()

void GUISUMOAbstractView::updateToolTip ( )

◆ waitForSnapshots()

void GUISUMOAbstractView::waitForSnapshots ( const SUMOTime  snapshotTime)

Definition at line 1306 of file GUISUMOAbstractView.cpp.

References mySnapshotCondition, mySnapshots, and mySnapshotsMutex.

Field Documentation

◆ myAdditionallyDrawn

std::map<GUIGlObject*, int> GUISUMOAbstractView::myAdditionallyDrawn
protected

◆ myAmInitialised

bool GUISUMOAbstractView::myAmInitialised
protected

Internal information whether doInit() was called.

Definition at line 477 of file GUISUMOAbstractView.h.

Referenced by onConfigure(), onPaint(), GNEViewNet::openObjectDialog(), and openObjectDialog().

◆ myApp

◆ myChanger

◆ myDecals

std::vector<Decal> GUISUMOAbstractView::myDecals
protected

◆ myDecalsLock

FXMutex GUISUMOAbstractView::myDecalsLock
protected

The mutex to use before accessing the decals list in order to avoid thread conflicts.

Definition at line 494 of file GUISUMOAbstractView.h.

Referenced by drawDecals(), and showViewschemeEditor().

◆ myFrameDrawTime

long GUISUMOAbstractView::myFrameDrawTime
protected

counter for measuring rendering time

Definition at line 513 of file GUISUMOAbstractView.h.

Referenced by getFPS(), and paintGL().

◆ myGrid

SUMORTree* GUISUMOAbstractView::myGrid
protected

The visualization speed-up.

Definition at line 453 of file GUISUMOAbstractView.h.

Referenced by GUIViewTraffic::doPaintGL(), GNEViewNet::doPaintGL(), getGridHeight(), getGridWidth(), makeSnapshot(), and recenterView().

◆ myInEditMode

bool GUISUMOAbstractView::myInEditMode
protected

Information whether too-tip informations shall be generated.

Definition at line 459 of file GUISUMOAbstractView.h.

Referenced by isInEditMode().

◆ myMouseHotspotX

int GUISUMOAbstractView::myMouseHotspotX
protected

Offset to the mouse-hotspot from the mouse position.

Definition at line 462 of file GUISUMOAbstractView.h.

Referenced by setWindowCursorPosition().

◆ myMouseHotspotY

int GUISUMOAbstractView::myMouseHotspotY
protected

Definition at line 462 of file GUISUMOAbstractView.h.

Referenced by setWindowCursorPosition().

◆ myParent

GUIGlChildWindow* GUISUMOAbstractView::myParent
protected

The parent window.

Definition at line 450 of file GUISUMOAbstractView.h.

Referenced by getColoringSchemesCombo().

◆ myPolyDrawLock

FXMutex GUISUMOAbstractView::myPolyDrawLock
mutableprotected

poly draw lock

Definition at line 507 of file GUISUMOAbstractView.h.

◆ myPopup

GUIGLObjectPopupMenu* GUISUMOAbstractView::myPopup
protected

◆ myPopupPosition

Position GUISUMOAbstractView::myPopupPosition
protected

The current popup-menu position.

Definition at line 468 of file GUISUMOAbstractView.h.

Referenced by destroyPopup(), getPopupPosition(), GNEViewNet::openObjectDialog(), and openObjectDialog().

◆ mySnapshotCondition

FXCondition GUISUMOAbstractView::mySnapshotCondition
protected

the semaphore when waiting for snapshots to finish

Definition at line 504 of file GUISUMOAbstractView.h.

Referenced by checkSnapshots(), and waitForSnapshots().

◆ mySnapshots

std::map<SUMOTime, std::vector<std::tuple<std::string, int, int> > > GUISUMOAbstractView::mySnapshots
protected

Snapshots.

Definition at line 498 of file GUISUMOAbstractView.h.

Referenced by addSnapshot(), checkSnapshots(), and waitForSnapshots().

◆ mySnapshotsMutex

FXMutex GUISUMOAbstractView::mySnapshotsMutex
protected

The mutex to use before accessing the decals list in order to avoid thread conflicts.

Definition at line 501 of file GUISUMOAbstractView.h.

Referenced by addSnapshot(), checkSnapshots(), and waitForSnapshots().

◆ myUseToolTips

bool GUISUMOAbstractView::myUseToolTips
protected

◆ myViewportChooser

GUIDialog_EditViewport* GUISUMOAbstractView::myViewportChooser
protected

◆ myVisualizationChanger

GUIDialog_ViewSettings* GUISUMOAbstractView::myVisualizationChanger
protected

◆ myVisualizationSettings

◆ myWindowCursorPositionX

FXint GUISUMOAbstractView::myWindowCursorPositionX
protected

Position of the cursor relative to the window.

Definition at line 483 of file GUISUMOAbstractView.h.

Referenced by getPositionInformation(), getWindowCursorPosition(), and setWindowCursorPosition().

◆ myWindowCursorPositionY

FXint GUISUMOAbstractView::myWindowCursorPositionY
protected

◆ SENSITIVITY

const double GUISUMOAbstractView::SENSITIVITY = 0.1
staticprivate

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