Archon::X3D::Server Struct Reference

Inheritance diagram for Archon::X3D::Server:

Inheritance graph
[legend]
Collaboration diagram for Archon::X3D::Server:

Collaboration graph
[legend]
List of all members.

Public Member Functions

string getName () const
LoggergetLogger () const
void setLoader (Ref< Loader >)
Ref< LoadergetLoader () const
void setListener (Ref< Listener >)
Ref< ListenergetListener () const
void setRootScene (Ref< Scene >)
Ref< ScenegetRootScene () const
double getFrameRate () const
void print (string m)
Ref< ScenegetRootSceneNoLock ()
 Requires scenegraph read lock.
void setProgressiveLoad (bool)
bool getProgressiveLoad () const
Time getNextTimeStamp ()
void tick ()
 Process input events and generate new autonomous (time based) events.
 ~Server ()

Static Public Member Functions

static Ref< Serverget (string name, double frameRate, Logger *logger, bool loadScene, Uri sceneUrl, bool progressiveLoad)
 Construct a new X3D engine/server.

Public Attributes

const Mutex scenegraphMutex
 This mutex protects the following parts of the scenegraph and nothing else:.

Classes

struct  Listener

Detailed Description

Definition at line 41 of file server.H.


Member Function Documentation

Ref< Server > Archon::X3D::Server::get string  name,
double  frameRate,
Logger logger,
bool  loadScene,
Uri  sceneUrl,
bool  progressiveLoad
[static]
 

Construct a new X3D engine/server.

Parameters:
name The name of the server as known to Archon applications.
frameRate Number of frames per second. Currently only used to report to Archon applications. The real frame rate is controlled by the caller of the tick() method of this class.
logger The logger to use for diagnostic and non-fatal error messages.
loadScene Set to true if a scene must be loaded initially.
sceneUrl The URL of the scene to load. Ignored if 'loadScene' is false.
progressiveLoad Set to true if you accept progressive loading of the scene. Ie. display and animation may start before the entire root scene is loaded. Setting this parameter to false does not requre sub-scenes included through EMBED elements to be loaded before diaply and animation starts.

Definition at line 29 of file server.C.

References Archon::X3D::XML::parse(), and Archon::rootGroup.

Referenced by Archon::Raytracer::main(), and Archon::Console3d::main().

void Archon::X3D::Server::tick  ) 
 

Process input events and generate new autonomous (time based) events.

Must only be called by someone holding a scenegraph write lock.

Definition at line 195 of file server.C.


Member Data Documentation

const Mutex Archon::X3D::Server::scenegraphMutex
 

This mutex protects the following parts of the scenegraph and nothing else:.

  • The value of every X3D field of every realized X3D Node including the associated time stamps. Not the route lists (EventSource)

  • The value of every custom field of a realized CustomFileNode such as Script including the associated time stamps. Not the route lists (EventSource)

  • The Engine object of a realized script node and the engine reference of the containing node.

  • The 'drawCache' variable of realized ShapeNodes and any ShapeCache object that is refered to by such a variable. Also, the list of disposed shape caches 'ShapeCachegetDisposedShapeCaches' is included here.

This is not an ideal situation. We would love to replace it ith a more finegrained locking strategy, but so far we have not come up with a good idea :-(

One thing that seems to complicate matters is that rendering needs to present a consistent scene graph, and never one that is partially updated. What partially updated means, is not absolutely clear to me (at the time of writing this), but as I understand it, an event cascade needs to be carried out as an atomic operation. Also when the SAI uses the buffered update mode, then all changes has to be carried out as an atomic operation with respect to rendering. That is, we should not allow a frame to be rendered wich will show some of the chages of such an update but not others.

Definition at line 158 of file server.H.

Referenced by getRootScene(), and setRootScene().


The documentation for this struct was generated from the following files:
Generated on Sun Jul 30 23:00:59 2006 for Archon by  doxygen 1.4.4