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

CBaseVRenderer Class Reference

#include <CBaseVRenderer.h>

Inheritance diagram for CBaseVRenderer:

CCubeVRenderer CInt1VRenderer CLogoRenderer CShearWarp2VRenderer CTexture1VRenderer CInt2VRenderer CPreIntVRenderer CPreIntTextureVRenderer List of all members.

Public Member Functions

 CBaseVRenderer (CVoxelFieldGrad *pVoxelField, CTransferFunction *pTransferFunction)
virtual ~CBaseVRenderer (void)
virtual void setVoxelField (CVoxelFieldGrad *pVoxelField)
virtual void setTransferFunction (CTransferFunction *pTransferFunction)
virtual CTransferFunctiongetTransferFunction ()
virtual void prepare (void)=0
virtual void calculate (void)=0
virtual void drawScene (void)=0
virtual void draw (void)
virtual void clear (void)
vec_t getAbsorption (const Vector &)
Vector getEmission (const Vector &)
CVoxelFieldGradgetVoxelField (void)
void setTextureSize (unsigned int uiSizeX, unsigned int uiSizeY)
unsigned int getTextureSizeX (void)
unsigned int getTextureSizeY (void)
void setSlices (unsigned int uiSlices)
virtual bool needsUpdate (void)
virtual void notifySceneUpdated (void)
virtual void forceUpdate (void)
void setScale (const float fScale)
float getScale () const
CVRendererSceneConfigsceneConfig (void)
virtual void saveScreenshot (const std::string &sFilename)

Protected Member Functions

virtual void on_transferfunction_changed ()

Protected Attributes

CTransferFunctionm_pTransferFunction
CVoxelFieldGradm_pVoxelField
unsigned int m_uiSizeX
unsigned int m_uiSizeY
unsigned int m_uiSlices
int m_iTextures
GLuint * m_TTextures
CVRendererSceneConfig m_oCConfig
CVRendererSceneConfig m_oOConfig
Vector m_VTransformedDirectionalLightDir
float m_fScale
bool m_bTextureSizeChanged
bool m_bTransferFunctionChanged
sigc::connection m_oTransferFunctionSignalChangedConnection

Detailed Description

Class implements a base class for all renderers

Author:
Johannes Lampel <johannes@lampel.net>

Tobias Eberle <tobias.eberle@gmx.de>

Definition at line 30 of file CBaseVRenderer.h.


Constructor & Destructor Documentation

CBaseVRenderer::CBaseVRenderer CVoxelFieldGrad pVoxelField,
CTransferFunction pTransferFunction
 

This constructor initializes the class and attaches it to a CVoxelFieldGrad instance

Parameters:
pVoxelField pointer to CVoxelFieldGrad to be attached to
pTransferFunction pointer to CTransferFunction to be attached to
Author:
Johannes Lampel <johannes@lampel.net>

Definition at line 6 of file CBaseVRenderer.cpp.

References forceUpdate(), m_bTextureSizeChanged, m_iTextures, m_pTransferFunction, m_TTextures, setScale(), setTransferFunction(), and setVoxelField().

CBaseVRenderer::~CBaseVRenderer void   )  [virtual]
 

destructor, calls clear()

Author:
Johannes Lampel <johannes@lampel.net>

Definition at line 25 of file CBaseVRenderer.cpp.

References clear(), and setTransferFunction().


Member Function Documentation

virtual void CBaseVRenderer::calculate void   )  [pure virtual]
 

this pure virtual function has to be implemented by derived class to calculate any textures that have to be updated each frame.

Author:
Johannes Lampel <johannes@lampel.net>

Implemented in CCubeVRenderer, CInt1VRenderer, CLogoRenderer, CShearWarp2VRenderer, and CTexture1VRenderer.

Referenced by draw().

void CBaseVRenderer::clear void   )  [virtual]
 

Resets the class

Author:
Johannes Lampel <johannes@lampel.net>

Reimplemented in CTexture1VRenderer.

Definition at line 32 of file CBaseVRenderer.cpp.

References m_iTextures, and m_TTextures.

