66 #define SPEEDFACTOR_SCALE 100.0
99 FXIcon* ic, FXuint opts,
100 FXint x, FXint y, FXint w, FXint h) :
101 GUIGlChildWindow(p, parentWindow, mdimenu, name,
nullptr, ic, opts, x, y, w, h) {
102 buildSpeedControlToolbar();
103 myParent->addGLChild(
this);
188 FXFileDialog opendialog(
this,
"Save Snapshot");
190 opendialog.setSelectMode(SELECTFILE_ANY);
192 opendialog.setPatternList(
"All Image and Video Files (*.gif,*.bmp,*.xpm,*.pcx,*.ico,*.rgb,*.xbm,*.tga,*.png,*.jpg,*.jpeg,*.tif,*.tiff,*.ps,*.eps,*.pdf,*.svg,*.tex,*.pgf,*.h264,*.hevc)\n"
193 "All Video Files (*.h264,*.hevc)\n"
195 opendialog.setPatternList(
"All Image Files (*.gif,*.bmp,*.xpm,*.pcx,*.ico,*.rgb,*.xbm,*.tga,*.png,*.jpg,*.jpeg,*.tif,*.tiff,*.ps,*.eps,*.pdf,*.svg,*.tex,*.pgf)\n"
197 "GIF Image (*.gif)\nBMP Image (*.bmp)\nXPM Image (*.xpm)\nPCX Image (*.pcx)\nICO Image (*.ico)\n"
198 "RGB Image (*.rgb)\nXBM Image (*.xbm)\nTARGA Image (*.tga)\nPNG Image (*.png)\n"
199 "JPEG Image (*.jpg,*.jpeg)\nTIFF Image (*.tif,*.tiff)\n"
200 "Postscript (*.ps)\nEncapsulated Postscript (*.eps)\nPortable Document Format (*.pdf)\n"
201 "Scalable Vector Graphics (*.svg)\nLATEX text strings (*.tex)\nPortable LaTeX Graphics (*.pgf)\n"
204 opendialog.setDirectory(gCurrentFolder);
210 std::string file = opendialog.getFilename().text();
212 if (error ==
"video") {
214 }
else if (error !=
"") {
215 FXMessageBox::error(
this, MBOX_OK,
"Saving failed.",
"%s", error.c_str());
224 switch (FXSELID(sel)) {
255 std::vector<GUIGlID> vehicles;
277 std::vector<GUIGlID> persons;
294 std::vector<GUIGlID> containers;
366 throw ProcessError(
"Unknown Message ID in onCmdLocate");
390 if (edge ==
nullptr) {
394 const std::vector<MSLane*>& lanes = edge->
getLanes();
395 for (std::vector<MSLane*>::const_iterator j = lanes.begin(); j != lanes.end(); ++j) {
430 mySpeedFactorSlider =
new FXSlider(toolbar,
this,
MID_SPEEDFACTOR, LAYOUT_FIX_WIDTH | SLIDER_ARROW_UP | SLIDER_TICKS_TOP, 0, 0, 200, 10, 0, 0, 5, 0);
463 sender->handle(
this, FXSEL(SEL_COMMAND, disable ? ID_DISABLE : ID_ENABLE), ptr);
490 ACChooserJunction(nullptr),
491 ACChooserEdges(nullptr),
492 ACChooserVehicles(nullptr),
493 ACChooserPersons(nullptr),
494 ACChooserContainer(nullptr),
495 ACChooserTLS(nullptr),
496 ACChooserAdditional(nullptr),
497 ACChooserPOI(nullptr),
498 ACChooserPolygon(nullptr),
499 ACChooserRoutes(nullptr),
500 ACChooserStops(nullptr),
501 ACChooserProhibition(nullptr) {
508 delete ACChooserJunction;
509 delete ACChooserEdges;
510 delete ACChooserVehicles;
511 delete ACChooserPersons;
512 delete ACChooserContainer;
514 delete ACChooserAdditional;
516 delete ACChooserPolygon;
517 delete ACChooserRoutes;
518 delete ACChooserStops;
519 delete ACChooserProhibition;
@ MID_MAKESNAPSHOT
Make snapshot - button.
@ MID_LOCATEPERSON
Locate person - button.
@ MID_LOCATEJUNCTION
Locate junction - button.
@ MID_LOCATEPOLY
Locate polygons - button.
@ MID_SPEEDFACTOR
scale vehicle speed
@ MID_LOCATEADD
Locate addtional structure - button.
@ MID_LOCATEPOI
Locate poi - button.
@ MID_SIMSTEP
A Simulation step was performed.
@ MID_LOCATEEDGE
Locate edge - button.
@ MID_LOCATEVEHICLE
Locate vehicle - button.
@ MID_LOCATETLS
Locate TLS - button.
@ MID_LOCATECONTAINER
Locate container - button.
#define GUIDesignVerticalSeparator
vertical separator
@ GLO_ADDITIONALELEMENT
reserved GLO type to pack all additionals elements
GUISelectedStorage gSelected
A global holder of selected objects.
FXString gCurrentFolder
The folder used as last.
#define SPEEDFACTOR_SCALE
FXDEFMAP(GUISUMOViewParent) GUISUMOViewParentMap[]
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
A road/street connecting two junctions (gui-version)
static std::vector< GUIGlID > getIDs(bool includeInternal)
GUISUMOAbstractView * myView
The view.
FXMenuButton * myLocatorButton
The locator button.
FXVerticalFrame * myContentFrame
The contents frame.
FXPopup * myLocatorPopup
The locator menu.
GUIMainWindow * myParent
The parent window.
FXToolBar * myStaticNavigationToolBar
The static navigation tool bar.
FXMenuBar * myGripNavigationToolbar
The grip navigation tool bar.
static std::vector< GUIGlID > getIDList(GUIGlObjectType typeFilter)
Returns the list of gl-ids of all additional objects that match the given type.
static const GUIGlID INVALID_ID
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
GUIGlID getGlID() const
Returns the numerical id of the object.
static GUIGlObjectStorage gIDStorage
A single static instance of this class.
GUIGlObject * getObjectBlocking(GUIGlID id)
Returns the object from the container locking it.
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
Representation of a lane in the micro simulation (gui-version)
The class responsible for building and deletion of vehicles (gui-version)
bool isGaming() const
return whether the gui is in gaming mode
bool listTeleporting() const
return whether to list teleporting vehicles
bool listParking() const
return whether to list parking vehicles
bool listInternal() const
return whether to list internal structures
FXGLVisual * getGLVisual() const
get GL Visual
void removeGLChild(GUIGlChildWindow *child)
removes the given child window from the list (GUIGlChildWindow)
A MSNet extended by some values for usage within the gui.
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.
virtual void checkSnapshots()
Checks whether it is time for a snapshot.
virtual void endSnapshot()
Ends a video snapshot.
virtual void buildViewToolBars(GUIGlChildWindow *)
builds the view toolbars
virtual long onKeyPress(FXObject *o, FXSelector sel, void *data)
keyboard functions
virtual void stopTrack()
stop track
virtual long onKeyRelease(FXObject *o, FXSelector sel, void *data)
virtual GUIGlID getTrackedID() const
get tracked id
struct for GLObjChooser dialog
GUIDialog_GLObjChooser * ACChooserVehicles
pointer to ACChooser dialog used for locate vehicles
GUIDialog_GLObjChooser * ACChooserPolygon
pointer to ACChooser dialog used for locate Polygons
GUIDialog_GLObjChooser * ACChooserPOI
pointer to ACChooser dialog used for locate POIs
GUIDialog_GLObjChooser * ACChooserEdges
pointer to ACChooser dialog used for locate edges
GUIDialog_GLObjChooser * ACChooserProhibition
pointer to ACChooser dialog used for locate Prohibitions
GUIDialog_GLObjChooser * ACChooserJunction
pointer to ACChooser dialog used for locate junctions
GUIDialog_GLObjChooser * ACChooserTLS
pointer to ACChooser dialog used for locate TLSs
GLObjChooser()
constructor
GUIDialog_GLObjChooser * ACChooserAdditional
pointer to ACChooser dialog used for locate additional
GUIDialog_GLObjChooser * ACChooserContainer
pointer to ACChooser dialog used for locate Containers
~GLObjChooser()
destructor
GUIDialog_GLObjChooser * ACChooserStops
pointer to ACChooser dialog used for locate stops
GUIDialog_GLObjChooser * ACChooserPersons
pointer to ACChooser dialog used for locate persons
GUIDialog_GLObjChooser * ACChooserRoutes
pointer to ACChooser dialog used for locate routes
A single child window which contains a view of the simulation area.
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
virtual GUISUMOAbstractView * init(FXGLCanvas *share, GUINet &net, ViewType type)
"Initialises" this window by building the contents
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.
GLObjChooser myGLObjChooser
GLObjChooser.
bool isSelected(GUIGlObjectType type, GUIGlID id)
Returns the information whether the object with the given type and id is selected.
Storage for geometrical objects extended by mutexes.
GUI-version of the transportable control for building gui persons and containers.
The class responsible for building and deletion of vehicles (gui-version)
static FXbool userPermitsOverwritingWhenFileExists(FXWindow *const parent, const FXString &file)
Returns true if either the file given by its name does not exist or the user allows overwriting it.
The base class for microscopic and mesoscopic vehicles.
void setChosenSpeedFactor(const double factor)
Returns the precomputed factor by which the driver wants to be faster than the speed limit.
double getChosenSpeedFactor() const
Returns the precomputed factor by which the driver wants to be faster than the speed limit.
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
virtual MSTransportableControl & getContainerControl()
Returns the container control.
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
virtual MSTransportableControl & getPersonControl()
Returns the person control.
double getChosenSpeedFactor() const