Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

vuTransferDialog Class Reference

A dialog window editor for the vuTFDesign transfer function. More...

#include <vuTransferDialog.h>

Inheritance diagram for vuTransferDialog:

Inheritance graph
[legend]
Collaboration diagram for vuTransferDialog:

Collaboration graph
[legend]
List of all members.

Public Types

enum  {
  idCANVAS = 100, idUPDATE, idLOADTF, idSAVETF,
  idLAST
}

Public Member Functions

 vuTransferDialog (wxWindow *parent, vuTFDesign &tf)
 Constructor for the dialog window.
const vuTFDesigngetTransferFunc () const
 Returns the transfer function as edited by the dialog window.
bool isUpdated ()
 true if tfunc (or lights in vuTFDialogSpec) have been updated
void unsetUpdated ()
 unsets updated flag

Protected Member Functions

void OnSelect (wxCommandEvent &ev)
 Updates the user interface when a control node has been selected.
void OnOpen (wxCommandEvent &ev)
 Pops up a colour dialog when a colour control node has been opened.
void OnUpdate (wxCommandEvent &ev)
 Refreshes the user interface when control nodes have been edited.
void OnOK (wxCommandEvent &ev)
 Sets the proper return codes for the ok button.
void OnLoadTF (wxCommandEvent &ev)
 Loads a transfer function.
void OnSaveTF (wxCommandEvent &ev)
 Saves a transfer function.
void OnSlideLight (wxScrollEvent &event)
 Event handler for changes at the light sliders.
bool TransferDataToWindow ()
 Part of the wxWindows architecture -- there is no data to transfer.
bool TransferDataFromWindow ()
 Part of the wxWindows architecture -- there is no data to transfer.
virtual void buildCustomSizer ()
void rebuildCustomSizer ()
virtual void editSpecColour (dword id)
void repaintParent () const
 triggers repaint event in parent window

Protected Attributes

vuTransferCanvasm_Canvas
 The editing canvas for the transfer function.
wxBoxSizer * m_CustomSizer
 This is the sizer for the additional control elements.
wxBoxSizer * m_MainSizer
 This is the sizer for the additional control elements.
wxTextCtrl * tInte
 These are the textboxes for displaying control node properties.
wxTextCtrl * tOpac
 These are the textboxes for displaying control node properties.
wxTextCtrl * tr
 These are the textboxes for displaying control node properties.
wxTextCtrl * tg
 These are the textboxes for displaying control node properties.
wxTextCtrl * tb
 These are the textboxes for displaying control node properties.
wxTextCtrl * tOpacSmooth
 These are the textboxes for displaying control node properties.
wxTextCtrl * tColSmooth
 These are the textboxes for displaying control node properties.
bool m_DoSpectral
 Indicates whether spectral colours are to be designed or RGBa.
bool m_IsUpdated
 Flag is on if tfunc was updated.

Detailed Description

A dialog window editor for the vuTFDesign transfer function.

This class is a wxWindows dialog window that lets user edit the vuTFDesign transfer function. It is based on the vuTransferCanvas editor, and actually displays this canvas in edit mode. The difference is that the editor is run in a dialog window which can be displayed like any other dialog window. The dialog window also attaches a user interface to the transfer function.

The user interface for the editor shows users the info for each of the control nodes. When they select a control node, the control node properties are displayed in relevant text boxes. The user can thus see explicitly where the control node is, and can edit it specifically. There are also text boxes for editing the opacity and colour smoothing properties. Finally, if the user double clicks on a colour control node, a standard colour dialogue is popped up which lets the user choose a colour from the colour wheel.

Finally, the dialog has OK and Cancel buttons which work as usual. The dialog sets the proper return codes for these buttons so that the resultant transfer function can be treated appropriately (either accepted or ignored).

Definition at line 36 of file vuTransferDialog.h.


Member Enumeration Documentation

anonymous enum
 

Enumeration values:
idCANVAS 
idUPDATE 
idLOADTF 
idSAVETF 
idLAST 

Definition at line 40 of file vuTransferDialog.h.


Constructor & Destructor Documentation

vuTransferDialog::vuTransferDialog wxWindow *  parent,
vuTFDesign tf
 

Constructor for the dialog window.

This creates the dialog window and it's controls, but doesn't show it. Call the standard ShowModal() method to display it.

Parameters:
parent The parent window showing the dialog.
tf The transfer function to be displayed and edited by the dialog.


