OpenGL::TextureContainer Class Reference

#include <TextureContainer.h>

Inheritance diagram for OpenGL::TextureContainer:

OpenGL::PrimaryTextureContainer OpenGL::SecondaryTextureContainer List of all members.

Public Types

enum  Channel { , GREEN, BLUE, ALPHA }

Public Member Functions

 TextureContainer (IoTextureSet *textureSet, unsigned int viewportX, unsigned int viewportY, unsigned int viewportWidth, unsigned int viewportHeight)
 TextureContainer (IoTextureSet *textureSet)
void render () const
unsigned int getTextureCount () const
bool isActive (unsigned int textureNumber) const
void activateTexture (unsigned int textureNumber)
void deactivateTexture (unsigned int textureNumber)
void dumpTexture (unsigned int textureNumber, Channel channel, std::ostream &output)
unsigned int getTextureId (unsigned int textureNumber)
void activateSingleChannel (Channel channel)
void activateDualChannels (Channel first, Channel second)
void activateTripleChannels (Channel first, Channel second, Channel third)
void setRange (float minValue, float maxValue)
bool isGridActive () const
void setGridActive (bool gridActive)
void setTextColor (float red, float green, float blue)
void setGridColor (float red, float green, float blue)
void setSeparatorColor (float red, float green, float blue)
void setDescription (const std::string &description)

Static Public Member Functions

static bool getSmoothDisplay ()
static void setSmoothDisplay (bool smoothDisplay)

Protected Member Functions

void insertTexture (unsigned int textureId)

Private Member Functions

virtual GLenum getActiveTarget () const =0
virtual unsigned int getActiveWidth () const =0
virtual unsigned int getActiveHeight () const =0
virtual GLenum getTarget (unsigned int textureNumber) const =0
virtual unsigned int getWidth (unsigned int textureNumber) const =0
virtual unsigned int getHeight (unsigned int textureNumber) const =0
virtual void handleTextureActivation (unsigned int textureNumber)=0

Detailed Description

Contains a set of textures from an IoTextureSet and displays them on the screen. The textures in the TextureContainer are numbered from 0 to getTextureCount() - 1 and these texture numbers are used as identifiers for the actual textures.


Member Enumeration Documentation

enum OpenGL::TextureContainer::Channel
 

Texture channels.

Enumerator:
GREEN  the red channel
BLUE  the green channel
ALPHA  the alpha channel


Constructor & Destructor Documentation

OpenGL::TextureContainer::TextureContainer IoTextureSet textureSet,
unsigned int  viewportX,
unsigned int  viewportY,
unsigned int  viewportWidth,
unsigned int  viewportHeight
 

Initializes the TextureContainer based on the given IoTextureSet and viewport dimensions.

Parameters:
textureSet the given IoTextureSet.
viewportX the left position of the viewport.
viewportY the top position of the viewport.
viewportWidth the width of the viewport.
viewportHeight the height of the viewport.

OpenGL::TextureContainer::TextureContainer IoTextureSet textureSet  ) 
 

Initializes the TextureContainer based on the given IoTextureSet, and the current OpenGL viewport coordinates.

Parameters:
textureSet the given IoTextureSet.


Member Function Documentation

void OpenGL::TextureContainer::activateDualChannels Channel  first,
Channel  second
 

Activates two channels of the textures. The first channel becomes the red channel of the output, whereas the second channel becomes the green channel of the output.

Parameters:
first the first channel (to be displayed in red).
second the second channel (to be displayed in green).

void OpenGL::TextureContainer::activateSingleChannel Channel  channel  ) 
 

Activates a single channel of the textures. This channel will be displayed in grayscale.

Parameters:
channel the given channel (to be displayed in grayscale).

void OpenGL::TextureContainer::activateTexture unsigned int  textureNumber  ) 
 

Activates the given texture.

Parameters:
textureNumber the number of the given texture.

void OpenGL::TextureContainer::activateTripleChannels Channel  first,
Channel  second,
Channel  third
 

Activates three channels of the textures. The first channel becomes the red channel of the output, the second channel becomes the green channel of the output, and the third channel becomes the blue channel of the output.

Parameters:
first the first channel (to be displayed in red).
second the second channel (to be displayed in green).
third the third channel (to be displayed in blue).

void OpenGL::TextureContainer::deactivateTexture unsigned int  textureNumber  ) 
 

Deactivates the given texture.

Parameters:
textureNumber the number of the given texture.

void OpenGL::TextureContainer::dumpTexture unsigned int  textureNumber,
Channel  channel,
std::ostream &  output
 

Dumps the selected channel of the given texture to the output stream.

Parameters:
textureNumber the number of the given texture.
channel the channel to dump.
output the output stream to dump the texture to.

virtual unsigned int OpenGL::TextureContainer::getActiveHeight  )  const [private, pure virtual]
 

Gets the height of the active texture(s).

Returns:
the height of the active texture(s).

Implemented in OpenGL::PrimaryTextureContainer, and OpenGL::SecondaryTextureContainer.

