|struct for storing input needed for the callback function. More...|
|struct for storing input needed to the thread function More...|
Protected Member Functions
|virtual void||update ()|
|Updates the value from the url and imageLoader fields of the Image3DTexture. |
|Image *||loadImage (Image3DTexture *texture, const vector< string > &urls, const NodeVector &image_loader)|
|Tries to create an image. |
Static Protected Member Functions
|static Scene::CallbackCode||loadImageCB (void *data)|
|Callback function for setting the image field when thread has finished downloading. |
|static void *||loadImageThreadFunc (void *)|
|Function to use in the thread for downloading and creating an Image object. |
|data used for the thread function |
|data used for the callback function. |
Each url is tried with all ImageLoader and the first one that is successful is the one that is used.
If X3DTextureNode::load_images_in_separate_thread is true, the image field will not be set directly. Instead it will be set to NULL, and the image downloaded and created in a separate thread. When it has been created a callback function is set to execute with Scene::setCallback that sets the image field to the new image. This allows the program to continue to execute and run without textures while the textures are loaded and the textures will then be applied as they are available.
If X3DTextureNode::load_images_in_separate_thread is false the image will be updated directly and the program has to wait for it to download if it is not available. routes_in is the url field. routes_in is the imageLoader field.
|Image * Image3DTexture::SFImage::loadImage||(||Image3DTexture *||texture,|
|const vector< string > &||urls,|
|const NodeVector &||image_loader|
Tries to create an image.
All urls are tested agains all image loaders until one that works is found. Returns NULL if it could not load the image, and the new image on success.
References H3DUtil::AutoRefVector< class >::begin(), H3DUtil::AutoRefVector< class >::end(), H3D::H3DImageLoaderNode::getSupportedFileReader(), H3D::H3DImageObject::image, H3D::ResourceResolver::releaseTmpFileName(), H3D::X3DUrlObject::resolveURLAsFile(), H3D::X3DUrlObject::setURLUsed(), H3DUtil::AutoRefVector< class >::size(), and H3D::X3DUrlObject::url.
Referenced by update().
|void * Image3DTexture::SFImage::loadImageThreadFunc||(||void *||data||)||
Function to use in the thread for downloading and creating an Image object.
References H3D::H3DImageObject::image, H3D::Image3DTexture::SFImage::ThreadFuncData::image_loaders, loadImageCB(), H3D::Image3DTexture::SFImage::ThreadFuncData::texture, and H3D::Image3DTexture::SFImage::ThreadFuncData::urls.
Referenced by update().