Eclipse SUMO - Simulation of Urban MObility
GUIDialog_EditViewport Class Reference

A dialog to change the viewport. More...

#include <GUIDialog_EditViewport.h>

Inheritance diagram for GUIDialog_EditViewport:
[legend]
Collaboration diagram for GUIDialog_EditViewport:
[legend]

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. More...
 
 GUIDialog_EditViewport (GUISUMOAbstractView *parent, const char *name)
 Constructor. More...
 
bool haveGrabbed () const
 Returns the information whether one of the spin dialers is grabbed. More...
 
void loadWindowPos ()
 
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 setZoomValue (double zoom)
 Resets the zoom spin dialer. 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...
 

Protected Attributes

int myDefaultHeight
 
int myDefaultWidth
 
int myDefaultX
 
int myDefaultY
 
int myMinSize
 
int myMinTitlebarHeight
 
bool myStoreSize
 whether window size shall be stored More...
 
std::string myWindowName
 Name for storing in the registry. More...
 

Private Attributes

FXButton * myCancelButton = nullptr
 Cancel button. More...
 
FXButton * myLoadButton = nullptr
 load button More...
 
FXRealSpinner * myLookAtX = nullptr
 The spin dialers used to change the view at (osg only) More...
 
FXRealSpinner * myLookAtY = nullptr
 
FXRealSpinner * myLookAtZ = nullptr
 
FXButton * myOKButton = nullptr
 OK button. More...
 
Position myOldLookAt
 
Position myOldLookFrom
 The old viewport. More...
 
double myOldRotation
 
GUISUMOAbstractViewmyParent = nullptr
 The calling view. More...
 
FXRealSpinner * myRotation = nullptr
 
FXButton * mySaveButton = nullptr
 save button More...
 
FXRealSpinner * myXOff = nullptr
 
FXRealSpinner * myYOff = nullptr
 
FXRealSpinner * myZOff = nullptr
 
FXRealSpinner * myZoom = nullptr
 The spin dialers used to change the view. More...
 

Detailed Description

A dialog to change the viewport.

Definition at line 41 of file GUIDialog_EditViewport.h.

Member Enumeration Documentation

◆ anonymous enum

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.

Constructor & Destructor Documentation

◆ GUIDialog_EditViewport()

◆ ~GUIDialog_EditViewport()

GUIDialog_EditViewport::~GUIDialog_EditViewport ( )

Destructor.

Definition at line 142 of file GUIDialog_EditViewport.cpp.

Member Function Documentation

◆ getZoomValue()

double GUIDialog_EditViewport::getZoomValue ( ) const

Returns the current zoom value stored in the corresponding spin dialer.

Returns
The current zoom value in the spin dialer

Definition at line 317 of file GUIDialog_EditViewport.cpp.

References myZoom.

◆ haveGrabbed()

bool GUIDialog_EditViewport::haveGrabbed ( ) const

Returns the information whether one of the spin dialers is grabbed.

Returns
Whether the spin dialers are currently used

Definition at line 310 of file GUIDialog_EditViewport.cpp.

Referenced by GUISUMOAbstractView::onMouseMove().

Here is the caller graph for this function:

◆ loadWindowPos()

void GUIPersistentWindowPos::loadWindowPos ( )
inherited

◆ onCmdCancel()

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().

Here is the caller graph for this function:

◆ onCmdChanged()

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().

Here is the caller graph for this function:

◆ onCmdLoad()

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().

Here is the caller graph for this function:

◆ onCmdOk()

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().

Here is the caller graph for this function:

◆ onCmdSave()

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().

Here is the caller graph for this function:

◆ saveWindowPos()

void GUIDialog_EditViewport::saveWindowPos ( )
protected

save window position to the registry

Definition at line 328 of file GUIDialog_EditViewport.cpp.

◆ setOldValues()

void GUIDialog_EditViewport::setOldValues ( const Position lookFrom,
const Position lookAt,
double  rotation 
)

Resets old values.

Parameters
[in]lookFromCurrent viewport's from
[in]lookAtCurrent viewport's at

Definition at line 301 of file GUIDialog_EditViewport.cpp.

References myOldLookAt, myOldLookFrom, myOldRotation, and setValues().

Referenced by GUISUMOAbstractView::showViewportEditor().

Here is the caller graph for this function:

◆ setValues() [1/2]

void GUIDialog_EditViewport::setValues ( const Position lookFrom,
const Position lookAt,
double  rotation 
)

Sets the given values into the dialog.

Parameters
[in]lookFromCurrent viewport's from
[in]lookAtCurrent 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().

◆ setValues() [2/2]

void GUIDialog_EditViewport::setValues ( double  zoom,
double  xoff,
double  yoff,
double  rotation 
)

Sets the given values into the dialog.

Parameters
[in]zoomCurrent view's zoom
[in]xoffCurrent view's x-offset
[in]yoffCurrent 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().

Here is the caller graph for this function:

◆ setZoomValue()

void GUIDialog_EditViewport::setZoomValue ( double  zoom)

Resets the zoom spin dialer.

Parameters
[in]zoomthe value to set the spin dialer to

Definition at line 322 of file GUIDialog_EditViewport.cpp.

References myZoom.

◆ show()

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().

Here is the caller graph for this function:

◆ writeXML()

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().

Here is the caller graph for this function:

Field Documentation

◆ myCancelButton

FXButton* GUIDialog_EditViewport::myCancelButton = nullptr
private

Cancel button.

Definition at line 160 of file GUIDialog_EditViewport.h.

◆ myDefaultHeight

