Eclipse SUMO - Simulation of Urban MObility
GUISUMOViewParent.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3// Copyright (C) 2001-2022 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
21// A single child window which contains a view of the simulation area
22/****************************************************************************/
23#pragma once
24#include <config.h>
25
26#include <string>
27#include <vector>
29#include <utils/geom/Position.h>
30#include <utils/geom/Boundary.h>
33
34
35// ===========================================================================
36// class declarations
37// ===========================================================================
38class GUINet;
42
43
44// ===========================================================================
45// class declarations
46// ===========================================================================
58 // FOX-declarations
59 FXDECLARE(GUISUMOViewParent)
60
61public:
63 enum ViewType {
68 };
69
82 GUISUMOViewParent(FXMDIClient* p, FXMDIMenu* mdimenu,
83 const FXString& name, GUIMainWindow* parentWindow,
84 FXIcon* ic = NULL, FXuint opts = 0, FXint x = 0, FXint y = 0, FXint w = 0, FXint h = 0);
85
86
93 virtual GUISUMOAbstractView* init(FXGLCanvas* share, GUINet& net, ViewType type);
94
97
99 long onCmdMakeSnapshot(FXObject* sender, FXSelector, void*);
100
102 long onSimStep(FXObject* sender, FXSelector, void*);
103
105 long onCmdLocate(FXObject*, FXSelector, void*);
106
108 long onCmdSpeedFactor(FXObject*, FXSelector, void*);
109 long onUpdSpeedFactor(FXObject*, FXSelector, void*);
110
112 long onKeyPress(FXObject* o, FXSelector sel, void* data);
113 long onKeyRelease(FXObject* o, FXSelector sel, void* data);
114
116 bool isSelected(GUIGlObject* o) const;
117
119 void setToolBarVisibility(const bool value);
120
122 std::vector<GUIGlID> getObjectIDs(int messageId) const;
123
125 void eraseGLObjChooser(GUIDialog_GLObjChooser* GLObjChooser);
126
127protected:
129 FOX_CONSTRUCTOR(GUISUMOViewParent)
130
131
133
135 FXToolBarShell* myToolBarDragSpeed = nullptr;
136
138 FXToolBar* myToolBarSpeed = nullptr;
139
141 FXSlider* mySpeedFactorSlider = nullptr;
142
143private:
145 std::map<int, GUIDialog_ChooserAbstract*> myGLObjChooser;
146};
A MSNet extended by some values for usage within the gui.
Definition: GUINet.h:82
A single child window which contains a view of the simulation area.
std::map< int, GUIDialog_ChooserAbstract * > myGLObjChooser
map for existing dialogs
bool isSelected(GUIGlObject *o) const
true if the object is selected (may include extra logic besides calling gSelected)
ViewType
Available view types.
@ VIEW_3D_OSG
plain 3D OSG view (
@ VIEW_2D_OPENGL
plain 2D openGL view (
long onCmdSpeedFactor(FXObject *, FXSelector, void *)
speedFactor-callback
void eraseGLObjChooser(GUIDialog_GLObjChooser *GLObjChooser)
erase GLObjChooser
FXToolBar * myToolBarSpeed
toolbar for speed
virtual GUISUMOAbstractView * init(FXGLCanvas *share, GUINet &net, ViewType type)
"Initialises" this window by building the contents
GUISUMOViewParent(FXMDIClient *p, FXMDIMenu *mdimenu, const FXString &name, GUIMainWindow *parentWindow, FXIcon *ic=NULL, FXuint opts=0, FXint x=0, FXint y=0, FXint w=0, FXint h=0)
Constructor.
FXToolBarShell * myToolBarDragSpeed
toolbar shell for speed
long onCmdLocate(FXObject *, FXSelector, void *)
locator-callback
void buildSpeedControlToolbar()
fox need this
long onUpdSpeedFactor(FXObject *, FXSelector, void *)
long onKeyRelease(FXObject *o, FXSelector sel, void *data)
long onCmdMakeSnapshot(FXObject *sender, FXSelector, void *)
Called if the user wants to make a snapshot (screenshot)
long onSimStep(FXObject *sender, FXSelector, void *)
Called on a simulation step.
FXSlider * mySpeedFactorSlider
slider for speedfactor
void setToolBarVisibility(const bool value)
about toggled gaming status
long onKeyPress(FXObject *o, FXSelector sel, void *data)
handle keys
~GUISUMOViewParent()
Destructor.
std::vector< GUIGlID > getObjectIDs(int messageId) const
get all objects of the given type