23 #ifndef GUISUMOAbstractView_h 24 #define GUISUMOAbstractView_h 103 virtual void centerTo(
GUIGlID id,
bool applyZoom,
double zoomDist = 20);
115 double m2p(
double meter)
const;
118 double p2m(
double pixel)
const;
141 virtual long onConfigure(FXObject*, FXSelector,
void*);
142 virtual long onPaint(FXObject*, FXSelector,
void*);
150 virtual long onMouseWheel(FXObject*, FXSelector,
void*);
151 virtual long onMouseMove(FXObject*, FXSelector,
void*);
152 virtual long onMouseLeft(FXObject*, FXSelector,
void*);
157 virtual long onKeyPress(FXObject* o, FXSelector sel,
void* data);
158 virtual long onKeyRelease(FXObject* o, FXSelector sel,
void* data);
172 void setSnapshots(std::map<SUMOTime, std::string> snaps);
184 virtual void saveFrame(
const std::string& destFile, FXColor* buf);
321 void addDecals(
const std::vector<Decal>& decals);
GUIDialog_EditViewport * getViewportEditor()
get the viewport and create it on first access
void paintGLGrid()
paints a grid
A decal (an image) that can be shown.
virtual long onConfigure(FXObject *, FXSelector, void *)
mouse functions
void showToolTips(bool val)
show tool tips
double altitude
The altitude of the image (net coordinates in z-direction, in m)
std::vector< GUIGlID > getObjectsAtPosition(Position pos, double radius)
returns the ids of the object at position within the given (rectangular) radius using GL_SELECT ...
FXImage * checkGDALImage(Decal &d)
check whether we can read image data or position with gdal
FXImage * image
The image pointer for later cleanup.
virtual long onDoubleClicked(FXObject *, FXSelector, void *)
virtual void setViewportFromTo(const Position &lookFrom, const Position &lookAt)
applies the given viewport settings
bool myAmInitialised
Internal information whether doInit() was called.
virtual void recenterView()
recenters the view
FXint myWindowCursorPositionY
SUMORTree * myGrid
The visualization speed-up.
virtual long onMouseMove(FXObject *, FXSelector, void *)
virtual long onMiddleBtnPress(FXObject *, FXSelector, void *)
Stores the information about how to visualize structures.
The dialog to change the view (gui) settings.
void setDelay(double delay)
Sets the delay of the parent application.
void displayLegend()
a line with ticks, and the length information.
void updatePositionInformation() const
update position information
GUIVisualizationSettings * getVisualisationSettings() const
get visualitation settings
GUIMainWindow * myApp
The application.
Position snapToActiveGrid(const Position &pos) const
Returns a position that is mapped to the closest grid point if the grid is active.
virtual void saveFrame(const std::string &destFile, FXColor *buf)
Adds a frame to a video snapshot which will be initialized if neccessary.
MFXMutex myDecalsLock
The mutex to use before accessing the decals list in order to avoid thread conficts.
double centerX
The center of the image in x-direction (net coordinates, in m)
bool screenRelative
Whether this image should be skipped in 2D-views.
virtual long onLeftBtnPress(FXObject *, FXSelector, void *)
bool myInEditMode
Information whether too-tip informations shall be generated.
virtual void openObjectDialog()
virtual long onKeyRelease(FXObject *o, FXSelector sel, void *data)
bool addAdditionalGLVisualisation(const GUIGlObject *const which)
Adds an object to call its additional visualisation method.
int glID
whether the decal shall be drawn in screen coordinates, rather than network coordinates ...
void setSnapshots(std::map< SUMOTime, std::string > snaps)
Sets the snapshot time to file map.
virtual void copyViewportTo(GUISUMOAbstractView *view)
copy the viewport to the given view
virtual void onGamingClick(Position)
on gaming click
GUIDialog_ViewSettings * myVisualizationChanger
Visualization changer.
virtual void buildViewToolBars(GUIGlChildWindow &)
builds the view toolbars
virtual void stopTrack()
stop track
GUIDialog_EditViewport * myViewportChooser
viewport chooser
A RT-tree for efficient storing of SUMO's GL-objects.
double getGridHeight() const
get grid Height
double height
The height of the image (net coordinates in y-direction, in m)
virtual void endSnapshot()
Ends a video snapshot.
A class that stores a 2D geometrical boundary.
int myMouseHotspotX
Offset to the mouse-hotspot from the mouse position.
void addDecals(const std::vector< Decal > &decals)
add decals
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.
MFXMutex myPolyDrawLock
poly draw lock
double layer
The layer of the image.
double p2m(double pixel) const
pixels-to-meters conversion method
std::map< const GUIGlObject *, int > myAdditionallyDrawn
List of objects for which GUIGlObject::drawGLAdditional is called.
double roll
The roll of the image to the ground plane (in degrees)
std::vector< Decal > myDecals
double getGridWidth() const
get grid width
GUIGlID getObjectAtPosition(Position pos)
returns the id of the object at position using GL_SELECT
virtual GUIGlID getTrackedID() const
get tracked id
virtual void startTrack(int)
star track
virtual long onPaint(FXObject *, FXSelector, void *)
void showToolTipFor(const GUIGlID id)
invokes the tooltip for the given object
virtual long onKeyPress(FXObject *o, FXSelector sel, void *data)
keyboard functions
bool isInEditMode()
returns true, if the edit button was pressed
A point in 2D or 3D with translation and scaling methods.
double rot
The rotation of the image in the ground plane (in degrees)
virtual void centerTo(GUIGlID id, bool applyZoom, double zoomDist=20)
centers to the chosen artifact
GUIPerspectiveChanger & getChanger() const
get changer
FXComboBox & getColoringSchemesCombo()
get coloring schemes combo
bool initialised
Whether this image was initialised (inserted as a texture)
virtual void doInit()
doInit
double centerY
The center of the image in y-direction (net coordinates, in m)
virtual long onMouseWheel(FXObject *, FXSelector, void *)
virtual void checkSnapshots()
Checks whether it is time for a snapshot.
virtual ~GUISUMOAbstractView()
destructor
std::string filename
The path to the file the image is located at.
virtual int doPaintGL(int, const Boundary &)
paint GL
Position screenPos2NetPos(int x, int y) const
Translate screen position to network position.
std::map< SUMOTime, std::string > mySnapshots
Snapshots.
GUIPerspectiveChanger * myChanger
The perspective changer.
bool myUseToolTips
use tool tips
std::string makeSnapshot(const std::string &destFile)
Takes a snapshots and writes it into the given file.
GUIGLObjectPopupMenu * myPopup
The current popup-menu.
void destroyPopup()
destoys the popup
FXint myWindowCursorPositionX
Position of the cursor relative to the window.
virtual long onMiddleBtnRelease(FXObject *, FXSelector, void *)
double width
The width of the image (net coordinates in x-direction, in m)
virtual bool setColorScheme(const std::string &)
set color scheme
virtual void showViewportEditor()
show viewport editor
FXbool makeCurrent()
A reimplementation due to some internal reasons.
void 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)
virtual long onLeftBtnRelease(FXObject *, FXSelector, void *)
double m2p(double meter) const
meter-to-pixels conversion method
GUIVisualizationSettings * myVisualizationSettings
visualization settings
bool isAdditionalGLVisualisationEnabled(GUIGlObject *const which) const
Check if an object is added in the additional GL visualitation.
void paintGL()
performs the painting of the simulation
void setWindowCursorPosition(FXint x, FXint y)
Returns the information whether rotation is allowd.
double centerZ
The center of the image in z-direction (net coordinates, in m)
void drawDecals()
Draws the stored decals.
double tilt
The tilt of the image to the ground plane (in degrees)
bool skip2D
Whether this image should be skipped in 2D-views.
GUISUMOAbstractView()
empty constructor
virtual SUMOTime getCurrentTimeStep() const
get the current simulation time
Position getPositionInformation() const
Returns the cursor's x/y position within the network.
Boundary getVisibleBoundary() const
get visible boundary
void updateToolTip()
A method that updates the tooltip.
A dialog to change the viewport.
void showViewschemeEditor()
show viewsscheme editor
virtual long onRightBtnPress(FXObject *, FXSelector, void *)
virtual long onMouseLeft(FXObject *, FXSelector, void *)
GUIGlID getObjectUnderCursor()
returns the id of the object under the cursor using GL_SELECT
GUIGlChildWindow * myParent
The parent window.
virtual long onRightBtnRelease(FXObject *, FXSelector, void *)
std::vector< GUIGlID > getObjectsInBoundary(const Boundary &bound)
returns the ids of all objects in the given boundary
A MSVehicle extended by some values for usage within the gui.