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