![]() |
Eclipse SUMO - Simulation of Urban MObility
|
A dialog to change the viewport. More...
#include <GUIDialog_EditViewport.h>
Public Types | |
| enum | { MID_CHANGED = FXDialogBox::ID_LAST, MID_OK, MID_CANCEL, MID_LOAD, MID_SAVE } |
| FOX-callback enumerations. More... | |
Public Member Functions | |
| GUIDialog_EditViewport (GUISUMOAbstractView *parent, const char *name, int x, int y) | |
| Constructor. More... | |
| bool | haveGrabbed () const |
| Returns the information whether one of the spin dialers is grabbed. More... | |
| void | setOldValues (const Position &lookFrom, const Position &lookAt, double rotation) |
| Resets old values. More... | |
| void | setValues (const Position &lookFrom, const Position &lookAt, double rotation) |
| Sets the given values into the dialog. More... | |
| void | setValues (double zoom, double xoff, double yoff, double rotation) |
| Sets the given values into the dialog. More... | |
| void | show () |
| overload show function to focus always in OK Button More... | |
| void | writeXML (OutputDevice &dev) |
| write the settings to the given device More... | |
| ~GUIDialog_EditViewport () | |
| Destructor. More... | |
FOX-callbacks | |
| long | onCmdChanged (FXObject *, FXSelector, void *) |
| Called when the user changes the viewport. More... | |
| long | onCmdOk (FXObject *, FXSelector, void *) |
| Called when the user wants to keep the viewport. More... | |
| long | onCmdCancel (FXObject *, FXSelector, void *) |
| Called when the user wants to restore the viewport. More... | |
| long | onCmdLoad (FXObject *, FXSelector, void *) |
| Called when the user wants to load a viewport. More... | |
| long | onCmdSave (FXObject *, FXSelector, void *) |
| Called when the user wants to save a viewport. More... | |
Protected Member Functions | |
| void | saveWindowPos () |
| save window position to the registry More... | |
Private Attributes | |
| FXButton * | myCancelButton |
| Cancel button. More... | |
| FXButton * | myLoadButton |
| load button More... | |
| FXRealSpinner * | myLookAtX |
| The spin dialers used to change the view at (osg only) More... | |
| FXRealSpinner * | myLookAtY |
| FXRealSpinner * | myLookAtZ |
| FXButton * | myOKButton |
| OK button. More... | |
| Position | myOldLookAt |
| Position | myOldLookFrom |
| The old viewport. More... | |
| double | myOldRotation |
| GUISUMOAbstractView * | myParent |
| The calling view. More... | |
| FXRealSpinner * | myRotation |
| FXButton * | mySaveButton |
| save button More... | |
| FXRealSpinner * | myXOff |
| FXRealSpinner * | myYOff |
| FXRealSpinner * | myZOff |
| FXRealSpinner * | myZoom |
| The spin dialers used to change the view. More... | |
A dialog to change the viewport.
Definition at line 42 of file GUIDialog_EditViewport.h.
| anonymous enum |
FOX-callback enumerations.
| Enumerator | |
|---|---|
| MID_CHANGED | |
| MID_OK | |
| MID_CANCEL | |
| MID_LOAD | |
| MID_SAVE | |
Definition at line 47 of file GUIDialog_EditViewport.h.
| GUIDialog_EditViewport::GUIDialog_EditViewport | ( | GUISUMOAbstractView * | parent, |
| const char * | name, | ||
| int | x, | ||
| int | y | ||
| ) |
Constructor.
| [in] | parent | The view to change |
| [in] | name | This dialog's caption |
| [in] | x | x-position to show the dialog at |
| [in] | y | y-position to show the dialog at |
Definition at line 58 of file GUIDialog_EditViewport.cpp.
References GUIIconSubSys::getIcon(), GUIDesignAuxiliarHorizontalFrame, GUIDesignAuxiliarVerticalFrame, GUIDesignButtonCancel, GUIDesignButtonOK, GUIDesignButtonToolbarWithText, GUIDesignContentsFrame, GUIDesignHorizontalFrameIcons, GUIDesignHorizontalSeparator, GUIDesignLabelCenterThick, GUIDesignLabelLeftThick, GUIDesignSpinDial, ICON_ACCEPT, ICON_CANCEL, ICON_EDITVIEWPORT, ICON_OPEN_CONFIG, ICON_SAVE, MID_CANCEL, MID_LOAD, MID_OK, and MID_SAVE.
| GUIDialog_EditViewport::~GUIDialog_EditViewport | ( | ) |
Destructor.
Definition at line 141 of file GUIDialog_EditViewport.cpp.
| bool GUIDialog_EditViewport::haveGrabbed | ( | ) | const |
Returns the information whether one of the spin dialers is grabbed.
Definition at line 294 of file GUIDialog_EditViewport.cpp.
Referenced by GUISUMOAbstractView::onMouseMove().
| long GUIDialog_EditViewport::onCmdCancel | ( | FXObject * | , |
| FXSelector | , | ||
| void * | |||
| ) |
Called when the user wants to restore the viewport.
Definition at line 176 of file GUIDialog_EditViewport.cpp.
References myOldLookAt, myOldLookFrom, myOldRotation, myParent, saveWindowPos(), and GUISUMOAbstractView::setViewportFromToRot().
| long GUIDialog_EditViewport::onCmdChanged | ( | FXObject * | o, |
| FXSelector | , | ||
| void * | |||
| ) |
Called when the user changes the viewport.
Definition at line 185 of file GUIDialog_EditViewport.cpp.
References GUISUMOAbstractView::getChanger(), Position::INVALID, myLookAtX, myLookAtY, myLookAtZ, myParent, myRotation, myXOff, myYOff, myZOff, myZoom, GUISUMOAbstractView::setViewportFromToRot(), GUIPerspectiveChanger::zoom2ZPos(), and GUIPerspectiveChanger::zPos2Zoom().
| long GUIDialog_EditViewport::onCmdLoad | ( | FXObject * | , |
| FXSelector | , | ||
| void * | |||
| ) |
Called when the user wants to load a viewport.
Definition at line 204 of file GUIDialog_EditViewport.cpp.
References GUISettingsHandler::applyViewport(), gCurrentFolder, GUISUMOAbstractView::getChanger(), GUIIconSubSys::getIcon(), GUIPerspectiveChanger::getRotation(), GUIPerspectiveChanger::getXPos(), GUIPerspectiveChanger::getYPos(), GUIPerspectiveChanger::getZoom(), ICON_EMPTY, myParent, and setValues().
| long GUIDialog_EditViewport::onCmdOk | ( | FXObject * | , |
| FXSelector | , | ||
| void * | |||
| ) |
Called when the user wants to keep the viewport.
Definition at line 157 of file GUIDialog_EditViewport.cpp.
References Position::INVALID, myLookAtX, myLookAtY, myLookAtZ, myParent, myRotation, myXOff, myYOff, myZOff, myZoom, saveWindowPos(), GUISUMOAbstractView::setViewportFromToRot(), toString(), and WRITE_DEBUG.
| long GUIDialog_EditViewport::onCmdSave | ( | FXObject * | , |
| FXSelector | , | ||
| void * | |||
| ) |
Called when the user wants to save a viewport.
Definition at line 223 of file GUIDialog_EditViewport.cpp.
References OutputDevice::close(), OutputDevice::closeTag(), gCurrentFolder, OutputDevice::getDevice(), MFXUtils::getFilename2Write(), GUIIconSubSys::getIcon(), ICON_EMPTY, OutputDevice::openTag(), SUMO_TAG_VIEWSETTINGS, and writeXML().
|
protected |
save window position to the registry
Definition at line 300 of file GUIDialog_EditViewport.cpp.
Referenced by onCmdCancel(), and onCmdOk().
| void GUIDialog_EditViewport::setOldValues | ( | const Position & | lookFrom, |
| const Position & | lookAt, | ||
| double | rotation | ||
| ) |
Resets old values.
| [in] | lookFrom | Current viewport's from |
| [in] | lookAt | Current viewport's at |
Definition at line 285 of file GUIDialog_EditViewport.cpp.
References myOldLookAt, myOldLookFrom, myOldRotation, and setValues().
Referenced by GUISUMOAbstractView::showViewportEditor().
| void GUIDialog_EditViewport::setValues | ( | const Position & | lookFrom, |
| const Position & | lookAt, | ||
| double | rotation | ||
| ) |
Sets the given values into the dialog.
| [in] | lookFrom | Current viewport's from |
| [in] | lookAt | Current viewport's at |
Definition at line 268 of file GUIDialog_EditViewport.cpp.
References GUISUMOAbstractView::getChanger(), myLookAtX, myLookAtY, myLookAtZ, myParent, myRotation, myXOff, myYOff, myZOff, myZoom, UNUSED_PARAMETER, Position::x(), Position::y(), Position::z(), and GUIPerspectiveChanger::zPos2Zoom().
| void GUIDialog_EditViewport::setValues | ( | double | zoom, |
| double | xoff, | ||
| double | yoff, | ||
| double | rotation | ||
| ) |
Sets the given values into the dialog.
| [in] | zoom | Current view's zoom |
| [in] | xoff | Current view's x-offset |
| [in] | yoff | Current view's y-offset |
Definition at line 258 of file GUIDialog_EditViewport.cpp.
References GUISUMOAbstractView::getChanger(), myParent, myRotation, myXOff, myYOff, myZOff, myZoom, and GUIPerspectiveChanger::zoom2ZPos().
Referenced by GUISUMOAbstractView::getViewportEditor(), onCmdLoad(), GUISUMOAbstractView::onMouseMove(), GUISUMOAbstractView::onMouseWheel(), and setOldValues().
| void GUIDialog_EditViewport::show | ( | ) |
overload show function to focus always in OK Button
Definition at line 145 of file GUIDialog_EditViewport.cpp.
References OptionsCont::getOptions(), myLoadButton, and myOKButton.
Referenced by GUISUMOAbstractView::showViewportEditor().
| void GUIDialog_EditViewport::writeXML | ( | OutputDevice & | dev | ) |
write the settings to the given device
Definition at line 242 of file GUIDialog_EditViewport.cpp.
References OutputDevice::closeTag(), myLookAtX, myLookAtY, myLookAtZ, myRotation, myXOff, myYOff, myZoom, OutputDevice::openTag(), SUMO_ATTR_ANGLE, SUMO_ATTR_CENTER_X, SUMO_ATTR_CENTER_Y, SUMO_ATTR_CENTER_Z, SUMO_ATTR_X, SUMO_ATTR_Y, SUMO_ATTR_ZOOM, SUMO_TAG_VIEWPORT, and OutputDevice::writeAttr().
Referenced by GUIDialog_ViewSettings::onCmdExportSetting(), and onCmdSave().
|
private |
Cancel button.
Definition at line 146 of file GUIDialog_EditViewport.h.
|
private |
|
private |
The spin dialers used to change the view at (osg only)
Definition at line 140 of file GUIDialog_EditViewport.h.
Referenced by onCmdChanged(), onCmdOk(), setValues(), and writeXML().
|
private |
Definition at line 140 of file GUIDialog_EditViewport.h.
Referenced by onCmdChanged(), onCmdOk(), setValues(), and writeXML().
|
private |
Definition at line 140 of file GUIDialog_EditViewport.h.
Referenced by onCmdChanged(), onCmdOk(), setValues(), and writeXML().
|
private |
|
private |
Definition at line 127 of file GUIDialog_EditViewport.h.
Referenced by onCmdCancel(), and setOldValues().
|
private |
The old viewport.
Definition at line 127 of file GUIDialog_EditViewport.h.
Referenced by onCmdCancel(), and setOldValues().
|
private |
Definition at line 128 of file GUIDialog_EditViewport.h.
Referenced by onCmdCancel(), and setOldValues().
|
private |
The calling view.
Definition at line 124 of file GUIDialog_EditViewport.h.
Referenced by onCmdCancel(), onCmdChanged(), onCmdLoad(), onCmdOk(), and setValues().
|
private |
Definition at line 137 of file GUIDialog_EditViewport.h.
Referenced by onCmdChanged(), onCmdOk(), setValues(), and writeXML().
|
private |
save button
Definition at line 134 of file GUIDialog_EditViewport.h.
|
private |
Definition at line 137 of file GUIDialog_EditViewport.h.
Referenced by onCmdChanged(), onCmdOk(), setValues(), and writeXML().
|
private |
Definition at line 137 of file GUIDialog_EditViewport.h.
Referenced by onCmdChanged(), onCmdOk(), setValues(), and writeXML().
|
private |
Definition at line 137 of file GUIDialog_EditViewport.h.
Referenced by onCmdChanged(), onCmdOk(), and setValues().
|
private |
The spin dialers used to change the view.
Definition at line 137 of file GUIDialog_EditViewport.h.
Referenced by onCmdChanged(), onCmdOk(), setValues(), and writeXML().