OpenGUI::ImageryManager Class Reference

#include <OpenGUI_ImageryManager.h>

List of all members.


Detailed Description

Provides management services for loading, unloading, keeping track of, and searching for Imageset and the children Image objects.
[Singleton].


Public Types

typedef std::list< StringImagesetList
 A string list used by ImageryManager::getImagesetList().

Public Member Functions

ImagesetPtr createImageset (const String &imageFilename)
 Create a new Imageset.
ImagesetPtr createImagesetFromTexture (TexturePtr texture, const String &imageFilename="")
 Create a new Imageset from an existing texture.
ImagesetPtr getImageset (const String &imageFilename)
 Returns a pointer to the Imageset that was created using the given filename, or 0 on failure.
ImagesetPtr getImagesetByTexture (TexturePtr texture)
 Returns a pointer to the Imageset that is based on the given texture, or 0 on failure.
void destroyImageset (ImagesetPtr pImageset)
 Destroys an Imageset.
void destroyImageset (const String &imageFilename)
 Destroys an Imageset.
void destroyAllImagesets ()
 Destroys all Imagesets.
ImageryPtr getImagery (const String &imageryName)
 Retrieves an Imagery by fully qualified name, or by first match on name alone.
ImagesetList getImagesetList ()
 Returns an ImagesetList of all Imagesets that are currently loaded. Items can be fed back into getImageset().
void addFace (FacePtr facePtr)
 Adds the given FacePtr to the managed list of Faces so that it can be retrieved later by name.
FacePtr getFace (const String &faceName)
 Retrieves a previously added Face by name.
void removeFace (const String &faceName)
 Removes a previously added Face by name.
StringList getFaceList ()
 Returns a list of all registered faces.

Static Public Member Functions

static ImageryManagergetSingleton (void)
 Retrieve the current singleton, if one exists. If none exists, this will cause an error.
static ImageryManagergetSingletonPtr (void)
 Retrieve a pointer to the current singleton, if one exists. If none exists, this will return 0.
static ImagesetPtr createImagesetEx (const String &imageFilename)
 Static pass through function to createImageset().


Member Typedef Documentation

typedef std::list<String> OpenGUI::ImageryManager::ImagesetList
 

A string list used by ImageryManager::getImagesetList().


Member Function Documentation

void OpenGUI::ImageryManager::addFace FacePtr  facePtr  ) 
 

Adds the given FacePtr to the managed list of Faces so that it can be retrieved later by name.

ImagesetPtr OpenGUI::ImageryManager::createImageset const String imageFilename  ) 
 

Create a new Imageset.

This will create a new Imageset based on the image file specified. If an Imageset already exists based on the provided filename, then the existing Imageset is returned instead of creating a new one.

Parameters:
imageFilename The filename of the source image file. This name can also be used to later retrieve the Imageset pointer via getImageset()
Returns:
pointer to the newly created imageset, or 0 on failure.

static ImagesetPtr OpenGUI::ImageryManager::createImagesetEx const String imageFilename  )  [inline, static]
 

Static pass through function to createImageset().

ImagesetPtr OpenGUI::ImageryManager::createImagesetFromTexture TexturePtr  texture,
const String imageFilename = ""
 

Create a new Imageset from an existing texture.

This acts much like the file-based createImageset() function, with the exception that it does not attempt to load the texture from a file on disk. Instead, it uses the already existing texture that is given. The imageFilename parameter is only used for future lookups by getImageset(), and must therefore be unique, but is otherwise meaningless. If no imageFilename is given, one is automatically generated for you.

Any single texture or imageFilename can only be used once to create an Imageset, so future calls to this function with the same texture or imageFilename will result in varying functionality.

If the given imageFilename ever matches an existing filename, an exception is thrown. Due to TexturePtr caching, the redefinition of an Imageset's texture would result in staggered usage across the GUI, which is undesirable. If you want to have dynamically changing textures for use within Imagery, you should create a texture specifically for that purpose and directly update the Texture's contents as needed.

If the given imageFilename does not match any existing Imageset filenames, but a duplicate texture is found, the Imageset will successfully create using the texture for yet another Imageset. The usefulness of this is minimal, but it is the most logical action given the design.

Returns:
On success the return value is the pointer to the Imageset created.

void OpenGUI::ImageryManager::destroyAllImagesets  ) 
 

Destroys all Imagesets.

void OpenGUI::ImageryManager::destroyImageset const String imageFilename  ) 
 

Destroys an Imageset.

void OpenGUI::ImageryManager::destroyImageset ImagesetPtr  pImageset  ) 
 

Destroys an Imageset.

FacePtr OpenGUI::ImageryManager::getFace const String faceName  ) 
 

Retrieves a previously added Face by name.

StringList OpenGUI::ImageryManager::getFaceList  ) 
 

Returns a list of all registered faces.

ImageryPtr OpenGUI::ImageryManager::getImagery const String imageryName  ) 
 

Retrieves an Imagery by fully qualified name, or by first match on name alone.

This method provides 2 paths for Imagery lookup. The first method attempted is lookup by fully qualified name. This is in the format "<Imageset_Name>:<Imagery_Name>", and if used will provide a perfect lookup of the Imagery specified. Fully qualified name is identified by the presence of the ':' character, and if this is found the function will only return a valid pointer if that exact Imagery can be found.

The second method of lookup is used when the ':' character is not found in given the Imagery name. This method searches all Imagesets for the first Imagery found with the given name. If an Imagery is found it is immediately returned. This method is only useful if you can guarantee that the Imagery you are searching for has a globally unique name, otherwise you may not get the Imagery you were intending.

Returns:
ImageryPtr(0) on failure, otherwise a RefPtr to the found Imagery

ImagesetPtr OpenGUI::ImageryManager::getImageset const String imageFilename  ) 
 

Returns a pointer to the Imageset that was created using the given filename, or 0 on failure.

ImagesetPtr OpenGUI::ImageryManager::getImagesetByTexture TexturePtr  texture  ) 
 

Returns a pointer to the Imageset that is based on the given texture, or 0 on failure.

ImageryManager::ImagesetList OpenGUI::ImageryManager::getImagesetList  ) 
 

Returns an ImagesetList of all Imagesets that are currently loaded. Items can be fed back into getImageset().

ImageryManager & OpenGUI::ImageryManager::getSingleton void   )  [static]
 

Retrieve the current singleton, if one exists. If none exists, this will cause an error.

ImageryManager * OpenGUI::ImageryManager::getSingletonPtr void   )  [static]
 

Retrieve a pointer to the current singleton, if one exists. If none exists, this will return 0.

void OpenGUI::ImageryManager::removeFace const String faceName  ) 
 

Removes a previously added Face by name.


The documentation for this class was generated from the following files:
Copyright © 2006 OpenGUI | OpenGUI.SF.net
Generated: Sun Sep 9 02:00:21 2007