Member Function Documentation

virtual void vuTransferDialog::buildCustomSizer  )  [inline, protected, virtual]
 

Reimplemented in vuTFDialogSpec.

Definition at line 92 of file vuTransferDialog.h.

Referenced by rebuildCustomSizer().

virtual void vuTransferDialog::editSpecColour dword  id  )  [inline, protected, virtual]
 

Reimplemented in vuTFDialogSpec.

Definition at line 96 of file vuTransferDialog.h.

Referenced by OnOpen().

const vuTFDesign & vuTransferDialog::getTransferFunc  )  const
 

Returns the transfer function as edited by the dialog window.

Call this method after showing the dialog window. It returns the transfer function passed in the constructor as edited by the user.

Definition at line 370 of file vuTransferDialog.cpp.

References vuTransferCanvas::getTransferFunc(), and m_Canvas.

Referenced by vuSlicer::glOnMouse(), vuShearWarp::glOnMouse(), vuBccSplat::glOnMouse(), vuBCCSheetSplatter::glOnMouse(), vuBCCShearWarp::glOnMouse(), vuShearWarp::OnButtonTransferFunction(), vuBCCShearWarp::OnButtonTransferFunction(), and vuTransferCanvas::OnMouse().

Here is the call graph for this function:

bool vuTransferDialog::isUpdated  )  [inline]
 

true if tfunc (or lights in vuTFDialogSpec) have been updated

Definition at line 66 of file vuTransferDialog.h.

Referenced by vuSpectral::glRender(), and vuSpecFVR::glRender().

void vuTransferDialog::OnLoadTF wxCommandEvent &  ev  )  [protected]
 

Loads a transfer function.

Definition at line 315 of file vuTransferDialog.cpp.

References vuTFDesign::generateFunction(), vuTransferCanvas::getTransferFunc(), vuTFDesign::loadTF(), m_Canvas, m_IsUpdated, rebuildCustomSizer(), and vuGLCanvas::redraw().

Here is the call graph for this function:

void vuTransferDialog::OnOK wxCommandEvent &  ev  )  [protected]
 

Sets the proper return codes for the ok button.

Definition at line 268 of file vuTransferDialog.cpp.

References m_IsUpdated.

void vuTransferDialog::OnOpen wxCommandEvent &  ev  )  [protected]
 

Pops up a colour dialog when a colour control node has been opened.

Definition at line 232 of file vuTransferDialog.cpp.

References byte, vuTFDesign::ColourNode::col, editSpecColour(), vuTransferCanvas::getActiveColour(), vuTFDesign::getColourNodeIndex(), vuTransferCanvas::getTransferFunc(), vuTFDesign::ColourNode::intensity, m_Canvas, m_IsUpdated, and vuTransferCanvas::setActiveColour().

Here is the call graph for this function:

void vuTransferDialog::OnSaveTF wxCommandEvent &  ev  )  [protected]
 

Saves a transfer function.

Definition at line 345 of file vuTransferDialog.cpp.

References vuTransferCanvas::getTransferFunc(), m_Canvas, and vuTFDesign::saveTF().

Here is the call graph for this function:

void vuTransferDialog::OnSelect wxCommandEvent &  ev  )  [protected]
 

Updates the user interface when a control node has been selected.

Definition at line 163 of file vuTransferDialog.cpp.

References vuTFDesign::ColourNode::col, vuTransferCanvas::getActiveColour(), vuTransferCanvas::getActiveOpacity(), vuTFDesign::ColourNode::intensity, vuTFDesign::OpacityNode::intensity, m_Canvas, vuTFDesign::OpacityNode::opacity, tb, tg, tInte, tOpac, and tr.

Here is the call graph for this function:

void vuTransferDialog::OnSlideLight wxScrollEvent &  event  )  [protected]
 

Event handler for changes at the light sliders.

All three sliders m_LightSlide[] map to this function.

Reimplemented in vuTFDialogSpec.

void vuTransferDialog::OnUpdate wxCommandEvent &  ev  )  [protected]
 

Refreshes the user interface when control nodes have been edited.

Definition at line 278 of file vuTransferDialog.cpp.

References byte, m_Canvas, m_IsUpdated, vuTransferCanvas::setActiveColour(), vuTransferCanvas::setActiveOpacity(), vuTransferCanvas::setSmoothing(), tb, tColSmooth, tg, tInte, tOpac, tOpacSmooth, and tr.

