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

 GUIDialog_EditViewport ()
 FOX needs this. More...
 
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
 
GUISUMOAbstractViewmyParent
 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...
 

Detailed Description

A dialog to change the viewport.

Definition at line 43 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 48 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 142 of file GUIDialog_EditViewport.cpp.

◆ GUIDialog_EditViewport() [2/2]

GUIDialog_EditViewport::GUIDialog_EditViewport ( )
inlineprotected

FOX needs this.

Definition at line 119 of file GUIDialog_EditViewport.h.

References saveWindowPos().

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

Referenced by GUISUMOAbstractView::onMouseMove().

◆ onCmdCancel()

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

Called when the user wants to restore the viewport.

Definition at line 177 of file GUIDialog_EditViewport.cpp.

References myOldLookAt, myOldLookFrom, myOldRotation, myParent, saveWindowPos(), and GUISUMOAbstractView::setViewportFromToRot().

◆ 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 *   
)

◆ saveWindowPos()

void GUIDialog_EditViewport::saveWindowPos ( )
protected

save window position to the registry

Definition at line 301 of file GUIDialog_EditViewport.cpp.

Referenced by GUIDialog_EditViewport(), onCmdCancel(), and onCmdOk().

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

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

Referenced by GUISUMOAbstractView::showViewportEditor().

◆ setValues() [1/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 259 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().

◆ setValues() [2/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 269 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().

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

◆ writeXML()

Field Documentation

◆ myCancelButton

FXButton* GUIDialog_EditViewport::myCancelButton
private

Cancel button.

Definition at line 148 of file GUIDialog_EditViewport.h.

◆ myLoadButton

FXButton* GUIDialog_EditViewport::myLoadButton
private

load button

Definition at line 133 of file GUIDialog_EditViewport.h.

Referenced by show().

◆ myLookAtX

FXRealSpinner* GUIDialog_EditViewport::myLookAtX
private

The spin dialers used to change the view at (osg only)

Definition at line 142 of file GUIDialog_EditViewport.h.

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

◆ myLookAtY

FXRealSpinner * GUIDialog_EditViewport::myLookAtY
private

Definition at line 142 of file GUIDialog_EditViewport.h.

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

◆ myLookAtZ

FXRealSpinner * GUIDialog_EditViewport::myLookAtZ
private

Definition at line 142 of file GUIDialog_EditViewport.h.

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

◆ myOKButton

FXButton* GUIDialog_EditViewport::myOKButton
private

OK button.

Definition at line 145 of file GUIDialog_EditViewport.h.

Referenced by show().

◆ myOldLookAt

Position GUIDialog_EditViewport::myOldLookAt
private

Definition at line 129 of file GUIDialog_EditViewport.h.

Referenced by onCmdCancel(), and setOldValues().

◆ myOldLookFrom

Position GUIDialog_EditViewport::myOldLookFrom
private

The old viewport.

Definition at line 129 of file GUIDialog_EditViewport.h.

Referenced by onCmdCancel(), and setOldValues().

◆ myOldRotation

double GUIDialog_EditViewport::myOldRotation
private

Definition at line 130 of file GUIDialog_EditViewport.h.

Referenced by onCmdCancel(), and setOldValues().

◆ myParent

GUISUMOAbstractView* GUIDialog_EditViewport::myParent
private

The calling view.

Definition at line 126 of file GUIDialog_EditViewport.h.

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

◆ myRotation

FXRealSpinner * GUIDialog_EditViewport::myRotation
private

Definition at line 139 of file GUIDialog_EditViewport.h.

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

◆ mySaveButton

FXButton* GUIDialog_EditViewport::mySaveButton
private

save button

Definition at line 136 of file GUIDialog_EditViewport.h.

◆ myXOff

FXRealSpinner * GUIDialog_EditViewport::myXOff
private

Definition at line 139 of file GUIDialog_EditViewport.h.

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

◆ myYOff

FXRealSpinner * GUIDialog_EditViewport::myYOff
private

Definition at line 139 of file GUIDialog_EditViewport.h.

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

◆ myZOff

FXRealSpinner * GUIDialog_EditViewport::myZOff
private

Definition at line 139 of file GUIDialog_EditViewport.h.

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

◆ myZoom

FXRealSpinner* GUIDialog_EditViewport::myZoom
private

The spin dialers used to change the view.

Definition at line 139 of file GUIDialog_EditViewport.h.

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


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