 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
52 FXIMPLEMENT(
GUIDialog_EditViewport, FXDialogBox, GUIDialog_EditViewportMap, ARRAYNUMBER(GUIDialog_EditViewportMap))
59 FXDialogBox(parent, name,
GUIDesignDialogBox, x, y, 0, 0, 0, 0, 0, 0),
65 myLoadButton =
new FXButton(frameFiles,
"Load\t\tLoad viewport from file",
67 mySaveButton =
new FXButton(frameFiles,
"Save\t\tSave viewport to file",
79 myZoom->setRange(0.0001, 100000);
85 myXOff =
new FXRealSpinner(lookFromXFrame, 16,
this, MID_CHANGED,
GUIDesignSpinDial | SPIN_NOMIN | SPIN_NOMAX);
90 myYOff =
new FXRealSpinner(lookFromYFrame, 16,
this, MID_CHANGED,
GUIDesignSpinDial | SPIN_NOMIN | SPIN_NOMAX);
95 myZOff =
new FXRealSpinner(lookFromZFrame, 16,
this, MID_CHANGED,
GUIDesignSpinDial | SPIN_NOMIN | SPIN_NOMAX);
96 myZOff->setRange(0.12, 100000000);
101 myRotation =
new FXRealSpinner(rotationFrame, 16,
this, MID_CHANGED,
GUIDesignSpinDial | SPIN_NOMIN | SPIN_NOMAX);
110 myLookAtX =
new FXRealSpinner(lookAtXFrame, 16,
this, MID_CHANGED,
GUIDesignSpinDial | SPIN_NOMIN | SPIN_NOMAX);
115 myLookAtY =
new FXRealSpinner(lookAtYFrame, 16,
this, MID_CHANGED,
GUIDesignSpinDial | SPIN_NOMIN | SPIN_NOMAX);
120 myLookAtZ =
new FXRealSpinner(lookAtZFrame, 16,
this, MID_CHANGED,
GUIDesignSpinDial | SPIN_NOMIN | SPIN_NOMAX);
205 FXFileDialog opendialog(
this,
"Load Viewport");
207 opendialog.setSelectMode(SELECTFILE_ANY);
208 opendialog.setPatternList(
"*.xml");
212 if (opendialog.execute()) {
235 FXMessageBox::error(
this, MBOX_OK,
"Storing failed!",
"%s", e.what());
269 myXOff->setValue(lookFrom.
x());
270 myYOff->setValue(lookFrom.
y());
271 myZOff->setValue(lookFrom.
z());
301 getApp()->reg().writeIntEntry(
"VIEWPORT_DIALOG_SETTINGS",
"x", getX());
302 getApp()->reg().writeIntEntry(
"VIEWPORT_DIALOG_SETTINGS",
"y", getY());
virtual double getYPos() const =0
Returns the y-offset of the field to show stored in this changer.
#define UNUSED_PARAMETER(x)
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
virtual void setViewportFromToRot(const Position &lookFrom, const Position &lookAt, double rotation)
applies the given viewport settings
#define GUIDesignSpinDial
long onCmdCancel(FXObject *, FXSelector, void *)
Called when the user wants to restore the viewport.
long onCmdOk(FXObject *, FXSelector, void *)
Called when the user wants to keep the viewport.
Static storage of an output device and its base (abstract) implementation.
void writeXML(OutputDevice &dev)
write the settings to the given device
double z() const
Returns the z-position.
static const Position INVALID
used to indicate that a position is valid
#define GUIDesignButtonToolbarWithText
little button with text and icon
#define GUIDesignButtonOK
FXDEFMAP(GUIDialog_EditViewport) GUIDialog_EditViewportMap[]
static OptionsCont & getOptions()
Retrieves the options.
virtual double getRotation() const =0
Returns the rotation of the canvas stored in this changer.
FXRealSpinner * myZoom
The spin dialers used to change the view.
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
void close()
Closes the device and removes it from the dictionary.
void setOldValues(const Position &lookFrom, const Position &lookAt, double rotation)
Resets old values.
static FXString getFilename2Write(FXWindow *parent, const FXString &header, const FXString &extension, FXIcon *icon, FXString ¤tFolder)
Returns the file name to write.
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
FXButton * myLoadButton
load button
#define GUIDesignContentsFrame
design for the main content frame of every frame/dialog
A dialog to change the viewport.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
#define GUIDesignHorizontalFrameIcons
Horizontal frame used for pack icons.
FXRealSpinner * myLookAtX
The spin dialers used to change the view at (osg only)
GUISUMOAbstractView * myParent
The calling view.
long onCmdLoad(FXObject *, FXSelector, void *)
Called when the user wants to load a viewport.
#define GUIDesignAuxiliarVerticalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
#define GUIDesignHorizontalSeparator
void saveWindowPos()
save window position to the registry
~GUIDialog_EditViewport()
Destructor.
A point in 2D or 3D with translation and scaling methods.
double x() const
Returns the x-position.
virtual double getZoom() const =0
Returns the zoom factor computed stored in this changer.
An XML-handler for visualisation schemes.
void applyViewport(GUISUMOAbstractView *view) const
Sets the viewport which has been parsed.
FXString gCurrentFolder
The folder used as last.
Position myOldLookFrom
The old viewport.
#define GUIDesignLabelCenterThick
label extended over frame with thick and with text justify to center and height of 23
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
static OutputDevice & getDevice(const std::string &name)
Returns the described OutputDevice.
#define GUIDesignLabelLeftThick
label extended over frame with thick and with text justify to left and height of 23
double y() const
Returns the y-position.
GUIPerspectiveChanger & getChanger() const
get changer
virtual double zoom2ZPos(double zoom) const =0
Returns the camera height at which the given zoom level is reached.
long onCmdSave(FXObject *, FXSelector, void *)
Called when the user wants to save a viewport.
void show()
overload show function to focus always in OK Button
FXButton * myOKButton
OK button.
virtual double zPos2Zoom(double zPos) const =0
Returns the zoom level that is achieved at a given camera height.
void setValues(double zoom, double xoff, double yoff, double rotation)
Sets the given values into the dialog.
#define GUIDesignButtonCancel
Cancel Button.
FXRealSpinner * myRotation
virtual double getXPos() const =0
Returns the x-offset of the field to show stored in this changer.
bool haveGrabbed() const
Returns the information whether one of the spin dialers is grabbed.
FXRealSpinner * myLookAtZ
FXRealSpinner * myLookAtY
long onCmdChanged(FXObject *, FXSelector, void *)
Called when the user changes the viewport.
#define GUIDesignDialogBox