3rd Eye Scene C#
3rd Eye Scene C# documentation
Tes::Runtime::MessageHandler Class Reference

This class defines the interface for any message handler class. More...

Inheritance diagram for Tes::Runtime::MessageHandler:
Tes::Handlers::CameraHandler Tes::Handlers::CategoriesHandler Tes::Handlers::MeshCache Tes::Handlers::Shape2D::Text2DHandler Tes::Handlers::ShapeHandler Tes::Handlers::Shape3D::ArrowHandler Tes::Handlers::Shape3D::BoxHandler Tes::Handlers::Shape3D::CapsuleHandler Tes::Handlers::Shape3D::ConeHandler Tes::Handlers::Shape3D::CylinderHandler Tes::Handlers::Shape3D::MeshHandler Tes::Handlers::Shape3D::MeshSetHandler Tes::Handlers::Shape3D::PlaneHandler Tes::Handlers::Shape3D::PointCloudHandler Tes::Handlers::Shape3D::SphereHandler Tes::Handlers::Shape3D::StarHandler Tes::Handlers::Shape3D::Text3DHandler Tes::PyramidHandler

List of all members.

Public Types

enum  ModeFlags { IgnoreTransient = (1 << 0) }
 Flags modifying the normal operating behaviour of a message handler. More...

Public Member Functions

 MessageHandler (CategoryCheckDelegate categoryCheck)
 Create a message handler with the given delegate to assign to CategoryCheck.
virtual void Initialise (GameObject root, GameObject serverRoot, MaterialLibrary materials)
 Called to initialise the handler with various 3rd Eye Scene components.
virtual void UpdateServerInfo (Net.ServerInfoMessage info)
 Called on all handlers whenever the server info changes.
virtual void Reset ()
 Clear all data in the handler.
virtual void BeginFrame (uint frameNumber, bool maintainTransient)
 Called at the start of a new frame, before processing new messages.
virtual void EndFrame (uint frameNumber)
 Called at the end of a frame.
virtual void PreRender ()
 Called a little prior to actually rendering a frame.
abstract Error ReadMessage (PacketBuffer packet, BinaryReader reader)
 Called when a message arrives with a message routing ID matching RoutingID.
Error Serialise (BinaryWriter writer)
 Serialise the current state of the handler to the given stream.
abstract Error Serialise (BinaryWriter writer, ref SerialiseInfo info)
 Serialise the current state of the handler to the given stream.
abstract void OnCategoryChange (ushort categoryId, bool active)
 Called whenever a category's active state changes.

Properties

ModeFlags Mode [get, set]
 Current mode control value.
CategoryCheckDelegate CategoryCheck [get, set]
 Delegate used to check if a category is enabled.
abstract string Name [get]
 A reference name for the handler.
abstract ushort RoutingID [get]
 Returns the unique ID for the message handler.
Net.ServerInfoMessage ServerInfo [get, set]
 Stored server information.

Detailed Description

This class defines the interface for any message handler class.

Messages are routed by the routingID().


Member Enumeration Documentation

Flags modifying the normal operating behaviour of a message handler.

Enumerator:
IgnoreTransient 

Ignore messages for transient objects.

Do not create new transient objects.

Normally used to reduce object creation during multi-frame stepping.


Constructor & Destructor Documentation

Tes::Runtime::MessageHandler::MessageHandler ( CategoryCheckDelegate  categoryCheck) [inline]

Create a message handler with the given delegate to assign to CategoryCheck.

Parameters:
categoryCheckThe delegate to invoke for category enable checks.

Member Function Documentation

virtual void Tes::Runtime::MessageHandler::BeginFrame ( uint  frameNumber,
bool  maintainTransient 
) [inline, virtual]

Called at the start of a new frame, before processing new messages.

In practice, this method is called when the Tes.Net.ControlMessageID.EndFrame message arrives, just prior to processing all messages for the completed frame.

Parameters:
frameNumberA monotonic frame counter.
maintainTransientTrue to prevent flushing of transient objects.

Reimplemented in Tes::Handlers::CameraHandler, Tes::Handlers::CategoriesHandler, Tes::Handlers::Shape2D::Text2DHandler, Tes::Handlers::Shape3D::MeshHandler, and Tes::Handlers::ShapeHandler.

virtual void Tes::Runtime::MessageHandler::EndFrame ( uint  frameNumber) [inline, virtual]

Called at the end of a frame.

In practice, this is likely to be called at the same time as BeginFrame(uint, bool).

This method is called when the Tes.Net.ControlMessageID.EndFrame message arrives, after processing all messages for the completed frame.

Parameters:
frameNumberA monotonic frame counter.

Reimplemented in Tes::Handlers::CameraHandler, and Tes::Handlers::CategoriesHandler.

virtual void Tes::Runtime::MessageHandler::Initialise ( GameObject  root,
GameObject  serverRoot,
MaterialLibrary  materials 
) [inline, virtual]

