H3D::X3DUrlObject Class Reference
[Abstract interface classes.]

This abstract interface is inherited by all nodes that contain data located on the World Wide Web, such as AudioClip, ImageTexture and Inline. More...

#include <H3D/X3DUrlObject.h>

Inheritance diagram for H3D::X3DUrlObject:

Inheritance graph

List of all members.

Public Types

enum  LoadStatus { INIT, LOADED, LOADING, FAILED }

Public Member Functions

 X3DUrlObject (Inst< MFString > _url=0)
 Constructor.
virtual LoadStatus loadStatus ()
 The loadStatus function returns the status of the loading of the current urls in order to be used with the LoadSensor node.
virtual H3DFloat loadProgress ()
 The loadProgress() functions returns a value between 0 and 1 indicating how much of the current url has been loaded.
void setURLUsed (const string &_url_used)
 Set the url that is currently loaded.
const string & getURLUsed ()
 Get the url that is currently loaded.
void setURLBase (const string &_url_base)
 Set the url base address.
const string & getURLBase ()
 Get the current url base address.
string resolveURLAsFile (const string &url, bool *is_tmp_file=NULL)
 Get the url as a local file.
bool removeTmpFile (const string &file)
 Remove a tmpfile with the given name.

Public Attributes

auto_ptr< MFStringurl
 The urls in decreasing order of preference.

Protected Member Functions

void addInlinePrefix (const string &s)
 Add a inline prefix that this node supports.

Protected Attributes

string url_used
 If loadStatus() returns LOADED this string should contain the url that is loaded.
string url_base
 The base URL for urls in this url object.
list< string > supported_inline_prefixes
 A list of inline prefixes that are supported by this url object.


Detailed Description

This abstract interface is inherited by all nodes that contain data located on the World Wide Web, such as AudioClip, ImageTexture and Inline.

All url fields can hold multiple string values. The strings in these fields indicate multiple locations to search for data in decreasing order of preference. If the browser cannot locate or interpret the data specified by the first location, it shall try the second and subsequent locations in order until a location containing interpretable data is encountered. X3D browsers only have to interpret a single string. If no interpretable locations are found, the node type defines the resultant default behaviour.


Member Enumeration Documentation

Enumerator:
INIT  The url has not been tried to load yet.
LOADED  The url has been successfully loaded.
LOADING  The url is currently loading.
FAILED  The loading of the url failed.


Member Function Documentation

virtual H3DFloat H3D::X3DUrlObject::loadProgress (  )  [inline, virtual]

The loadProgress() functions returns a value between 0 and 1 indicating how much of the current url has been loaded.

1 means that the file has been sucessfully loaded. The only requirement of this function is that if the url has been successfully loaded the function returns 1.

Referenced by H3D::LoadSensor::traverseSG().

virtual LoadStatus H3D::X3DUrlObject::loadStatus (  )  [inline, virtual]

The loadStatus function returns the status of the loading of the current urls in order to be used with the LoadSensor node.

Reimplemented in H3D::ShaderPart.

References FAILED, and LOADED.

Referenced by H3D::LoadSensor::traverseSG().

bool X3DUrlObject::removeTmpFile ( const string &  file  ) 

Remove a tmpfile with the given name.

Returns true on success, or false if no such file exists or the removal failed.

References H3D::ResourceResolver::releaseTmpFileName().


Member Data Documentation

A list of inline prefixes that are supported by this url object.

E.g. "glsl", "python", etc

Referenced by addInlinePrefix(), and resolveURLAsFile().

string H3D::X3DUrlObject::url_base [protected]

The base URL for urls in this url object.

All relative paths will start from this. Will be set to ResourceResolver::getBaseURL() when created.

Referenced by H3D::ImportLibrary::initialize(), and resolveURLAsFile().

string H3D::X3DUrlObject::url_used [protected]

If loadStatus() returns LOADED this string should contain the url that is loaded.

All subclasses of X3DUrlObject should set this when successfully loaded a file.

Referenced by H3D::ShaderPart::compileShader(), and H3D::ShaderPart::loadStatus().


The documentation for this class was generated from the following files:

Generated on Fri Nov 7 10:31:34 2008 for H3D API by  doxygen 1.5.7