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

CWidgetRenderer Class Reference

#include <CWidgetRenderer.h>

List of all members.

Public Member Functions

 CWidgetRenderer (Glib::RefPtr< Gdk::GL::Config > &refGLConfig)
virtual ~CWidgetRenderer ()
void setRenderer (CBaseVRenderer *pRenderer)
CBaseVRenderergetRenderer ()
void saveScreenshot (const std::string &sFileName)
void resetRotation ()
void prepare ()
void refresh ()
void setTextureSize (unsigned int uiTextureSizeX, unsigned int uiTextureSizeY)
unsigned int getTextureSizeX () const
unsigned int getTextureSizeY () const
void setTextureSizeRotation (unsigned int uiTextureSizeX, unsigned int uiTextureSizeY)
unsigned int getTextureSizeRotationX () const
unsigned int getTextureSizeRotationY () const
float getBrightness () const
void setBrightness (const float fBrightness)
void incBrightness (const float fStep=10.0)
void decBrightness (const float fStep=10.0)
sigc::signal< void, std::string > signal_progress_start ()
sigc::signal< void, float > signal_progress ()
sigc::signal< void > signal_progress_finished ()

Protected Member Functions

void updateBrightness ()
virtual void on_size_request (Gtk::Requisition *pRequisition)
virtual void on_realize ()
virtual bool on_configure_event (GdkEventConfigure *pEvent)
virtual bool on_expose_event (GdkEventExpose *pEvent)
virtual bool on_button_press_event (GdkEventButton *pEvent)
virtual bool on_button_release_event (GdkEventButton *pEvent)
virtual bool on_motion_notify_event (GdkEventMotion *pEvent)

Protected Attributes

CBaseVRendererm_pRenderer
CLogWriterProgress m_oLogProgressPreIntegrate
CLogWriterProgress m_oLogProgressPrepareTextures
sigc::signal< void, std::string > m_signalProgressStart
sigc::signal< void, float > m_signalProgress
sigc::signal< void > m_signalProgressFinished
bool m_bMouseButtonPressed
bool m_bRotating
Tuple2fT m_a2fMousePosStart
ArcBallT m_oArcBall
Matrix4fT m_a44fTransform
Matrix3fT m_a33fCurrentRotation
Matrix3fT m_a33fFormerRotation
float m_fScale
bool m_bTexturesPrepared
unsigned int m_uiTextureSizeX
unsigned int m_uiTextureSizeY
unsigned int m_uiTextureSizeRotationX
unsigned int m_uiTextureSizeRotationY
float m_fBrightness


Detailed Description

class viewing the textures created by CBaseVRenderer descendants.

Author:
Tobias Eberle <tobias.eberle@gmx.de>
Todo:
allow user to set minimum and maximum scale factor

Definition at line 24 of file CWidgetRenderer.h.


Constructor & Destructor Documentation

CWidgetRenderer::CWidgetRenderer Glib::RefPtr< Gdk::GL::Config > &  refGLConfig  ) 
 

Constructor initializing an class instance.

Parameters:
refGLConfig reference to gl config
Author:
Tobias Eberle <tobias.eberle@gmx.de>

Definition at line 6 of file CWidgetRenderer.cpp.

References m_bMouseButtonPressed, m_bRotating, m_bTexturesPrepared, m_fBrightness, m_fScale, m_oLogProgressPreIntegrate, m_oLogProgressPrepareTextures, m_pRenderer, m_signalProgress, m_uiTextureSizeRotationX, m_uiTextureSizeRotationY, m_uiTextureSizeX, m_uiTextureSizeY, resetRotation(), and CLogWriterProgress::signal_progress().

CWidgetRenderer::~CWidgetRenderer  )  [virtual]
 

Cleanups

Author:
Tobias Eberle <tobias.eberle@gmx.de>

Definition at line 36 of file CWidgetRenderer.cpp.


Member Function Documentation

void CWidgetRenderer::decBrightness const float  fStep = 10.0  ) 
 

decrement the brightness by fStep

Parameters:
fStep 
Author:
Tobias Eberle <tobias.eberle@gmx.de>