Here is the call graph for this function:

void vuTransferDialog::rebuildCustomSizer  )  [protected]
 

Definition at line 143 of file vuTransferDialog.cpp.

References buildCustomSizer(), m_CustomSizer, and m_MainSizer.

Referenced by vuTFDialogSpec::editSpecColour(), and OnLoadTF().

Here is the call graph for this function:

void vuTransferDialog::repaintParent  )  const [protected]
 

triggers repaint event in parent window

Definition at line 375 of file vuTransferDialog.cpp.

Referenced by vuTFDialogSpec::editSpecColour(), vuTFDialogSpec::OnSetupNodes(), and vuTFDialogSpec::OnSlideLight().

bool vuTransferDialog::TransferDataFromWindow  )  [inline, protected]
 

Part of the wxWindows architecture -- there is no data to transfer.

Definition at line 89 of file vuTransferDialog.h.

bool vuTransferDialog::TransferDataToWindow  )  [inline, protected]
 

Part of the wxWindows architecture -- there is no data to transfer.

Definition at line 87 of file vuTransferDialog.h.

void vuTransferDialog::unsetUpdated  )  [inline]
 

unsets updated flag

Definition at line 68 of file vuTransferDialog.h.

References m_IsUpdated.

Referenced by vuSpectral::glRender(), and vuSpecFVR::glRender().


Member Data Documentation

vuTransferCanvas* vuTransferDialog::m_Canvas [protected]
 

The editing canvas for the transfer function.

Definition at line 103 of file vuTransferDialog.h.

Referenced by getTransferFunc(), OnLoadTF(), OnOpen(), OnSaveTF(), OnSelect(), and OnUpdate().

wxBoxSizer* vuTransferDialog::m_CustomSizer [protected]
 

This is the sizer for the additional control elements.

It is rebuilt after a transfer function is loaded and the number of lights might has changed.

Definition at line 107 of file vuTransferDialog.h.

Referenced by rebuildCustomSizer().

bool vuTransferDialog::m_DoSpectral [protected]
 

Indicates whether spectral colours are to be designed or RGBa.

Definition at line 113 of file vuTransferDialog.h.

bool vuTransferDialog::m_IsUpdated [protected]
 

Flag is on if tfunc was updated.

Definition at line 116 of file vuTransferDialog.h.

Referenced by OnLoadTF(), OnOK(), OnOpen(), OnUpdate(), and unsetUpdated().

wxBoxSizer * vuTransferDialog::m_MainSizer [protected]
 

This is the sizer for the additional control elements.

It is rebuilt after a transfer function is loaded and the number of lights might has changed.

Definition at line 107 of file vuTransferDialog.h.

Referenced by rebuildCustomSizer().

wxTextCtrl * vuTransferDialog::tb [protected]
 

These are the textboxes for displaying control node properties.

Definition at line 110 of file vuTransferDialog.h.

Referenced by OnSelect(), and OnUpdate().

wxTextCtrl * vuTransferDialog::tColSmooth [protected]
 

These are the textboxes for displaying control node properties.

Definition at line 110 of file vuTransferDialog.h.

Referenced by OnUpdate().

wxTextCtrl * vuTransferDialog::tg [protected]
 

These are the textboxes for displaying control node properties.

Definition at line 110 of file vuTransferDialog.h.

Referenced by OnSelect(), and OnUpdate().

wxTextCtrl* vuTransferDialog::tInte [protected]
 

These are the textboxes for displaying control node properties.

Definition at line 110 of file vuTransferDialog.h.

Referenced by OnSelect(), and OnUpdate().

wxTextCtrl * vuTransferDialog::tOpac [protected]
 

These are the textboxes for displaying control node properties.

Definition at line 110 of file vuTransferDialog.h.

Referenced by OnSelect(), and OnUpdate().

wxTextCtrl * vuTransferDialog::tOpacSmooth [protected]
 

These are the textboxes for displaying control node properties.

Definition at line 110 of file vuTransferDialog.h.

Referenced by OnUpdate().

wxTextCtrl * vuTransferDialog::tr [protected]
 

These are the textboxes for displaying control node properties.

Definition at line 110 of file vuTransferDialog.h.

Referenced by OnSelect(), and OnUpdate().


The documentation for this class was generated from the following files:
Generated on Wed Dec 15 21:22:08 2004 for vuVolume by  doxygen 1.3.9.1