3rd Eye Scene C#
3rd Eye Scene C# documentation
Tes::Shapes::Shape Class Reference

This is the base class for any spatial shape represented by 3rd Eye Scene. More...

Inheritance diagram for Tes::Shapes::Shape:
Tes::Pyramid Tes::Shapes::Arrow Tes::Shapes::Box Tes::Shapes::Capsule Tes::Shapes::Cone Tes::Shapes::Cylinder Tes::Shapes::MeshSet Tes::Shapes::MeshShape Tes::Shapes::Plane Tes::Shapes::PointCloudShape Tes::Shapes::Sphere Tes::Shapes::Star Tes::Shapes::Text2D Tes::Shapes::Text3D

List of all members.

Public Member Functions

ObjectAttributes GetAttributes ()
 Exposes shape details via an ObjectAttributes structure.
void SetAttributes (ObjectAttributes attr)
 Sets shape details via an ObjectAttributes structure.
void SetPosition (float x, float y, float z)
 Set the position.
void SetScale (float x, float y, float z)
 Set the scale.
virtual void UpdateFrom (Shape other)
 Update the attributes of this shape to match other.
virtual bool WriteCreate (PacketBuffer packet)
 Write a create message to packet .
virtual bool WriteUpdate (PacketBuffer packet)
 Write a update message to packet .
virtual bool WriteDestroy (PacketBuffer packet)
 Write a destroy message to packet .
virtual int WriteData (PacketBuffer packet, ref uint progressMarker)
 Called only for complex shapes to write additional creation data.
virtual object Clone ()
 Clone this shape.

Protected Member Functions

 Shape (ushort routingID, uint id=0)
 Initialises a new instance of the Shape.
 Shape (ushort routingID, uint id, ushort category)
 Initialises a new instance of the Shape.
void OnClone (Shape copy)
 Perform clone copy operations.

Protected Attributes

CreateMessage _data = new CreateMessage()
 Core shape data.

Properties

ushort RoutingID [get, set]
 Access to the routing ID for this shape.
bool IsComplex [get, set]
 Set to true for complex shapes.
uint ID [get, set]
 Shape ID.
ushort Category [get, set]
 Shape category (optional).
ushort Flags [get, set]
 Direct access to the ObjectFlag set for this shape.
bool Wireframe [get, set]
 Gets or sets the wire frame display flag.
bool Transparent [get, set]
 Gets or sets the transparent display flag.
float X [get, set]
 Position X coordinate.
float Y [get, set]
 Position Y coordinate.
float Z [get, set]
 Position Z coordinate.
Vector3 Position [get, set]
 Collated position vector.
float ScaleX [get, set]
 Scale X component.
float ScaleY [get, set]
 Scale Y component.
float ScaleZ [get, set]
 Scale Z component.
Vector3 Scale [get, set]
 Collated scale vector.
Quaternion Rotation [get, set]
 Collated quaternion rotation value.
uint Colour [get, set]
 Encoded integer colour value.
virtual IEnumerable< ResourceResources [get]
 Called to enumerate resources for this shape.

Detailed Description

This is the base class for any spatial shape represented by 3rd Eye Scene.

The base shape exposes core shape properties, such as position scale and rotation, colour, type and message creation. Most simple shapes will not require any additional data, however, the semantics of certain properties may vary. For instance, a sphere requires only one scale element. A cylinder may use the scale fields to represent length and radius.

Shape message handling depends on RoutingID. This this ID must be unique for each type of Shape. For each RoutingID value, each shape may have its own unique ID. Any shape with a non-zero ID is considered persistent and must be explicitly removed from a connection later. Any shape with a zero ID is transient, lasting only a single frame. Such shapes will not have a destroy message sent.

The core shape attributes are serialised in creation and update messages via WriteCreate(PacketBuffer) and WriteUpdate(PacketBuffer). A simple destruction message is authored by WriteDestroy(PacketBuffer). Subclasses generally need only use the base implementation. Some subclasses may need to write additional data on creation by overriding the WriteCreate(PacketBuffer). The base method should always be called first before appending custom data.

Some shapes may be marked as IsComplex. These shapes contain a large amount of data which cannot be adequately contained in a single (create) message. Such shapes may implement WriteData(PacketBuffer, ref uint) to serialise one or more additional packets of data. This method is only called when IsComplex is true.

