Classes | Public Member Functions | Public Attributes | Protected Attributes

VgMyTextureLoader Class Reference

List of all members.

Classes

struct  ImageCache
 A structure to hold 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.
virtual ~VgMyTextureLoader ()
VgEngine::VgRefPtr
< VgEngine::VgITexture > 
getTextureBuffer (const std::string &pImageName)
 Returns a texture buffer.
VgEngine::VgRefPtr
< Vg3DModule::VgIconMarkerDescriptor > 
getMarker (const std::string &pMarkerName)
 Returns an icon marker.
void setImage (const std::string &pImageName, const std::string &pFilename)
 Associates an image file with an identifier.
void setMarker (const std::string &pMarkerName, const std::string &pImageName)
 Associates an icon marker with an image.
void resetImage (const std::string &pImageName)
 Resets an image.
void resetImage (std::hash_map< std::string, ImageCache >::iterator pImageIter)
void resetMarker (const std::string &pType)
 Resets a marker.
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.
bool isMarkerSet (const std::string &pMarkerName) const
 Tells whether a marker with the provided name has been set.

Public Attributes

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

Protected Attributes

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

Constructor & Destructor Documentation

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

Constructor.

Parameters:
VgApplicationpointer
Pathto 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:
Theidentifier of the image to reset.
void VgMyTextureLoader::resetImage ( std::hash_map< std::string, ImageCache >::iterator  pImageIter )
void VgMyTextureLoader::resetMarker ( std::hash_map< std::string, MarkerCache >::iterator  pMarkerIter )
void VgMyTextureLoader::resetMarker ( const std::string &  pType )

Resets a marker.

Parameters:
Theidentifier of the marker to reset.
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.

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:
VisioDevKit 2.0, Visioglobe® 2013