arbeit
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

VolRenAlgBase Class Reference

#include <VolRenAlgBase.h>

Inheritance diagram for VolRenAlgBase:

glift::StateGLI glift::GliftObject glift::Compilable gutz::Counted List of all members.

Detailed Description

Rendering strategy for "VolRen" classes...

Base interface for volume rendering algorithms, works in conjunction with VolRenBase. Also, implements a simple slice via-lines view

Definition at line 38 of file VolRenAlgBase.h.

Public Member Functions

 VolRenAlgBase ()
 ~VolRenAlgBase ()
virtual void setShader (VolShader *vs)
 Set shader, a user policy.

VolShadergetShader ()
virtual void blend (bool onoff)
 Blending, defaults to true.

virtual void setSliceAxis (gutz::vec3f sliceAxis)
 Set Slice Axis.

virtual void setVolytope (VolytopeSP vt)
 Set/get Volytope, set by "VolRen" class Which volytope are you currently rendering, needed to get access to textures, this class binds the textures associated with the current volytope being rendered.

virtual VolytopeSP getVolytope ()
virtual void setGeom (VolSamples *vs)
 Set geometry to be rendered.

virtual VolSamplesgetGeom ()
virtual void drawTris (VolSamples *vs)
 Core Draw Function.

virtual gutz::LightVec getLightVec ()
 Light management.

virtual void setLightVec (gutz::LightVec &ltv)
virtual void enableLight (bool on)
virtual void enableLTHA (bool on)
virtual void init ()
void bind ()
void release ()
bool isBound ()
virtual void compile ()
virtual bool hasNonCompilable ()
virtual void setErrStream (std::ostream *os)
 Where do you want gl errors to go? they must go somewhere, so don't set it to zero please.

virtual std::ostream * getErrStream () const
 Where are gl errors going?


Protected Member Functions

virtual void bindDef ()
 Bind def.

virtual void releaseDef ()
 Release def.

virtual void bindTex ()
 Bind Textures.

virtual void releaseTex ()
 Release Textures.

virtual void updateShader ()
 call if something changes that the shader should know about

virtual bool isCompiled () const
void err (const char *where, const char *when=0) const
 error

std::ostream & err () const
 a simpler way, just use the stream! only for always print, this one automatically adds the objects name

void derr (const char *where, const char *when=0) const
 debug error

bool glerr (const char *where, const char *when=0) const
 gl error report only in debug mode, only if there is an error, if so return true

std::ostream & estr () const
 this one just gives you the stream

virtual void _incCount ()
 gutz::Counted interface, increment reference count by one.

virtual void _decCount ()
 gutz::Counted interface, decrement reference count by one.

virtual int _getCount () const
 gutz::Counted interface, get the current reference count.


Protected Attributes

glift::VecTexP _dataTex
glift::VecTexP _normTex
glift::VecTexP _etcTex
gutz::vec3f _currentAxis
bool _lightOn
bool _ltha
gutz::LightVec _ltv
VolytopeSP _curVoly
VolSamplesSP _curVSamp
bool _blend
VolShaderSP _curShader

Friends

class SmartPtr
class SmartPtrRef


Constructor & Destructor Documentation

VolRenAlgBase::VolRenAlgBase  )  [inline]
 

Definition at line 41 of file VolRenAlgBase.h.

References _blend, _currentAxis, _curShader, _curVSamp, _dataTex, _etcTex, _lightOn, _normTex, gutz::vec3f_z, and glift::VecTexP_empty.

VolRenAlgBase::~VolRenAlgBase  )  [inline]
 

Definition at line 52 of file VolRenAlgBase.h.


Member Function Documentation

virtual void gutz::Counted::_decCount  )  [inline, protected, virtual, inherited]
 

gutz::Counted interface, decrement reference count by one.

Not generaly used by subclasses, mostly for collaboration with gutz::SmartPtr. Sometimes you need to call this though, see the documentation for gutz::SmartPtr

Definition at line 54 of file smartptr.h.

Referenced by TFImage::clear(), NrroImage::fBlendOverRGBA(), and Nrro::updateMinMax().

virtual int gutz::Counted::_getCount  )  const [inline, protected, virtual, inherited]
 

gutz::Counted interface, get the current reference count.

Not generaly used by subclasses, mostly for collaboration with gutz::SmartPtr.

Definition at line 58 of file smartptr.h.

virtual void gutz::Counted::_incCount  )  [inline, protected, virtual, inherited]
 

gutz::Counted interface, increment reference count by one.

Not generaly used by subclasses, mostly for collaboration with gutz::SmartPtr. Sometimes you need to call this though, see the documentation for gutz::SmartPtr

