SUMO - Simulation of Urban MObility
GUIDialog_EditViewport.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
18 // A dialog to change the viewport
19 /****************************************************************************/
20 #ifndef GUIDialog_EditViewport_h
21 #define GUIDialog_EditViewport_h
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
33 #include <fx.h>
35 
36 // ===========================================================================
37 // class declarations
38 // ===========================================================================
40 class Position;
41 
42 
43 // ===========================================================================
44 // class definitions
45 // ===========================================================================
50 class GUIDialog_EditViewport : public FXDialogBox {
51  // FOX-declarations
52  FXDECLARE(GUIDialog_EditViewport)
53 public:
55  enum {
56  MID_CHANGED = FXDialogBox::ID_LAST,
61  };
62 
63 
70  GUIDialog_EditViewport(GUISUMOAbstractView* parent, const char* name, int x, int y);
71 
74 
76  void show();
77 
80 
82  long onCmdChanged(FXObject*, FXSelector, void*);
83 
85  long onCmdOk(FXObject*, FXSelector, void*);
86 
88  long onCmdCancel(FXObject*, FXSelector, void*);
89 
91  long onCmdLoad(FXObject*, FXSelector, void*);
92 
94  long onCmdSave(FXObject*, FXSelector, void*);
96 
98  void writeXML(OutputDevice& dev);
99 
105  void setValues(double zoom, double xoff, double yoff);
106 
111  void setValues(const Position& lookFrom, const Position& lookAt);
112 
117  void setOldValues(const Position& lookFrom, const Position& lookAt);
118 
122  bool haveGrabbed() const;
123 
124 
125 protected:
128 
131 
133  FXRealSpinDial* myZoom, *myXOff, *myYOff, *myZOff;
134 
136  FXButton* buttonOk;
137 
138 #ifdef HAVE_OSG
139  FXRealSpinDial* myLookAtX, *myLookAtY, *myLookAtZ;
141 #endif
142 
143 
144 protected:
147 
148 };
149 
150 
151 #endif
152 
153 /****************************************************************************/
154 
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:45
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:70
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.