CVR-Lib last update 20 Sep 2009

cvr::viewerBase::viewerBase::mainWindow Class Reference

Parent class of all main windows. More...

#include <cvrViewerBase.h>

Inheritance diagram for cvr::viewerBase::viewerBase::mainWindow:

Inheritance graph
[legend]
Collaboration diagram for cvr::viewerBase::viewerBase::mainWindow:

Collaboration graph
[legend]

List of all members.

Classes

class  tk
 GTK toolkit class. More...

Public Member Functions

 mainWindow (viewerBase &parent)
 mainWindow (const mainWindow &other, viewerBase &parent)
virtual ~mainWindow ()
virtual mainWindowclone (viewerBase &parent) const
const informationgetInformation () const
virtual const ipointgetCanvasSize () const
virtual ipoint computeCanvasSize () const
virtual bool onKMInteraction (const interaction &action, const ipoint &position)
virtual bool closeWindow ()
virtual bool updateParameters (parameters &params)
const viewerBase::parametersgetParameters () 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 ()
mainWindowoperator= (const mainWindow &other)

Protected Attributes

tktk_
viewerBaseparent_
parametersparams_
ipoint canvasSize_


Detailed Description

Parent class of all main windows.

Constructor & Destructor Documentation

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.


Member Function Documentation

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

Get information hold by the viewerBase.

Reimplemented in cvr::viewer2D::viewer2D::mainWindow.

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.


Member Data Documentation

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.


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

Generated on Sun Sep 20 22:09:11 2009 for CVR-Lib by Doxygen 1.5.8