Referenced by CTexture1VRenderer::clear(), and ~CBaseVRenderer().

void CBaseVRenderer::draw void   )  [virtual]
 

draw calls the functions need to be called once each frame i.e. CBaseVRenderer::calculate and drawScene

Author:
Johannes Lampel <johannes@lampel.net>

Definition at line 134 of file CBaseVRenderer.cpp.

References calculate(), drawScene(), and needsUpdate().

Referenced by CWidgetRenderer::on_expose_event().

virtual void CBaseVRenderer::drawScene void   )  [pure virtual]
 

this pure virtual function has to be implemented by derived class since this is the main purpose of this class of classes which is drawing the scene, often squads and textures

Author:
Johannes Lampel <johannes@lampel.net>

Implemented in CCubeVRenderer, CInt1VRenderer, CLogoRenderer, CShearWarp2VRenderer, and CTexture1VRenderer.

Referenced by draw().

void CBaseVRenderer::forceUpdate void   )  [virtual]
 

sets angles from last update to some crazy values, so that the next frame the texture needs to be recalculated - hopefully

Author:
Johannes Lampel <johannes@lampel.net>

Definition at line 164 of file CBaseVRenderer.cpp.

References m_oOConfig, and CVRendererSceneConfig::zero().

Referenced by CBaseVRenderer().

vec_t CBaseVRenderer::getAbsorption const Vector  ) 
 

Todo:
this function should maybe be moved to CTransferFunction resp CTransferFunctionElem

Definition at line 75 of file CBaseVRenderer.cpp.

References CTransferFunctionElem::getAbsorptivity(), CVoxelFieldGrad::getGradientLengthLin(), CTransferFunction::getTransferFunction(), getVoxelField(), m_pTransferFunction, and m_pVoxelField.

Referenced by CTexture1VRenderer::prepare().

Vector CBaseVRenderer::getEmission const Vector  ) 
 

Todo:
this function should maybe be moved to CTransferFunction resp CTransferFunctionElem

Definition at line 93 of file CBaseVRenderer.cpp.

References CTransferFunctionElem::getEmissivity(), CVoxelFieldGrad::getGradientLengthLin(), CTransferFunction::getTransferFunction(), getVoxelField(), m_pTransferFunction, and m_pVoxelField.

Referenced by CTexture1VRenderer::prepare().

float CBaseVRenderer::getScale  )  const
 

Returns:
scale factor for output. this is the scale factor of the output plane(s), the scale factor for a texture size
Author:
Tobias Eberle <tobias.eberle@gmx.de>

Definition at line 174 of file CBaseVRenderer.cpp.

References m_fScale.

Referenced by CTexture1VRenderer::drawScene(), CShearWarp2VRenderer::drawScene(), and CInt1VRenderer::drawScene().

unsigned int CBaseVRenderer::getTextureSizeX void   )  [inline]
 

Returns:
X Size of texture
Author:
Johannes Lampel <johannes@lampel.net>

Definition at line 153 of file CBaseVRenderer.h.

References m_uiSizeX.

unsigned int CBaseVRenderer::getTextureSizeY void   )  [inline]
 

Returns:
Y Size of texture
Author:
Johannes Lampel <johannes@lampel.net>

Definition at line 160 of file CBaseVRenderer.h.

References m_uiSizeY.

CTransferFunction * CBaseVRenderer::getTransferFunction  )  [virtual]
 

Returns:
pointer to attached transfer function instance
Author:
Tobias Eberle <tobias.eberle@gmx.de>

Definition at line 70 of file CBaseVRenderer.cpp.

References m_pTransferFunction.

Referenced by CWidgetRenderer::prepare().

CVoxelFieldGrad* CBaseVRenderer::getVoxelField void   )  [inline]
 

Returns:
pointer to the voxel field currently attached to
Author:
Johannes Lampel <johannes@lampel.net>

Definition at line 136 of file CBaseVRenderer.h.

References m_pVoxelField.

