61 FXIMPLEMENT(
GUIDialog_EditViewport, FXDialogBox, GUIDialog_EditViewportMap, ARRAYNUMBER(GUIDialog_EditViewportMap))
68 FXDialogBox(parent, name,
GUIDesignDialogBox, x, y, 0, 0, 0, 0, 0, 0),
74 new FXButton(frameFiles,
"Load\t\tLoad viewport from file",
76 new FXButton(frameFiles,
"Save\t\tSave viewport to file",
82 myZoom->setRange(0.0001, 100000);
83 myZoom->setNumberFormat(4);
140 Position(myLookAtX->getValue(), myLookAtY->getValue(), myLookAtZ->getValue())
172 Position(myLookAtX->getValue(), myLookAtY->getValue(), myLookAtZ->getValue())
183 FXFileDialog opendialog(
this,
"Load Viewport");
185 opendialog.setSelectMode(SELECTFILE_ANY);
186 opendialog.setPatternList(
"*.xml");
190 if (opendialog.execute()) {
213 FXMessageBox::error(
this, MBOX_OK,
"Storing failed!",
"%s", e.what());
244 myXOff->setValue(lookFrom.
x());
245 myYOff->setValue(lookFrom.
y());
246 myZOff->setValue(lookFrom.
z());
249 myLookAtX->setValue(lookAt.
x());
250 myLookAtY->setValue(lookAt.
y());
251 myLookAtZ->setValue(lookAt.
z());
268 return myZoom->getDial().grabbed() ||
myXOff->getDial().grabbed() ||
myYOff->getDial().grabbed();
long onCmdOk(FXObject *, FXSelector, void *)
Called when the user wants to keep the viewport.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
void close()
Closes the device and removes it from the dictionary.
bool haveGrabbed() const
Returns the information whether one of the spin dialers is grabbed.
double z() const
Returns the z-position.
virtual void setViewportFromTo(const Position &lookFrom, const Position &lookAt)
applies the given viewport settings
long onCmdCancel(FXObject *, FXSelector, void *)
Called when the user wants to restore the viewport.
long onCmdChanged(FXObject *, FXSelector, void *)
Called when the user changes the viewport.
virtual double zoom2ZPos(double zoom) const =0
Returns the camera height at which the given zoom level is reached.
double y() const
Returns the y-position.
#define GUIDesignContentsFrame
design for the main content frame of every frame/dialog
double x() const
Returns the x-position.
#define GUIDesignButtonCancel
Cancel Button.
void writeXML(OutputDevice &dev)
write the settings to the given device
FXString gCurrentFolder
The folder used as last.
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
long onCmdLoad(FXObject *, FXSelector, void *)
Called when the user wants to load a viewport.
FXRealSpinDial * myZoom
The spin dialers used to change the view.
static FXString getFilename2Write(FXWindow *parent, const FXString &header, const FXString &extension, FXIcon *icon, FXString ¤tFolder)
Returns the file name to write.
#define UNUSED_PARAMETER(x)
#define WRITE_WARNING(msg)
FXButton * buttonOk
OK button.
static OptionsCont & getOptions()
Retrieves the options.
#define GUIDesignHorizontalSeparator
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
A point in 2D or 3D with translation and scaling methods.
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames ...
GUIPerspectiveChanger & getChanger() const
get changer
virtual double zPos2Zoom(double zPos) const =0
Returns the zoom level that is achieved at a given camera height.
~GUIDialog_EditViewport()
Destructor.
long onCmdSave(FXObject *, FXSelector, void *)
Called when the user wants to save a viewport.
GUISUMOAbstractView * myParent
The calling view.
virtual double getZoom() const =0
Returns the zoom factor computed stored in this changer.
FXDEFMAP(GUIDialog_EditViewport) GUIDialog_EditViewportMap[]
Position myOldLookFrom
The old viewport.
#define GUIDesignDialogBox
void applyViewport(GUISUMOAbstractView *view) const
Sets the viewport which has been parsed.
static OutputDevice & getDevice(const std::string &name)
Returns the described OutputDevice.
#define GUIDesignHorizontalFrameIcons
Horizontal frame used for pack icons.
void show()
overload show function to focus always in OK Button
virtual double getYPos() const =0
Returns the y-offset of the field to show stored in this changer.
#define GUIDesignButtonOK
Static storage of an output device and its base (abstract) implementation.
bool closeTag()
Closes the most recently opened tag.
An XML-handler for visualisation schemes.
#define GUIDesignSpinDial
A dialog to change the viewport.
void setValues(double zoom, double xoff, double yoff)
Sets the given values into the dialog.
#define GUIDesignButtonToolbarWithText
little button with text and icon
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
virtual double getXPos() const =0
Returns the x-offset of the field to show stored in this changer.
#define GUIDesignLabelLeftThick
label extended over frame with thick and with text justify to left and height of 23 ...
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
static const Position INVALID
used to indicate that a position is valid
void setOldValues(const Position &lookFrom, const Position &lookAt)
Resets old values.