VisioMove-Sample  2.1.3
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Properties Pages
VgMyTextureLoader Class Reference

Classes

struct  ImageCache
 Holds the loaded images. More...
 
struct  MarkerCache
 A structure to hold the markers. More...
 

Public Member Functions

 VgMyTextureLoader (VgApplication::VgIApplication *pVgApplication, const std::string &pImageResourceDirectory)
 Constructor. More...
 
virtual ~VgMyTextureLoader ()
 
VgEngine::VgRefPtr
< VgEngine::VgITexture > 
getTextureBuffer (const std::string &pImageName)
 Returns a texture buffer. More...
 
VgEngine::VgRefPtr
< Vg3DModule::VgIconMarkerDescriptor > 
getMarker (const std::string &pMarkerName)
 Returns an icon marker. More...
 
void setImage (const std::string &pImageName, const std::string &pFilename)
 Associates an image file with an identifier. More...
 
void setMarker (const std::string &pMarkerName, const std::string &pImageName)
 Associates an icon marker with an image. More...
 
void resetImage (const std::string &pImageName)
 Resets an image. More...
 
void resetImage (std::hash_map< std::string, ImageCache >::iterator pImageIter)
 
void resetMarker (const std::string &pType)
 Resets a marker. More...
 
void resetMarker (std::hash_map< std::string, MarkerCache >::iterator pMarkerIter)
 
bool isImageSet (const std::string &pImageName) const
 Tells whether an image with the provided name has been set. More...
 
bool isMarkerSet (const std::string &pMarkerName) const
 Tells whether a marker with the provided name has been set. More...
 

Public Attributes

std::hash_map< std::string,
ImageCache
mImageCache
 The map of image textures. More...
 
std::hash_map< std::string,
MarkerCache
mMarkerCache
 The markers map. More...
 

Protected Attributes

VgApplication::VgIApplication * mVgApplication
 The VgApplication instance this texture loader was created for. More...
 
std::string mImageResourceDirectory
 The path of the image resource directory. More...
 

Constructor & Destructor Documentation

VgMyTextureLoader::VgMyTextureLoader ( VgApplication::VgIApplication *  pVgApplication,
const std::string &  pImageResourceDirectory 
)

Constructor.

Parameters
pVgApplicationApplication pointer
pImageResourceDirectoryPath to image, the path ends with "/"
virtual VgMyTextureLoader::~VgMyTextureLoader ( )
virtual

Member Function Documentation

VgEngine::VgRefPtr< Vg3DModule::VgIconMarkerDescriptor > VgMyTextureLoader::getMarker ( const std::string &  pMarkerName)

Returns an icon marker.

If it has not been loaded, it loads it. NULL if an error occurs.

Parameters
pMarkerNameThe name of the marker to retrieve.
Returns
The searched VgIconMarkerDescriptor pointer, if found. NULL if not.
VgEngine::VgRefPtr< VgEngine::VgITexture > VgMyTextureLoader::getTextureBuffer ( const std::string &  pImageName)

Returns a texture buffer.

If it has not been loaded, it loads it. NULL if an error occurs.

Parameters
pImageNameThe name of the texture to retrieve.
Returns
The searched VgTexture pointer, if found. NULL if not.
bool VgMyTextureLoader::isImageSet ( const std::string &  pImageName) const

Tells whether an image with the provided name has been set.

Parameters
pImageNameThe identifier to test.
Returns
True if the image has been set, false if not.
bool VgMyTextureLoader::isMarkerSet ( const std::string &  pMarkerName) const

Tells whether a marker with the provided name has been set.

Parameters
pMarkerNameThe identifier to test.
Returns
True if the marker has been set, false if not.
void VgMyTextureLoader::resetImage ( const std::string &  pImageName)

Resets an image.

Parameters
pImageNameThe identifier of the image to reset.
void VgMyTextureLoader::resetImage ( std::hash_map< std::string, ImageCache >::iterator  pImageIter)
void VgMyTextureLoader::resetMarker ( const std::string &  pType)

Resets a marker.

Parameters
pTypeThe identifier of the marker to reset.
void VgMyTextureLoader::resetMarker ( std::hash_map< std::string, MarkerCache >::iterator  pMarkerIter)
void VgMyTextureLoader::setImage ( const std::string &  pImageName,
const std::string &  pFilename 
)

Associates an image file with an identifier.

Parameters
pImageNameThe image identifier.
pFilenameThe path of the file to load.
void VgMyTextureLoader::setMarker ( const std::string &  pMarkerName,
const std::string &  pImageName 
)

Associates an icon marker with an image.

Parameters
pMarkerNameThe identifier of the marker to associate with the image.
pImageNameThe identifier of the image to associate with the marker.

Member Data Documentation

std::hash_map<std::string, ImageCache> VgMyTextureLoader::mImageCache

The map of image textures.

std::string VgMyTextureLoader::mImageResourceDirectory
protected

The path of the image resource directory.

std::hash_map<std::string, MarkerCache> VgMyTextureLoader::mMarkerCache

The markers map.

VgApplication::VgIApplication* VgMyTextureLoader::mVgApplication
protected

The VgApplication instance this texture loader was created for.


The documentation for this class was generated from the following file:
VisioMove 2.1.3, Visioglobe® 2015