Referenced by CShearWarp2VRenderer::calculate(), CInt1VRenderer::calculate(), getAbsorption(), getEmission(), CPreIntVRenderer::integrateAlong(), CInt2VRenderer::integrateAlong(), CInt1VRenderer::integrateAlong(), CTexture1VRenderer::prepare(), CShearWarp2VRenderer::prepare(), CPreIntTextureVRenderer::prepare(), CCubeVRenderer::prepare(), and CInt1VRenderer::setVoxelField().

bool CBaseVRenderer::needsUpdate void   )  [virtual]
 

Returns:
true if the current sceneConfig is not the same as the last sceneConfig, which means that there is the need to calculate something new, in most cases to call calculateTexture again.
Author:
Johannes Lampel <johannes@lampel.net>

Definition at line 144 of file CBaseVRenderer.cpp.

References m_bTextureSizeChanged, m_bTransferFunctionChanged, m_oCConfig, and m_oOConfig.

Referenced by draw().

void CBaseVRenderer::notifySceneUpdated void   )  [virtual]
 

Call this to tell the class that the current configuration described by sceneConfig has been used to calculate new textures etc. This base class then sets the last config member variable to the current one

Author:
Johannes Lampel <johannes@lampel.net>

Definition at line 158 of file CBaseVRenderer.cpp.

References m_bTransferFunctionChanged, m_oCConfig, and m_oOConfig.

Referenced by CTexture1VRenderer::calculate(), CShearWarp2VRenderer::calculate(), CLogoRenderer::calculate(), CInt1VRenderer::calculate(), and CCubeVRenderer::calculate().

void CBaseVRenderer::on_transferfunction_changed  )  [protected, virtual]
 

signal handler for signal_changed() of transferfunction

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

Reimplemented in CCubeVRenderer.

Definition at line 179 of file CBaseVRenderer.cpp.

References m_bTransferFunctionChanged.

Referenced by CCubeVRenderer::on_transferfunction_changed(), and setTransferFunction().

virtual void CBaseVRenderer::prepare void   )  [pure virtual]
 

this pure virtual function has to be implemented by derived class to prepare any textures. this function is not called every frame, but before rendering the first frame.

Author:
Johannes Lampel <johannes@lampel.net>

Implemented in CCubeVRenderer, CInt1VRenderer, CInt2VRenderer, CLogoRenderer, CPreIntTextureVRenderer, CPreIntVRenderer, CShearWarp2VRenderer, and CTexture1VRenderer.

Referenced by CWidgetRenderer::prepare().

void CBaseVRenderer::saveScreenshot const std::string &  sFilename  )  [virtual]
 

saves a screenshot to the given filename - to be implemented by the renderer

Author:
Johannes Lampel <johannes@lampel.net>

Reimplemented in CInt1VRenderer, CShearWarp2VRenderer, and CTexture1VRenderer.

Definition at line 189 of file CBaseVRenderer.cpp.

Referenced by CWidgetRenderer::saveScreenshot().

CVRendererSceneConfig & CBaseVRenderer::sceneConfig void   ) 
 

Returns:
a reference to the scene config
Author:
Johannes Lampel <johannes@lampel.net>

Definition at line 184 of file CBaseVRenderer.cpp.

References m_oCConfig.

Referenced by CShearWarp2VRenderer::calculate(), CInt1VRenderer::calculate(), CTexture1VRenderer::drawScene(), CCubeVRenderer::drawScene(), CPreIntVRenderer::integrateAlong(), CInt2VRenderer::integrateAlong(), CInt1VRenderer::integrateAlong(), CWidgetRenderer::on_expose_event(), CPreIntTextureVRenderer::prepare(), and CWidgetRenderer::updateBrightness().

void CBaseVRenderer::setScale const float  fScale  ) 
 

set scale factor

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

Definition at line 169 of file CBaseVRenderer.cpp.

References m_fScale.

Referenced by CBaseVRenderer(), and CWidgetRenderer::on_expose_event().

void CBaseVRenderer::setSlices unsigned int  uiSlices  ) 
 

sets the number of slices this might not be used for certain renderers

Parameters:
uiSlices number of slices
Author:
Johannes Lampel <johannes@lampel.net>

Definition at line 129 of file CBaseVRenderer.cpp.

