87 FXGLCanvas* share,
GNENet* net, const
bool newNet,
GNEUndoList* undoList, FXIcon* ic, FXuint opts, FXint x, FXint y, FXint w, FXint h) :
88 GUIGlChildWindow(p, parentWindow, mdimenu, name, parentWindow->getToolbarsGrip().navigation, ic, opts, x, y, w, h),
89 myGNEAppWindows(parentWindow) {
91 myParent->addGLChild(
this);
113 myFramesArea->setWidth(220);
119 FXComposite* tmp =
new FXComposite(
this);
122 GNEViewNet* viewNet =
new GNEViewNet(tmp, myViewArea, *myParent,
this, net, newNet, undoList, myParent->getGLVisual(), share);
125 myGNEAppWindows->getToolbarsGrip().buildMenuToolbarsGrip();
131 myCommonFrames.buildCommonFrames(
this, viewNet);
132 myNetworkFrames.buildNetworkFrames(
this, viewNet);
133 myDemandFrames.buildDemandFrames(
this, viewNet);
134 myDataFrames.buildDataFrames(
this, viewNet);
137 onCmdUpdateFrameAreaWidth(
nullptr, 0,
nullptr);
143 myView->buildViewToolBars(
this);
363 if (chooserDialog ==
nullptr) {
403 FXFileDialog opendialog(
this,
"Save Snapshot");
405 opendialog.setSelectMode(SELECTFILE_ANY);
406 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"
407 "GIF Image (*.gif)\nBMP Image (*.bmp)\nXPM Image (*.xpm)\nPCX Image (*.pcx)\nICO Image (*.ico)\n"
408 "RGB Image (*.rgb)\nXBM Image (*.xbm)\nTARGA Image (*.tga)\nPNG Image (*.png)\n"
409 "JPEG Image (*.jpg, *.jpeg)\nTIFF Image (*.tif, *.tiff)\n"
410 "Postscript (*.ps)\nEncapsulated Postscript (*.eps)\nPortable Document Format (*.pdf)\n"
411 "Scalable Vector Graphics (*.svg)\nLATEX text strings (*.tex)\nPortable LaTeX Graphics (*.pgf)\n"
420 std::string file = opendialog.getFilename().text();
421 if (file.find(
".") == std::string::npos) {
423 WRITE_MESSAGE(
"No file extension was specified - saving Snapshot as PNG.");
428 WRITE_DEBUG(
"Opening FXMessageBox 'error saving snapshot'");
430 FXMessageBox::error(
this, MBOX_OK,
"Saving failed.",
"%s", error.c_str());
432 WRITE_DEBUG(
"Closed FXMessageBox 'error saving snapshot' with 'OK'");
447 std::vector<GUIGlID> result;
457 std::vector<GNEAttributeCarrier*> ACsToLocate;
458 int messageId = FXSELID(sel);
469 ACsToLocate.push_back(junction.second);
484 ACsToLocate.push_back(edge.second);
503 ACsToLocate.push_back(vehicle);
507 ACsToLocate.push_back(trip);
511 ACsToLocate.push_back(flowRoute);
515 ACsToLocate.push_back(flow);
532 ACsToLocate.push_back(person);
536 ACsToLocate.push_back(personFlow);
552 ACsToLocate.push_back(route);
572 ACsToLocate.push_back(stopLane);
576 ACsToLocate.push_back(stopBusStop);
580 ACsToLocate.push_back(stopContainerStop);
584 ACsToLocate.push_back(stopChargingStation);
588 ACsToLocate.push_back(stopParkingArea);
603 if (junction.second->getNBNode()->getControllingTLS().size() > 0) {
604 ACsToLocate.push_back(junction.second);
619 for (
const auto& additional : additionalTag.second) {
620 ACsToLocate.push_back(additional);
635 ACsToLocate.push_back(
POI);
649 ACsToLocate.push_back(polygon);
652 ACsToLocate.push_back(taz);
659 throw ProcessError(
"Unknown Message ID in onCmdLocate");
700 inspectorFrame(nullptr),
701 deleteFrame(nullptr),
702 selectorFrame(nullptr),
718 inspectorFrame->hide();
720 selectorFrame->hide();
728 inspectorFrame->setFrameWidth(frameWidth);
729 deleteFrame->setFrameWidth(frameWidth);
730 selectorFrame->setFrameWidth(frameWidth);
731 moveFrame->setFrameWidth(frameWidth);
738 if (inspectorFrame->shown()) {
740 }
else if (deleteFrame->shown()) {
742 }
else if (selectorFrame->shown()) {
744 }
else if (moveFrame->shown()) {
755 if (inspectorFrame->shown()) {
756 return inspectorFrame;
757 }
else if (deleteFrame->shown()) {
759 }
else if (selectorFrame->shown()) {
760 return selectorFrame;
761 }
else if (moveFrame->shown()) {
773 connectorFrame(nullptr),
774 TLSEditorFrame(nullptr),
775 additionalFrame(nullptr),
776 crossingFrame(nullptr),
778 polygonFrame(nullptr),
779 prohibitionFrame(nullptr),
780 createEdgeFrame(nullptr) {
799 connectorFrame->hide();
800 TLSEditorFrame->hide();
801 additionalFrame->hide();
802 crossingFrame->hide();
804 polygonFrame->hide();
805 prohibitionFrame->hide();
806 createEdgeFrame->hide();
813 connectorFrame->setFrameWidth(frameWidth);
814 TLSEditorFrame->setFrameWidth(frameWidth);
815 additionalFrame->setFrameWidth(frameWidth);
816 crossingFrame->setFrameWidth(frameWidth);
817 TAZFrame->setFrameWidth(frameWidth);
818 polygonFrame->setFrameWidth(frameWidth);
819 prohibitionFrame->setFrameWidth(frameWidth);
820 createEdgeFrame->setFrameWidth(frameWidth);
827 if (connectorFrame->shown()) {
829 }
else if (TLSEditorFrame->shown()) {
831 }
else if (additionalFrame->shown()) {
833 }
else if (crossingFrame->shown()) {
835 }
else if (TAZFrame->shown()) {
837 }
else if (polygonFrame->shown()) {
839 }
else if (prohibitionFrame->shown()) {
841 }
else if (createEdgeFrame->shown()) {
852 if (connectorFrame->shown()) {
853 return connectorFrame;
854 }
else if (TLSEditorFrame->shown()) {
855 return TLSEditorFrame;
856 }
else if (additionalFrame->shown()) {
857 return additionalFrame;
858 }
else if (crossingFrame->shown()) {
859 return crossingFrame;
860 }
else if (TAZFrame->shown()) {
862 }
else if (polygonFrame->shown()) {
864 }
else if (prohibitionFrame->shown()) {
865 return prohibitionFrame;
866 }
else if (createEdgeFrame->shown()) {
867 return createEdgeFrame;
879 vehicleFrame(nullptr),
880 vehicleTypeFrame(nullptr),
882 personFrame(nullptr),
883 personPlanFrame(nullptr),
884 containerFrame(nullptr),
885 containerPlanFrame(nullptr) {
905 vehicleFrame->hide();
906 vehicleTypeFrame->hide();
909 personPlanFrame->hide();
910 containerFrame->hide();
911 containerPlanFrame->hide();
918 routeFrame->setFrameWidth(frameWidth);
919 vehicleFrame->setFrameWidth(frameWidth);
920 vehicleTypeFrame->setFrameWidth(frameWidth);
921 stopFrame->setFrameWidth(frameWidth);
922 personFrame->setFrameWidth(frameWidth);
923 personPlanFrame->setFrameWidth(frameWidth);
924 containerFrame->setFrameWidth(frameWidth);
925 containerPlanFrame->setFrameWidth(frameWidth);
932 if (routeFrame->shown()) {
934 }
else if (vehicleFrame->shown()) {
936 }
else if (vehicleTypeFrame->shown()) {
938 }
else if (stopFrame->shown()) {
940 }
else if (personFrame->shown()) {
942 }
else if (personPlanFrame->shown()) {
944 }
else if (containerFrame->shown()) {
946 }
else if (containerPlanFrame->shown()) {
957 if (routeFrame->shown()) {
959 }
else if (vehicleFrame->shown()) {
961 }
else if (vehicleTypeFrame->shown()) {
962 return vehicleTypeFrame;
963 }
else if (stopFrame->shown()) {
965 }
else if (personFrame->shown()) {
967 }
else if (personPlanFrame->shown()) {
968 return personPlanFrame;
969 }
else if (containerFrame->shown()) {
970 return containerFrame;
971 }
else if (containerPlanFrame->shown()) {
972 return containerPlanFrame;
983 edgeDataFrame(nullptr),
984 edgeRelDataFrame(nullptr),
985 TAZRelDataFrame(nullptr) {
999 edgeDataFrame->hide();
1000 edgeRelDataFrame->hide();
1001 TAZRelDataFrame->hide();
1008 edgeDataFrame->setFrameWidth(frameWidth);
1009 edgeRelDataFrame->setFrameWidth(frameWidth);
1010 TAZRelDataFrame->setFrameWidth(frameWidth);
1017 if (edgeDataFrame->shown()) {
1019 }
else if (edgeRelDataFrame->shown()) {
1021 }
else if (TAZRelDataFrame->shown()) {
1032 if (edgeDataFrame->shown()) {
1033 return edgeDataFrame;
1034 }
else if (edgeRelDataFrame->shown()) {
1035 return edgeRelDataFrame;
1036 }
else if (TAZRelDataFrame->shown()) {
1037 return TAZRelDataFrame;
1048 ACChooserJunction(nullptr),
1049 ACChooserEdges(nullptr),
1050 ACChooserVehicles(nullptr),
1051 ACChooserPersons(nullptr),
1052 ACChooserRoutes(nullptr),
1053 ACChooserStops(nullptr),
1054 ACChooserTLS(nullptr),
1055 ACChooserAdditional(nullptr),
1056 ACChooserPOI(nullptr),
1057 ACChooserPolygon(nullptr),
1058 ACChooserProhibition(nullptr) {
1064 if (ACChooserJunction) {
1065 delete ACChooserJunction;
1067 if (ACChooserEdges) {
1068 delete ACChooserEdges;
1070 if (ACChooserRoutes) {
1071 delete ACChooserRoutes;
1073 if (ACChooserStops) {
1074 delete ACChooserStops;
1076 if (ACChooserVehicles) {
1077 delete ACChooserVehicles;
1079 if (ACChooserPersons) {
1080 delete ACChooserPersons;
1083 delete ACChooserTLS;
1085 if (ACChooserAdditional) {
1086 delete ACChooserAdditional;
1089 delete ACChooserPOI;
1091 if (ACChooserPolygon) {
1092 delete ACChooserPolygon;
1094 if (ACChooserProhibition) {
1095 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.
@ MID_GNE_TOOLBAREDIT_COMPUTEPATHMANAGER
compute path manager
#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.
#define WRITE_MESSAGE(msg)
@ SUMO_TAG_STOP_CONTAINERSTOP
stop placed over a containerStop (used in netedit)
@ SUMO_TAG_TAZ
a traffic assignment zone
@ 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_STOP_PARKINGAREA
stop placed over a parking area (used in netedit)
@ SUMO_TAG_TRIP
a single trip definition (used by router)
#define UNUSED_PARAMETER(x)
The main window of the Netedit.
GNEUndoList * getUndoList()
get pointer to undoList
GNEApplicationWindowHelper::ToolbarsGrip & getToolbarsGrip()
get ToolbarsGrip
const std::map< SumoXMLTag, std::set< GNEDemandElement * > > & getDemandElements() const
get demand elements
const std::map< std::string, GNEEdge * > & getEdges() const
map with the ID and pointer to edges of net
const std::map< SumoXMLTag, std::set< GNETAZElement * > > & getTAZElements() const
get TAZElements
const std::map< SumoXMLTag, std::set< GNEShape * > > & getShapes() const
get shapes
const std::map< SumoXMLTag, std::set< GNEAdditional * > > & getAdditionals() const
get additionals
const std::map< std::string, GNEJunction * > & getJunctions() const
get junctions
A NBNetBuilder extended by visualisation and editing capabilities.
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
long onUpdUndo(FXObject *, FXSelector, void *)
event after Undo
long 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
GNEContainerFrame * containerFrame
frame for DEMAND_CONTAINER
GNEContainerPlanFrame * containerPlanFrame
frame for DEMAND_CONTAINERPLAN
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
GNETypeFrame * vehicleTypeFrame
frame for DEMAND_VEHICLETYPE
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
GNEContainerPlanFrame * getContainerPlanFrame() const
get frame for DEMAND_CONTAINERFRAME
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
GNETypeFrame * getTypeFrame() const
get frame for DEMAND_VEHICLETYPE
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
GNEContainerFrame * getContainerFrame() const
get frame for DEMAND_CONTAINER
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
GNEApplicationWindow * myGNEAppWindows
pointer to GNEApplicationWindow
GNEEdgeRelDataFrame * getEdgeRelDataFrame() const
get frame for DATA_EDGERELDATA
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)
std::vector< GUIGlID > getObjectIDs(int messageId) const
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.