Finally, a shape may have additional Resource requirements. A shape exposes its resources via the Resources property. Resources may be shared between shapes. They are reference counted in a client connection and sent and destroyed as needed. See Resource for more details.


Constructor & Destructor Documentation

Tes::Shapes::Shape::Shape ( ushort  routingID,
uint  id = 0 
) [inline, protected]

Initialises a new instance of the Shape.

Parameters:
routingIDThe routing ID for the shape type.
idThe shape ID. Zero for transient.
Tes::Shapes::Shape::Shape ( ushort  routingID,
uint  id,
ushort  category 
) [inline, protected]

Initialises a new instance of the Shape.

Parameters:
routingIDThe routing ID for the shape type.
idThe shape ID. Zero for transient.
categoryOptional category used to display the shape.

Member Function Documentation

ObjectAttributes Tes::Shapes::Shape::GetAttributes ( ) [inline]

Exposes shape details via an ObjectAttributes structure.

Returns:
The attributes.
void Tes::Shapes::Shape::OnClone ( Shape  copy) [inline, protected]

Perform clone copy operations.

Parameters:
copyThe new object to copy into.
void Tes::Shapes::Shape::SetAttributes ( ObjectAttributes  attr) [inline]

Sets shape details via an ObjectAttributes structure.

Parameters:
attrThe attributes to set.
void Tes::Shapes::Shape::SetPosition ( float  x,
float  y,
float  z 
) [inline]

Set the position.

Parameters:
xThe x coordinate.
yThe y coordinate.
zThe z coordinate.
void Tes::Shapes::Shape::SetScale ( float  x,
float  y,
float  z 
) [inline]

Set the scale.

Parameters:
xThe x scale.
yThe y scale.
zThe z scale.
virtual void Tes::Shapes::Shape::UpdateFrom ( Shape  other) [inline, virtual]

Update the attributes of this shape to match other.

Parameters:
otherThe shape to update data from.

Used in maintaining cached copies of shapes. The shapes should already represent the same object.

Not all attributes need to be updated. Only attributes which may be updated via an UpdateMessage for this shape need be copied.

The default implementation copies only the ObjectAttributes.

virtual bool Tes::Shapes::Shape::WriteCreate ( PacketBuffer  packet) [inline, virtual]

Write a create message to packet .

Returns:
true on success.
Parameters:
packetPacket to write the message to.

Reimplemented in Tes::Shapes::MeshSet, Tes::Shapes::MeshShape, Tes::Shapes::PointCloudShape, Tes::Shapes::Text2D, and Tes::Shapes::Text3D.

virtual int Tes::Shapes::Shape::WriteData ( PacketBuffer  packet,
ref uint  progressMarker 
) [inline, virtual]

Called only for complex shapes to write additional creation data.

Parameters:
packetThe data stream to write to.
progressMarkerIndicates data transfer progress. Initially zero, the Shape manages its own semantics.
Returns:
Indicates completion progress. 0 indicates completion, 1 indicates more data are available and more calls should be made. -1 indicates an error. No more calls should be made.

Reimplemented in Tes::Shapes::MeshShape, and Tes::Shapes::PointCloudShape.

virtual bool Tes::Shapes::Shape::WriteDestroy ( PacketBuffer  packet) [inline, virtual]

Write a destroy message to packet .

Returns:
true on success.
Parameters:
packetPacket to write the message to.
virtual bool Tes::Shapes::Shape::WriteUpdate ( PacketBuffer  packet) [inline, virtual]

Write a update message to packet .

Returns:
true on success.
Parameters:
packetPacket to write the message to.

Member Data Documentation

Core shape data.

Uses the CreateMessage because that conveniently holds all the core data required.


Property Documentation

uint Tes::Shapes::Shape::Colour [get, set]

Encoded integer colour value.

See Maths.Colour.

ushort Tes::Shapes::Shape::Flags [get, set]

Direct access to the ObjectFlag set for this shape.

The flags.

uint Tes::Shapes::Shape::ID [get, set]

Shape ID.

Zero for transient.

bool Tes::Shapes::Shape::IsComplex [get, set]

Set to true for complex shapes.

Only complex shapes will have WriteData(PacketBuffer, ref uint) called.

Quaternion Tes::Shapes::Shape::Rotation [get, set]

Collated quaternion rotation value.

The rotation.

bool Tes::Shapes::Shape::Transparent [get, set]

Gets or sets the transparent display flag.

true if transparent; otherwise, false.


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