SUMO - Simulation of Urban MObility
GUIDialog_EditViewport.h
Go to the documentation of this file.
1 /****************************************************************************/
8 // A dialog to change the viewport
9 /****************************************************************************/
10 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
11 // Copyright (C) 2001-2017 DLR (http://www.dlr.de/) and contributors
12 /****************************************************************************/
13 //
14 // This file is part of SUMO.
15 // SUMO is free software: you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation, either version 3 of the License, or
18 // (at your option) any later version.
19 //
20 /****************************************************************************/
21 #ifndef GUIDialog_EditViewport_h
22 #define GUIDialog_EditViewport_h
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 #include <fx.h>
36 
37 // ===========================================================================
38 // class declarations
39 // ===========================================================================
41 class Position;
42 
43 
44 // ===========================================================================
45 // class definitions
46 // ===========================================================================
51 class GUIDialog_EditViewport : public FXDialogBox {
52  // FOX-declarations
53  FXDECLARE(GUIDialog_EditViewport)
54 public:
56  enum {
57  MID_CHANGED = FXDialogBox::ID_LAST,
62  };
63 
64 
71  GUIDialog_EditViewport(GUISUMOAbstractView* parent, const char* name, int x, int y);
72 
75 
77  void show();
78 
81 
83  long onCmdChanged(FXObject*, FXSelector, void*);
84 
86  long onCmdOk(FXObject*, FXSelector, void*);
87 
89  long onCmdCancel(FXObject*, FXSelector, void*);
90 
92  long onCmdLoad(FXObject*, FXSelector, void*);
93 
95  long onCmdSave(FXObject*, FXSelector, void*);
97 
99  void writeXML(OutputDevice& dev);
100 
106  void setValues(double zoom, double xoff, double yoff);
107 
112  void setValues(const Position& lookFrom, const Position& lookAt);
113 
118  void setOldValues(const Position& lookFrom, const Position& lookAt);
119 
123  bool haveGrabbed() const;
124 
125 
126 protected:
129 
132 
134  FXRealSpinDial* myZoom, *myXOff, *myYOff, *myZOff;
135 
137  FXButton* buttonOk;
138 
139 #ifdef HAVE_OSG
140  FXRealSpinDial* myLookAtX, *myLookAtY, *myLookAtZ;
142 #endif
143 
144 
145 protected:
148 
149 };
150 
151 
152 #endif
153 
154 /****************************************************************************/
155 
long onCmdOk(FXObject *, FXSelector, void *)
Called when the user wants to keep the viewport.
bool haveGrabbed() const
Returns the information whether one of the spin dialers is grabbed.
long onCmdCancel(FXObject *, FXSelector, void *)
Called when the user wants to restore the viewport.
long onCmdChanged(FXObject *, FXSelector, void *)
Called when the user changes the viewport.
void writeXML(OutputDevice &dev)
write the settings to the given device
long onCmdLoad(FXObject *, FXSelector, void *)
Called when the user wants to load a viewport.
FXRealSpinDial * myZoom
The spin dialers used to change the view.
FXButton * buttonOk
OK button.
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:46
GUIDialog_EditViewport()
FOX needs this.
long onCmdSave(FXObject *, FXSelector, void *)
Called when the user wants to save a viewport.
GUISUMOAbstractView * myParent
The calling view.
Position myOldLookFrom
The old viewport.
void show()
overload show function to focus always in OK Button
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:71
A dialog to change the viewport.
void setValues(double zoom, double xoff, double yoff)
Sets the given values into the dialog.
void setOldValues(const Position &lookFrom, const Position &lookAt)
Resets old values.