v2o::v2oLoader Class Reference

#include <v2oLoader.h>

List of all members.

Public Member Functions

 v2oLoader ()
virtual ~v2oLoader ()
osgGroupRef createOSGScene (const bool reset=true)
virtual void loadScene (const char *fileToLoad)
ScenegetLoadedScene (void)
v2oFactorygetFactory (std::string name)
v2oFactorygetGeomFactory (std::string name)
osgNodeRef createOSGNode (v2oFactory *, Node *)
osgGeometryRef createOSGGeomNode (v2oFactory *myv2oDec, Node *_currentRootNode)
v2oLoadergetLoader ()
NodegetRoot ()
osgNodeRef getOSGRoot ()
v2oFactoryListgetFactoryList ()
osgNodeRef getDEFNode (Node *_defNamedNode)
v2oOSGHanimSkeletongetHanimSkeleton (void)
v2oOSGHanimMeshgetHanimMesh (void)

Static Public Member Functions

static void storeTexture (std::string &textureName, osg::Texture2D *textureNode)
static void storeLight (osg::Light *parsedLight)
static osgTexture2DRef getStoredTexture (std::string &textureName)
static v2oLoaderinstance ()

Static Public Attributes

static v2oUseNodeMap _v2oUseNodeMap

Private Attributes

Scene_loadedScene
Node_root
NodeList_allRootNodes
v2oFactoryList _allv2oDecNodes
osgGroupRef _vrmlGroup
osgNodeRef _componentNode
Node_currentRootNode
v2oFactory_v2oFactory
FieldValue_value
v2oOSGHanimSkeleton_skel
v2oOSGHanimMesh_mesh

Static Private Attributes

static bool _v2oShapeExtMode
static v2oTextureMap _v2oTextureMap
static v2oLightsList _v2oLightsList
static v2oLoader_instance


Detailed Description

Class responsible for loading the parsed VRML Scene from the vhdVRMLParser library,initialising and creating the corresponding OSG Scenegraph scene.


Constructor & Destructor Documentation

v2oLoader::v2oLoader (  ) 

Initialises the '_v2oDecMap' Hashtable containing pairs of (std::string,v2oFactory*): (the Node name, the corresponding class that will reconstruct that node in OpenSceneGraph)

v2oLoader::~v2oLoader (  )  [virtual]


Member Function Documentation

osgGroupRef v2oLoader::createOSGScene ( const bool  reset = true  ) 

Loader's main construction method. Parses the children of the root node and polymorphically creates the corresponding OpenSceneGraph scenegraph.

Returns:
the osg::Group node that contains the OpenSceneGraph Scenegraph.

void v2oLoader::loadScene ( const char *  fileToLoad  )  [virtual]

Performs all the necessary initialisations for loading the scene and the root node.

Scene* v2o::v2oLoader::getLoadedScene ( void   )  [inline]

Get the VRML Scene parsed during loadScene.

v2oFactory * v2oLoader::getFactory ( std::string  name  ) 

Returns the corresponding v2oFactory class according to the parsed Vrml node name. e.g. for the "Transform" node name it returns a v2oTransformFactory object.

Parameters:
name the node name.

v2oFactory * v2oLoader::getGeomFactory ( std::string  name  ) 

Returns the corresponding geometry v2oFactory class according to the parsed Vrml geometry node name. e.g. for the "Cone" geometry node name it returns a v2oConeFactory object.

Parameters:
name the node name.

osgNodeRef v2oLoader::createOSGNode ( v2oFactory ,
Node  
)

Accesses polymorphically the correct createOSGNode() of the corresponding to the vrml node, v2oFactory object.

Parameters:
myosgDec the v2oFactory derived class(e.g. v2oGroupFactory) pointer is assigned to the base class(v2oFactory) and passed as an argument here.
currentRootNode the parsed Vrml node that has to be reconstructed in OpenSceneGraph.

osgGeometryRef v2oLoader::createOSGGeomNode ( v2oFactory myv2oDec,
Node _currentRootNode 
)

Accesses polymorphically the correct createOSGGeomNode() of the corresponding to the vrml node, v2oFactory object.

