LTI-Lib latest version v1.9 - last update 10 Apr 2010

lti::viewerBase3D::configDialog Class Reference

GTK Widget for the configuration dialog of the histogram viewer. More...

#include <ltiViewerBase3D.h>

Inheritance diagram for lti::viewerBase3D::configDialog:
Inheritance graph
[legend]
Collaboration diagram for lti::viewerBase3D::configDialog:
Collaboration graph
[legend]

List of all members.

Classes

struct  pageWidget
 Structure used in the elements of the list of all pages of the configuration dialog. More...

Public Member Functions

 configDialog ()
virtual ~configDialog ()
void buildDialog ()
virtual void show ()
virtual void hide ()
virtual bool useParameters (parameters &theParam)
void whereToCallBack (mainWindow *obj)
Virtual members to be reimplemented

Following members should be reimplemented in your derived class if you add new dialog options.



virtual void insertPages ()
virtual bool getDialogData ()
virtual bool setDialogData ()

Protected Member Functions

pageWidget buildCommonPage ()
void newStrCopy (char *&dest, const char *src)
std::string toString (const double &value, const int &dec=4)
double fromString (const char *value)
void appendPage (pageWidget pw)
virtual void redrawMainWindow (void)

Static Protected Member Functions

GTK+ Callbacks

Callback functions created by Glade



static void on_ok_clicked (GtkButton *button, gpointer user_data)
static void on_cancel_clicked (GtkButton *button, gpointer user_data)
static void on_apply_clicked (GtkButton *button, gpointer user_data)
static void on_chooseFilename_clicked (GtkButton *button, gpointer user_data)
static void chooseFilename_callback (GtkWidget *widget, gpointer data)
static void on_save_clicked (GtkButton *button, gpointer user_data)
static void on_backBlack_toggled (GtkToggleButton *togglebutton, gpointer user_data)
static void on_backGrey_toggled (GtkToggleButton *togglebutton, gpointer user_data)
static void on_backWhite_toggled (GtkToggleButton *togglebutton, gpointer user_data)
static void on_backUserdef_toggled (GtkToggleButton *togglebutton, gpointer user_data)
static void on_backChoose_clicked (GtkButton *button, gpointer user_data)
static void on_axisGradient_toggled (GtkToggleButton *togglebutton, gpointer user_data)
static void on_axisFixed_toggled (GtkToggleButton *togglebutton, gpointer user_data)
static void on_axisChoose_clicked (GtkButton *button, gpointer user_data)
static void on_sizex_changed (GtkEditable *editable, gpointer user_data)
static void on_sizey_changed (GtkEditable *editable, gpointer user_data)
static void on_centerx_changed (GtkEditable *editable, gpointer user_data)
static void on_centery_changed (GtkEditable *editable, gpointer user_data)
static void on_camx_changed (GtkEditable *editable, gpointer user_data)
static void on_camy_changed (GtkEditable *editable, gpointer user_data)
static void on_camz_changed (GtkEditable *editable, gpointer user_data)
static void on_elevation_changed (GtkEditable *editable, gpointer user_data)
static void on_azimuth_changed (GtkEditable *editable, gpointer user_data)
static void on_zoom_changed (GtkEditable *editable, gpointer user_data)
static void on_perspective_changed (GtkEditable *editable, gpointer user_data)

Protected Attributes

mainWindowtheMainWindow
parametersparam
rgbPixel userdefBackcolor
std::list< pageWidgetpageList
GTK+ Objects

GTK Widgets



GtkTooltips * tooltips
GtkWidget * settings
GtkWidget * filew
colorDialogcolorSelector
GtkWidget * comboFilename
GList * comboNamelist
GtkWidget * backBlack
GtkWidget * backGrey
GtkWidget * backWhite
GtkWidget * backUserdef
GtkWidget * sizex
GtkWidget * sizey
GtkWidget * axisGradient
GtkWidget * axisFixed
GtkWidget * elevation
GtkWidget * azimuth
GtkWidget * zoom
GtkWidget * perspective
GtkWidget * centerx
GtkWidget * centery
GtkWidget * camx
GtkWidget * camy
GtkWidget * camz

Detailed Description

GTK Widget for the configuration dialog of the histogram viewer.

You will usually reimplement the methods insertPages(), setDialogData(), getDialogData(), default constructor (which call the constructor of the parent class) and destructor (which destroys the whole GTK stuff).

See also:
Creating new viewers for 3D data

Constructor & Destructor Documentation

lti::viewerBase3D::configDialog::configDialog (  ) 

create dialog and tell it in which parameter block the user data should be stored

Reimplemented in lti::histogramViewer::configDialog.

virtual lti::viewerBase3D::configDialog::~configDialog (  )  [virtual]

destroy the dialog

Reimplemented in lti::histogramViewer::configDialog.


Member Function Documentation

void lti::viewerBase3D::configDialog::appendPage ( pageWidget  pw  )  [protected]

append a page in the pages list.

pageWidget lti::viewerBase3D::configDialog::buildCommonPage (  )  [protected]

Build a page in the main settings dialog.

Returns:
a pageWidget for the common settings.
void lti::viewerBase3D::configDialog::buildDialog (  ) 

