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-2016 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 // ===========================================================================
39 // class declarations
40 // ===========================================================================
42 class Position;
43 
44 
45 // ===========================================================================
46 // class definitions
47 // ===========================================================================
52 class GUIDialog_EditViewport : public FXDialogBox {
53  // FOX-declarations
54  FXDECLARE(GUIDialog_EditViewport)
55 public:
57  enum {
58  MID_CHANGED = FXDialogBox::ID_LAST,
63  };
64 
65 
72  GUIDialog_EditViewport(GUISUMOAbstractView* parent, const char* name,
73  int x, int y);
74 
75 
78 
79 
80 
83 
85  long onCmdChanged(FXObject*, FXSelector, void*);
86 
88  long onCmdOk(FXObject*, FXSelector, void*);
89 
91  long onCmdCancel(FXObject*, FXSelector, void*);
92 
94  long onCmdLoad(FXObject*, FXSelector, void*);
95 
97  long onCmdSave(FXObject*, FXSelector, void*);
99 
101  void writeXML(OutputDevice& dev);
102 
108  void setValues(SUMOReal zoom, SUMOReal xoff, SUMOReal yoff);
109 
110 
115  void setValues(const Position& lookFrom, const Position& lookAt);
116 
117 
122  void setOldValues(const Position& lookFrom, const Position& lookAt);
123 
124 
128  bool haveGrabbed() const;
129 
130 
131 protected:
134 
137 
139  FXRealSpinDial* myZoom, *myXOff, *myYOff, *myZOff;
140 
141 #ifdef HAVE_OSG
142  FXRealSpinDial* myLookAtX, *myLookAtY, *myLookAtZ;
144 #endif
145 
146 
147 protected:
150 
151 };
152 
153 
154 #endif
155 
156 /****************************************************************************/
157 
void setValues(SUMOReal zoom, SUMOReal xoff, SUMOReal yoff)
Sets the given values into the dialog.
long onCmdOk(FXObject *, FXSelector, void *)
Called when the user wants to keep the viewport.
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.
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.
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:71
#define SUMOReal
Definition: config.h:213
A dialog to change the viewport.
bool haveGrabbed() const
Returns the information whether one of the spin dialers is grabbed.
void setOldValues(const Position &lookFrom, const Position &lookAt)
Resets old values.