#include <OpenGUI_ImageryManager.h>
Public Types | |
| typedef std::list< std::string > | ImagesetList |
| A string list used by ImageryManager::getImagesetList(). | |
Public Member Functions | |
| ImagesetPtr | createImageset (const std::string &imageFilename) |
| Create a new Imageset. | |
| ImagesetPtr | createImagesetFromTexture (TexturePtr texture, const std::string &imageFilename="") |
| Create a new Imageset from an existing texture. | |
| ImagesetPtr | getImageset (const std::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 std::string &imageFilename) |
| Destroys an Imageset. | |
| void | destroyAllImagesets () |
| Destroys all Imagesets. | |
| ImageryPtr | getImagery (const std::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 std::string &faceName) |
| Retrieves a previously added Face by name. | |
| void | removeFace (const std::string &faceName) |
| Removes a previously added Face by name. | |
| StringList | getFaceList () |
| Returns a list of all registered faces. | |
Static Public Member Functions | |
| static ImageryManager & | getSingleton (void) |
| Retrieve the current singleton, if one exists. If none exists, this will cause an error. | |
| static ImageryManager * | getSingletonPtr (void) |
| Retrieve a pointer to the current singleton, if one exists. If none exists, this will return 0. | |
| static ImagesetPtr | createImagesetEx (const std::string &imageFilename) |
| Static pass through function to createImageset(). | |
| typedef std::list<std::string> OpenGUI::ImageryManager::ImagesetList |
A string list used by ImageryManager::getImagesetList().
| 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 std::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.
| imageFilename | The filename of the source image file. This name can also be used to later retrieve the Imageset pointer via getImageset() |
| static ImagesetPtr OpenGUI::ImageryManager::createImagesetEx | ( | const std::string & | imageFilename | ) | [inline, static] |
Static pass through function to createImageset().
| ImagesetPtr OpenGUI::ImageryManager::createImagesetFromTexture | ( | TexturePtr | texture, | |
| const std::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.
| void OpenGUI::ImageryManager::destroyAllImagesets | ( | ) |
Destroys all Imagesets.
| void OpenGUI::ImageryManager::destroyImageset | ( | const std::string & | imageFilename | ) |
Destroys an Imageset.
| void OpenGUI::ImageryManager::destroyImageset | ( | ImagesetPtr | pImageset | ) |
Destroys an Imageset.
| FacePtr OpenGUI::ImageryManager::getFace | ( | const std::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 std::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.
| ImagesetPtr OpenGUI::ImageryManager::getImageset | ( | const std::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 std::string & | faceName | ) |
Removes a previously added Face by name.