Build the Dialog's GTK+ Widget Tree.

You won't need to reimplement this methode, but insertPages().

double lti::viewerBase3D::configDialog::fromString ( const char *  value  )  [protected]

convert an ascii string into a double value

virtual bool lti::viewerBase3D::configDialog::getDialogData (  )  [virtual]

copy the contents of the dialog in the parameters object.

This method should read all data from the GTK-Widget and write them in the parameter object. Do not forget to check first if the parameter pointer is valid or not.

Returns:
true if successful, false otherwise.

Reimplemented in lti::histogramViewer::configDialog.

virtual void lti::viewerBase3D::configDialog::hide (  )  [virtual]

hide the dialog

virtual void lti::viewerBase3D::configDialog::insertPages (  )  [virtual]

Inserts all pages in the main settings dialog.

See also:
Creating new viewers for 3D data

You will usually want to overload this member. Here you will usually want to call appendPage(buildCommonPage()) followed by all methods where you build your pages.

The default implementation will just add the common page, with the camera positioning, zoom, perspective and similar settings. You could call the parent class method to do this, but is usually not done to avoid dealing with a MS VC++ bug.

If you want to add some pages, you will need to create the desired GTK Widget, and give a name for it, assign both values to a pageWidget structure and append it to the current list of pages using appendPage().

The best way doing so is implementing methods buildABCPage, where ABC should be replaced with a meaningful name. These methods should return an object pageWidget, that can be appended to the pages list. Following example illustrate this concept:

 class myViewer : public viewerBase3D {
   // ... implementation of parameters, etc. ...
   class configDialog : public viewerBase3D::configDialog {
   public:
     // default constructor
     configDialog() : viewerBase3D::configDialog() {};

     // build my page
     pageWidget buildMyPage() {
       pageWidget pw;        // this object will be returned
       pw.label = "my page"; // the name of the widget

       // create the GTK widget
       GtkWidget* theWidget = gtk_vbox_new (FALSE, 0);
       // ...

       pw.widget = theWidget;
       return pw;
     };

     // insert pages
     virtual void insertPages() {
       // append first the common dialog (from the parent class)
       appendPage(buildCommonPage());
       // append my page
       appendPage(buildMyPage());
     }
   }
 };

This method will insert the pages in an internal list, that will be read in the buildDialog() method.

Reimplemented in lti::histogramViewer::configDialog.

void lti::viewerBase3D::configDialog::newStrCopy ( char *&  dest,
const char *  src 
) [protected]

copy src to dest and allocates memory for dest

virtual void lti::viewerBase3D::configDialog::redrawMainWindow ( void   )  [protected, virtual]

copy the parameters to the mainWindow and calls redraw method

virtual bool lti::viewerBase3D::configDialog::setDialogData (  )  [virtual]

copy the contents of the parameters object into the dialog entries

This method should write all data given in the parameters into the GTK-Widget. Do not forget to check first if the parameter pointer is valid or not.

Returns:
true if successful, false otherwise.

Reimplemented in lti::histogramViewer::configDialog.

virtual void lti::viewerBase3D::configDialog::show (  )  [virtual]

show the dialog

std::string lti::viewerBase3D::configDialog::toString ( const double &  value,
const int &  dec = 4 
) [protected]

convert a double in an ascii string

virtual bool lti::viewerBase3D::configDialog::useParameters ( parameters theParam  )  [virtual]

Indicate which parameters object should be used.

This class will not administrate the memory management of the object. It will just keep a reference to it. If deleted externally an error will occur.

You should also ensure that this method is called before showing the dialog for the first time, or all data will be uninitialized!

Returns:
true if successful, false otherwise.
void lti::viewerBase3D::configDialog::whereToCallBack ( mainWindow obj  ) 

set the parent of this dialog to tell it when everything is done!


Member Data Documentation

Tooltip: explains parameters.

kind(color) of coodinate axis

Tooltip: explains parameters.

toggle buttons for backgroundcolor

Tooltip: explains parameters.

Tooltip: explains parameters.

Tooltip: explains parameters.

GtkWidget* lti::viewerBase3D::configDialog::camx [protected]

camera position

GtkWidget* lti::viewerBase3D::configDialog::camy [protected]

Tooltip: explains parameters.

GtkWidget* lti::viewerBase3D::configDialog::camz [protected]

Tooltip: explains parameters.

center position

Tooltip: explains parameters.

color selection dialog

combobox for save-file-names

pointerlist to strings, which saves all save-file-names

view parameters

file selector

holds the the widges and the names for special pages in the settings dialog

pointer to the used viewer parameters.

This class should NEVER delete or create this object, because is just a reference to external data.

The methods should check if it points to valid data, i.e. if the pointer points to the right type (check it with dynamic_cast), or if the pointer is null.

Tooltip: explains parameters.

main dialog

x,y windows size

Tooltip: explains parameters.

Pointer to the parent mainWindow.

Tooltip: explains parameters.

userdef background color

Default: lti::Black (lti::rgbPixel(0,0,0))

GtkWidget* lti::viewerBase3D::configDialog::zoom [protected]

Tooltip: explains parameters.


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

Generated on Sat Apr 10 15:29:10 2010 for LTI-Lib by Doxygen 1.6.1