Definition at line 180 of file CWidgetRenderer.cpp.

References m_fBrightness, and updateBrightness().

Referenced by CWindowMain::on_MainMenuDisplayDecrementBrightness_activate().

float CWidgetRenderer::getBrightness  )  const
 

Returns:
brightness
Author:
Tobias Eberle <tobias.eberle@gmx.de>

Definition at line 163 of file CWidgetRenderer.cpp.

References m_fBrightness.

Referenced by CWindowMain::on_MainMenuDisplaySetBrightness_activate().

CBaseVRenderer * CWidgetRenderer::getRenderer  ) 
 

Returns:
pointer to used renderer
Author:
Tobias Eberle <tobias.eberle@gmx.de>

Definition at line 47 of file CWidgetRenderer.cpp.

References m_pRenderer.

unsigned int CWidgetRenderer::getTextureSizeRotationX  )  const
 

Returns:
texture size used while rotating the volume in x direction
Author:
Tobias Eberle <tobias.eberle@gmx.de>

Definition at line 153 of file CWidgetRenderer.cpp.

References m_uiTextureSizeRotationX.

unsigned int CWidgetRenderer::getTextureSizeRotationY  )  const
 

Returns:
texture size used while rotating the volume in y direction
Author:
Tobias Eberle <tobias.eberle@gmx.de>

Definition at line 158 of file CWidgetRenderer.cpp.

References m_uiTextureSizeRotationY.

unsigned int CWidgetRenderer::getTextureSizeX  )  const
 

Returns:
texture size used for normal volume rendering in x direction
Author:
Tobias Eberle <tobias.eberle@gmx.de>

Definition at line 136 of file CWidgetRenderer.cpp.

References m_uiTextureSizeX.

unsigned int CWidgetRenderer::getTextureSizeY  )  const
 

Returns:
texture size used for normal volume rendering in y direction
Author:
Tobias Eberle <tobias.eberle@gmx.de>

Definition at line 141 of file CWidgetRenderer.cpp.

References m_uiTextureSizeY.

void CWidgetRenderer::incBrightness const float  fStep = 10.0  ) 
 

increment the brightness by fStep

Parameters:
fStep 
Author:
Tobias Eberle <tobias.eberle@gmx.de>

Definition at line 174 of file CWidgetRenderer.cpp.

References m_fBrightness, and updateBrightness().

Referenced by CWindowMain::on_MainMenuDisplayIncrementBrightness_activate().

bool CWidgetRenderer::on_button_press_event GdkEventButton *  pEvent  )  [protected, virtual]
 

signal handler for left and right mouse button pressed

Parameters:
pEvent 
Returns:
handled
Author:
Tobias Eberle <tobias.eberle@gmx.de>

Definition at line 305 of file CWidgetRenderer.cpp.

References m_a2fMousePosStart, m_bMouseButtonPressed, m_bRotating, and m_oArcBall.

bool CWidgetRenderer::on_button_release_event GdkEventButton *  pEvent  )  [protected, virtual]
 

signal handler for mouse button released

Parameters:
pEvent 
Returns:
handled
Author:
Tobias Eberle <tobias.eberle@gmx.de>

Definition at line 323 of file CWidgetRenderer.cpp.

References m_a33fCurrentRotation, m_a33fFormerRotation, m_bMouseButtonPressed, and m_bRotating.

bool CWidgetRenderer::on_configure_event GdkEventConfigure *  pEvent  )  [protected, virtual]
 

resizes the opengl window

Parameters:
pEvent 
Returns:
handled
Author:
Tobias Eberle <tobias.eberle@gmx.de>

Definition at line 230 of file CWidgetRenderer.cpp.

References m_oArcBall.

bool CWidgetRenderer::on_expose_event GdkEventExpose *  pEvent  )  [protected, virtual]
 

draws the volume

Parameters:
pEvent 
Returns:
handled
Author:
Tobias Eberle <tobias.eberle@gmx.de>

Definition at line 259 of file CWidgetRenderer.cpp.