Parameters:
myosgDec the v2oFactory derived class(e.g. v2oSphereFactory) pointer is assigned to the base class(v2oFactory) and passed as an argument here.
_currentRootNode the parsed Vrml Geometry node that has to be reconstructed in OpenSceneGraph.

static void v2o::v2oLoader::storeTexture ( std::string &  textureName,
osg::Texture2D *  textureNode 
) [static]

Store the parsed textures as pairs Name-osgTexture2D in order to reuse already loaded textures

static void v2o::v2oLoader::storeLight ( osg::Light *  parsedLight  )  [static]

Store the parsed lights as osgLights in order to append them in the root Environment node

static osgTexture2DRef v2o::v2oLoader::getStoredTexture ( std::string &  textureName  )  [static]

Returns the stored osg::Texture2D according to the specified name(filename)

v2oLoader * v2oLoader::instance (  )  [static]

Returns Singleton access to the static instance of the v2oloader that can be accessed easily by all guys around. Makes "lazy" creation of an instance on the first call. It DOES NOT returns a copy of the current v2oLoader object. NOT To be used only when this original instance of v2oLoader isn't sufficient (e.g. v2oInlineFactory)

v2oLoader* v2o::v2oLoader::getLoader (  )  [inline]

Returns the current instance of v2oLoader. It DOES return a copy of the current v2oLoader object. ONLY To be used when the original instance of v2oLoader isn't sufficient (v2oLoader::instance()) (e.g. in v2oInlineFactory)

Node* v2o::v2oLoader::getRoot (  )  [inline]

Returns the root Node of the raw scenegraph constructed by vhdVRMLParser.

osgNodeRef v2o::v2oLoader::getOSGRoot (  )  [inline]

Returns the root Node of the raw scenegraph constructed by vhdVRMLParser.

v2oFactoryList* v2o::v2oLoader::getFactoryList (  )  [inline]

Gets the vector containing all the root v2oFactorys of the current Scene.

osgNodeRef v2oLoader::getDEFNode ( Node _defNamedNode  ) 

It returns the osg::Node that corresponds to a VRML97 node with a DEF named, which is already stored in a v2oLoader Map<Node*, void *>. Thus all the DEF VRML nodes can be retrieved in osg::Node form by the interpolator nodes

v2oOSGHanimSkeleton* v2o::v2oLoader::getHanimSkeleton ( void   )  [inline]

TM get the v2oOSGHanimSkeleton class containing direct access to Hanim Joints and Humanoid root (see v2oOSGHanimSkeleton.h)

v2oOSGHanimMesh* v2o::v2oLoader::getHanimMesh ( void   )  [inline]

TM get the v2oOSGHanimMesh class containing direct access to Hanim Meshes (see v2oOSGHanimMesh.h)


Member Data Documentation

v2oUseNodeMap v2oLoader::_v2oUseNodeMap [static]

Temporary here, it has to be removed to private...

bool v2o::v2oLoader::_v2oShapeExtMode [static, private]

Scene* v2o::v2oLoader::_loadedScene [private]

Node* v2o::v2oLoader::_root [private]

NodeList* v2o::v2oLoader::_allRootNodes [private]

v2oFactoryList v2o::v2oLoader::_allv2oDecNodes [private]

v2oTextureMap v2oLoader::_v2oTextureMap [static, private]

v2oLightsList v2oLoader::_v2oLightsList [static, private]

v2oLoader * v2oLoader::_instance [static, private]

osgGroupRef v2o::v2oLoader::_vrmlGroup [private]

osgNodeRef v2o::v2oLoader::_componentNode [private]

Node* v2o::v2oLoader::_currentRootNode [private]

v2oFactory* v2o::v2oLoader::_v2oFactory [private]

FieldValue* v2o::v2oLoader::_value [private]

v2oOSGHanimSkeleton* v2o::v2oLoader::_skel [private]

v2oOSGHanimMesh* v2o::v2oLoader::_mesh [private]


Generated on Thu Jan 18 10:06:28 2007 for vhdPLUS by  doxygen 1.5.1-p1