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-2018 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
16 // A dialog to change the viewport
17 /****************************************************************************/
18 #ifndef GUIDialog_EditViewport_h
19 #define GUIDialog_EditViewport_h
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #include <config.h>
26 
27 #include <fx.h>
28 
29 // ===========================================================================
30 // class declarations
31 // ===========================================================================
33 class Position;
34 
35 
36 // ===========================================================================
37 // class definitions
38 // ===========================================================================
43 class GUIDialog_EditViewport : public FXDialogBox {
44  // FOX-declarations
45  FXDECLARE(GUIDialog_EditViewport)
46 public:
48  enum {
49  MID_CHANGED = FXDialogBox::ID_LAST,
54  };
55 
56 
63  GUIDialog_EditViewport(GUISUMOAbstractView* parent, const char* name, int x, int y);
64 
67 
69  void show();
70 
73 
75  long onCmdChanged(FXObject*, FXSelector, void*);
76 
78  long onCmdOk(FXObject*, FXSelector, void*);
79 
81  long onCmdCancel(FXObject*, FXSelector, void*);
82 
84  long onCmdLoad(FXObject*, FXSelector, void*);
85 
87  long onCmdSave(FXObject*, FXSelector, void*);
89 
91  void writeXML(OutputDevice& dev);
92 
98  void setValues(double zoom, double xoff, double yoff, double rotation);
99 
104  void setValues(const Position& lookFrom, const Position& lookAt, double rotation);
105 
110  void setOldValues(const Position& lookFrom, const Position& lookAt, double rotation);
111 
115  bool haveGrabbed() const;
116 
117 protected:
120 
122  void saveWindowPos();
123 
124 private:
127 
131 
133  FXButton* myLoadButton;
134 
136  FXButton* mySaveButton;
137 
139  FXRealSpinner* myZoom, *myXOff, *myYOff, *myZOff, *myRotation;
140 
142  FXRealSpinner* myLookAtX, *myLookAtY, *myLookAtZ;
143 
145  FXButton* myOKButton;
146 
148  FXButton* myCancelButton;
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.
FXButton * myLoadButton
load button
FXRealSpinner * myZoom
The spin dialers used to change the view.
void setOldValues(const Position &lookFrom, const Position &lookAt, double rotation)
Resets old values.
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.
FXButton * mySaveButton
save button
void saveWindowPos()
save window position to the registry
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
FXRealSpinner * myLookAtX
The spin dialers used to change the view at (osg only)
GUIDialog_EditViewport()
FOX needs this.
long onCmdSave(FXObject *, FXSelector, void *)
Called when the user wants to save a viewport.
GUISUMOAbstractView * myParent
The calling view.
FXButton * myOKButton
OK button.
void setValues(double zoom, double xoff, double yoff, double rotation)
Sets the given values into the dialog.
Position myOldLookFrom
The old viewport.
void show()
overload show function to focus always in OK Button
FXButton * myCancelButton
Cancel button.
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:64
A dialog to change the viewport.