 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
85 FXGLCanvas* share,
GNENet* net,
GNEUndoList* undoList, FXIcon* ic, FXuint opts, FXint x, FXint y, FXint w, FXint h) :
86 GUIGlChildWindow(p, parentWindow, mdimenu, name, parentWindow->getToolbarsGrip().navigation, ic, opts, x, y, w, h),
87 myGNEAppWindows(parentWindow) {
89 myParent->addGLChild(
this);
105 myFramesArea->setWidth(220);
111 FXComposite* tmp =
new FXComposite(
this);
114 GNEViewNet* viewNet =
new GNEViewNet(tmp, myViewArea, *myParent,
this, net, undoList, myParent->getGLVisual(), share);
117 myGNEAppWindows->getToolbarsGrip().buildMenuToolbarsGrip();
130 myFrames.TAZFrame =
new GNETAZFrame(myFramesArea, viewNet);
136 myFrames.routeFrame =
new GNERouteFrame(myFramesArea, viewNet);
139 myFrames.stopFrame =
new GNEStopFrame(myFramesArea, viewNet);
145 onCmdUpdateFrameAreaWidth(
nullptr, 0,
nullptr);
151 myView->buildViewToolBars(*
this);
320 if (chooserDialog ==
nullptr) {
351 FXFileDialog opendialog(
this,
"Save Snapshot");
353 opendialog.setSelectMode(SELECTFILE_ANY);
354 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"
355 "GIF Image (*.gif)\nBMP Image (*.bmp)\nXPM Image (*.xpm)\nPCX Image (*.pcx)\nICO Image (*.ico)\n"
356 "RGB Image (*.rgb)\nXBM Image (*.xbm)\nTARGA Image (*.tga)\nPNG Image (*.png)\n"
357 "JPEG Image (*.jpg, *.jpeg)\nTIFF Image (*.tif, *.tiff)\n"
358 "Postscript (*.ps)\nEncapsulated Postscript (*.eps)\nPortable Document Format (*.pdf)\n"
359 "Scalable Vector Graphics (*.svg)\nLATEX text strings (*.tex)\nPortable LaTeX Graphics (*.pgf)\n"
368 std::string file = opendialog.getFilename().text();
372 WRITE_DEBUG(
"Opening FXMessageBox 'error saving snapshot'");
374 FXMessageBox::error(
this, MBOX_OK,
"Saving failed.",
"%s", error.c_str());
376 WRITE_DEBUG(
"Closed FXMessageBox 'error saving snapshot' with 'OK'");
395 std::vector<GNEAttributeCarrier*> ACsToLocate;
396 switch (FXSELID(sel)) {
404 ACsToLocate.reserve(junctions.size());
405 for (
auto i : junctions) {
406 ACsToLocate.push_back(i);
419 ACsToLocate.reserve(edges.size());
420 for (
auto i : edges) {
421 ACsToLocate.push_back(i);
439 ACsToLocate.push_back(i.second);
443 ACsToLocate.push_back(i.second);
447 ACsToLocate.push_back(i.second);
451 ACsToLocate.push_back(i.second);
466 ACsToLocate.push_back(i.second);
485 ACsToLocate.push_back(i.second);
489 ACsToLocate.push_back(i.second);
493 ACsToLocate.push_back(i.second);
497 ACsToLocate.push_back(i.second);
501 ACsToLocate.push_back(i.second);
514 ACsToLocate.reserve(junctions.size());
515 for (
auto i : junctions) {
516 if (i->getNBNode()->getControllingTLS().size() > 0) {
517 ACsToLocate.push_back(i);
531 ACsToLocate.reserve(additionals.size());
532 for (
auto i : additionals) {
533 ACsToLocate.push_back(i);
546 ACsToLocate.push_back(dynamic_cast<GNEAttributeCarrier*>(i.second));
559 ACsToLocate.push_back(dynamic_cast<GNEAttributeCarrier*>(i.second));
566 throw ProcessError(
"Unknown Message ID in onCmdLocate");
603 inspectorFrame(nullptr),
604 selectorFrame(nullptr),
605 connectorFrame(nullptr),
606 TLSEditorFrame(nullptr),
607 additionalFrame(nullptr),
608 crossingFrame(nullptr),
610 deleteFrame(nullptr),
611 polygonFrame(nullptr),
612 prohibitionFrame(nullptr),
613 createEdgeFrame(nullptr),
615 vehicleFrame(nullptr),
616 vehicleTypeFrame(nullptr),
618 personFrame(nullptr),
619 personTypeFrame(nullptr),
620 personPlanFrame(nullptr) {
626 inspectorFrame->hide();
627 selectorFrame->hide();
628 connectorFrame->hide();
629 TLSEditorFrame->hide();
630 additionalFrame->hide();
631 crossingFrame->hide();
634 polygonFrame->hide();
635 prohibitionFrame->hide();
640 vehicleFrame->hide();
641 vehicleTypeFrame->hide();
643 personTypeFrame->hide();
645 personPlanFrame->hide();
652 inspectorFrame->setFrameWidth(frameWidth);
653 selectorFrame->setFrameWidth(frameWidth);
654 connectorFrame->setFrameWidth(frameWidth);
655 TLSEditorFrame->setFrameWidth(frameWidth);
656 additionalFrame->setFrameWidth(frameWidth);
657 crossingFrame->setFrameWidth(frameWidth);
658 TAZFrame->setFrameWidth(frameWidth);
659 deleteFrame->setFrameWidth(frameWidth);
660 polygonFrame->setFrameWidth(frameWidth);
661 prohibitionFrame->setFrameWidth(frameWidth);
665 routeFrame->setFrameWidth(frameWidth);
666 vehicleFrame->setFrameWidth(frameWidth);
667 vehicleTypeFrame->setFrameWidth(frameWidth);
668 stopFrame->setFrameWidth(frameWidth);
669 personTypeFrame->setFrameWidth(frameWidth);
670 personFrame->setFrameWidth(frameWidth);
671 personPlanFrame->setFrameWidth(frameWidth);
678 if (inspectorFrame->shown()) {
680 }
else if (selectorFrame->shown()) {
682 }
else if (connectorFrame->shown()) {
684 }
else if (TLSEditorFrame->shown()) {
686 }
else if (additionalFrame->shown()) {
688 }
else if (crossingFrame->shown()) {
690 }
else if (TAZFrame->shown()) {
692 }
else if (deleteFrame->shown()) {
694 }
else if (polygonFrame->shown()) {
696 }
else if (prohibitionFrame->shown()) {
702 }
else if (routeFrame->shown()) {
704 }
else if (vehicleFrame->shown()) {
706 }
else if (vehicleTypeFrame->shown()) {
708 }
else if (stopFrame->shown()) {
710 }
else if (personTypeFrame->shown()) {
712 }
else if (personFrame->shown()) {
714 }
else if (personPlanFrame->shown()) {
725 if (inspectorFrame->shown()) {
726 return inspectorFrame;
727 }
else if (selectorFrame->shown()) {
728 return selectorFrame;
729 }
else if (connectorFrame->shown()) {
730 return connectorFrame;
731 }
else if (TLSEditorFrame->shown()) {
732 return TLSEditorFrame;
733 }
else if (additionalFrame->shown()) {
734 return additionalFrame;
735 }
else if (crossingFrame->shown()) {
736 return crossingFrame;
737 }
else if (TAZFrame->shown()) {
739 }
else if (deleteFrame->shown()) {
741 }
else if (polygonFrame->shown()) {
743 }
else if (prohibitionFrame->shown()) {
744 return prohibitionFrame;
749 }
else if (routeFrame->shown()) {
751 }
else if (vehicleFrame->shown()) {
753 }
else if (vehicleTypeFrame->shown()) {
754 return vehicleTypeFrame;
755 }
else if (personTypeFrame->shown()) {
756 return personTypeFrame;
757 }
else if (stopFrame->shown()) {
759 }
else if (personFrame->shown()) {
761 }
else if (personPlanFrame->shown()) {
762 return personPlanFrame;
773 ACChooserJunction(nullptr),
774 ACChooserEdges(nullptr),
775 ACChooserVehicles(nullptr),
776 ACChooserRoutes(nullptr),
777 ACChooserStops(nullptr),
778 ACChooserTLS(nullptr),
779 ACChooserAdditional(nullptr),
780 ACChooserPOI(nullptr),
781 ACChooserPolygon(nullptr),
782 ACChooserProhibition(nullptr) {
788 if (ACChooserJunction) {
789 delete ACChooserJunction;
791 if (ACChooserEdges) {
792 delete ACChooserEdges;
794 if (ACChooserRoutes) {
795 delete ACChooserRoutes;
797 if (ACChooserStops) {
798 delete ACChooserStops;
800 if (ACChooserVehicles) {
801 delete ACChooserVehicles;
806 if (ACChooserAdditional) {
807 delete ACChooserAdditional;
812 if (ACChooserPolygon) {
813 delete ACChooserPolygon;
815 if (ACChooserProhibition) {
816 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
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
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.
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
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)
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
#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
std::string makeSnapshot(const std::string &destFile, const int width=-1, const int height=-1)
Takes a snapshots and writes it into the given file.
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
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