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 | |
double | getZoomValue () const |
Returns the current zoom value stored in the corresponding spin dialer. | |
GUIDialog_EditViewport (GUISUMOAbstractView *parent, const char *name) | |
Constructor. | |
bool | haveGrabbed () const |
Returns the information whether one of the spin dialers is grabbed. | |
void | loadWindowPos () |
void | setOldValues (const Position &lookFrom, const Position &lookAt, double rotation) |
Resets old values. | |
void | setValues (const Position &lookFrom, const Position &lookAt, double rotation) |
Sets the given values into the dialog. | |
void | setValues (double zoom, double xoff, double yoff, double rotation) |
Sets the given values into the dialog. | |
void | setZoomValue (double zoom) |
Resets the zoom spin dialer. | |
void | show () |
overload show function to focus always in OK Button | |
void | writeXML (OutputDevice &dev) |
write the settings to the given device | |
~GUIDialog_EditViewport () | |
Destructor. | |
FOX-callbacks | |
long | onCmdChanged (FXObject *, FXSelector, void *) |
Called when the user changes the viewport. | |
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 | onCmdLoad (FXObject *, FXSelector, void *) |
Called when the user wants to load a viewport. | |
long | onCmdSave (FXObject *, FXSelector, void *) |
Called when the user wants to save a viewport. | |
Protected Member Functions | |
void | saveWindowPos () |
save window position to the registry | |
Protected Attributes | |
int | myDefaultHeight |
int | myDefaultWidth |
int | myDefaultX |
int | myDefaultY |
int | myMinSize |
int | myMinTitlebarHeight |
bool | myStoreSize |
whether window size shall be stored | |
std::string | myWindowName |
Name for storing in the registry. | |
Private Attributes | |
FXButton * | myCancelButton = nullptr |
Cancel button. | |
FXButton * | myLoadButton = nullptr |
load button | |
FXRealSpinner * | myLookAtX = nullptr |
The spin dialers used to change the view at (osg only) | |
FXRealSpinner * | myLookAtY = nullptr |
FXRealSpinner * | myLookAtZ = nullptr |
FXButton * | myOKButton = nullptr |
OK button. | |
Position | myOldLookAt |
Position | myOldLookFrom |
The old viewport. | |
double | myOldRotation |
GUISUMOAbstractView * | myParent = nullptr |
The calling view. | |
FXRealSpinner * | myRotation = nullptr |
FXButton * | mySaveButton = nullptr |
save button | |
FXRealSpinner * | myXOff = nullptr |
FXRealSpinner * | myYOff = nullptr |
FXRealSpinner * | myZOff = nullptr |
FXRealSpinner * | myZoom = nullptr |
The spin dialers used to change the view. | |
A dialog to change the viewport.
Definition at line 41 of file GUIDialog_EditViewport.h.
anonymous enum |
FOX-callback enumerations.
Enumerator | |
---|---|
MID_CHANGED | |
MID_OK | |
MID_CANCEL | |
MID_LOAD | |
MID_SAVE |
Definition at line 46 of file GUIDialog_EditViewport.h.
GUIDialog_EditViewport::GUIDialog_EditViewport | ( | GUISUMOAbstractView * | parent, |
const char * | name | ||
) |
Constructor.
[in] | parent | The view to change |
[in] | name | This dialog's caption |
Definition at line 57 of file GUIDialog_EditViewport.cpp.
References ACCEPT, GUIDesigns::buildFXButton(), CANCEL, EDITVIEWPORT, GUIIconSubSys::getIcon(), GUIDesignAuxiliarHorizontalFrame, GUIDesignAuxiliarVerticalFrame, GUIDesignButtonCancel, GUIDesignButtonOK, GUIDesignButtonToolbarWithText, GUIDesignContentsFrame, GUIDesignHorizontalFrameIcons, GUIDesignHorizontalSeparator, GUIDesignLabelThick, GUIDesignSpinDialViewPort, GUIDesignSpinDialViewPortZoom, MID_CANCEL, MID_LOAD, MID_OK, MID_SAVE, OPEN, SAVE, and TL.
GUIDialog_EditViewport::~GUIDialog_EditViewport | ( | ) |
Destructor.
Definition at line 142 of file GUIDialog_EditViewport.cpp.
double GUIDialog_EditViewport::getZoomValue | ( | ) | const |
Returns the current zoom value stored in the corresponding spin dialer.
Definition at line 317 of file GUIDialog_EditViewport.cpp.
References myZoom.
bool GUIDialog_EditViewport::haveGrabbed | ( | ) | const |
Returns the information whether one of the spin dialers is grabbed.
Definition at line 310 of file GUIDialog_EditViewport.cpp.
Referenced by GUISUMOAbstractView::onMouseMove().
|
inherited |
Definition at line 84 of file GUIPersistentWindowPos.cpp.
References MAX2(), MIN2(), GUIPersistentWindowPos::myDefaultHeight, GUIPersistentWindowPos::myDefaultWidth, GUIPersistentWindowPos::myDefaultX, GUIPersistentWindowPos::myDefaultY, GUIPersistentWindowPos::myMinSize, GUIPersistentWindowPos::myMinTitlebarHeight, GUIPersistentWindowPos::myParent, GUIPersistentWindowPos::myStoreSize, and GUIPersistentWindowPos::myWindowName.
Referenced by GUIParameterTableWindow::GUIParameterTableWindow().
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, and GUISUMOAbstractView::setViewportFromToRot().
Referenced by FXDEFMAP().
long GUIDialog_EditViewport::onCmdChanged | ( | FXObject * | o, |
FXSelector | , | ||
void * | |||
) |
Called when the user changes the viewport.
Definition at line 184 of file GUIDialog_EditViewport.cpp.
References GUISUMOAbstractView::getChanger(), Position::INVALID, GUISUMOAbstractView::is3DView(), myLookAtX, myLookAtY, myLookAtZ, myParent, myRotation, myXOff, myYOff, myZOff, myZoom, GUISUMOAbstractView::setViewportFromToRot(), GUISUMOAbstractView::zoom2Pos(), GUIPerspectiveChanger::zoom2ZPos(), and GUIPerspectiveChanger::zPos2Zoom().
Referenced by FXDEFMAP().
long GUIDialog_EditViewport::onCmdLoad | ( | FXObject * | , |
FXSelector | , | ||
void * | |||
) |
Called when the user wants to load a viewport.
Definition at line 209 of file GUIDialog_EditViewport.cpp.
References GUISettingsHandler::applyViewport(), gCurrentFolder, GUISUMOAbstractView::getChanger(), GUIIconSubSys::getIcon(), GUIPerspectiveChanger::getRotation(), GUIPerspectiveChanger::getXPos(), GUIPerspectiveChanger::getYPos(), GUIPerspectiveChanger::getZoom(), myParent, OPEN, setValues(), and TL.
Referenced by FXDEFMAP().
long GUIDialog_EditViewport::onCmdOk | ( | FXObject * | , |
FXSelector | , | ||
void * | |||
) |
Called when the user wants to keep the viewport.
Definition at line 158 of file GUIDialog_EditViewport.cpp.
References Position::INVALID, myLookAtX, myLookAtY, myLookAtZ, myParent, myRotation, myXOff, myYOff, myZOff, myZoom, GUISUMOAbstractView::setViewportFromToRot(), toString(), and WRITE_DEBUG.
Referenced by FXDEFMAP().
long GUIDialog_EditViewport::onCmdSave | ( | FXObject * | , |
FXSelector | , | ||
void * | |||
) |
Called when the user wants to save a viewport.
Definition at line 228 of file GUIDialog_EditViewport.cpp.
References OutputDevice::close(), OutputDevice::closeTag(), gCurrentFolder, OutputDevice::getDevice(), MFXUtils::getFilename2Write(), GUIIconSubSys::getIcon(), OutputDevice::openTag(), SAVE, SUMO_TAG_VIEWSETTINGS, TL, and writeXML().
Referenced by FXDEFMAP().
|
protected |
save window position to the registry
Definition at line 328 of file GUIDialog_EditViewport.cpp.
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 301 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 282 of file GUIDialog_EditViewport.cpp.
References GUISUMOAbstractView::getChanger(), GUISUMOAbstractView::is3DView(), 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 272 of file GUIDialog_EditViewport.cpp.
References GUISUMOAbstractView::getChanger(), myParent, myRotation, myXOff, myYOff, myZOff, myZoom, and GUIPerspectiveChanger::zoom2ZPos().
Referenced by onCmdLoad(), GUISUMOAbstractView::onMouseMove(), GUISUMOAbstractView::onMouseWheel(), setOldValues(), and GUISUMOAbstractView::updateViewportValues().
void GUIDialog_EditViewport::setZoomValue | ( | double | zoom | ) |
Resets the zoom spin dialer.
[in] | zoom | the value to set the spin dialer to |
Definition at line 322 of file GUIDialog_EditViewport.cpp.
References myZoom.
void GUIDialog_EditViewport::show | ( | ) |
overload show function to focus always in OK Button
Definition at line 146 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 247 of file GUIDialog_EditViewport.cpp.
References OutputDevice::closeTag(), Position::INVALID, GUISUMOAbstractView::is3DView(), myLookAtX, myLookAtY, myLookAtZ, myParent, myRotation, myXOff, myYOff, myZOff, 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_Z, SUMO_ATTR_ZOOM, SUMO_TAG_VIEWPORT, OutputDevice::writeAttr(), Position::x(), Position::y(), and Position::z().
Referenced by GUIDialog_ViewSettings::onCmdExportSetting(), and onCmdSave().
|
private |
Cancel button.
Definition at line 160 of file GUIDialog_EditViewport.h.
|
protectedinherited |
Definition at line 65 of file GUIPersistentWindowPos.h.
Referenced by GUIPersistentWindowPos::loadWindowPos().
|
protectedinherited |
Definition at line 64 of file GUIPersistentWindowPos.h.
Referenced by GUIPersistentWindowPos::loadWindowPos().
|
protectedinherited |
Definition at line 61 of file GUIPersistentWindowPos.h.
Referenced by GUIPersistentWindowPos::loadWindowPos().
|
protectedinherited |
Definition at line 62 of file GUIPersistentWindowPos.h.
Referenced by GUIPersistentWindowPos::loadWindowPos().
|
private |
|
private |
The spin dialers used to change the view at (osg only)
Definition at line 152 of file GUIDialog_EditViewport.h.
Referenced by onCmdChanged(), onCmdOk(), setValues(), and writeXML().
|
private |
Definition at line 153 of file GUIDialog_EditViewport.h.
Referenced by onCmdChanged(), onCmdOk(), setValues(), and writeXML().
|
private |
Definition at line 154 of file GUIDialog_EditViewport.h.
Referenced by onCmdChanged(), onCmdOk(), setValues(), and writeXML().
|
protectedinherited |
Definition at line 67 of file GUIPersistentWindowPos.h.
Referenced by GUIPersistentWindowPos::loadWindowPos().
|
protectedinherited |
Definition at line 68 of file GUIPersistentWindowPos.h.
Referenced by GUIPersistentWindowPos::loadWindowPos().
|
private |
|
private |
Definition at line 135 of file GUIDialog_EditViewport.h.
Referenced by onCmdCancel(), and setOldValues().
|
private |
The old viewport.
Definition at line 135 of file GUIDialog_EditViewport.h.
Referenced by onCmdCancel(), and setOldValues().
|
private |
Definition at line 136 of file GUIDialog_EditViewport.h.
Referenced by onCmdCancel(), and setOldValues().
|
private |
The calling view.
Definition at line 132 of file GUIDialog_EditViewport.h.
Referenced by onCmdCancel(), onCmdChanged(), onCmdLoad(), onCmdOk(), setValues(), setValues(), and writeXML().
|
private |
Definition at line 149 of file GUIDialog_EditViewport.h.
Referenced by onCmdChanged(), onCmdOk(), setValues(), setValues(), and writeXML().
|
private |
save button
Definition at line 142 of file GUIDialog_EditViewport.h.
|
protectedinherited |
whether window size shall be stored
Definition at line 59 of file GUIPersistentWindowPos.h.
Referenced by GUIPersistentWindowPos::loadWindowPos(), and GUIPersistentWindowPos::saveWindowPos().
|
protectedinherited |
Name for storing in the registry.
Definition at line 56 of file GUIPersistentWindowPos.h.
Referenced by GUIPersistentWindowPos::loadWindowPos(), and GUIPersistentWindowPos::saveWindowPos().
|
private |
Definition at line 146 of file GUIDialog_EditViewport.h.
Referenced by onCmdChanged(), onCmdOk(), setValues(), setValues(), and writeXML().
|
private |
Definition at line 147 of file GUIDialog_EditViewport.h.
Referenced by onCmdChanged(), onCmdOk(), setValues(), setValues(), and writeXML().
|
private |
Definition at line 148 of file GUIDialog_EditViewport.h.
Referenced by onCmdChanged(), onCmdOk(), setValues(), setValues(), and writeXML().
|
private |
The spin dialers used to change the view.
Definition at line 145 of file GUIDialog_EditViewport.h.
Referenced by getZoomValue(), onCmdChanged(), onCmdOk(), setValues(), setValues(), setZoomValue(), and writeXML().