last update 20 Sep 2009 |
#include <cvrViewerBase.h>
Classes | |
class | tk |
GTK toolkit class. More... | |
Public Member Functions | |
mainWindow (viewerBase &parent) | |
mainWindow (const mainWindow &other, viewerBase &parent) | |
virtual | ~mainWindow () |
virtual mainWindow * | clone (viewerBase &parent) const |
const information & | getInformation () const |
virtual const ipoint & | getCanvasSize () const |
virtual ipoint | computeCanvasSize () const |
virtual bool | onKMInteraction (const interaction &action, const ipoint &position) |
virtual bool | closeWindow () |
virtual bool | updateParameters (parameters ¶ms) |
const viewerBase::parameters & | getParameters () const |
Toolkit dependent functions | |
virtual bool | build () |
virtual bool | show () |
virtual bool | hide () |
virtual bool | destroy () |
virtual bool | statusBar (const std::string &txt) |
virtual bool | setCanvasSize (const ipoint &newSize) |
Protected Member Functions | |
virtual void | initToolkit () |
virtual void | destroyToolkit () |
mainWindow & | operator= (const mainWindow &other) |
Protected Attributes | |
tk * | tk_ |
viewerBase * | parent_ |
parameters * | params_ |
ipoint | canvasSize_ |
cvr::viewerBase::viewerBase::mainWindow::mainWindow | ( | viewerBase & | parent | ) |
Create an "empty" window.
The constructor creates just the object, without interacting with the GUI, to save some time (maybe the users still do not want to show any data. This is the one and only constructor and requires to know who is the parent viewer, in order to make possible the communication with it.
cvr::viewerBase::viewerBase::mainWindow::mainWindow | ( | const mainWindow & | other, | |
viewerBase & | parent | |||
) |
Copy constructor.
This makes a deep copy except of the parent, which has to be given explicitely.
virtual cvr::viewerBase::viewerBase::mainWindow::~mainWindow | ( | ) | [virtual] |
Destructor.
virtual bool cvr::viewerBase::viewerBase::mainWindow::build | ( | ) | [virtual] |
Constructs the main window.
You usually don't need to call this method directly, as it is called by show() if necessary.
This is called just once for a viewer.
virtual mainWindow* cvr::viewerBase::viewerBase::mainWindow::clone | ( | viewerBase & | parent | ) | const [virtual] |
Clone.
A new mainWindow is created with everything identical to the current one expect for the parent viewer, which has to be given explicitely
virtual bool cvr::viewerBase::viewerBase::mainWindow::closeWindow | ( | ) | [virtual] |
Called when the main window was closed.
The default implementation just generates the proper event (for waitInteration()) and hides everything.
virtual ipoint cvr::viewerBase::viewerBase::mainWindow::computeCanvasSize | ( | ) | const [virtual] |
Compute the new canvas size.
Nothing but the computation of the "optimal" size has to be in an overloaded method. The setCanvasSize() method decides if the change takes place or not.
Reimplemented in cvr::viewer2D::viewer2D::mainWindow.
virtual bool cvr::viewerBase::viewerBase::mainWindow::destroy | ( | ) | [virtual] |
Destroys the widget completely.
Before the widget is destroyed, the window is hidden, and the parent viewer is signalized accordingly in order to destroy the configuration dialog.
virtual void cvr::viewerBase::viewerBase::mainWindow::destroyToolkit | ( | ) | [protected, virtual] |
Destroy toolkit dependent class.
This is called at destruction time and is implemented by the toolkit being used.
Reimplemented in cvr::viewer2D::viewer2D::mainWindow.
virtual const ipoint& cvr::viewerBase::viewerBase::mainWindow::getCanvasSize | ( | ) | const [virtual] |
Return the by now registered canvas size.
This method does not return the real canvas size, but an internal value stored the las time the canvas size was changed.
const information& cvr::viewerBase::viewerBase::mainWindow::getInformation | ( | ) | const |
const viewerBase::parameters& cvr::viewerBase::viewerBase::mainWindow::getParameters | ( | ) | const |
Get a read-only reference to the parameters.
virtual bool cvr::viewerBase::viewerBase::mainWindow::hide | ( | ) | [virtual] |
Hides the main window.
virtual void cvr::viewerBase::viewerBase::mainWindow::initToolkit | ( | ) | [protected, virtual] |
Initialize toolkit dependent class.
This is called at construction time but is implemented by the toolkit being used.
Reimplemented in cvr::viewer2D::viewer2D::mainWindow.
virtual bool cvr::viewerBase::viewerBase::mainWindow::onKMInteraction | ( | const interaction & | action, | |
const ipoint & | position | |||
) | [virtual] |
Keyboard/Mouse slot.
Virtual function called by the toolkit when there is some sort of interaction with the main window. This function then calls parentViewer.setKMInteraction() with the appropriate parameters and checks if it is the key/button configuration that starts the configuration dialog.
mainWindow& cvr::viewerBase::viewerBase::mainWindow::operator= | ( | const mainWindow & | other | ) | [protected] |
Disable operator=.
virtual bool cvr::viewerBase::viewerBase::mainWindow::setCanvasSize | ( | const ipoint & | newSize | ) | [virtual] |
Resize canvas.
Update the size of the area used to display data.
The "canvas" may receive different names in different toolkits. In the GTK implementation is a gtk-drawing-area, but QT and Windows might use other similar names.
The canvas is usually as big the the image being displayed or as the largest possible projection plane in rendering 3D scenes.
virtual bool cvr::viewerBase::viewerBase::mainWindow::show | ( | ) | [virtual] |
Shows the main window.
If it is not constructed yet, then the main window is constructed.
virtual bool cvr::viewerBase::viewerBase::mainWindow::statusBar | ( | const std::string & | txt | ) | [virtual] |
Display in the status bar the given text.
virtual bool cvr::viewerBase::viewerBase::mainWindow::updateParameters | ( | parameters & | params | ) | [virtual] |
Change the parameters being used.
This method is implemented in the toolkit dependent part, as it is the toolkit the one that knows how to set all parameters.
Note that the given reference can/will be modified by the toolkit, since the user can change the geometry of the window, and that will be reflected in the parameters.
ipoint cvr::viewerBase::viewerBase::mainWindow::canvasSize_ [protected] |
Last hint about the size of the canvas, i.e.
the area which is going to be used by the used toolkit to display the information
parameters* cvr::viewerBase::viewerBase::mainWindow::params_ [protected] |
Parameters of the viewer.
viewerBase* cvr::viewerBase::viewerBase::mainWindow::parent_ [protected] |
Reference to the parent window.
tk* cvr::viewerBase::viewerBase::mainWindow::tk_ [mutable, protected] |
The toolkit instance created only at construction time and destroyed in the destructor.