Definition at line 48 of file smartptr.h.

Referenced by TFImage::clear(), NrroImage::fBlendOverRGBA(), and Nrro::updateMinMax().

void StateGLI::bind  )  [inherited]
 

Definition at line 34 of file stateGLI.cpp.

References glift::StateGLI::bindDef(), glift::DispList::isCompiled(), and glift::DispList::issue().

Referenced by glift::SubTex::bindDef(), glift::CoreTex::bindDef(), glift::Shader::bindDef(), glift::ProgShader::bindDef(), glift::ShadedPrim::drawDef(), and drawTris().

void VolRenAlgBase::bindDef  )  [protected, virtual]
 

Bind def.

Implements glift::StateGLI.

Definition at line 36 of file VolRenAlgBase.cpp.

References _curShader, _curVSamp, and bindTex().

void VolRenAlgBase::bindTex  )  [protected, virtual]
 

Bind Textures.

Definition at line 127 of file VolRenAlgBase.cpp.

References _curVoly, GL_TEXTURE0_ARB, and glActiveTexture.

Referenced by bindDef(), and setVolytope().

virtual void VolRenAlgBase::blend bool  onoff  )  [inline, virtual]
 

Blending, defaults to true.

Definition at line 61 of file VolRenAlgBase.h.

References _blend, and updateShader().

void StateGLI::compile  )  [virtual, inherited]
 

Compile new disply lists

Force deletion/construction of new objects in case a display list already exists for this object.

Implements glift::Compilable.

Definition at line 81 of file stateGLI.cpp.

References glift::DispList::compile(), and glift::g_compiling.

Referenced by glift::VertexProgARB::reset(), glift::PixelShaderATI8K::reset(), and glift::FragProgARB::reset().

void glift::GliftObject::derr const char *  where,
const char *  when = 0
const [inline, protected, inherited]
 

debug error

Definition at line 122 of file gliftObject.h.

References glift::GliftObject::m_err.

void VolRenAlgBase::drawTris VolSamples vs  )  [virtual]
 

Core Draw Function.

Called by "VolRen" class you get the range of elements from the vertex/tcoord data the number of triangles and the index array

Definition at line 67 of file VolRenAlgBase.cpp.

References glift::StateGLI::bind(), glift::DrawableGLI::draw(), and glift::StateGLI::release().

virtual void VolRenAlgBase::enableLight bool  on  )  [inline, virtual]
 

Definition at line 99 of file VolRenAlgBase.h.

References _lightOn.

virtual void VolRenAlgBase::enableLTHA bool  on  )  [inline, virtual]
 

Definition at line 100 of file VolRenAlgBase.h.

References _ltha.

std::ostream & glift::GliftObject::err  )  const [inline, protected, inherited]
 

a simpler way, just use the stream! only for always print, this one automatically adds the objects name

Definition at line 111 of file gliftObject.h.

References glift::GliftObject::m_err.

Referenced by glift::CoordTrans::apply(), glift::SubTex::bindDef(), glift::PrimGL::bindIndices(), glift::SubdivPlanarQuadS::bindQuads(), glift::PrimGL::bindTexCoords(), glift::CoreTex::checkTexType(), glift::EmptyTex::copyToTex(), glift::CoreTex::CoreTex(), glift::FuncTex::FuncTex(), glift::Shader::genTexCoords(), glift::CoreTex::getDataf(), glift::CoreTex::getDataub(), glift::VertexProgARB::init(), glift::FragProgARB::init(), glift::PriorityTex::PriorityTex(), glift::VertexProgARB::reload(), glift::FragProgARB::reload(), glift::RenderableGLI::render(), glift::RenderPass::renderDef(), glift::EmptyTex::resetTexState(), glift::PixelShaderATI8K::setLocalConstf(), glift::TexCube::setTexData(), glift::EmptyTex::setTexData(), glift::ShadedPrim::ShadedPrim(), glift::TexConst::TexConst(), glift::TexCube::TexCube(), and glift::EmptyTex::tryToBindPbuff().

void glift::GliftObject::err const char *  where,
const char *  when = 0
const [inline, protected, inherited]
 

error

Definition at line 101 of file gliftObject.h.

References glift::GliftObject::m_err.

Referenced by glift::SubPBuff::enable().

std::ostream& glift::GliftObject::estr  )  const [inline, protected, inherited]
 

this one just gives you the stream

Definition at line 84 of file gliftObject.h.

References glift::GliftObject::m_err.

