 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
20 #ifndef GUISUMOAbstractView_h
21 #define GUISUMOAbstractView_h
95 virtual void centerTo(
GUIGlID id,
bool applyZoom,
double zoomDist = 20);
103 virtual void centerTo(
const Position& pos,
bool applyZoom,
double zoomDist = 20);
115 double m2p(
double meter)
const;
118 double p2m(
double pixel)
const;
144 virtual long onConfigure(FXObject*, FXSelector,
void*);
145 virtual long onPaint(FXObject*, FXSelector,
void*);
153 virtual long onMouseWheel(FXObject*, FXSelector,
void*);
154 virtual long onMouseMove(FXObject*, FXSelector,
void*);
155 virtual long onMouseLeft(FXObject*, FXSelector,
void*);
160 virtual long onKeyPress(FXObject* o, FXSelector sel,
void* data);
161 virtual long onKeyRelease(FXObject* o, FXSelector sel,
void* data);
175 void addSnapshot(
SUMOTime time,
const std::string& file,
const int width = -1,
const int height = -1);
184 std::string
makeSnapshot(
const std::string& destFile,
const int width = -1,
const int height = -1);
187 virtual void saveFrame(
const std::string& destFile, FXColor* buf);
221 bool hide =
false,
double hideThreshold = 0) {
228 return std::vector<std::string>();
233 return std::vector<std::string>();
349 void addDecals(
const std::vector<Decal>& decals);
365 return std::vector<SUMOTime>();
488 std::map<SUMOTime, std::vector<std::tuple<std::string, int, int> > >
mySnapshots;
Boundary getVisibleBoundary() const
get visible boundary
virtual void openObjectDialog()
double roll
The roll of the image to the ground plane (in degrees)
virtual void doInit()
doInit
bool addAdditionalGLVisualisation(const GUIGlObject *const which)
Adds an object to call its additional visualisation method.
#define UNUSED_PARAMETER(x)
FXbool makeCurrent()
A reimplementation due to some internal reasons.
virtual void setViewportFromToRot(const Position &lookFrom, const Position &lookAt, double rotation)
applies the given viewport settings
virtual void showViewportEditor()
show viewport editor
virtual void copyViewportTo(GUISUMOAbstractView *view)
copy the viewport to the given view
double getGridHeight() const
get grid Height
virtual void stopTrack()
stop track
int myMouseHotspotX
Offset to the mouse-hotspot from the mouse position.
virtual long onRightBtnPress(FXObject *, FXSelector, void *)
FXImage * image
The image pointer for later cleanup.
The dialog to change the view (gui) settings.
FXMutex myPolyDrawLock
poly draw lock
bool isInEditMode()
returns true, if the edit button was pressed
virtual bool setColorScheme(const std::string &)
set color scheme
FXComboBox * getColoringSchemesCombo()
get coloring schemes combo
void showViewschemeEditor()
show viewsscheme editor
std::vector< Decal > myDecals
virtual void buildViewToolBars(GUIGlChildWindow &)
builds the view toolbars
void waitForSnapshots(const SUMOTime snapshotTime)
GUIGlChildWindow * myParent
The parent window.
double m2p(double meter) const
meter-to-pixels conversion method
std::vector< GUIGlID > getObjectstUnderCursor()
returns the id of the objects under the cursor using GL_SELECT (including overlapped objects)
virtual void onGamingRightClick(Position)
std::vector< GUIGlObject * > getGUIGlObjectsUnderCursor()
returns the GUIGlObject under the cursor using GL_SELECT (including overlapped objects)
GUIGlID getObjectUnderCursor()
returns the id of the front object under the cursor using GL_SELECT
virtual void centerTo(GUIGlID id, bool applyZoom, double zoomDist=20)
centers to the chosen artifact
GUISUMOAbstractView()
FOX need this.
double centerY
The center of the image in y-direction (net coordinates, in m)
void showToolTips(bool val)
show tool tips
std::string filename
The path to the file the image is located at.
void drawFPS()
Draws frames-per-second indicator.
virtual std::vector< std::string > getEdgeLaneParamKeys(bool) const
return list of available edge parameters
Boundary applyGLTransform(bool fixRatio=true)
applies gl-transformations to fit the Boundary given by myChanger onto the canvas....
virtual void checkSnapshots()
Checks whether it is time for a snapshot.
double centerZ
The center of the image in z-direction (net coordinates, in m)
GUIGlID getObjectAtPosition(Position pos)
returns the id of the object at position using GL_SELECT
double height
The height of the image (net coordinates in y-direction, in m)
void setWindowCursorPosition(FXint x, FXint y)
Returns the gl-id of the object under the given coordinates.
void updateToolTip()
A method that updates the tooltip.
void paintGL()
performs the painting of the simulation
bool skip2D
Whether this image should be skipped in 2D-views.
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.
virtual long onMouseWheel(FXObject *, FXSelector, void *)
void updatePositionInformation() const
update position information
virtual long onRightBtnRelease(FXObject *, FXSelector, void *)
double layer
The layer of the image.
A RT-tree for efficient storing of SUMO's GL-objects.
bool myAmInitialised
Internal information whether doInit() was called.
A dialog to change the viewport.
std::vector< GUIGlID > getObjectsInBoundary(Boundary bound)
returns the ids of all objects in the given boundary
std::vector< GUIGlObject * > getGUIGlObjectsAtPosition(Position pos, double radius)
returns the GUIGlObjects at position within the given (rectangular) radius using GL_SELECT
long myFrameDrawTime
counter for measuring rendering time
std::vector< GUIGlID > getObjectsAtPosition(Position pos, double radius)
returns the ids of the object at position within the given (rectangular) radius using GL_SELECT
bool screenRelative
Whether this image should be skipped in 2D-views.
virtual long onLeftBtnRelease(FXObject *, FXSelector, void *)
virtual SUMOTime getCurrentTimeStep() const
get the current simulation time
bool myInEditMode
Information whether too-tip informations shall be generated.
void displayLegend()
Draws a line with ticks, and the length information.
double rot
The rotation of the image in the ground plane (in degrees)
double tilt
The tilt of the image to the ground plane (in degrees)
GUIVisualizationSettings * getVisualisationSettings() const
get visualitation settings
virtual long onDoubleClicked(FXObject *, FXSelector, void *)
A MSVehicle extended by some values for usage within the gui.
FXint myWindowCursorPositionY
virtual long onMiddleBtnRelease(FXObject *, FXSelector, void *)
void addSnapshot(SUMOTime time, const std::string &file, const int width=-1, const int height=-1)
Sets the snapshot time to file map.
virtual long onConfigure(FXObject *, FXSelector, void *)
mouse functions
A class that stores a 2D geometrical boundary.
FXint myWindowCursorPositionX
Position of the cursor relative to the window.
FXCondition mySnapshotCondition
the semaphore when waiting for snapshots to finish
std::map< const GUIGlObject *, int > myAdditionallyDrawn
List of objects for which GUIGlObject::drawGLAdditional is called.
A point in 2D or 3D with translation and scaling methods.
virtual long onMouseLeft(FXObject *, FXSelector, void *)
void remove(GUIDialog_EditViewport *)
remove viewport
static const double SENSITIVITY
GUIVisualizationSettings * myVisualizationSettings
visualization settings
double altitude
The altitude of the image (net coordinates in z-direction, in m)
void drawDecals()
Draws the stored decals.
virtual void endSnapshot()
Ends a video snapshot.
Position getPositionInformation() const
Returns the cursor's x/y position within the network.
virtual long onKeyRelease(FXObject *o, FXSelector sel, void *data)
virtual void startTrack(int)
star track
const Position & getPopupPosition() const
get position of current popup
GUIDialog_EditViewport * getViewportEditor()
get the viewport and create it on first access
virtual void onGamingClick(Position)
on gaming click
virtual void buildColorRainbow(const GUIVisualizationSettings &, GUIColorScheme &, int, GUIGlObjectType, bool hide=false, double hideThreshold=0)
recalibrate color scheme according to the current value range
GUIPerspectiveChanger & getChanger() const
get changer
double getFPS() const
retrieve FPS
void setDelay(double delay)
Sets the delay of the parent application.
double p2m(double pixel) const
pixels-to-meters conversion method
double getDelay() const
Returns the delay of the parent application.
bool removeAdditionalGLVisualisation(const GUIGlObject *const which)
Removes an object from the list of objects that show additional things.
FXImage * checkGDALImage(Decal &d)
check whether we can read image data or position with gdal
Position getWindowCursorPosition() const
Returns the information whether rotation is allowd.
void showToolTipFor(const GUIGlID id)
invokes the tooltip for the given object
GUIMainWindow * myApp
The application.
SUMORTree * myGrid
The visualization speed-up.
virtual ~GUISUMOAbstractView()
destructor
void paintGLGrid()
paints a grid
virtual long onMiddleBtnPress(FXObject *, FXSelector, void *)
void setBreakpoints(const std::vector< SUMOTime > &breakpoints)
Sets the breakpoints of the parent application.
bool myUseToolTips
use tool tips
virtual long onKeyPress(FXObject *o, FXSelector sel, void *data)
keyboard functions
bool initialised
Whether this image was initialised (inserted as a texture)
void addDecals(const std::vector< Decal > &decals)
add decals
GUIGLObjectPopupMenu * myPopup
The current popup-menu.
GUIDialog_ViewSettings * myVisualizationChanger
Visualization changer.
virtual std::vector< std::string > getEdgeDataAttrs() const
return list of loaded edgeData attributes
std::string makeSnapshot(const std::string &destFile, const int width=-1, const int height=-1)
Takes a snapshots and writes it into the given file.
virtual void recenterView()
recenters the view
FXMutex mySnapshotsMutex
The mutex to use before accessing the decals list in order to avoid thread conflicts.
virtual void saveFrame(const std::string &destFile, FXColor *buf)
Adds a frame to a video snapshot which will be initialized if neccessary.
virtual long onLeftBtnPress(FXObject *, FXSelector, void *)
GUIDialog_EditViewport * myViewportChooser
viewport chooser
Position screenPos2NetPos(int x, int y) const
Translate screen position to network position.
virtual const std::vector< SUMOTime > retrieveBreakpoints() const
retrieve breakpoints if provided by the application
Stores the information about how to visualize structures.
void destroyPopup()
destoys the popup
std::map< SUMOTime, std::vector< std::tuple< std::string, int, int > > > mySnapshots
Snapshots.
GUIPerspectiveChanger * myChanger
The perspective changer.
virtual long onMouseMove(FXObject *, FXSelector, void *)
void displayColorLegend()
Draws a legend for the current edge coloring scheme.
double width
The width of the image (net coordinates in x-direction, in m)
Position myPopupPosition
The current popup-menu position.
double centerX
The center of the image in x-direction (net coordinates, in m)
A decal (an image) that can be shown.
int glID
whether the decal shall be drawn in screen coordinates, rather than network coordinates
virtual int doPaintGL(int, const Boundary &)
paint GL
virtual GUIGlID getTrackedID() const
get tracked id
FXMutex myDecalsLock
The mutex to use before accessing the decals list in order to avoid thread conflicts.
virtual long onPaint(FXObject *, FXSelector, void *)
double getGridWidth() const
get grid width
bool isAdditionalGLVisualisationEnabled(GUIGlObject *const which) const
Check if an object is added in the additional GL visualitation.