Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

RubySceneImporter Class Reference

#include <rubysceneimporter.h>

Inheritance diagram for RubySceneImporter:

Inheritance graph
[legend]
Collaboration diagram for RubySceneImporter:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 RubySceneImporter ()
virtual ~RubySceneImporter ()
virtual bool ImportScene (const std::string &fileName, boost::shared_ptr< oxygen::BaseNode > root, boost::shared_ptr< zeitgeist::ParameterList > parameter)
 import a scene from a file
virtual bool ParseScene (const std::string &scene, boost::shared_ptr< oxygen::BaseNode > root, boost::shared_ptr< zeitgeist::ParameterList > parameter)
 import a scene from a string description
void SetUnlinkOnCompleteScenes (bool unlink)
 constrols the behavior of the importer for complete scenes (instead of delta scenes).

Protected Types

typedef std::map< std::string,
int > 
TParameterMap
 mapping from parameter name to parameter index
typedef std::list< MethodInvocation > TMethodInvocationList
typedef std::list< ParamEnv > TParameterStack

Protected Member Functions

virtual bool ParseScene (const char *scene, int size, boost::shared_ptr< oxygen::BaseNode > root, boost::shared_ptr< zeitgeist::ParameterList > parameter)
bool ReadHeader (sexp_t *sexp)
bool ReadGraph (sexp_t *sexp, boost::shared_ptr< oxygen::BaseNode > root)
bool ReadDeltaGraph (sexp_t *sexp, boost::shared_ptr< oxygen::BaseNode > root)
boost::shared_ptr< zeitgeist::Object > CreateInstance (const std::string &className)
void PushInvocation (const MethodInvocation &invoc)
bool Invoke (const MethodInvocation &invoc)
bool InvokeMethods ()
bool ReadMethodCall (sexp_t *_sexp, boost::shared_ptr< oxygen::BaseNode > node)
bool ReplaceVariable (std::string &param)
bool EvalParameter (sexp_t *sexp, std::string &value)
boost::shared_ptr< oxygen::BaseNode > CreateNode (sexp_t *sexp)
bool ParseTemplate (sexp_t *sexp)
bool ParseDefine (sexp_t *sexp)
void PushParameter (boost::shared_ptr< zeitgeist::ParameterList > parameter)
void PopParameter ()
ParamEnv & GetParamEnv ()

Protected Attributes

bool mAutoUnlink
 true if a scene is automatically unlinked before a new scene is imported
bool mDeltaScene
 true, if a delta scene is applied
float mVersionMajor
 the major version of the scen graph file
float mVersionMinor
 the minor version of the scen graph file
std::string mFileName
 the last supplied fileName
TParameterStack mParameterStack
 a stack of parameter environments

Classes

struct  MethodInvocation
 defines a method invocation More...
struct  ParamEnv
 a parameter environment More...

Detailed Description

Definition at line 29 of file rubysceneimporter.h.


Member Typedef Documentation

typedef std::list<MethodInvocation> RubySceneImporter::TMethodInvocationList [protected]
 

Definition at line 43 of file rubysceneimporter.h.

typedef std::map<std::string, int> RubySceneImporter::TParameterMap [protected]
 

mapping from parameter name to parameter index

Definition at line 33 of file rubysceneimporter.h.

typedef std::list<ParamEnv> RubySceneImporter::TParameterStack [protected]
 

Definition at line 57 of file rubysceneimporter.h.


Constructor & Destructor Documentation

RubySceneImporter::RubySceneImporter (   ) 
 

Definition at line 70 of file rubysceneimporter.cpp.

References mAutoUnlink, mDeltaScene, mVersionMajor, and mVersionMinor.

RubySceneImporter::~RubySceneImporter (   )  [virtual]
 

Definition at line 78 of file rubysceneimporter.cpp.


Member Function Documentation

boost::shared_ptr<zeitgeist::Object> RubySceneImporter::CreateInstance (  const std::string &  className  )  [protected]
 

Referenced by CreateNode().

shared_ptr< BaseNode > RubySceneImporter::CreateNode (  sexp_t *  sexp  )  [protected]
 

Definition at line 293 of file rubysceneimporter.cpp.

References CreateInstance(), zeitgeist::Object::GetLog(), and mFileName.

Here is the call graph for this function:

bool RubySceneImporter::EvalParameter (  sexp_t *  sexp,
std::string &  value
)  [protected]
 

Referenced by ParseDefine().

RubySceneImporter::ParamEnv & RubySceneImporter::GetParamEnv (   )  [protected]
 

Definition at line 184 of file rubysceneimporter.cpp.

References zeitgeist::Object::GetLog(), and mParameterStack.

Referenced by InvokeMethods(), ParseDefine(), ParseTemplate(), and PushInvocation().

Here is the call graph for this function:

virtual bool RubySceneImporter::ImportScene (  const std::string &  fileName,
boost::shared_ptr< oxygen::BaseNode >  root,
boost::shared_ptr< zeitgeist::ParameterList >  parameter
)  [virtual]
 

import a scene from a file

Implements oxygen::SceneImporter.

bool RubySceneImporter::Invoke (  const MethodInvocation &  invoc  )  [protected]
 

Definition at line 489 of file rubysceneimporter.cpp.