Referenced by glift::CoreTex::bindDef(), glift::Shader::bindDef(), glift::MultiTex::bindDef(), glift::EmptyTex::bindDef(), glift::DispList::compile(), glift::CoreTex::CoreTex(), glift::VertexProgARB::init(), glift::FragProgARB::init(), glift::MultiTex::releaseDef(), and glift::EmptyTex::releaseDef().

virtual std::ostream* glift::GliftObject::getErrStream  )  const [inline, virtual, inherited]
 

Where are gl errors going?

Definition at line 49 of file gliftObject.h.

References glift::GliftObject::m_err.

Referenced by glift::getProgShaderFromFile(), and glift::getProgShaderFromText().

virtual VolSamples* VolRenAlgBase::getGeom  )  [inline, virtual]
 

Definition at line 84 of file VolRenAlgBase.h.

References _curVSamp.

virtual gutz::LightVec VolRenAlgBase::getLightVec  )  [inline, virtual]
 

Light management.

Definition at line 97 of file VolRenAlgBase.h.

References _ltv.

VolShader* VolRenAlgBase::getShader  ) 
 

virtual VolytopeSP VolRenAlgBase::getVolytope  )  [inline, virtual]
 

Definition at line 79 of file VolRenAlgBase.h.

References _curVoly.

bool GliftObject::glerr const char *  where,
const char *  when = 0
const [protected, inherited]
 

gl error report only in debug mode, only if there is an error, if so return true

Definition at line 31 of file gliftObject.cpp.

References glGetError(), and GLuint.

Referenced by RenderState2D::bindDef(), glift::NormalAttrib< VAT >::disableDef(), glift::IndexAttrib< VAT >::disableDef(), glift::TexCoordAttrib< VAT >::disableDef(), glift::VertAttrib< VAT >::disableDef(), glift::GenDrawAttrib< VAT >::disableDef(), glift::DrawAlgImm::draw(), glift::DrawAlgArr::draw(), glift::ShadedPrim::drawDef(), glift::NormalAttrib< VAT >::enableDef(), glift::IndexAttrib< VAT >::enableDef(), glift::TexCoordAttrib< VAT >::enableDef(), glift::VertAttrib< VAT >::enableDef(), glift::GenDrawAttrib< VAT >::enableDef(), and RenderState2D::releaseDef().

virtual bool glift::StateGLI::hasNonCompilable  )  [inline, virtual, inherited]
 

Definition at line 72 of file stateGLI.h.

virtual void VolRenAlgBase::init  )  [inline, virtual]
 

Definition at line 102 of file VolRenAlgBase.h.

bool glift::StateGLI::isBound  )  [inline, inherited]
 

Definition at line 70 of file stateGLI.h.

Referenced by glift::GenPrimGL< VERTA, TEXCA, IDXA, RANGEA >::drawDef(), VolShader::setBlend(), setGeom(), VolShader::setPixelShader(), setShader(), VolShader::setVertexShader(), and setVolytope().

virtual bool glift::StateGLI::isCompiled  )  const [inline, protected, virtual, inherited]
 

Implements glift::Compilable.

Definition at line 81 of file stateGLI.h.

Referenced by glift::VertexProgARB::reset(), glift::PixelShaderATI8K::reset(), and glift::FragProgARB::reset().

void StateGLI::release  )  [inherited]
 

Definition at line 57 of file stateGLI.cpp.

References glift::DispList::isCompiled(), glift::DispList::issue(), and glift::StateGLI::releaseDef().

Referenced by glift::ShadedPrim::drawDef(), drawTris(), glift::CoreTex::getDataub(), glift::SubTex::releaseDef(), glift::CoreTex::releaseDef(), glift::Shader::releaseDef(), and glift::ProgShader::releaseDef().

void VolRenAlgBase::releaseDef  )  [protected, virtual]
 

Release def.

Implements glift::StateGLI.

Definition at line 47 of file VolRenAlgBase.cpp.

References _curShader, _curVSamp, and releaseTex().

void VolRenAlgBase::releaseTex  )  [protected, virtual]
 

Release Textures.

Definition at line 143 of file VolRenAlgBase.cpp.

References _curVoly, GL_TEXTURE0_ARB, and glActiveTexture.

Referenced by releaseDef(), and setVolytope().

virtual void glift::GliftObject::setErrStream std::ostream *  os  )  [inline, virtual, inherited]
 

Where do you want gl errors to go? they must go somewhere, so don't set it to zero please.

Definition at line 44 of file gliftObject.h.

References glift::GliftObject::m_err.

Referenced by glift::getProgShaderFromFile(), and glift::getProgShaderFromText().

void VolRenAlgBase::setGeom VolSamples vs  )  [virtual]
 

Set geometry to be rendered.

Set by "VolRen" class

Definition at line 93 of file VolRenAlgBase.cpp.

References _curVSamp, and glift::StateGLI::isBound().

virtual void VolRenAlgBase::setLightVec gutz::LightVec ltv  )  [inline, virtual]
 

Definition at line 98 of file VolRenAlgBase.h.

References _ltv.

void VolRenAlgBase::setShader VolShader vs  )  [virtual]
 

Set shader, a user policy.

Definition at line 107 of file VolRenAlgBase.cpp.

References _curShader, glift::StateGLI::isBound(), and updateShader().

void VolRenAlgBase::setSliceAxis gutz::vec3f  sliceAxis  )  [virtual]
 

Set Slice Axis.

set by the "VolRen" class Provided in eye space, this is needed to tell if you are slicing front-to-back or back-to-front, so you can set the blend equations appropriately, recall that if: sliceAxis.dot(vec3f_neg_z) is greater than 0 then you are slicing front to back. The light view should always be front-to-back

Definition at line 58 of file VolRenAlgBase.cpp.

References _currentAxis, and updateShader().

void VolRenAlgBase::setVolytope VolytopeSP  vt  )  [virtual]
 

Set/get Volytope, set by "VolRen" class Which volytope are you currently rendering, needed to get access to textures, this class binds the textures associated with the current volytope being rendered.

Definition at line 79 of file VolRenAlgBase.cpp.

References _curVoly, bindTex(), glift::StateGLI::isBound(), and releaseTex().

void VolRenAlgBase::updateShader  )  [protected, virtual]
 

call if something changes that the shader should know about

End update Blending/////////////////////////////////////

update Blending

Definition at line 160 of file VolRenAlgBase.cpp.

References _blend, _currentAxis, _curShader, VolShader::BLEND_B2F, VolShader::BLEND_F2B, VolShader::BLEND_NONE, and gutz::vec3f_neg_z.

Referenced by blend(), setShader(), and setSliceAxis().


Friends And Related Function Documentation

friend class SmartPtr [friend, inherited]
 

Definition at line 40 of file smartptr.h.

Referenced by Nrro::NrroIter< T >::NrroIter().

friend class SmartPtrRef [friend, inherited]
 

Definition at line 41 of file smartptr.h.


Member Data Documentation

bool VolRenAlgBase::_blend [protected]
 

Definition at line 128 of file VolRenAlgBase.h.

Referenced by blend(), updateShader(), and VolRenAlgBase().

gutz::vec3f VolRenAlgBase::_currentAxis [protected]
 

Definition at line 118 of file VolRenAlgBase.h.

Referenced by setSliceAxis(), updateShader(), and VolRenAlgBase().

VolShaderSP VolRenAlgBase::_curShader [protected]
 

Definition at line 130 of file VolRenAlgBase.h.

Referenced by bindDef(), releaseDef(), setShader(), updateShader(), and VolRenAlgBase().

VolytopeSP VolRenAlgBase::_curVoly [protected]
 

Definition at line 124 of file VolRenAlgBase.h.

Referenced by bindTex(), getVolytope(), releaseTex(), and setVolytope().

VolSamplesSP VolRenAlgBase::_curVSamp [protected]
 

Definition at line 126 of file VolRenAlgBase.h.

Referenced by bindDef(), getGeom(), releaseDef(), setGeom(), and VolRenAlgBase().

glift::VecTexP VolRenAlgBase::_dataTex [protected]
 

Definition at line 116 of file VolRenAlgBase.h.

Referenced by VolRenAlgBase().

glift::VecTexP VolRenAlgBase::_etcTex [protected]
 

Definition at line 116 of file VolRenAlgBase.h.

Referenced by VolRenAlgBase().

bool VolRenAlgBase::_lightOn [protected]
 

Definition at line 120 of file VolRenAlgBase.h.

Referenced by enableLight(), and VolRenAlgBase().

bool VolRenAlgBase::_ltha [protected]
 

Definition at line 120 of file VolRenAlgBase.h.

Referenced by enableLTHA().

gutz::LightVec VolRenAlgBase::_ltv [protected]
 

Definition at line 122 of file VolRenAlgBase.h.

Referenced by getLightVec(), and setLightVec().

glift::VecTexP VolRenAlgBase::_normTex [protected]
 

Definition at line 116 of file VolRenAlgBase.h.

Referenced by VolRenAlgBase().


The documentation for this class was generated from the following files:
Send questions, comments, and bug reports to:
jmk