References CBaseVRenderer::draw(), m_a44fTransform, m_bRotating, m_bTexturesPrepared, m_fScale, m_pRenderer, m_uiTextureSizeRotationX, m_uiTextureSizeRotationY, m_uiTextureSizeX, m_uiTextureSizeY, CBaseVRenderer::sceneConfig(), CVRendererSceneConfig::setPreviewMode(), CVRendererSceneConfig::setRotationMatrix(), CBaseVRenderer::setScale(), and CBaseVRenderer::setTextureSize().

bool CWidgetRenderer::on_motion_notify_event GdkEventMotion *  pEvent  )  [protected, virtual]
 

signal handler for mouse motion

Parameters:
pEvent 
Returns:
handled
Author:
Tobias Eberle <tobias.eberle@gmx.de>

Definition at line 338 of file CWidgetRenderer.cpp.

References m_a2fMousePosStart, m_a33fCurrentRotation, m_a33fFormerRotation, m_a44fTransform, m_bMouseButtonPressed, m_bRotating, m_fScale, m_oArcBall, and m_pRenderer.

void CWidgetRenderer::on_realize  )  [protected, virtual]
 

initializes the widget and light stuff

Author:
Tobias Eberle <tobias.eberle@gmx.de>

Definition at line 205 of file CWidgetRenderer.cpp.

void CWidgetRenderer::on_size_request Gtk::Requisition *  pRequisition  )  [protected, virtual]
 

requests the minimal size of the widget

Parameters:
pRequisition 
Author:
Tobias Eberle <tobias.eberle@gmx.de>

Definition at line 195 of file CWidgetRenderer.cpp.

void CWidgetRenderer::prepare  ) 
 

calls CBaseVRenderer::prepareTextures() inside of the correct opengl context.

Author:
Tobias Eberle <tobias.eberle@gmx.de>

Definition at line 71 of file CWidgetRenderer.cpp.

References CTransferFunction::getCount(), CBaseVRenderer::getTransferFunction(), m_bTexturesPrepared, m_pRenderer, m_signalProgressFinished, m_signalProgressStart, m_uiTextureSizeX, m_uiTextureSizeY, CBaseVRenderer::prepare(), and CBaseVRenderer::setTextureSize().

Referenced by CWindowMain::on_windowTransferFunctionEditor_changed(), and CWindowMain::setRenderer().

void CWidgetRenderer::refresh  ) 
 

redraws the volume

Definition at line 124 of file CWidgetRenderer.cpp.

Referenced by CWindowMain::on_windowTransferFunctionEditor_changed(), and updateBrightness().

void CWidgetRenderer::resetRotation  ) 
 

resets rotation matrices to identity matrix

Author:
Tobias Eberle <tobias.eberle@gmx.de>

Definition at line 104 of file CWidgetRenderer.cpp.

References m_a33fCurrentRotation, m_a33fFormerRotation, and m_a44fTransform.

Referenced by CWidgetRenderer().

void CWidgetRenderer::saveScreenshot const std::string &  sFileName  ) 
 

Saves a screenshot to file using tiff

possible exceptions:

See also:
CBaseVRenderer::saveScreenshot()
Parameters:
sFileName filename
Author:
Tobias Eberle <tobias.eberle@gmx.de>

Definition at line 52 of file CWidgetRenderer.cpp.

References m_pRenderer, and CBaseVRenderer::saveScreenshot().

Referenced by CWindowMain::on_MainMenuFileSaveScreenshot_activate().

void CWidgetRenderer::setBrightness const float  fBrightness  ) 
 

set brightness

Parameters:
fBrightness 
Author:
Tobias Eberle <tobias.eberle@gmx.de>

Definition at line 168 of file CWidgetRenderer.cpp.

References m_fBrightness, and updateBrightness().

Referenced by CWindowMain::CWindowMain(), CWindowMain::on_MainMenuDisplaySetBrightness_activate(), and setRenderer().

void CWidgetRenderer::setRenderer CBaseVRenderer pRenderer  ) 
 

sets used renderer

Parameters:
pRenderer pointer to an instance of the renderer that should be used
Author:
Tobias Eberle <tobias.eberle@gmx.de>