int GUIPersistentWindowPos::myDefaultHeight
protectedinherited

Definition at line 65 of file GUIPersistentWindowPos.h.

Referenced by GUIPersistentWindowPos::loadWindowPos().

◆ myDefaultWidth

int GUIPersistentWindowPos::myDefaultWidth
protectedinherited

Definition at line 64 of file GUIPersistentWindowPos.h.

Referenced by GUIPersistentWindowPos::loadWindowPos().

◆ myDefaultX

int GUIPersistentWindowPos::myDefaultX
protectedinherited

Definition at line 61 of file GUIPersistentWindowPos.h.

Referenced by GUIPersistentWindowPos::loadWindowPos().

◆ myDefaultY

int GUIPersistentWindowPos::myDefaultY
protectedinherited

Definition at line 62 of file GUIPersistentWindowPos.h.

Referenced by GUIPersistentWindowPos::loadWindowPos().

◆ myLoadButton

FXButton* GUIDialog_EditViewport::myLoadButton = nullptr
private

load button

Definition at line 139 of file GUIDialog_EditViewport.h.

Referenced by show().

◆ myLookAtX

FXRealSpinner* GUIDialog_EditViewport::myLookAtX = nullptr
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().

◆ myLookAtY

FXRealSpinner* GUIDialog_EditViewport::myLookAtY = nullptr
private

Definition at line 153 of file GUIDialog_EditViewport.h.

Referenced by onCmdChanged(), onCmdOk(), setValues(), and writeXML().

◆ myLookAtZ

FXRealSpinner* GUIDialog_EditViewport::myLookAtZ = nullptr
private

Definition at line 154 of file GUIDialog_EditViewport.h.

Referenced by onCmdChanged(), onCmdOk(), setValues(), and writeXML().

◆ myMinSize

int GUIPersistentWindowPos::myMinSize
protectedinherited

Definition at line 67 of file GUIPersistentWindowPos.h.

Referenced by GUIPersistentWindowPos::loadWindowPos().

◆ myMinTitlebarHeight

int GUIPersistentWindowPos::myMinTitlebarHeight
protectedinherited

Definition at line 68 of file GUIPersistentWindowPos.h.

Referenced by GUIPersistentWindowPos::loadWindowPos().

◆ myOKButton

FXButton* GUIDialog_EditViewport::myOKButton = nullptr
private

OK button.

Definition at line 157 of file GUIDialog_EditViewport.h.

Referenced by show().

◆ myOldLookAt

Position GUIDialog_EditViewport::myOldLookAt
private

Definition at line 135 of file GUIDialog_EditViewport.h.

Referenced by onCmdCancel(), and setOldValues().

◆ myOldLookFrom

Position GUIDialog_EditViewport::myOldLookFrom
private

The old viewport.

Definition at line 135 of file GUIDialog_EditViewport.h.

Referenced by onCmdCancel(), and setOldValues().

◆ myOldRotation

double GUIDialog_EditViewport::myOldRotation
private

Definition at line 136 of file GUIDialog_EditViewport.h.

Referenced by onCmdCancel(), and setOldValues().

◆ myParent

GUISUMOAbstractView* GUIDialog_EditViewport::myParent = nullptr
private

The calling view.

Definition at line 132 of file GUIDialog_EditViewport.h.

Referenced by onCmdCancel(), onCmdChanged(), onCmdLoad(), onCmdOk(), setValues(), and writeXML().

◆ myRotation

FXRealSpinner* GUIDialog_EditViewport::myRotation = nullptr
private

Definition at line 149 of file GUIDialog_EditViewport.h.

Referenced by onCmdChanged(), onCmdOk(), setValues(), and writeXML().

◆ mySaveButton

FXButton* GUIDialog_EditViewport::mySaveButton = nullptr
private

save button

Definition at line 142 of file GUIDialog_EditViewport.h.

◆ myStoreSize

bool GUIPersistentWindowPos::myStoreSize
protectedinherited

whether window size shall be stored

Definition at line 59 of file GUIPersistentWindowPos.h.

Referenced by GUIPersistentWindowPos::loadWindowPos(), and GUIPersistentWindowPos::saveWindowPos().

◆ myWindowName

std::string GUIPersistentWindowPos::myWindowName
protectedinherited

Name for storing in the registry.

Definition at line 56 of file GUIPersistentWindowPos.h.

Referenced by GUIPersistentWindowPos::loadWindowPos(), and GUIPersistentWindowPos::saveWindowPos().

◆ myXOff

FXRealSpinner* GUIDialog_EditViewport::myXOff = nullptr
private

Definition at line 146 of file GUIDialog_EditViewport.h.

Referenced by onCmdChanged(), onCmdOk(), setValues(), and writeXML().

◆ myYOff

FXRealSpinner* GUIDialog_EditViewport::myYOff = nullptr
private

Definition at line 147 of file GUIDialog_EditViewport.h.

Referenced by onCmdChanged(), onCmdOk(), setValues(), and writeXML().

◆ myZOff

FXRealSpinner* GUIDialog_EditViewport::myZOff = nullptr
private

Definition at line 148 of file GUIDialog_EditViewport.h.

Referenced by onCmdChanged(), onCmdOk(), setValues(), and writeXML().

◆ myZoom

FXRealSpinner* GUIDialog_EditViewport::myZoom = nullptr
private

The spin dialers used to change the view.

Definition at line 145 of file GUIDialog_EditViewport.h.

Referenced by getZoomValue(), onCmdChanged(), onCmdOk(), setValues(), setZoomValue(), and writeXML().


The documentation for this class was generated from the following files: