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

glift::SubTex Class Reference

#include <subTex.h>

Inheritance diagram for glift::SubTex:

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

Detailed Description

SubTex - A sub-region of a larger texture that is treated as its own Glift texture.

Definition at line 37 of file subTex.h.

Public Member Functions

 SubTex (SingleTex *tex, GLenum channel=GL_RGBA)
 SubTex (const MultiTexOState &texState, SubPBuff *subPBuff, GLenum channel=GL_RGBA)
 SubTex (SingleTex *tex, int origin, int dimen, GLenum channel=GL_RGBA)
 SubTex (SingleTex *tex, const gutz::vec2i &origin, const gutz::vec2i &dimen, GLenum channel=GL_RGBA)
 SubTex (SingleTex *tex, const gutz::vec3i &origin, const gutz::vec3i &dimen, GLenum channel=GL_RGBA)
 ~SubTex ()
 Default copy constructor and assignment operator.

SingleTextex () const
 Accessors.

const gutz::vec3iorigin () const
virtual gutz::vec3i dimen () const
 Dimen of the current data.

GLenum channel () const
virtual PBuffGliftpbuff () const
 Ptr to the pbuffer.

virtual GLenum texType () const
 Ptr to the pbuffer.

virtual GLuint texNum () const
 The OpenGL texture number (name).

virtual bool tryToBindPbuff () const
 will it try to use a pbuffer

virtual void copyToTex (int mipLevel, const gutz::vec3i &texOrig, const gutz::vec2i &screenOrig, const gutz::vec2i &copySize)
 Call correct copyToTex. "texOrig" will ignore unused components depending on dimension of texture.

virtual void getDataub (GLenum format, int mipLevel, gutz::arraybub &data)
virtual void getDataf (GLenum format, int mipLevel, gutz::arraybf &data)
virtual void setTexData (TexData *texData, int mipLevel=0, bool setTexSize=true)
 Set Funcs.

virtual void setTexState (TexObjState *texState)
 Add texture object state.

virtual void setTexState (const MultiTexOState &texState)
 Bind new texState vector and set the state therein.

virtual void tryToBindPbuff (bool tryToUsePbuff)
 Should the pbuffer be bound with the texture?

void adjustTexCoord (gutz::arrayw2f &texCoord)
 Texture-Coordinate Utilities.

virtual int numTexUnits () const
 The 'Texture' interface.

virtual void setTexCoordNum (int texCNum)=0
 set/get the texture coordinate number this texture should use

virtual int getTexCoordNum ()=0
std::string getName ()
void setName (std::string name)
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 ()
 The StateGLI interface.

virtual void releaseDef ()
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

std::string _name

Friends

class SmartPtr
class SmartPtrRef


Constructor & Destructor Documentation

SubTex::SubTex SingleTex tex,
GLenum  channel = GL_RGBA
 

Definition at line 34 of file subTex.cpp.

References channel(), glift::SingleTex::dimen(), dimen(), glift::SubPBuff::origin(), origin(), glift::SingleTex::pbuff(), glift::SubPBuff::subDimen(), and gutz::vec3i.

SubTex::SubTex const MultiTexOState texState,
SubPBuff subPBuff,
GLenum  channel = GL_RGBA
 

Definition at line 46 of file subTex.cpp.

References channel(), dimen(), glift::SubPBuff::origin(), origin(), glift::SubPBuff::subDimen(), tex(), texState, and gutz::vec3i.

SubTex::SubTex SingleTex tex,
int  origin,
int  dimen,
GLenum  channel = GL_RGBA
 

Definition at line 56 of file subTex.cpp.

References channel(), and gutz::vec3i.

SubTex::SubTex SingleTex tex,
const gutz::vec2i origin,
const gutz::vec2i dimen,
GLenum  channel = GL_RGBA
 

Definition at line 62 of file subTex.cpp.

References channel(), and gutz::vec3i.

SubTex::SubTex SingleTex tex,
const gutz::vec3i origin,
const gutz::vec3i dimen,
GLenum  channel = GL_RGBA
 

Definition at line 69 of file subTex.cpp.

References channel(), and gutz::vec3i.

SubTex::~SubTex  ) 
 

Default copy constructor and assignment operator.

Definition at line 112 of file subTex.cpp.


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 glift::SubTex::adjustTexCoord gutz::arrayw2f texCoord  )  [inline]
 

Texture-Coordinate Utilities.

Definition at line 73 of file subTex.h.

Referenced by glift::Shader::genTexCoords().

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 bindDef(), glift::CoreTex::bindDef(), glift::Shader::bindDef(), glift::ProgShader::bindDef(), glift::ShadedPrim::drawDef(), and VolRenAlgBase::drawTris().

void SubTex::bindDef  )  [protected, virtual]
 

The StateGLI interface.

Implements glift::SingleTex.

Definition at line 163 of file subTex.cpp.

References glift::StateGLI::bind(), glift::GliftObject::err(), GL_MODELVIEW, GL_TEXTURE, glMatrixMode(), glPushMatrix(), glScalef(), and glTranslatef().

GLenum glift::SubTex::channel  )  const [inline]
 

Definition at line 52 of file subTex.h.

References GLenum.

Referenced by SubTex().

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::SubTex::copyToTex int  mipLevel,
const gutz::vec3i texOrig,
const gutz::vec2i screenOrig,
const gutz::vec2i copySize
[inline, virtual]
 

Call correct copyToTex. "texOrig" will ignore unused components depending on dimension of texture.

Implements glift::SingleTex.

Definition at line 94 of file subTex.h.

References glift::SingleTex::copyToTex().

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.

virtual gutz::vec3i glift::SubTex::dimen  )  const [inline, virtual]
 

Dimen of the current data.

Implements glift::SingleTex.

Definition at line 51 of file subTex.h.

Referenced by SubTex().

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(), 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().

void SubTex::getDataf GLenum  format,
int  mipLevel,
gutz::arraybf data
[virtual]
 

Implements glift::SingleTex.

Definition at line 124 of file subTex.cpp.

References data, format, and glift::SingleTex::getDataf().

void SubTex::getDataub GLenum  format,
int  mipLevel,
gutz::arraybub data
[virtual]
 

Implements glift::SingleTex.

Definition at line 119 of file subTex.cpp.

References data, format, and glift::SingleTex::getDataub().

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().

std::string glift::Texture::getName  )  [inline, inherited]
 

Definition at line 39 of file texture.h.

virtual int glift::SingleTex::getTexCoordNum  )  [pure virtual, inherited]
 

Implemented in glift::CoreTex.

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.

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(), VolRenAlgBase::setGeom(), VolShader::setPixelShader(), VolRenAlgBase::setShader(), VolShader::setVertexShader(), and VolRenAlgBase::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().

virtual int glift::SingleTex::numTexUnits  )  const [inline, virtual, inherited]
 

The 'Texture' interface.

Implements glift::Texture.

Definition at line 56 of file singleTex.h.

const gutz::vec3i& glift::SubTex::origin  )  const [inline]
 

Definition at line 50 of file subTex.h.

Referenced by SubTex().

virtual PBuffGlift* glift::SubTex::pbuff  )  const [inline, virtual]
 

Ptr to the pbuffer.

Implements glift::SingleTex.

Definition at line 54 of file subTex.h.

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(), VolRenAlgBase::drawTris(), glift::CoreTex::getDataub(), releaseDef(), glift::CoreTex::releaseDef(), glift::Shader::releaseDef(), and glift::ProgShader::releaseDef().

void SubTex::releaseDef  )  [protected, virtual]
 

Implements glift::SingleTex.

Definition at line 185 of file subTex.cpp.

References GL_MODELVIEW, GL_TEXTURE, glMatrixMode(), glPopMatrix(), and glift::StateGLI::release().

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 glift::Texture::setName std::string  name  )  [inline, inherited]
 

Definition at line 40 of file texture.h.

References name.

virtual void glift::SingleTex::setTexCoordNum int  texCNum  )  [pure virtual, inherited]
 

set/get the texture coordinate number this texture should use

Implemented in glift::CoreTex.

virtual void glift::SubTex::setTexData TexData texData,
int  mipLevel = 0,
bool  setTexSize = true
[inline, virtual]
 

Set Funcs.

Implements glift::SingleTex.

Definition at line 67 of file subTex.h.

References texData.

virtual void glift::SubTex::setTexState const MultiTexOState texState  )  [inline, virtual]
 

Bind new texState vector and set the state therein.

Implements glift::SingleTex.

Definition at line 69 of file subTex.h.

References texState.

virtual void glift::SubTex::setTexState TexObjState texState  )  [inline, virtual]
 

Add texture object state.

Implements glift::SingleTex.

Definition at line 68 of file subTex.h.

References texState.

SingleTex* glift::SubTex::tex  )  const [inline]
 

Accessors.

Definition at line 49 of file subTex.h.

Referenced by SubTex().

virtual GLuint glift::SubTex::texNum  )  const [inline, virtual]
 

The OpenGL texture number (name).

Implements glift::SingleTex.

Definition at line 56 of file subTex.h.

References GLuint.

virtual GLenum glift::SubTex::texType  )  const [inline, virtual]
 

Ptr to the pbuffer.

Implements glift::SingleTex.

Definition at line 55 of file subTex.h.

References GLenum.

virtual void glift::SubTex::tryToBindPbuff bool  tryToUsePbuff  )  [inline, virtual]
 

Should the pbuffer be bound with the texture?

Implements glift::SingleTex.

Definition at line 70 of file subTex.h.

virtual bool glift::SubTex::tryToBindPbuff  )  const [inline, virtual]
 

will it try to use a pbuffer

Implements glift::SingleTex.

Definition at line 57 of file subTex.h.


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

std::string glift::Texture::_name [protected, inherited]
 

Definition at line 48 of file texture.h.


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