ImageNode Class Reference

Base class for all nodes that produce image data. More...

#include <ImageNode.h>

Inheritance diagram for ImageNode:

Inheritance graph
[legend]
Collaboration diagram for ImageNode:

Collaboration graph
[legend]

List of all members.

Public Slots

void clearImageCache ()
 Clears the image cache by freeing all memory allocated for the cache.

Public Member Functions

 ImageNode (const QString &name, ParameterGroup *parameterRoot, bool cacheEnabled=true, const QString &outputImageName="Image")
 Constructor of the ImageNode class.
virtual ~ImageNode ()
 Destructor of the ImageNode class.
virtual Ogre::TexturePtr getImage ()
 Returns the image that is generated by this node.
bool isCached (int index) const
 Returns whether a cached image is available for the frame with the given index.
Ogre::Image * getCachedImage (int index) const
 Returns the image cached for the frame with the given index.

Static Public Attributes

static const int NumberUnknown = -1
 A constant value indicating that the number of images (to cache) is not known yet.

Protected Member Functions

void setNumberOfImagesToCache (unsigned int numberOfImagesToCache)
 Sets the number of images to cache to the given value.
Ogre::Image * createImageFromTexture (Ogre::TexturePtr texturePointer)
 Creates an image from the given texture.
void cacheImage (int index, Ogre::Image *image)
 Stores the given image in the cache for the frame with the given index.
void setOutputImage (Ogre::Image *image)
 Sets the given image as the output image in the output image parameter.

Protected Attributes

bool m_cacheEnabled
 Flag that states whether the image cache for this node is enabled.
bool m_cacheInvalid
 Flag that states whether the cache is invalid and should be cleared.
QString m_outputImageName
 The name of the image output parameter.
int m_numberOfImagesToCache
 The total number of images to cache.
QMap< int, Ogre::Image * > m_imageCache
 The data structure to use for caching the loaded images.

Private Member Functions

void updateCacheStatus ()
 Updates the cache status.


Detailed Description

Base class for all nodes that produce image data.

Constructor & Destructor Documentation

ImageNode::ImageNode ( const QString &  name,
ParameterGroup parameterRoot,
bool  cacheEnabled = true,
const QString &  outputImageName = "Image" 
)

Constructor of the ImageNode class.

Constructors and Destructors.

Parameters:
name The name for the new node.
parameterRoot A copy of the parameter tree specific for the type of the node.
cacheEnabled Flag to enable or disable the image cache for this node.
outputImageName The name of the geometry output parameter.
Constructor of the ImageNode class.

Parameters:
name The name for the new node.
parameterRoot A copy of the parameter tree specific for the type of the node.
cacheEnabled Flag to enable or disable the image cache for this node.
outputImageName The name of the geometry output parameter.

ImageNode::~ImageNode (  )  [virtual]

Destructor of the ImageNode class.

Defined virtual to guarantee that the destructor of a derived class will be called if the instance of the derived class is saved in a variable of its parent class type.


Member Function Documentation

Ogre::TexturePtr ImageNode::getImage (  )  [virtual]

Returns the image that is generated by this node.

Public Functions.

Returns:
The image that is generated by this node.
Returns the image that is generated by this node.

Returns:
The image that is generated by this node.

Reimplemented from ViewNode.

bool ImageNode::isCached ( int  index  )  const

Returns whether a cached image is available for the frame with the given index.

Parameters:
index The index of the frame for which to test whether a cached image is available.
Returns:
True if a cached image is available for the frame with the given index, otherwise False.

Ogre::Image * ImageNode::getCachedImage ( int  index  )  const

Returns the image cached for the frame with the given index.

Parameters:
index The index of the frame for which to return the cached image.
Returns:
The cached image, or 0 if no cached image is available for the frame with the given index.

void ImageNode::clearImageCache (  )  [slot]

Clears the image cache by freeing all memory allocated for the cache.

Public Slots.

void ImageNode::setNumberOfImagesToCache ( unsigned int  numberOfImagesToCache  )  [protected]

Sets the number of images to cache to the given value.

Protected Functions.

Parameters:
numberOfImagesToCache The number of images to cache.
Sets the number of images to cache to the given value.

Parameters:
numberOfImagesToCache The number of images to cache.

Ogre::Image * ImageNode::createImageFromTexture ( Ogre::TexturePtr  texturePointer  )  [protected]

Creates an image from the given texture.

Parameters:
texturePointer The texture from which to copy the image data.
Returns:
The image created from the given texture, or 0 if the given texture is invalid.

void ImageNode::cacheImage ( int  index,
Ogre::Image *  image 
) [protected]

Stores the given image in the cache for the frame with the given index.

Parameters:
index The index of the frame for which to cache the image.
image The image to cache for the frame with the given index.

void ImageNode::setOutputImage ( Ogre::Image *  image  )  [protected]

Sets the given image as the output image in the output image parameter.

Parameters:
image The image containing the pixel data to use for the texture.

void ImageNode::updateCacheStatus (  )  [private]

Updates the cache status.

Private Functions.


Member Data Documentation

const int ImageNode::NumberUnknown = -1 [static]

A constant value indicating that the number of images (to cache) is not known yet.

bool ImageNode::m_cacheEnabled [protected]

Flag that states whether the image cache for this node is enabled.

bool ImageNode::m_cacheInvalid [protected]

Flag that states whether the cache is invalid and should be cleared.

QString ImageNode::m_outputImageName [protected]

The name of the image output parameter.

The total number of images to cache.

QMap<int, Ogre::Image *> ImageNode::m_imageCache [protected]

The data structure to use for caching the loaded images.

The key for the map is the index of a frame.


The documentation for this class was generated from the following files:

Generated on Wed Feb 24 15:01:00 2010 for Frapper by  doxygen 1.5.9