Home Hierarchy Members Alphabetical Related Pages

Scene Class Reference
[Base Types]

#include <scene.h>

List of all members.

Public Member Functions

 Scene ()
virtual ~Scene ()
void load (const char *fileName, bool verbose=false, bool fast=true)
void load (const std::string &fileName, bool verbose=false, bool fast=true)

Public Attributes

MFNode nodes
std::deque< ProtoDeclaration * > protos
std::deque< ExternProtoDeclaration * > externProtos


Detailed Description

This class offers encapsulation of the parsing of a VRML file. The function load calls the parser and you can then get the parsed nodes and parsed protos declarations as member of the scene. Below is a typical example of use.
  #include <xdkwrl/scene.h>
  #include <xdkwrl/tools/prettyprinter.h>
  #include <stdexcept>

  using namespace std;

  int
  main(int argc,char** argv)
  {
    try
    {
      wrl::Scene scene;
      scene.load(argv[1],true);
      wrl::PrettyPrinter p(cout);
      p<<scene;
    }
    catch (runtime_error e)
    {
      cerr <<e.what()<<endl;
    }    
  } 


Constructor & Destructor Documentation

Scene  ) 
 

Constructs an empty scene.

virtual ~Scene  )  [inline, virtual]
 


Member Function Documentation

void load const std::string &  fileName,
bool  verbose = false,
bool  fast = true
 

void load const char *  fileName,
bool  v = false,
bool  fast = true
 

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.


Member Data Documentation

std::deque<ExternProtoDeclaration*> externProtos
 

nodes
 

Once the load function has been called, this member contains all root nodes that has been parsed in the file. If load() is called successively on several files, this member is cleared each time so you cannot "accumulate" files in a Scene.

Todo:
fix the deallocating of nodes that is completely unhandled at the moment and causes memory leak.

protos
 

Once the load function has been called, this member contains all proto declarations that has been parsed in the file. If load() is called successively on several files, this member is cleared each time so you cannot "accumulate" files in a Scene.

This protos are just declarations. If they are instanciated in the file then the nodes member contains somewhere in the hierarchy ProtoInstance nodes. See The Proto Classes for more info on protos classes.xb


Generated on 24 Feb 2005 with doxygen version 1.3.9.1. Valid HTML 4.0! Valid CSS!