Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

NBFLoader Class Reference

A Scene Loader for nbf files. More...

#include <NBFLoader.h>

Inheritance diagram for NBFLoader:

Inheritance graph
[legend]
Collaboration diagram for NBFLoader:

Collaboration graph
[legend]
List of all members.

Public Member Functions

void deleteThis (void)
 Realization of the pure virtual interface function of a PlugIn.
const nvsg::Sceneload (const std::string &filename, const std::vector< std::string > &searchPaths, const nvsg::ViewState *&viewState)
 Realization of the pure virtual interface function of a SceneLoader.

Protected Member Functions

virtual ~NBFLoader (void)
 Protected destructor to prevent explicit creation on stack.
virtual const nvsg::ObjectloadCustomObject (uint_t objectCode, uint_t offset)
 Load a custom object identified by objectCode from the file offset specified by offset.
ubyte_tmapOffset (uint_t offset, size_t numBytes)
 Mapping numBytes bytes at file offset offset into process memory.

Classes

struct  ViewHeader

Detailed Description

A Scene Loader for nbf files.


Constructor & Destructor Documentation

virtual NBFLoader::~NBFLoader void   )  [protected, virtual]
 

Protected destructor to prevent explicit creation on stack.


Member Function Documentation

void NBFLoader::deleteThis void   )  [inline, virtual]
 

Realization of the pure virtual interface function of a PlugIn.

Note:
Never call delete on a PlugIn, always use the member function.

Implements nvutil::PlugIn.

const nvsg::Scene* NBFLoader::load const std::string &  filename,
const std::vector< std::string > &  searchPaths,
const nvsg::ViewState *&  viewState
 

Realization of the pure virtual interface function of a SceneLoader.

Loads a nvb file given by filename. It looks for this file and possibly referenced other files like textures or effects at the given path first, then at the current location and finally it searches through the searchPaths.

Returns:
A pointer to the loaded scene.
Parameters:
filename  file to load
searchPaths  paths to search through
viewState  If the function succeeded, this points to the optional ViewState stored with the scene.

virtual const nvsg::Object* NBFLoader::loadCustomObject uint_t  objectCode,
uint_t  offset
[protected, virtual]
 

Load a custom object identified by objectCode from the file offset specified by offset.

This function is called from the loader's framework if a custom object was detected for the object stored at the particular file offset.

A custom implementation should first evaluate the passed object code. To map identified objects into memory, a custom implementation should call the member function mapOffset with the file offset and the correct byte size for the identified object as parameters. After that, the corresponding NVSG object can be initialized from the mapped data.

Returns:
A pointer to the loaded NVSG object.
Note:
A custom implementation must not fall back on to the base implementation, as this simply returns a null pointer.
Parameters:
objectCode  NBF object code identifying the custom object.
offset  Specifies the file offset for the custom object.

ubyte_t* NBFLoader::mapOffset uint_t  offset,
size_t  numBytes
[protected]
 

Mapping numBytes bytes at file offset offset into process memory.

This function turns a given offset into a pointer and ensures that a minimum of numBytes bytes are mapped.

Returns:
A pointer to the mapped memory.
Parameters:
offset  File offset of the memory block to map.
numBytes  Amount of bytes to map into process memory.


The documentation for this class was generated from the following file:
Generated on Tue Mar 1 13:20:27 2005 for NVSGSDK by NVIDIA