References m_uiSlices.

Referenced by CVRenderer::factory().

void CBaseVRenderer::setTextureSize unsigned int  uiSizeX,
unsigned int  uiSizeY
 

sets the texture size to the given values.

Parameters:
uiSizeX x size
uiSizeY y size
Author:
Johannes Lampel <johannes@lampel.net>

Definition at line 115 of file CBaseVRenderer.cpp.

References m_bTransferFunctionChanged, m_uiSizeX, and m_uiSizeY.

Referenced by CVRenderer::factory(), CWidgetRenderer::on_expose_event(), and CWidgetRenderer::prepare().

void CBaseVRenderer::setTransferFunction CTransferFunction pTransferFunction  )  [virtual]
 

Attaches this renderer instance to another transfer function

Parameters:
pTransferFunction TransferFunction to be attached to
Author:
Johannes Lampel <johannes@lampel.net>

Reimplemented in CCubeVRenderer, and CShearWarp2VRenderer.

Definition at line 48 of file CBaseVRenderer.cpp.

References m_bTransferFunctionChanged, m_oTransferFunctionSignalChangedConnection, m_pTransferFunction, on_transferfunction_changed(), and CTransferFunction::signal_changed().

Referenced by CBaseVRenderer(), and ~CBaseVRenderer().

void CBaseVRenderer::setVoxelField CVoxelFieldGrad pVoxelField  )  [virtual]
 

Attaches this renderer instance to another voxel field.

Parameters:
pVoxelField Voxelfield to be attached to
Author:
Johannes Lampel <johannes@lampel.net>

Reimplemented in CCubeVRenderer, CInt1VRenderer, and CShearWarp2VRenderer.

Definition at line 43 of file CBaseVRenderer.cpp.

References m_pVoxelField.

Referenced by CBaseVRenderer(), CWindowMain::setRenderer(), CShearWarp2VRenderer::setVoxelField(), CInt1VRenderer::setVoxelField(), and CCubeVRenderer::setVoxelField().


Member Data Documentation

bool CBaseVRenderer::m_bTextureSizeChanged [protected]
 

texturesize changed?

Definition at line 283 of file CBaseVRenderer.h.

Referenced by CBaseVRenderer(), and needsUpdate().

bool CBaseVRenderer::m_bTransferFunctionChanged [protected]
 

transfer function changed?

Definition at line 288 of file CBaseVRenderer.h.

Referenced by needsUpdate(), notifySceneUpdated(), on_transferfunction_changed(), setTextureSize(), and setTransferFunction().

float CBaseVRenderer::m_fScale [protected]
 

scale factor

Definition at line 278 of file CBaseVRenderer.h.

Referenced by CCubeVRenderer::drawScene(), getScale(), and setScale().

int CBaseVRenderer::m_iTextures [protected]
 

number of textures

Definition at line 252 of file CBaseVRenderer.h.

Referenced by CBaseVRenderer(), clear(), CTexture1VRenderer::CTexture1VRenderer(), CTexture1VRenderer::drawScene(), CTexture1VRenderer::prepare(), CShearWarp2VRenderer::prepare(), CPreIntTextureVRenderer::prepare(), CLogoRenderer::prepare(), CInt1VRenderer::prepare(), and CCubeVRenderer::prepare().

CVRendererSceneConfig CBaseVRenderer::m_oCConfig [protected]
 

current render scene config

Definition at line 262 of file CBaseVRenderer.h.

Referenced by needsUpdate(), notifySceneUpdated(), and sceneConfig().

CVRendererSceneConfig CBaseVRenderer::m_oOConfig [protected]
 

old render scene config

Definition at line 267 of file CBaseVRenderer.h.

Referenced by forceUpdate(), needsUpdate(), and notifySceneUpdated().

sigc::connection CBaseVRenderer::m_oTransferFunctionSignalChangedConnection [protected]
 

remember connection to signal_changed() of the transferfunction, because we need it to be able to disconnect later

Definition at line 294 of file CBaseVRenderer.h.

Referenced by setTransferFunction().