References zeitgeist::Object::GetLog(), RubySceneImporter::MethodInvocation::method, mFileName, RubySceneImporter::MethodInvocation::node, and RubySceneImporter::MethodInvocation::parameter.

Referenced by InvokeMethods(), and PushInvocation().

Here is the call graph for this function:

bool RubySceneImporter::InvokeMethods (   )  [protected]
 

Definition at line 524 of file rubysceneimporter.cpp.

References GetParamEnv(), RubySceneImporter::ParamEnv::invocationList, and Invoke().

Here is the call graph for this function:

bool RubySceneImporter::ParseDefine (  sexp_t *  sexp  )  [protected]
 

Definition at line 587 of file rubysceneimporter.cpp.

References EvalParameter(), zeitgeist::Object::GetLog(), GetParamEnv(), mFileName, RubySceneImporter::ParamEnv::parameter, RubySceneImporter::ParamEnv::parameterMap, and ReplaceVariable().

Here is the call graph for this function:

virtual bool RubySceneImporter::ParseScene (  const char *  scene,
int  size,
boost::shared_ptr< oxygen::BaseNode >  root,
boost::shared_ptr< zeitgeist::ParameterList >  parameter
)  [protected, virtual]
 

virtual bool RubySceneImporter::ParseScene (  const std::string &  scene,
boost::shared_ptr< oxygen::BaseNode >  root,
boost::shared_ptr< zeitgeist::ParameterList >  parameter
)  [virtual]
 

import a scene from a string description

Implements oxygen::SceneImporter.

bool RubySceneImporter::ParseTemplate (  sexp_t *  sexp  )  [protected]
 

Definition at line 657 of file rubysceneimporter.cpp.

References zeitgeist::Object::GetLog(), GetParamEnv(), mFileName, and RubySceneImporter::ParamEnv::parameterMap.

Here is the call graph for this function:

void RubySceneImporter::PopParameter (   )  [protected]
 

Definition at line 171 of file rubysceneimporter.cpp.

References zeitgeist::Object::GetLog(), and mParameterStack.

Here is the call graph for this function:

void RubySceneImporter::PushInvocation (  const MethodInvocation &  invoc  )  [protected]
 

Definition at line 462 of file rubysceneimporter.cpp.

References zeitgeist::Object::GetCore(), zeitgeist::Object::GetLog(), GetParamEnv(), RubySceneImporter::ParamEnv::invocationList, Invoke(), and RubySceneImporter::MethodInvocation::method.

Here is the call graph for this function:

void RubySceneImporter::PushParameter (  boost::shared_ptr< zeitgeist::ParameterList >  parameter  )  [protected]
 

bool RubySceneImporter::ReadDeltaGraph (  sexp_t *  sexp,
boost::shared_ptr< oxygen::BaseNode >  root
)  [protected]
 

bool RubySceneImporter::ReadGraph (  sexp_t *  sexp,
boost::shared_ptr< oxygen::BaseNode >  root
)  [protected]
 

bool RubySceneImporter::ReadHeader (  sexp_t *  sexp  )  [protected]
 

Definition at line 199 of file rubysceneimporter.cpp.

References mDeltaScene, mVersionMajor, mVersionMinor, S_DELTASCENE, and S_SCENEGRAPH.

bool RubySceneImporter::ReadMethodCall (  sexp_t *  _sexp,
boost::shared_ptr< oxygen::BaseNode >  node
)  [protected]
 

bool RubySceneImporter::ReplaceVariable (  std::string &  param  )  [protected]
 

Referenced by ParseDefine().

void RubySceneImporter::SetUnlinkOnCompleteScenes (  bool  unlink  ) 
 

constrols the behavior of the importer for complete scenes (instead of delta scenes).

if 'unlink' is true, the scene below the root node given in ImportScene will automatically be unlinked before the scene is imported

Definition at line 82 of file rubysceneimporter.cpp.

References mAutoUnlink.


Member Data Documentation

bool RubySceneImporter::mAutoUnlink [protected]
 

true if a scene is automatically unlinked before a new scene is imported

Definition at line 108 of file rubysceneimporter.h.

Referenced by RubySceneImporter(), and SetUnlinkOnCompleteScenes().

bool RubySceneImporter::mDeltaScene [protected]
 

true, if a delta scene is applied

Definition at line 111 of file rubysceneimporter.h.

Referenced by ReadHeader(), and RubySceneImporter().

std::string RubySceneImporter::mFileName [protected]
 

the last supplied fileName

Definition at line 120 of file rubysceneimporter.h.

Referenced by CreateNode(), Invoke(), ParseDefine(), and ParseTemplate().

TParameterStack RubySceneImporter::mParameterStack [protected]
 

a stack of parameter environments

Definition at line 123 of file rubysceneimporter.h.

Referenced by GetParamEnv(), and PopParameter().

float RubySceneImporter::mVersionMajor [protected]
 

the major version of the scen graph file

Definition at line 114 of file rubysceneimporter.h.

Referenced by ReadHeader(), and RubySceneImporter().

float RubySceneImporter::mVersionMinor [protected]
 

the minor version of the scen graph file

Definition at line 117 of file rubysceneimporter.h.

Referenced by ReadHeader(), and RubySceneImporter().


The documentation for this class was generated from the following files:
Generated on Thu Apr 6 15:40:09 2006 for rcssserver3d by  doxygen 1.4.4