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:
Inheritance graph
Collaboration diagram for GUIDialog_EditViewport:
Collaboration graph

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)
 Resets old values. More...
 
void setValues (double zoom, double xoff, double yoff)
 Sets the given values into the dialog. More...
 
void setValues (const Position &lookFrom, const Position &lookAt)
 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

 GUIDialog_EditViewport ()
 FOX needs this. More...
 

Protected Attributes

FXButton * buttonOk
 OK button. More...
 
Position myOldLookAt
 
Position myOldLookFrom
 The old viewport. More...
 
GUISUMOAbstractViewmyParent
 The calling view. More...
 
FXRealSpinDial * myXOff
 
FXRealSpinDial * myYOff
 
FXRealSpinDial * myZOff
 
FXRealSpinDial * myZoom
 The spin dialers used to change the view. More...
 

Detailed Description

A dialog to change the viewport.

Definition at line 50 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 55 of file GUIDialog_EditViewport.h.

Constructor & Destructor Documentation

◆ GUIDialog_EditViewport() [1/2]

GUIDialog_EditViewport::GUIDialog_EditViewport ( GUISUMOAbstractView parent,
const char *  name,
int  x,
int  y 
)

◆ ~GUIDialog_EditViewport()

GUIDialog_EditViewport::~GUIDialog_EditViewport ( )

Destructor.

Definition at line 121 of file GUIDialog_EditViewport.cpp.

◆ GUIDialog_EditViewport() [2/2]

GUIDialog_EditViewport::GUIDialog_EditViewport ( )
inlineprotected

FOX needs this.

Definition at line 146 of file GUIDialog_EditViewport.h.

Member Function Documentation

◆ 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 267 of file GUIDialog_EditViewport.cpp.

References myXOff, myYOff, and myZoom.

Referenced by GUISUMOAbstractView::onMouseMove().

◆ onCmdCancel()

long GUIDialog_EditViewport::onCmdCancel ( FXObject *  ,
FXSelector  ,
void *   
)

Called when the user wants to restore the viewport.

Definition at line 156 of file GUIDialog_EditViewport.cpp.

References myOldLookAt, myOldLookFrom, myParent, and GUISUMOAbstractView::setViewportFromTo().

◆ onCmdChanged()

long GUIDialog_EditViewport::onCmdChanged ( FXObject *  o,
FXSelector  ,
void *   
)

◆ onCmdLoad()

long GUIDialog_EditViewport::onCmdLoad ( FXObject *  ,
FXSelector  ,
void *   
)

◆ onCmdOk()

long GUIDialog_EditViewport::onCmdOk ( FXObject *  ,
FXSelector  ,
void *   
)

◆ onCmdSave()

long GUIDialog_EditViewport::onCmdSave ( FXObject *  ,
FXSelector  ,
void *   
)

◆ setOldValues()

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

Resets old values.

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

Definition at line 259 of file GUIDialog_EditViewport.cpp.

References myOldLookAt, myOldLookFrom, and setValues().

Referenced by GUISUMOAbstractView::showViewportEditor().

◆ setValues() [1/2]

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

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 234 of file GUIDialog_EditViewport.cpp.

References GUISUMOAbstractView::getChanger(), myParent, myXOff, myYOff, myZOff, myZoom, and GUIPerspectiveChanger::zoom2ZPos().

Referenced by GUISUMOAbstractView::getViewportEditor(), onCmdLoad(), GUISUMOAbstractView::onMouseMove(), and setOldValues().

◆ setValues() [2/2]

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

Sets the given values into the dialog.

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

Definition at line 243 of file GUIDialog_EditViewport.cpp.

References GUISUMOAbstractView::getChanger(), myParent, myXOff, myYOff, myZOff, myZoom, UNUSED_PARAMETER, Position::x(), Position::y(), Position::z(), and GUIPerspectiveChanger::zPos2Zoom().

◆ show()

void GUIDialog_EditViewport::show ( )

overload show function to focus always in OK Button

Definition at line 125 of file GUIDialog_EditViewport.cpp.

References buttonOk, OptionsCont::getOptions(), and myZOff.

Referenced by GUISUMOAbstractView::showViewportEditor().

◆ writeXML()

Field Documentation

◆ buttonOk

FXButton* GUIDialog_EditViewport::buttonOk
protected

OK button.

Definition at line 136 of file GUIDialog_EditViewport.h.

Referenced by show().

◆ myOldLookAt

Position GUIDialog_EditViewport::myOldLookAt
protected

Definition at line 130 of file GUIDialog_EditViewport.h.

Referenced by onCmdCancel(), and setOldValues().

◆ myOldLookFrom

Position GUIDialog_EditViewport::myOldLookFrom
protected

The old viewport.

Definition at line 130 of file GUIDialog_EditViewport.h.

Referenced by onCmdCancel(), and setOldValues().

◆ myParent

GUISUMOAbstractView* GUIDialog_EditViewport::myParent
protected

The calling view.

Definition at line 127 of file GUIDialog_EditViewport.h.

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

◆ myXOff

FXRealSpinDial * GUIDialog_EditViewport::myXOff
protected

Definition at line 133 of file GUIDialog_EditViewport.h.

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

◆ myYOff

FXRealSpinDial * GUIDialog_EditViewport::myYOff
protected

Definition at line 133 of file GUIDialog_EditViewport.h.

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

◆ myZOff

FXRealSpinDial * GUIDialog_EditViewport::myZOff
protected

Definition at line 133 of file GUIDialog_EditViewport.h.

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

◆ myZoom

FXRealSpinDial* GUIDialog_EditViewport::myZoom
protected

The spin dialers used to change the view.

Definition at line 133 of file GUIDialog_EditViewport.h.

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


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