Called to initialise the handler with various 3rd Eye Scene components.

Message handlers which instantiate 3D objects should only instantiate objects under either the root or the serverRoot . Use root when objects are to be maintained in the Unity coordinate frame. Use serverRoot when objects are to be maintained in the server coordinate frame.

Parameters:
rootThe 3rd Eye Scene root object. This is always at the origin and in Unity's coordinate frame.
serverRootThe scene root, which applies a transform to the server coordinate frame.
materialsMaintains available materials and shaders.

Reimplemented in Tes::Handlers::CameraHandler, Tes::Handlers::CategoriesHandler, Tes::Handlers::MeshCache, Tes::Handlers::Shape2D::Text2DHandler, Tes::Handlers::Shape3D::MeshHandler, Tes::Handlers::Shape3D::MeshSetHandler, Tes::Handlers::Shape3D::PointCloudHandler, Tes::Handlers::Shape3D::Text3DHandler, and Tes::Handlers::ShapeHandler.

abstract void Tes::Runtime::MessageHandler::OnCategoryChange ( ushort  categoryId,
bool  active 
) [pure virtual]

Called whenever a category's active state changes.

All start active.

Parameters:
categoryIdThe category changing state.
activeActive or not?

Implemented in Tes::Handlers::CameraHandler, Tes::Handlers::CategoriesHandler, Tes::Handlers::MeshCache, Tes::Handlers::Shape2D::Text2DHandler, and Tes::Handlers::ShapeHandler.

virtual void Tes::Runtime::MessageHandler::PreRender ( ) [inline, virtual]

Called a little prior to actually rendering a frame.

This is independent of EndFrame(uint).

Reimplemented in Tes::Handlers::Shape3D::MeshHandler, Tes::Handlers::Shape3D::MeshSetHandler, and Tes::Handlers::Shape3D::PointCloudHandler.

abstract Error Tes::Runtime::MessageHandler::ReadMessage ( PacketBuffer  packet,
BinaryReader  reader 
) [pure virtual]

Called when a message arrives with a message routing ID matching RoutingID.

The main message header has already been decoded into the packet . The handler is to decode the remaining message data from reader and effect the appropriate actions.

Returns:
An Error object with a code of ErrorCode.OK on success. On failure the error code indicates the reason for the failure.
Parameters:
packetThe packet object being read.
readerA binary reader which is initialised to the payload location in packet .

Implemented in Tes::Handlers::CameraHandler, Tes::Handlers::CategoriesHandler, Tes::Handlers::MeshCache, Tes::Handlers::Shape2D::Text2DHandler, and Tes::Handlers::ShapeHandler.

virtual void Tes::Runtime::MessageHandler::Reset ( ) [inline, virtual]

Clear all data in the handler.

This resets it to the default, initialised state. For example, this method may be called to clear the scene.

Reimplemented in Tes::Handlers::CameraHandler, Tes::Handlers::CategoriesHandler, Tes::Handlers::MeshCache, Tes::Handlers::Shape2D::Text2DHandler, Tes::Handlers::Shape3D::MeshHandler, Tes::Handlers::Shape3D::MeshSetHandler, Tes::Handlers::Shape3D::PointCloudHandler, and Tes::Handlers::ShapeHandler.

Error Tes::Runtime::MessageHandler::Serialise ( BinaryWriter  writer) [inline]

Serialise the current state of the handler to the given stream.

Parameters:
writerThe steam to serialise the current state to.

See Serialise(BinaryWriter, ref SerialiseInfo)

abstract Error Tes::Runtime::MessageHandler::Serialise ( BinaryWriter  writer,
ref SerialiseInfo  info 
) [pure virtual]

Serialise the current state of the handler to the given stream.

This is in direct support of recording incoming data streams. In particular, this supports when recording is requested after the first data packet has come through. This call must write the required messages to restore the handler from its initial state to its exact current state.

For example, the sphere rendering shape handler will simulate sphere creation packets for the existing spheres.

Parameters:
writerThe steam to serialise the current state to.
infoPassed to attain information about serialisation.

Implemented in Tes::Handlers::CameraHandler, Tes::Handlers::CategoriesHandler, Tes::Handlers::MeshCache, Tes::Handlers::Shape2D::Text2DHandler, and Tes::Handlers::ShapeHandler.

virtual void Tes::Runtime::MessageHandler::UpdateServerInfo ( Net.ServerInfoMessage  info) [inline, virtual]

Called on all handlers whenever the server info changes.

Parameters:
infoServer information.

Property Documentation

ModeFlags Tes::Runtime::MessageHandler::Mode [get, set]

Current mode control value.

Derived classes should respect the ModeFlags values as much as possible.

abstract ushort Tes::Runtime::MessageHandler::RoutingID [get]
Net.ServerInfoMessage Tes::Runtime::MessageHandler::ServerInfo [get, set]

Stored server information.

Normally updated in UpdateServerInfo(Net.ServerInfoMessage).


The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Enumerations Properties Events