virtual GLenum OpenGL::TextureContainer::getActiveTarget  )  const [private, pure virtual]
 

Gets the texture target of the active texture(s).

Returns:
the texture target of the active texture(s).

Implemented in OpenGL::PrimaryTextureContainer, and OpenGL::SecondaryTextureContainer.

virtual unsigned int OpenGL::TextureContainer::getActiveWidth  )  const [private, pure virtual]
 

Gets the width of the active texture(s).

Returns:
the width of the active texture(s).

Implemented in OpenGL::PrimaryTextureContainer, and OpenGL::SecondaryTextureContainer.

virtual unsigned int OpenGL::TextureContainer::getHeight unsigned int  textureNumber  )  const [private, pure virtual]
 

Gets the height of the given texture.

Parameters:
textureNumber the number of the given texture.
Returns:
the height of the active texture(s).

Implemented in OpenGL::PrimaryTextureContainer, and OpenGL::SecondaryTextureContainer.

bool OpenGL::TextureContainer::getSmoothDisplay  )  [static]
 

Checks whether interpolation is used when displaying the active textures.

Returns:
whether interpolation is used.

virtual GLenum OpenGL::TextureContainer::getTarget unsigned int  textureNumber  )  const [private, pure virtual]
 

Gets the texture target of the given texture.

Parameters:
textureNumber the number of the given texture.
Returns:
the texture target of the given texture.

Implemented in OpenGL::PrimaryTextureContainer, and OpenGL::SecondaryTextureContainer.

unsigned int OpenGL::TextureContainer::getTextureCount  )  const
 

Gets the number of textures in the TextureContainer. The textures in the TextureContainer are numbered from 0 to number of textures - 1.

Returns:
the number of textures.

unsigned int OpenGL::TextureContainer::getTextureId unsigned int  textureNumber  ) 
 

Gets the OpenGL texture identifier (GLuint) of the given texture.

Parameters:
textureNumber the number of the given texture.
Returns:
the OpenGL texture's identifier.

virtual unsigned int OpenGL::TextureContainer::getWidth unsigned int  textureNumber  )  const [private, pure virtual]
 

Gets the width of the given texture.

Parameters:
textureNumber the number of the given texture.
Returns:
the width of the given texture.

Implemented in OpenGL::PrimaryTextureContainer, and OpenGL::SecondaryTextureContainer.

virtual void OpenGL::TextureContainer::handleTextureActivation unsigned int  textureNumber  )  [private, pure virtual]
 

Called whenever the given texture is activated.

Parameters:
textureNumber the number of the given texture.

Implemented in OpenGL::PrimaryTextureContainer, and OpenGL::SecondaryTextureContainer.

void OpenGL::TextureContainer::insertTexture unsigned int  textureId  )  [protected]
 

Used by subclasses to insert textures.

Parameters:
textureId the texture's identifier, used to lookup in the IoTextureSet.

bool OpenGL::TextureContainer::isActive unsigned int  textureNumber  )  const
 

Checks if the given texture is active.

Parameters:
textureNumber the number of the given texture.
Returns:
if the texture is active or not.

bool OpenGL::TextureContainer::isGridActive  )  const
 

Checks if the texture grid is currently active. The texture grid is drawn on top of each active texture, separating the texture texels.

Returns:
if the grid is active.

void OpenGL::TextureContainer::render  )  const
 

Renders the currently active textures to the viewport, based on the selected channels, range and colors.

void OpenGL::TextureContainer::setDescription const std::string &  description  ) 
 

Set the texture container's description, displayed when render is called.

Parameters:
description the texture container's description.

void OpenGL::TextureContainer::setGridActive bool  gridActive  ) 
 

Sets the active status of the texture grid.

Parameters:
gridActive the new grid active status.

void OpenGL::TextureContainer::setGridColor float  red,
float  green,
float  blue
 

Sets the texture grid color used when drawing the texture grid on top of each active texture, separating the texture texels.

Parameters:
red the red component.
green the green component.
blue the blue component.

void OpenGL::TextureContainer::setRange float  minValue,
float  maxValue
 

Sets the range of values to be displayed. Values below minValue will become 0, whereas values above maxValue become 1.

Parameters:
minValue the minimum value of the range to be displayed.
maxValue the maximum value of the range to be displayed.

void OpenGL::TextureContainer::setSeparatorColor float  red,
float  green,
float  blue
 

Sets the separator color used when drawing a frame around each active texture.

Parameters:
red the red component.
green the green component.
blue the blue component.

void OpenGL::TextureContainer::setSmoothDisplay bool  smoothDisplay  )  [static]
 

Sets whether interpolation should be used when displaying the active textures.

Parameters:
smoothDisplay whether interpolation should be used.

void OpenGL::TextureContainer::setTextColor float  red,
float  green,
float  blue
 

Sets the text color used when displaying texture descriptions.

Parameters:
red the red component.
green the green component.
blue the blue component.


The documentation for this class was generated from the following files:
Generated on Fri Jun 16 08:42:53 2006 for GPU Thesis by  doxygen 1.4.6-NO