CTransferFunction* CBaseVRenderer::m_pTransferFunction [protected]
 

The currently used transfer function CTransferFunction

Definition at line 232 of file CBaseVRenderer.h.

Referenced by CShearWarp2VRenderer::calculate(), CInt1VRenderer::calculate(), CBaseVRenderer(), getAbsorption(), getEmission(), getTransferFunction(), CInt1VRenderer::integrateAlong(), CCubeVRenderer::on_transferfunction_changed(), CTexture1VRenderer::prepare(), CShearWarp2VRenderer::prepare(), CPreIntTextureVRenderer::prepare(), CCubeVRenderer::prepare(), CShearWarp2VRenderer::setTransferFunction(), CCubeVRenderer::setTransferFunction(), and setTransferFunction().

CVoxelFieldGrad* CBaseVRenderer::m_pVoxelField [protected]
 

The voxel field this renderer is attached to

Definition at line 237 of file CBaseVRenderer.h.

Referenced by CShearWarp2VRenderer::calculate(), CInt1VRenderer::calculate(), CShearWarp2VRenderer::checkTextureSize(), CTexture1VRenderer::drawScene(), getAbsorption(), getEmission(), getVoxelField(), CPreIntVRenderer::integrateAlong(), CInt2VRenderer::integrateAlong(), CInt1VRenderer::integrateAlong(), CTexture1VRenderer::prepare(), CPreIntVRenderer::prepare(), CPreIntTextureVRenderer::prepare(), CInt2VRenderer::prepare(), CCubeVRenderer::prepare(), CPreIntVRenderer::setIntStepSize(), and setVoxelField().

GLuint* CBaseVRenderer::m_TTextures [protected]
 

Field to store texture indices

Definition at line 257 of file CBaseVRenderer.h.

Referenced by CShearWarp2VRenderer::calculate(), CInt1VRenderer::calculate(), CBaseVRenderer(), CInt1VRenderer::CInt1VRenderer(), clear(), CTexture1VRenderer::CTexture1VRenderer(), CTexture1VRenderer::drawScene(), CShearWarp2VRenderer::drawScene(), CLogoRenderer::drawScene(), CInt1VRenderer::drawScene(), CTexture1VRenderer::prepare(), CShearWarp2VRenderer::prepare(), CPreIntTextureVRenderer::prepare(), CLogoRenderer::prepare(), CInt1VRenderer::prepare(), and CCubeVRenderer::prepare().

unsigned int CBaseVRenderer::m_uiSizeX [protected]
 

size of render target

Definition at line 242 of file CBaseVRenderer.h.

Referenced by CInt1VRenderer::calculate(), CTexture1VRenderer::drawScene(), CInt1VRenderer::drawScene(), getTextureSizeX(), CTexture1VRenderer::prepare(), CPreIntTextureVRenderer::prepare(), CInt1VRenderer::saveScreenshot(), and setTextureSize().

unsigned int CBaseVRenderer::m_uiSizeY [protected]
 

size of render target

Definition at line 242 of file CBaseVRenderer.h.

Referenced by CInt1VRenderer::calculate(), CTexture1VRenderer::drawScene(), CInt1VRenderer::drawScene(), getTextureSizeY(), CTexture1VRenderer::prepare(), CPreIntTextureVRenderer::prepare(), CInt1VRenderer::saveScreenshot(), and setTextureSize().

unsigned int CBaseVRenderer::m_uiSlices [protected]
 

number of slices

Definition at line 247 of file CBaseVRenderer.h.

Referenced by CTexture1VRenderer::drawScene(), CTexture1VRenderer::prepare(), CPreIntTextureVRenderer::prepare(), and setSlices().

Vector CBaseVRenderer::m_VTransformedDirectionalLightDir [protected]
 

direction from which the directional light comes after applying the inverse view matrix to it

Definition at line 273 of file CBaseVRenderer.h.

Referenced by CShearWarp2VRenderer::calculate(), CInt1VRenderer::calculate(), CPreIntVRenderer::integrateAlong(), CInt2VRenderer::integrateAlong(), and CInt1VRenderer::integrateAlong().


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