 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
66 #define SPEEDFACTOR_SCALE 100.0
98 FXIcon* ic, FXuint opts,
99 FXint x, FXint y, FXint w, FXint h) :
100 GUIGlChildWindow(p, parentWindow, mdimenu, name,
nullptr, ic, opts, x, y, w, h) {
101 buildSpeedControlToolbar();
102 myParent->addGLChild(
this);
153 FXFileDialog opendialog(
this,
"Save Snapshot");
155 opendialog.setSelectMode(SELECTFILE_ANY);
157 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"
158 "All Video Files (*.h264,*.hevc)\n"
160 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"
162 "GIF Image (*.gif)\nBMP Image (*.bmp)\nXPM Image (*.xpm)\nPCX Image (*.pcx)\nICO Image (*.ico)\n"
163 "RGB Image (*.rgb)\nXBM Image (*.xbm)\nTARGA Image (*.tga)\nPNG Image (*.png)\n"
164 "JPEG Image (*.jpg,*.jpeg)\nTIFF Image (*.tif,*.tiff)\n"
165 "Postscript (*.ps)\nEncapsulated Postscript (*.eps)\nPortable Document Format (*.pdf)\n"
166 "Scalable Vector Graphics (*.svg)\nLATEX text strings (*.tex)\nPortable LaTeX Graphics (*.pgf)\n"
175 std::string file = opendialog.getFilename().text();
177 if (error ==
"video") {
179 }
else if (error !=
"") {
180 FXMessageBox::error(
this, MBOX_OK,
"Saving failed.",
"%s", error.c_str());
189 std::vector<GUIGlID> ids;
191 std::string chooserTitle;
192 switch (FXSELID(sel)) {
196 chooserTitle =
"Junction Chooser";
201 chooserTitle =
"Edge Chooser";
205 static_cast<GUIMEVehicleControl*>(static_cast<GUINet*>(
MSNet::getInstance())->getGUIMEVehicleControl())->insertVehicleIDs(ids);
207 static_cast<GUIVehicleControl&>(
MSNet::getInstance()->getVehicleControl()).insertVehicleIDs(
211 chooserTitle =
"Vehicle Chooser";
214 static_cast<GUITransportableControl&>(
MSNet::getInstance()->getPersonControl()).insertPersonIDs(ids);
216 chooserTitle =
"Person Chooser";
221 chooserTitle =
"Traffic Lights Chooser";
226 chooserTitle =
"Additional Objects Chooser";
229 ids = static_cast<GUIShapeContainer&>(
GUINet::getInstance()->getShapeContainer()).getPOIIds();
231 chooserTitle =
"POI Chooser";
234 ids = static_cast<GUIShapeContainer&>(
GUINet::getInstance()->getShapeContainer()).getPolygonIDs();
236 chooserTitle =
"Polygon Chooser";
239 throw ProcessError(
"Unknown Message ID in onCmdLocate");
263 GUIEdge* edge = dynamic_cast<GUIEdge*>(o);
264 if (edge ==
nullptr) {
268 const std::vector<MSLane*>& lanes = edge->
getLanes();
269 for (std::vector<MSLane*>::const_iterator j = lanes.begin(); j != lanes.end(); ++j) {
270 GUILane* l = dynamic_cast<GUILane*>(*j);
304 mySpeedFactorSlider =
new FXSlider(toolbar,
this,
MID_SPEEDFACTOR, LAYOUT_FIX_WIDTH | SLIDER_ARROW_UP | SLIDER_TICKS_TOP, 0, 0, 200, 10, 0, 0, 5, 0);
337 sender->handle(
this, FXSEL(SEL_COMMAND, disable ? ID_DISABLE : ID_ENABLE), ptr);
347 MSPerson* person = dynamic_cast<MSPerson*>(o);
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
static std::vector< GUIGlID > getIDList(GUIGlObjectType typeFilter)
Returns the list of gl-ids of all additional objects that match the given type.
void setToolBarVisibility(const bool value)
@notify about toggled gaming status
bool listParking() const
return whether to list parking vehicles
bool listTeleporting() const
return whether to list teleporting vehicles
A single child window which contains a view of the simulation area.
GUISUMOAbstractView * myView
The view.
virtual void buildViewToolBars(GUIGlChildWindow &)
builds the view toolbars
virtual void checkSnapshots()
Checks whether it is time for a snapshot.
FXPopup * myLocatorPopup
The locator menu.
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
long onSimStep(FXObject *sender, FXSelector, void *)
Called on a simulation step.
double getChosenSpeedFactor() const
Returns the precomputed factor by which the driver wants to be faster than the speed limit.
long onUpdSpeedFactor(FXObject *, FXSelector, void *)
static const GUIGlID INVALID_ID
bool isGaming() const
return whether the gui is in gaming mode
FXSlider * mySpeedFactorSlider
void setChosenSpeedFactor(const double factor)
Returns the precomputed factor by which the driver wants to be faster than the speed limit.
long onKeyPress(FXObject *o, FXSelector sel, void *data)
handle keys
FXDEFMAP(GUISUMOViewParent) GUISUMOViewParentMap[]
A Simulation step was performed.
GUIGlID getGlID() const
Returns the numerical id of the object.
ViewType
Available view types.
FXMenuButton * myLocatorButton
The locator button.
FXGLVisual * getGLVisual() const
GUIGlObject * getObjectBlocking(GUIGlID id)
Returns the object from the container locking it.
virtual void endSnapshot()
Ends a video snapshot.
GUIIcon
An enumeration of icons used by the gui applications.
FXString gCurrentFolder
The folder used as last.
virtual long onKeyRelease(FXObject *o, FXSelector sel, void *data)
long onCmdMakeSnapshot(FXObject *sender, FXSelector, void *)
Called if the user wants to make a snapshot (screenshot)
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Representation of a lane in the micro simulation (gui-version)
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.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
A road/street connecting two junctions (gui-version)
long onCmdLocate(FXObject *, FXSelector, void *)
locator-callback
Locate junction - button.
#define SPEEDFACTOR_SCALE
bool isSelected(GUIGlObject *o) const
true if the object is selected (may include extra logic besides calling gSelected)
long onKeyRelease(FXObject *o, FXSelector sel, void *data)
#define GUIDesignVerticalSeparator
vertical separator
FXToolBar * myStaticNavigationToolBar
The static navigation tool bar.
static GUIGlObjectStorage gIDStorage
A single static instance of this class.
void removeGLChild(GUIGlChildWindow *child)
removes the given child window from the list
double getChosenSpeedFactor() const
GUISelectedStorage gSelected
A global holder of selected objects.
The base class for microscopic and mesoscopic vehicles.
GUIMainWindow * myParent
The parent window.
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
virtual long onKeyPress(FXObject *o, FXSelector sel, void *data)
keyboard functions
void buildSpeedControlToolbar()
static std::vector< GUIGlID > getIDs(bool includeInternal)
reserved GLO type to pack all additionals
Locate polygons - button.
A MSNet extended by some values for usage within the gui.
FXVerticalFrame * myContentFrame
The contents frame.
bool listInternal() const
return whether to list internal structures
Locate addtional structure - button.
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.
FXMenuBar * myGripNavigationToolbar
The grip navigation tool bar.
virtual GUISUMOAbstractView * init(FXGLCanvas *share, GUINet &net, ViewType type)
"Initialises" this window by building the contents
virtual GUIGlID getTrackedID() const
get tracked id
long onCmdSpeedFactor(FXObject *, FXSelector, void *)
speedFactor-callback
~GUISUMOViewParent()
Destructor.
bool isSelected(GUIGlObjectType type, GUIGlID id)
Returns the information whether the object with the given type and id is selected.