 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
86 FXGLCanvas* share,
GNENet* net,
GNEUndoList* undoList, FXIcon* ic, FXuint opts, FXint x, FXint y, FXint w, FXint h) :
87 GUIGlChildWindow(p, parentWindow, mdimenu, name, parentWindow->getToolbarsGrip().navigation, ic, opts, x, y, w, h),
88 myGNEAppWindows(parentWindow) {
90 myParent->addGLChild(
this);
106 myFramesArea->setWidth(220);
112 FXComposite* tmp =
new FXComposite(
this);
115 GNEViewNet* viewNet =
new GNEViewNet(tmp, myViewArea, *myParent,
this, net, undoList, myParent->getGLVisual(), share);
118 myGNEAppWindows->getToolbarsGrip().buildMenuToolbarsGrip();
131 myFrames.TAZFrame =
new GNETAZFrame(myFramesArea, viewNet);
137 myFrames.routeFrame =
new GNERouteFrame(myFramesArea, viewNet);
140 myFrames.stopFrame =
new GNEStopFrame(myFramesArea, viewNet);
146 onCmdUpdateFrameAreaWidth(
nullptr, 0,
nullptr);
152 myView->buildViewToolBars(*
this);
321 if (chooserDialog ==
nullptr) {
361 FXFileDialog opendialog(
this,
"Save Snapshot");
363 opendialog.setSelectMode(SELECTFILE_ANY);
364 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"
365 "GIF Image (*.gif)\nBMP Image (*.bmp)\nXPM Image (*.xpm)\nPCX Image (*.pcx)\nICO Image (*.ico)\n"
366 "RGB Image (*.rgb)\nXBM Image (*.xbm)\nTARGA Image (*.tga)\nPNG Image (*.png)\n"
367 "JPEG Image (*.jpg, *.jpeg)\nTIFF Image (*.tif, *.tiff)\n"
368 "Postscript (*.ps)\nEncapsulated Postscript (*.eps)\nPortable Document Format (*.pdf)\n"
369 "Scalable Vector Graphics (*.svg)\nLATEX text strings (*.tex)\nPortable LaTeX Graphics (*.pgf)\n"
378 std::string file = opendialog.getFilename().text();
382 WRITE_DEBUG(
"Opening FXMessageBox 'error saving snapshot'");
384 FXMessageBox::error(
this, MBOX_OK,
"Saving failed.",
"%s", error.c_str());
386 WRITE_DEBUG(
"Closed FXMessageBox 'error saving snapshot' with 'OK'");
405 std::vector<GNEAttributeCarrier*> ACsToLocate;
406 switch (FXSELID(sel)) {
414 ACsToLocate.reserve(junctions.size());
415 for (
auto i : junctions) {
416 ACsToLocate.push_back(i);
429 ACsToLocate.reserve(edges.size());
430 for (
auto i : edges) {
431 ACsToLocate.push_back(i);
449 ACsToLocate.push_back(i.second);
453 ACsToLocate.push_back(i.second);
457 ACsToLocate.push_back(i.second);
461 ACsToLocate.push_back(i.second);
477 ACsToLocate.push_back(i.second);
481 ACsToLocate.push_back(i.second);
496 ACsToLocate.push_back(i.second);
515 ACsToLocate.push_back(i.second);
519 ACsToLocate.push_back(i.second);
523 ACsToLocate.push_back(i.second);
527 ACsToLocate.push_back(i.second);
531 ACsToLocate.push_back(i.second);
544 ACsToLocate.reserve(junctions.size());
545 for (
auto i : junctions) {
546 if (i->getNBNode()->getControllingTLS().size() > 0) {
547 ACsToLocate.push_back(i);
561 ACsToLocate.reserve(additionals.size());
562 for (
auto i : additionals) {
563 ACsToLocate.push_back(i);
576 ACsToLocate.push_back(dynamic_cast<GNEAttributeCarrier*>(i.second));
589 ACsToLocate.push_back(dynamic_cast<GNEAttributeCarrier*>(i.second));
596 throw ProcessError(
"Unknown Message ID in onCmdLocate");
633 inspectorFrame(nullptr),
634 selectorFrame(nullptr),
635 connectorFrame(nullptr),
636 TLSEditorFrame(nullptr),
637 additionalFrame(nullptr),
638 crossingFrame(nullptr),
640 deleteFrame(nullptr),
641 polygonFrame(nullptr),
642 prohibitionFrame(nullptr),
643 createEdgeFrame(nullptr),
645 vehicleFrame(nullptr),
646 vehicleTypeFrame(nullptr),
648 personFrame(nullptr),
649 personTypeFrame(nullptr),
650 personPlanFrame(nullptr) {
656 inspectorFrame->hide();
657 selectorFrame->hide();
658 connectorFrame->hide();
659 TLSEditorFrame->hide();
660 additionalFrame->hide();
661 crossingFrame->hide();
664 polygonFrame->hide();
665 prohibitionFrame->hide();
670 vehicleFrame->hide();
671 vehicleTypeFrame->hide();
673 personTypeFrame->hide();
675 personPlanFrame->hide();
682 inspectorFrame->setFrameWidth(frameWidth);
683 selectorFrame->setFrameWidth(frameWidth);
684 connectorFrame->setFrameWidth(frameWidth);
685 TLSEditorFrame->setFrameWidth(frameWidth);
686 additionalFrame->setFrameWidth(frameWidth);
687 crossingFrame->setFrameWidth(frameWidth);
688 TAZFrame->setFrameWidth(frameWidth);
689 deleteFrame->setFrameWidth(frameWidth);
690 polygonFrame->setFrameWidth(frameWidth);
691 prohibitionFrame->setFrameWidth(frameWidth);
695 routeFrame->setFrameWidth(frameWidth);
696 vehicleFrame->setFrameWidth(frameWidth);
697 vehicleTypeFrame->setFrameWidth(frameWidth);
698 stopFrame->setFrameWidth(frameWidth);
699 personTypeFrame->setFrameWidth(frameWidth);
700 personFrame->setFrameWidth(frameWidth);
701 personPlanFrame->setFrameWidth(frameWidth);
708 if (inspectorFrame->shown()) {
710 }
else if (selectorFrame->shown()) {
712 }
else if (connectorFrame->shown()) {
714 }
else if (TLSEditorFrame->shown()) {
716 }
else if (additionalFrame->shown()) {
718 }
else if (crossingFrame->shown()) {
720 }
else if (TAZFrame->shown()) {
722 }
else if (deleteFrame->shown()) {
724 }
else if (polygonFrame->shown()) {
726 }
else if (prohibitionFrame->shown()) {
732 }
else if (routeFrame->shown()) {
734 }
else if (vehicleFrame->shown()) {
736 }
else if (vehicleTypeFrame->shown()) {
738 }
else if (stopFrame->shown()) {
740 }
else if (personTypeFrame->shown()) {
742 }
else if (personFrame->shown()) {
744 }
else if (personPlanFrame->shown()) {
755 if (inspectorFrame->shown()) {
756 return inspectorFrame;
757 }
else if (selectorFrame->shown()) {
758 return selectorFrame;
759 }
else if (connectorFrame->shown()) {
760 return connectorFrame;
761 }
else if (TLSEditorFrame->shown()) {
762 return TLSEditorFrame;
763 }
else if (additionalFrame->shown()) {
764 return additionalFrame;
765 }
else if (crossingFrame->shown()) {
766 return crossingFrame;
767 }
else if (TAZFrame->shown()) {
769 }
else if (deleteFrame->shown()) {
771 }
else if (polygonFrame->shown()) {
773 }
else if (prohibitionFrame->shown()) {
774 return prohibitionFrame;
779 }
else if (routeFrame->shown()) {
781 }
else if (vehicleFrame->shown()) {
783 }
else if (vehicleTypeFrame->shown()) {
784 return vehicleTypeFrame;
785 }
else if (personTypeFrame->shown()) {
786 return personTypeFrame;
787 }
else if (stopFrame->shown()) {
789 }
else if (personFrame->shown()) {
791 }
else if (personPlanFrame->shown()) {
792 return personPlanFrame;
803 ACChooserJunction(nullptr),
804 ACChooserEdges(nullptr),
805 ACChooserVehicles(nullptr),
806 ACChooserPersons(nullptr),
807 ACChooserRoutes(nullptr),
808 ACChooserStops(nullptr),
809 ACChooserTLS(nullptr),
810 ACChooserAdditional(nullptr),
811 ACChooserPOI(nullptr),
812 ACChooserPolygon(nullptr),
813 ACChooserProhibition(nullptr) {
819 if (ACChooserJunction) {
820 delete ACChooserJunction;
822 if (ACChooserEdges) {
823 delete ACChooserEdges;
825 if (ACChooserRoutes) {
826 delete ACChooserRoutes;
828 if (ACChooserStops) {
829 delete ACChooserStops;
831 if (ACChooserVehicles) {
832 delete ACChooserVehicles;
834 if (ACChooserPersons) {
835 delete ACChooserPersons;
840 if (ACChooserAdditional) {
841 delete ACChooserAdditional;
846 if (ACChooserPolygon) {
847 delete ACChooserPolygon;
849 if (ACChooserProhibition) {
850 delete ACChooserProhibition;
GNEVehicleTypeFrame * getVehicleTypeFrame() const
get frame for GNE_DMODE_VEHICLETYPE
GNEStopFrame * getStopFrame() const
get frame for GNE_DMODE_STOP
GNEDialogACChooser * ACChooserStops
pointer to ACChooser dialog used for locate stops
GNEVehicleFrame * vehicleFrame
frame for GNE_DMODE_VEHICLE
GNESelectorFrame * getSelectorFrame() const
get frame for GNE_NMODE_SELECT
GNESelectorFrame * selectorFrame
frame for GNE_NMODE_SELECT
const AttributeCarriers & getAttributeCarriers() const
retrieve all attribute carriers of Net
bool isFrameShown() const
return true if at least there is a frame shown
void eraseACChooserDialog(GNEDialogACChooser *chooserDialog)
remove created chooser dialog
stop placed over a parking area (used in netedit)
GNECreateEdgeFrame * getCreateEdgeFrame() const
get frame for GNE_NMODE_CREATEEDGE
void updateUndoRedoButtons()
update toolbar undo/redo buttons (called when user press Ctrl+Z/Y)
stop placed over a lane (used in netedit)
GNEConnectorFrame * connectorFrame
frame for GNE_NMODE_CONNECT
GNEPolygonFrame * getPolygonFrame() const
get frame for GNE_NMODE_POLYGON
GNEProhibitionFrame * getProhibitionFrame() const
get frame for GNE_NMODE_PROHIBITION
GUISUMOAbstractView * myView
The view.
GUIMainWindow * getGUIMainWindow() const
get GUIMainWindow App
long onCmdMakeSnapshot(FXObject *sender, FXSelector, void *)
A NBNetBuilder extended by visualisation and editing capabilities.
GNEDialogACChooser * ACChooserAdditional
pointer to ACChooser dialog used for locate additional
GNEDialogACChooser * ACChooserPOI
pointer to ACChooser dialog used for locate POIs
GNEVehicleTypeFrame * vehicleTypeFrame
frame for GNE_DMODE_VEHICLETYPE
virtual void create()
create GUIGlChildWindow
GNEFrame * getCurrentShownFrame() const
get current frame show
FXHorizontalFrame * myFramesArea
frame to hold GNEFrames
long onCmdClose(FXObject *, FXSelector, void *)
Called when the user hits the close button (x)
GNETLSEditorFrame * TLSEditorFrame
frame for GNE_NMODE_TLS
ACChoosers myACChoosers
struct for ACChoosers
GNEConnectorFrame * getConnectorFrame() const
get frame for GNE_NMODE_CONNECT
GNETAZFrame * getTAZFrame() const
get frame for GNE_NMODE_TAZ
GNEInspectorFrame * inspectorFrame
frame for GNE_NMODE_INSPECT
The main window of the Netedit.
GNEDeleteFrame * getDeleteFrame() const
get frame for GNE_NMODE_DELETE
GNEApplicationWindow * myGNEAppWindows
pointer to GNEApplicationWindow
GNERouteFrame * routeFrame
frame for GNE_DMODE_ROUTE
long onKeyPress(FXObject *o, FXSelector sel, void *data)
Called when user press a key.
void hideFramesArea()
hide frames area if all GNEFrames are hidden
GNEAdditionalFrame * additionalFrame
frame for GNE_NMODE_ADDITIONAL
#define GUIDesignSplitter
GNEDeleteFrame * deleteFrame
frame for GNE_NMODE_DELETE
GNEProhibitionFrame * prohibitionFrame
frame for GNE_NMODE_PROHIBITION
FXPopup * myLocatorPopup
The locator menu.
GNEDialogACChooser * ACChooserVehicles
pointer to ACChooser dialog used for locate vehicles
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
Frames myFrames
struct for frames
FXButton * myUndoButton
toolbar undo button
GNEDialogACChooser * ACChooserTLS
pointer to ACChooser dialog used for locate TLSs
long onCmdUpdateFrameAreaWidth(FXObject *, FXSelector, void *)
Called when user change the splitter between FrameArea and ViewNet.
#define GUIDesignButtonToolbar
little button with icon placed in navigation toolbar
A single child window which contains a view of the simulation area.
FXButton * myRedoButton
toolbar redo button
GNEPolygonFrame * polygonFrame
frame for GNE_NMODE_POLYGON
GNEDialogACChooser * ACChooserEdges
pointer to ACChooser dialog used for locate edges
void showFramesArea()
show frames area if at least a GNEFrame is showed
GNENet * getNet() const
get the net object
GNECrossingFrame * crossingFrame
frame for GNE_NMODE_CROSSING
GNEDialogACChooser * ACChooserProhibition
pointer to ACChooser dialog used for locate Prohibitions
long onKeyRelease(FXObject *o, FXSelector sel, void *data)
Called when user releases a key.
a flow definition nusing a route instead of a from-to edges route (used in NETEDIT)
a flow definitio nusing a from-to edges instead of a route (used by router)
stop placed over a charging station (used in netedit)
GNEPersonPlanFrame * personPlanFrame
frame for GNE_DMODE_PERSONPLAN
GNEPersonPlanFrame * getPersonPlanFrame() const
get frame for GNE_DMODE_PERSONFRAME
GNEDialogACChooser * ACChooserPolygon
pointer to ACChooser dialog used for locate Polygons
GNECreateEdgeFrame * createEdgeFrame
frame for GNE_NMODE_CREATEDGE
FXMenuButton * myLocatorButton
The locator button.
GNEInspectorFrame * getInspectorFrame() const
get frame for GNE_NMODE_INSPECT
#define GUIDesignFrameArea
#define GUIDesignViewnArea
design for viewn area
GNEAdditionalFrame * getAdditionalFrame() const
get frame for GNE_NMODE_ADDITIONAL
~GNEViewParent()
Destructor.
FXString gCurrentFolder
The folder used as last.
std::map< SumoXMLTag, std::map< std::string, GNEDemandElement * > > demandElements
map with the name and pointer to demand elements of net
virtual long onKeyRelease(FXObject *o, FXSelector sel, void *data)
std::vector< GNEAdditional * > retrieveAdditionals(bool onlySelected=false) const
return all additionals
long p_onUpdRedo(FXObject *, FXSelector, void *)
event after Redo
const POIs & getPOIs() const
Returns all pois.
GNEDialogACChooser * ACChooserJunction
pointer to ACChooser dialog used for locate junctions
std::vector< GNEJunction * > retrieveJunctions(bool onlySelected=false)
return all junctions
GNEPersonFrame * personFrame
frame for GNE_DMODE_PERSON
GNEDialogACChooser * ACChooserRoutes
pointer to ACChooser dialog used for locate routes
void hideFrames()
hide frames
stop placed over a containerStop (used in netedit)
GNEFrame * getCurrentShownFrame() const
get current frame (note: it can be null)
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.
GNEApplicationWindow * getGNEAppWindows() const
get GNE Application Windows
FXDEFMAP(GNEViewParent) GNEViewParentMap[]
void hideAllFrames()
hide all frames
Locate junction - button.
GNERouteFrame * getRouteFrame() const
get frame for GNE_DMODE_ROUTE
GNEStopFrame * stopFrame
frame for GNE_DMODE_STOP
GNEPersonFrame * getPersonFrame() const
get frame for GNE_DMODE_PERSON
GNEDialogACChooser * ACChooserPersons
pointer to ACChooser dialog used for locate persons
GNEUndoList * getUndoList()
get pointer to undoList
#define GUIDesignVerticalSeparator
vertical separator
std::vector< GNEEdge * > retrieveEdges(bool onlySelected=false)
return all edges
GNEPersonTypeFrame * personTypeFrame
frame for GNE_DMODE_PERSONTYPE
void removeGLChild(GUIGlChildWindow *child)
removes the given child window from the list
GUIMainWindow * myParent
The parent window.
GNETLSEditorFrame * getTLSEditorFrame() const
get frame for GNE_NMODE_TLS
long onCmdLocate(FXObject *, FXSelector, void *)
locator-callback
virtual long onKeyPress(FXObject *o, FXSelector sel, void *data)
keyboard functions
begin/end of the description of a route
GNEPersonTypeFrame * getPersonTypeFrame() const
get frame for GNE_DMODE_PERSONTYPE
ToolbarsGrip & getToolbarsGrip()
get ToolbarsGrip
Size of frame area updated.
stop placed over a busStop (used in netedit)
void setWidth(int frameWidth)
set new width in all frames
long p_onUpdUndo(FXObject *, FXSelector, void *)
const Polygons & getPolygons() const
Returns all polygons.
Locate polygons - button.
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.
GNEVehicleFrame * getVehicleFrame() const
get frame for GNE_DMODE_VEHICLE
a single trip definition (used by router)
GNETAZFrame * TAZFrame
frame for GNE_NMODE_TAZ
GNECrossingFrame * getCrossingFrame() const
get frame for GNE_NMODE_CROSSING