Definition at line 40 of file CWidgetRenderer.cpp.

References m_bTexturesPrepared, m_fBrightness, m_pRenderer, and setBrightness().

Referenced by CWindowMain::setRenderer().

void CWidgetRenderer::setTextureSize unsigned int  uiTextureSizeX,
unsigned int  uiTextureSizeY
 

sets texture sizes should be used for normal volume rendering

Parameters:
uiTextureSizeX 
uiTextureSizeY 
Author:
Tobias Eberle <tobias.eberle@gmx.de>

Definition at line 129 of file CWidgetRenderer.cpp.

References m_uiTextureSizeX, and m_uiTextureSizeY.

Referenced by CWindowMain::setRenderer().

void CWidgetRenderer::setTextureSizeRotation unsigned int  uiTextureSizeX,
unsigned int  uiTextureSizeY
 

sets texture size used while rotating the volume. With lower texture sizes user interactivity can be improved.

Parameters:
uiTextureSizeX 
uiTextureSizeY 
Author:
Tobias Eberle <tobias.eberle@gmx.de>

Definition at line 146 of file CWidgetRenderer.cpp.

References m_uiTextureSizeRotationX, and m_uiTextureSizeRotationY.

Referenced by CWindowMain::setRenderer().

sigc::signal< void, float > CWidgetRenderer::signal_progress  ) 
 

Returns:
signal emitted while computing
Author:
Tobias Eberle <tobias.eberle@gmx.de>

Definition at line 385 of file CWidgetRenderer.cpp.

References m_signalProgress.

Referenced by CWindowMain::CWindowMain().

sigc::signal< void > CWidgetRenderer::signal_progress_finished  ) 
 

Returns:
signal emitted after computation finished
Author:
Tobias Eberle <tobias.eberle@gmx.de>

Definition at line 390 of file CWidgetRenderer.cpp.

References m_signalProgressFinished.

Referenced by CWindowMain::CWindowMain().

sigc::signal< void, std::string > CWidgetRenderer::signal_progress_start  ) 
 

Returns:
signal emitted before a larger computation starts
Author:
Tobias Eberle <tobias.eberle@gmx.de>

Definition at line 380 of file CWidgetRenderer.cpp.

References m_signalProgressStart.

Referenced by CWindowMain::CWindowMain().

void CWidgetRenderer::updateBrightness  )  [protected]
 

update the brightness setting

Author:
Tobias Eberle <tobias.eberle@gmx.de>

Definition at line 186 of file CWidgetRenderer.cpp.

References m_fBrightness, m_pRenderer, refresh(), CBaseVRenderer::sceneConfig(), and CVRendererSceneConfig::setBrightness().

Referenced by decBrightness(), incBrightness(), and setBrightness().


Member Data Documentation

Tuple2fT CWidgetRenderer::m_a2fMousePosStart [protected]
 

mouse position at rotation starts

Definition at line 314 of file CWidgetRenderer.h.

Referenced by on_button_press_event(), and on_motion_notify_event().

Matrix3fT CWidgetRenderer::m_a33fCurrentRotation [protected]
 

rotation matrix containing the current rotation while rotating the volume

Definition at line 329 of file CWidgetRenderer.h.

Referenced by on_button_release_event(), on_motion_notify_event(), and resetRotation().

Matrix3fT CWidgetRenderer::m_a33fFormerRotation [protected]
 

rotation matrix containing rotation of volume before the user is rotating it

Definition at line 335 of file CWidgetRenderer.h.

Referenced by on_button_release_event(), on_motion_notify_event(), and resetRotation().

Matrix4fT CWidgetRenderer::m_a44fTransform [protected]
 

transformation matrix

Definition at line 324 of file CWidgetRenderer.h.

Referenced by on_expose_event(), on_motion_notify_event(), and resetRotation().

bool CWidgetRenderer::m_bMouseButtonPressed [protected]
 

is the mouse button currently pressed?

Definition at line 304 of file CWidgetRenderer.h.

Referenced by CWidgetRenderer(), on_button_press_event(), on_button_release_event(), and on_motion_notify_event().

