88 FXGLCanvas* share,
GNENet* net,
GNEUndoList* undoList, FXIcon* ic, FXuint opts, FXint x, FXint y, FXint w, FXint h) :
89 GUIGlChildWindow(p, parentWindow, mdimenu, name, parentWindow->getToolbarsGrip().navigation, ic, opts, x, y, w, h),
90 myGNEAppWindows(parentWindow) {
92 myParent->addGLChild(
this);
108 myFramesArea->setWidth(220);
114 FXComposite* tmp =
new FXComposite(
this);
117 GNEViewNet* viewNet =
new GNEViewNet(tmp, myViewArea, *myParent,
this, net, undoList, myParent->getGLVisual(), share);
120 myGNEAppWindows->getToolbarsGrip().buildMenuToolbarsGrip();
126 myCommonFrames.buildCommonFrames(
this, viewNet);
127 myNetworkFrames.buildNetworkFrames(
this, viewNet);
128 myDemandFrames.buildDemandFrames(
this, viewNet);
129 myDataFrames.buildDataFrames(
this, viewNet);
132 onCmdUpdateFrameAreaWidth(
nullptr, 0,
nullptr);
138 myView->buildViewToolBars(
this);
352 if (chooserDialog ==
nullptr) {
392 FXFileDialog opendialog(
this,
"Save Snapshot");
394 opendialog.setSelectMode(SELECTFILE_ANY);
395 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"
396 "GIF Image (*.gif)\nBMP Image (*.bmp)\nXPM Image (*.xpm)\nPCX Image (*.pcx)\nICO Image (*.ico)\n"
397 "RGB Image (*.rgb)\nXBM Image (*.xbm)\nTARGA Image (*.tga)\nPNG Image (*.png)\n"
398 "JPEG Image (*.jpg, *.jpeg)\nTIFF Image (*.tif, *.tiff)\n"
399 "Postscript (*.ps)\nEncapsulated Postscript (*.eps)\nPortable Document Format (*.pdf)\n"
400 "Scalable Vector Graphics (*.svg)\nLATEX text strings (*.tex)\nPortable LaTeX Graphics (*.pgf)\n"
409 std::string file = opendialog.getFilename().text();
413 WRITE_DEBUG(
"Opening FXMessageBox 'error saving snapshot'");
415 FXMessageBox::error(
this, MBOX_OK,
"Saving failed.",
"%s", error.c_str());
417 WRITE_DEBUG(
"Closed FXMessageBox 'error saving snapshot' with 'OK'");
436 std::vector<GNEAttributeCarrier*> ACsToLocate;
437 switch (FXSELID(sel)) {
446 ACsToLocate.reserve(junctions.size());
447 for (
const auto& junction : junctions) {
448 ACsToLocate.push_back(junction);
462 ACsToLocate.reserve(edges.size());
463 for (
const auto& edge : edges) {
464 ACsToLocate.push_back(edge);
483 ACsToLocate.push_back(vehicle.second);
487 ACsToLocate.push_back(trip.second);
491 ACsToLocate.push_back(flowRoute.second);
495 ACsToLocate.push_back(flow.second);
512 ACsToLocate.push_back(person.second);
516 ACsToLocate.push_back(personFlow.second);
532 ACsToLocate.push_back(route.second);
552 ACsToLocate.push_back(stopLane.second);
556 ACsToLocate.push_back(stopBusStop.second);
560 ACsToLocate.push_back(stopContainerStop.second);
564 ACsToLocate.push_back(stopChargingStation.second);
568 ACsToLocate.push_back(stopParkingArea.second);
582 ACsToLocate.reserve(junctions.size());
583 for (
const auto& junction : junctions) {
584 if (junction->getNBNode()->getControllingTLS().size() > 0) {
585 ACsToLocate.push_back(junction);
600 for (
const auto& additional : additionalTag.second) {
601 ACsToLocate.push_back(additional.second);
616 ACsToLocate.push_back(
POI.second);
619 ACsToLocate.push_back(POILane.second);
633 ACsToLocate.push_back(polygon.second);
640 throw ProcessError(
"Unknown Message ID in onCmdLocate");
681 inspectorFrame(nullptr),
682 deleteFrame(nullptr),
683 selectorFrame(nullptr),
699 inspectorFrame->hide();
701 selectorFrame->hide();
709 inspectorFrame->setFrameWidth(frameWidth);
710 deleteFrame->setFrameWidth(frameWidth);
711 selectorFrame->setFrameWidth(frameWidth);
712 moveFrame->setFrameWidth(frameWidth);
719 if (inspectorFrame->shown()) {
721 }
else if (deleteFrame->shown()) {
723 }
else if (selectorFrame->shown()) {
725 }
else if (moveFrame->shown()) {
736 if (inspectorFrame->shown()) {
737 return inspectorFrame;
738 }
else if (deleteFrame->shown()) {
740 }
else if (selectorFrame->shown()) {
741 return selectorFrame;
742 }
else if (moveFrame->shown()) {
754 connectorFrame(nullptr),
755 TLSEditorFrame(nullptr),
756 additionalFrame(nullptr),
757 crossingFrame(nullptr),
759 polygonFrame(nullptr),
760 prohibitionFrame(nullptr),
761 createEdgeFrame(nullptr) {
780 connectorFrame->hide();
781 TLSEditorFrame->hide();
782 additionalFrame->hide();
783 crossingFrame->hide();
785 polygonFrame->hide();
786 prohibitionFrame->hide();
787 createEdgeFrame->hide();
794 connectorFrame->setFrameWidth(frameWidth);
795 TLSEditorFrame->setFrameWidth(frameWidth);
796 additionalFrame->setFrameWidth(frameWidth);
797 crossingFrame->setFrameWidth(frameWidth);
798 TAZFrame->setFrameWidth(frameWidth);
799 polygonFrame->setFrameWidth(frameWidth);
800 prohibitionFrame->setFrameWidth(frameWidth);
801 createEdgeFrame->setFrameWidth(frameWidth);
808 if (connectorFrame->shown()) {
810 }
else if (TLSEditorFrame->shown()) {
812 }
else if (additionalFrame->shown()) {
814 }
else if (crossingFrame->shown()) {
816 }
else if (TAZFrame->shown()) {
818 }
else if (polygonFrame->shown()) {
820 }
else if (prohibitionFrame->shown()) {
822 }
else if (createEdgeFrame->shown()) {
833 if (connectorFrame->shown()) {
834 return connectorFrame;
835 }
else if (TLSEditorFrame->shown()) {
836 return TLSEditorFrame;
837 }
else if (additionalFrame->shown()) {
838 return additionalFrame;
839 }
else if (crossingFrame->shown()) {
840 return crossingFrame;
841 }
else if (TAZFrame->shown()) {
843 }
else if (polygonFrame->shown()) {
845 }
else if (prohibitionFrame->shown()) {
846 return prohibitionFrame;
847 }
else if (createEdgeFrame->shown()) {
848 return createEdgeFrame;
860 vehicleFrame(nullptr),
861 vehicleTypeFrame(nullptr),
863 personFrame(nullptr),
864 personTypeFrame(nullptr),
865 personPlanFrame(nullptr) {
884 vehicleFrame->hide();
885 vehicleTypeFrame->hide();
887 personTypeFrame->hide();
889 personPlanFrame->hide();
896 routeFrame->setFrameWidth(frameWidth);
897 vehicleFrame->setFrameWidth(frameWidth);
898 vehicleTypeFrame->setFrameWidth(frameWidth);
899 stopFrame->setFrameWidth(frameWidth);
900 personTypeFrame->setFrameWidth(frameWidth);
901 personFrame->setFrameWidth(frameWidth);
902 personPlanFrame->setFrameWidth(frameWidth);
909 if (routeFrame->shown()) {
911 }
else if (vehicleFrame->shown()) {
913 }
else if (vehicleTypeFrame->shown()) {
915 }
else if (stopFrame->shown()) {
917 }
else if (personTypeFrame->shown()) {
919 }
else if (personFrame->shown()) {
921 }
else if (personPlanFrame->shown()) {
932 if (routeFrame->shown()) {
934 }
else if (vehicleFrame->shown()) {
936 }
else if (vehicleTypeFrame->shown()) {
937 return vehicleTypeFrame;
938 }
else if (personTypeFrame->shown()) {
939 return personTypeFrame;
940 }
else if (stopFrame->shown()) {
942 }
else if (personFrame->shown()) {
944 }
else if (personPlanFrame->shown()) {
945 return personPlanFrame;
956 edgeDataFrame(nullptr),
957 edgeRelDataFrame(nullptr),
958 TAZRelDataFrame(nullptr) {
972 edgeDataFrame->hide();
973 edgeRelDataFrame->hide();
974 TAZRelDataFrame->hide();
981 edgeDataFrame->setFrameWidth(frameWidth);
982 edgeRelDataFrame->setFrameWidth(frameWidth);
983 TAZRelDataFrame->setFrameWidth(frameWidth);
990 if (edgeDataFrame->shown()) {
992 }
else if (edgeRelDataFrame->shown()) {
994 }
else if (TAZRelDataFrame->shown()) {
1005 if (edgeDataFrame->shown()) {
1006 return edgeDataFrame;
1007 }
else if (edgeRelDataFrame->shown()) {
1008 return edgeRelDataFrame;
1009 }
else if (TAZRelDataFrame->shown()) {
1010 return TAZRelDataFrame;
1021 ACChooserJunction(nullptr),
1022 ACChooserEdges(nullptr),
1023 ACChooserVehicles(nullptr),
1024 ACChooserPersons(nullptr),
1025 ACChooserRoutes(nullptr),
1026 ACChooserStops(nullptr),
1027 ACChooserTLS(nullptr),
1028 ACChooserAdditional(nullptr),
1029 ACChooserPOI(nullptr),
1030 ACChooserPolygon(nullptr),
1031 ACChooserProhibition(nullptr) {
1037 if (ACChooserJunction) {
1038 delete ACChooserJunction;
1040 if (ACChooserEdges) {
1041 delete ACChooserEdges;
1043 if (ACChooserRoutes) {
1044 delete ACChooserRoutes;
1046 if (ACChooserStops) {
1047 delete ACChooserStops;
1049 if (ACChooserVehicles) {
1050 delete ACChooserVehicles;
1052 if (ACChooserPersons) {
1053 delete ACChooserPersons;
1056 delete ACChooserTLS;
1058 if (ACChooserAdditional) {
1059 delete ACChooserAdditional;
1062 delete ACChooserPOI;
1064 if (ACChooserPolygon) {
1065 delete ACChooserPolygon;
1067 if (ACChooserProhibition) {
1068 delete ACChooserProhibition;
FXDEFMAP(GNEViewParent) GNEViewParentMap[]
@ MID_MAKESNAPSHOT
Make snapshot - button.
@ MID_LOCATEPERSON
Locate person - button.
@ MID_HOTKEY_CTRL_Y_REDO
Undo.
@ MID_LOCATEJUNCTION
Locate junction - button.
@ MID_HOTKEY_CTRL_W_CLOSESIMULATION
Close simulation - ID.
@ MID_LOCATEPOLY
Locate polygons - button.
@ MID_LOCATEADD
Locate addtional structure - button.
@ MID_LOCATEPOI
Locate poi - button.
@ MID_LOCATESTOP
Locate stop - button.
@ MID_GNE_VIEWPARENT_FRAMEAREAWIDTH
Size of frame area updated.
@ MID_LOCATEEDGE
Locate edge - button.
@ MID_LOCATEVEHICLE
Locate vehicle - button.
@ MID_LOCATETLS
Locate TLS - button.
@ MID_HOTKEY_CTRL_Z_UNDO
Redo.
@ MID_LOCATEROUTE
Locate route - button.
#define GUIDesignButtonToolbar
little button with icon placed in navigation toolbar
#define GUIDesignFrameArea
#define GUIDesignVerticalSeparator
vertical separator
#define GUIDesignSplitter
#define GUIDesignViewnArea
design for viewn area
FXString gCurrentFolder
The folder used as last.
@ SUMO_TAG_STOP_CONTAINERSTOP
stop placed over a containerStop (used in netedit)
@ SUMO_TAG_STOP_CHARGINGSTATION
stop placed over a charging station (used in netedit)
@ SUMO_TAG_STOP_LANE
stop placed over a lane (used in netedit)
@ SUMO_TAG_POI
begin/end of the description of a Point of interest
@ SUMO_TAG_VEHICLE
description of a vehicle
@ GNE_TAG_FLOW_ROUTE
a flow definition using a route instead of a from-to edges route (used in NETEDIT)
@ SUMO_TAG_FLOW
a flow definitio nusing a from-to edges instead of a route (used by router)
@ SUMO_TAG_ROUTE
begin/end of the description of a route
@ SUMO_TAG_POLY
begin/end of the description of a polygon
@ SUMO_TAG_STOP_BUSSTOP
stop placed over a busStop (used in netedit)
@ SUMO_TAG_POILANE
begin/end of the description of a Point of interest over Lane (used by Netedit)
@ SUMO_TAG_STOP_PARKINGAREA
stop placed over a parking area (used in netedit)
@ SUMO_TAG_TRIP
a single trip definition (used by router)
The main window of the Netedit.
GNEUndoList * getUndoList()
get pointer to undoList
GNEApplicationWindowHelper::ToolbarsGrip & getToolbarsGrip()
get ToolbarsGrip
const std::map< SumoXMLTag, std::map< std::string, GNEAdditional * > > & getAdditionals() const
const std::map< SumoXMLTag, std::map< std::string, GNEDemandElement * > > & getDemandElements() const
const std::map< SumoXMLTag, std::map< std::string, GNEShape * > > & getShapes() const
A NBNetBuilder extended by visualisation and editing capabilities.
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
retrieve all attribute carriers of Net
std::vector< GNEJunction * > retrieveJunctions(bool onlySelected=false)
return all junctions
std::vector< GNEEdge * > retrieveEdges(bool onlySelected=false)
return all edges
long p_onUpdUndo(FXObject *, FXSelector, void *)
long p_onUpdRedo(FXObject *, FXSelector, void *)
event after Redo
GNENet * getNet() const
get the net object
GNEDialogACChooser * ACChooserStops
pointer to ACChooser dialog used for locate stops
GNEDialogACChooser * ACChooserEdges
pointer to ACChooser dialog used for locate edges
GNEDialogACChooser * ACChooserPolygon
pointer to ACChooser dialog used for locate Polygons
GNEDialogACChooser * ACChooserPOI
pointer to ACChooser dialog used for locate POIs
GNEDialogACChooser * ACChooserRoutes
pointer to ACChooser dialog used for locate routes
GNEDialogACChooser * ACChooserJunction
pointer to ACChooser dialog used for locate junctions
GNEDialogACChooser * ACChooserVehicles
pointer to ACChooser dialog used for locate vehicles
GNEDialogACChooser * ACChooserTLS
pointer to ACChooser dialog used for locate TLSs
GNEDialogACChooser * ACChooserProhibition
pointer to ACChooser dialog used for locate Prohibitions
GNEDialogACChooser * ACChooserPersons
pointer to ACChooser dialog used for locate persons
GNEDialogACChooser * ACChooserAdditional
pointer to ACChooser dialog used for locate additional
CommonFrames()
constructor
GNEMoveFrame * moveFrame
frame for move elements
GNEFrame * getCurrentShownFrame() const
get current common frame show
bool isCommonFrameShown() const
return true if at least there is a common frame shown
GNEDeleteFrame * deleteFrame
frame for delete elemetns
void buildCommonFrames(GNEViewParent *viewParent, GNEViewNet *viewNet)
build common frames
GNESelectorFrame * selectorFrame
frame for select elements
void hideCommonFrames()
hide common frames
GNEInspectorFrame * inspectorFrame
frame for inspect elements
void setCommonFramesWidth(int frameWidth)
set new width in all common frames
GNEEdgeDataFrame * edgeDataFrame
frame for DATA_EDGEDATA
void setDataFramesWidth(int frameWidth)
set new width in all data frames
GNEFrame * getCurrentShownFrame() const
get current data frame show
GNETAZRelDataFrame * TAZRelDataFrame
frame for DATA_TAZRELDATA
GNEEdgeRelDataFrame * edgeRelDataFrame
frame for DATA_EDGERELDATA
bool isDataFrameShown() const
return true if at least there is a data frame shown
void hideDataFrames()
hide data frames
void buildDataFrames(GNEViewParent *viewParent, GNEViewNet *viewNet)
build data frames
GNEPersonFrame * personFrame
frame for DEMAND_PERSON
DemandFrames()
constructor
GNEStopFrame * stopFrame
frame for DEMAND_STOP
GNERouteFrame * routeFrame
frame for DEMAND_ROUTE
GNEVehicleTypeFrame * vehicleTypeFrame
frame for DEMAND_VEHICLETYPE
GNEVehicleFrame * vehicleFrame
frame for DEMAND_VEHICLE
GNEFrame * getCurrentShownFrame() const
get current demand frame show
void setDemandFramesWidth(int frameWidth)
set new width in all demand frames
void buildDemandFrames(GNEViewParent *viewParent, GNEViewNet *viewNet)
build demand frames
GNEPersonPlanFrame * personPlanFrame
frame for DEMAND_PERSONPLAN
bool isDemandFrameShown() const
return true if at least there is a demand frame shown
GNEPersonTypeFrame * personTypeFrame
frame for DEMAND_PERSONTYPE
void hideDemandFrames()
hide demand frames
GNEAdditionalFrame * additionalFrame
frame for NETWORK_ADDITIONAL
NetworkFrames()
constructor
bool isNetworkFrameShown() const
return true if at least there is a network frame shown
GNEPolygonFrame * polygonFrame
frame for NETWORK_POLYGON
GNECrossingFrame * crossingFrame
frame for NETWORK_CROSSING
GNEConnectorFrame * connectorFrame
frame for NETWORK_CONNECT
GNECreateEdgeFrame * createEdgeFrame
frame for NETWORK_CREATEDGE
GNEProhibitionFrame * prohibitionFrame
frame for NETWORK_PROHIBITION
GNETAZFrame * TAZFrame
frame for NETWORK_TAZ
GNETLSEditorFrame * TLSEditorFrame
frame for NETWORK_TLS
GNEFrame * getCurrentShownFrame() const
get current network frame show
void hideNetworkFrames()
hide network frames
void setNetworkFramesWidth(int frameWidth)
set new width in all network frames
void buildNetworkFrames(GNEViewParent *viewParent, GNEViewNet *viewNet)
build network frames
A single child window which contains a view of the simulation area.
long onCmdMakeSnapshot(FXObject *sender, FXSelector, void *)
GNECrossingFrame * getCrossingFrame() const
get frame for NETWORK_CROSSING
GUIMainWindow * getGUIMainWindow() const
get GUIMainWindow App
GNEConnectorFrame * getConnectorFrame() const
get frame for NETWORK_CONNECT
GNEStopFrame * getStopFrame() const
get frame for DEMAND_STOP
void updateUndoRedoButtons()
update toolbar undo/redo buttons (called when user press Ctrl+Z/Y)
long onCmdUpdateFrameAreaWidth(FXObject *, FXSelector, void *)
Called when user change the splitter between FrameArea and ViewNet.
GNEProhibitionFrame * getProhibitionFrame() const
get frame for NETWORK_PROHIBITION
long onKeyPress(FXObject *o, FXSelector sel, void *data)
Called when user press a key.
GNEPersonPlanFrame * getPersonPlanFrame() const
get frame for DEMAND_PERSONFRAME
DemandFrames myDemandFrames
struct for demand frames
GNEPolygonFrame * getPolygonFrame() const
get frame for NETWORK_POLYGON
GNETAZRelDataFrame * getTAZRelDataFrame() const
get frame for DATA_TAZRELDATA
GNEMoveFrame * getMoveFrame() const
get frame for move elements
long onCmdClose(FXObject *, FXSelector, void *)
Called when the user hits the close button (x)
GNESelectorFrame * getSelectorFrame() const
get frame for select elements
void hideFramesArea()
hide frames area if all GNEFrames are hidden
FXButton * myRedoButton
toolbar redo button
GNEEdgeDataFrame * getEdgeDataFrame() const
get frame for DATA_EDGEDATA
GNEDeleteFrame * getDeleteFrame() const
get frame for delete elements
NetworkFrames myNetworkFrames
struct for network frames
ACChoosers myACChoosers
struct for ACChoosers
GNEVehicleFrame * getVehicleFrame() const
get frame for DEMAND_VEHICLE
void showFramesArea()
show frames area if at least a GNEFrame is showed
FXButton * myUndoButton
toolbar undo button
void hideAllFrames()
hide all frames
GNETAZFrame * getTAZFrame() const
get frame for NETWORK_TAZ
GNETLSEditorFrame * getTLSEditorFrame() const
get frame for NETWORK_TLS
CommonFrames myCommonFrames
struct for common frames
GNEApplicationWindow * getGNEAppWindows() const
get GNE Application Windows
DataFrames myDataFrames
struct for data frames
GNEAdditionalFrame * getAdditionalFrame() const
get frame for NETWORK_ADDITIONAL
FXHorizontalFrame * myFramesArea
frame to hold GNEFrames
GNEPersonFrame * getPersonFrame() const
get frame for DEMAND_PERSON
void eraseACChooserDialog(GNEDialogACChooser *chooserDialog)
remove created chooser dialog
GNEInspectorFrame * getInspectorFrame() const
get frame for inspect elements
GNEVehicleTypeFrame * getVehicleTypeFrame() const
get frame for DEMAND_VEHICLETYPE
GNEApplicationWindow * myGNEAppWindows
pointer to GNEApplicationWindow
GNEEdgeRelDataFrame * getEdgeRelDataFrame() const
get frame for DATA_EDGERELDATA
GNEPersonTypeFrame * getPersonTypeFrame() const
get frame for DEMAND_PERSONTYPE
GNECreateEdgeFrame * getCreateEdgeFrame() const
get frame for NETWORK_CREATEEDGE
GNERouteFrame * getRouteFrame() const
get frame for DEMAND_ROUTE
GNEFrame * getCurrentShownFrame() const
get current frame (note: it can be null)
long onCmdLocate(FXObject *, FXSelector, void *)
locator-callback
~GNEViewParent()
Destructor.
long onKeyRelease(FXObject *o, FXSelector sel, void *data)
Called when user releases a key.
virtual void create()
create GUIGlChildWindow
GUISUMOAbstractView * myView
The view.
FXMenuButton * myLocatorButton
The locator button.
FXPopup * myLocatorPopup
The locator menu.
GUIMainWindow * myParent
The parent window.
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
void removeGLChild(GUIGlChildWindow *child)
removes the given child window from the list (GUIGlChildWindow)
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 long onKeyPress(FXObject *o, FXSelector sel, void *data)
keyboard functions
virtual long onKeyRelease(FXObject *o, FXSelector sel, void *data)
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.
C++ TraCI client API implementation.