SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GUIDialog_EditViewport Class Reference

A dialog to change the viewport. More...

#include <GUIDialog_EditViewport.h>

Inheritance diagram for GUIDialog_EditViewport:
FXDialogBox

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.
bool haveGrabbed () const
 Returns the information whether one of the spin dialers is grabbed.
void setOldValues (const Position &lookFrom, const Position &lookAt)
 Resets old values.
void setValues (SUMOReal zoom, SUMOReal xoff, SUMOReal yoff)
 Sets the given values into the dialog.
void setValues (const Position &lookFrom, const Position &lookAt)
 Sets the given values into the dialog.
 ~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

 GUIDialog_EditViewport ()
 FOX needs this.

Protected Attributes

Position myOldLookAt
Position myOldLookFrom
 The old viewport.
GUISUMOAbstractViewmyParent
 The calling view.
FXRealSpinDial * myXOff
FXRealSpinDial * myYOff
FXRealSpinDial * myZoom
 The spin dialers used to change the view.

Detailed Description

A dialog to change the viewport.

Definition at line 52 of file GUIDialog_EditViewport.h.

Member Enumeration Documentation

anonymous enum

FOX-callback enumerations.

Enumerator:
MID_CHANGED 
MID_OK 
MID_CANCEL 
MID_LOAD 
MID_SAVE 

Definition at line 57 of file GUIDialog_EditViewport.h.

Constructor & Destructor Documentation

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

Constructor.

Parameters
[in]parentThe view to change
[in]nameThis dialog's caption
[in]xx-position to show the dialog at
[in]yy-position to show the dialog at

Definition at line 66 of file GUIDialog_EditViewport.cpp.

References GUIIconSubSys::getIcon(), ICON_EMPTY, ICON_OPEN_CONFIG, ICON_SAVE, MID_CANCEL, MID_LOAD, MID_OK, and MID_SAVE.

GUIDialog_EditViewport::~GUIDialog_EditViewport ( )

Destructor.

Definition at line 135 of file GUIDialog_EditViewport.cpp.

GUIDialog_EditViewport::GUIDialog_EditViewport ( )
inlineprotected

FOX needs this.

Definition at line 148 of file GUIDialog_EditViewport.h.

Member Function Documentation

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

References myXOff, myYOff, and myZoom.

Referenced by GUISUMOAbstractView::onMouseMove().

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

Called when the user wants to restore the viewport.

Definition at line 153 of file GUIDialog_EditViewport.cpp.

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

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

Called when the user changes the viewport.

Definition at line 161 of file GUIDialog_EditViewport.cpp.

References Position::INVALID, myParent, myXOff, myYOff, myZoom, and GUISUMOAbstractView::setViewport().

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

Called when the user wants to load a viewport.

Definition at line 174 of file GUIDialog_EditViewport.cpp.

References gCurrentFolder, GUIIconSubSys::getIcon(), ICON_EMPTY, myParent, setValues(), and GUISUMOAbstractView::setViewport().

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

Called when the user wants to keep the viewport.

Definition at line 139 of file GUIDialog_EditViewport.cpp.

References Position::INVALID, myParent, myXOff, myYOff, myZoom, and GUISUMOAbstractView::setViewport().

long GUIDialog_EditViewport::onCmdSave ( FXObject ,
FXSelector  ,
void *   
)
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 246 of file GUIDialog_EditViewport.cpp.

References myOldLookAt, myOldLookFrom, and setValues().

Referenced by GUISUMOAbstractView::showViewportEditor().

void GUIDialog_EditViewport::setValues ( SUMOReal  zoom,
SUMOReal  xoff,
SUMOReal  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 225 of file GUIDialog_EditViewport.cpp.

References myXOff, myYOff, and myZoom.

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

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

References myXOff, myYOff, myZoom, Position::x(), Position::y(), and Position::z().

Field Documentation

Position GUIDialog_EditViewport::myOldLookAt
protected

Definition at line 135 of file GUIDialog_EditViewport.h.

Referenced by onCmdCancel(), and setOldValues().

Position GUIDialog_EditViewport::myOldLookFrom
protected

The old viewport.

Definition at line 135 of file GUIDialog_EditViewport.h.

Referenced by onCmdCancel(), and setOldValues().

GUISUMOAbstractView* GUIDialog_EditViewport::myParent
protected

The calling view.

Definition at line 132 of file GUIDialog_EditViewport.h.

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

FXRealSpinDial * GUIDialog_EditViewport::myXOff
protected

Definition at line 138 of file GUIDialog_EditViewport.h.

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

FXRealSpinDial * GUIDialog_EditViewport::myYOff
protected

Definition at line 138 of file GUIDialog_EditViewport.h.

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

FXRealSpinDial* GUIDialog_EditViewport::myZoom
protected

The spin dialers used to change the view.

Definition at line 138 of file GUIDialog_EditViewport.h.

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


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