bool CWidgetRenderer::m_bRotating [protected]
 

are we rotating the volume?

Definition at line 309 of file CWidgetRenderer.h.

Referenced by CWidgetRenderer(), on_button_press_event(), on_button_release_event(), on_expose_event(), and on_motion_notify_event().

bool CWidgetRenderer::m_bTexturesPrepared [protected]
 

have textures been prepared?

Definition at line 345 of file CWidgetRenderer.h.

Referenced by CWidgetRenderer(), on_expose_event(), prepare(), and setRenderer().

float CWidgetRenderer::m_fBrightness [protected]
 

Brightness

Definition at line 370 of file CWidgetRenderer.h.

Referenced by CWidgetRenderer(), decBrightness(), getBrightness(), incBrightness(), setBrightness(), setRenderer(), and updateBrightness().

float CWidgetRenderer::m_fScale [protected]
 

scale

Definition at line 340 of file CWidgetRenderer.h.

Referenced by CWidgetRenderer(), on_expose_event(), and on_motion_notify_event().

ArcBallT CWidgetRenderer::m_oArcBall [protected]
 

arcball for simulating a trackball

Definition at line 319 of file CWidgetRenderer.h.

Referenced by on_button_press_event(), on_configure_event(), and on_motion_notify_event().

CLogWriterProgress CWidgetRenderer::m_oLogProgressPreIntegrate [protected]
 

progress log writer for "preIntegrate"

Definition at line 279 of file CWidgetRenderer.h.

Referenced by CWidgetRenderer().

CLogWriterProgress CWidgetRenderer::m_oLogProgressPrepareTextures [protected]
 

progress log writer for "prepareTextures"

Definition at line 284 of file CWidgetRenderer.h.

Referenced by CWidgetRenderer().

CBaseVRenderer* CWidgetRenderer::m_pRenderer [protected]
 

render class

Definition at line 274 of file CWidgetRenderer.h.

Referenced by CWidgetRenderer(), getRenderer(), on_expose_event(), on_motion_notify_event(), prepare(), saveScreenshot(), setRenderer(), and updateBrightness().

sigc::signal<void, float> CWidgetRenderer::m_signalProgress [protected]
 

signal emitted while computing

Definition at line 294 of file CWidgetRenderer.h.

Referenced by CWidgetRenderer(), and signal_progress().

sigc::signal<void> CWidgetRenderer::m_signalProgressFinished [protected]
 

signal emitted when computing finished

Definition at line 299 of file CWidgetRenderer.h.

Referenced by prepare(), and signal_progress_finished().

sigc::signal<void, std::string> CWidgetRenderer::m_signalProgressStart [protected]
 

signal emitted when the computation starts

Definition at line 289 of file CWidgetRenderer.h.

Referenced by prepare(), and signal_progress_start().

unsigned int CWidgetRenderer::m_uiTextureSizeRotationX [protected]
 

texture size while rotating: x direction

Definition at line 360 of file CWidgetRenderer.h.

Referenced by CWidgetRenderer(), getTextureSizeRotationX(), on_expose_event(), and setTextureSizeRotation().

unsigned int CWidgetRenderer::m_uiTextureSizeRotationY [protected]
 

texture size while rotating: y direction

Definition at line 365 of file CWidgetRenderer.h.

Referenced by CWidgetRenderer(), getTextureSizeRotationY(), on_expose_event(), and setTextureSizeRotation().

unsigned int CWidgetRenderer::m_uiTextureSizeX [protected]
 

texture size: x direction

Definition at line 350 of file CWidgetRenderer.h.

Referenced by CWidgetRenderer(), getTextureSizeX(), on_expose_event(), prepare(), and setTextureSize().

unsigned int CWidgetRenderer::m_uiTextureSizeY [protected]
 

texture size: y direction

Definition at line 355 of file CWidgetRenderer.h.

Referenced by CWidgetRenderer(), getTextureSizeY(), on_expose_event(), prepare(), and setTextureSize().


The documentation for this class was generated from the following files:
Generated on Sat Sep 24 15:47:03 2005 for vvis by  doxygen 1.4.3-20050530