VR-Exchange 2.4 API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
2 - The Portal Language

Table of Contents

2.1 Objects and Interactions Supported by VR-Exchange

The Portal provides a framework for creating objects (which have state) and interactions (event messages) that pass through a distributed messaging system. VR-Exchange provides many object and interaction classes in the Portal language. The Portal language is defined in the libPortal library. The table lists the objects and interactions supported by the Portal language.

Object and Interactions Supported by the Portal Language
Object/Interaction libPortal Class
Acknowledge DtPortalAcknowledgeInteraction
Action Request DtPortalActionRequestInteraction
Action Response DtPortalActionResponseInteraction
Aggregate DtPortalAggregate
Application Specific DtPortalApplicationSpecificInteraction
Collision DtPortalCollisionInteraction
Comment DtPortalCommentInteraction
Create Entity DtPortalCreateEntityInteraction
Data DtPortalDataInteraction
Data Query DtPortalDataQueryInteraction
Designator DtPortalDesignatorObject
Detonation DtPortalDetonationInteraction
Emitter System DtPortalEmitterSystemObject
Entity State DtPortalEntity
Environment Process DtPortalEnvironmentProcessObject
Event Report DtPortalEventReportInteraction
Fire DtPortalFireInteraction
Generic Interaction DtPortalGenericInteration
Generic Object DtPortalGenericObject
Gridded Data DtPortalGriddedDataObject
IFF DtPortalIffObject
Radio Receiver DtPortalRadioReceiverObject
Radio Signal DtPortalRadioSignalInteraction
Radio Transmitter DtPortalRadioTransmitterObject
Remove Entity DtPortalRemoveEntityInteraction
Set Data DtPortalSetDataInteraction
Start DtPortalStartInteraction
Stop DtPortalStopInteraction

Objects and interactions have attributes that describe their state, such as location, type, velocity, and target. Each attribute is a unique data field transmitted in a protocol-independent way. That means attributes cannot always be directly copied into Portal messages.

The Portal framework allows you to create new types of objects and interactions. Brokers can create, update, and delete objects, and send interactions to the Portal. They can also subscribe to the objects and interactions they want to receive from the Portal.

If you add a new object type you do not have to recompile all brokers, only those brokers that need to translate the new object type.

2.2 Translating Objects and Interactions to the Portal Language

The job of a broker is to translate object and interaction message attributes from the broker's simulation standard to the Portal language. The translation process involves the following:

Each of these issues is highly protocol-dependent. The following sections provide a general description of how VR-Exchange's data exchange represents objects and attributes. For details, refer to the class documentation.

2.3 Identifying Objects

The Portal identifies each object by a string. The string must be unique, but this is not enforced by the Portal. Future versions of the Portal may choose to enforce this. For protocols that do not identify objects by a string, some form of conversion must be developed by the broker architect.

In the default HLA broker, objects are identified by their HLA object name.

2.4 Translating Attributes

The attribute representations used by the Portal language draw heavily on the data types used by the DIS protocol. For example, Entity Location is transmitted as three doubles: X, Y, and Z, using geocentric coordinates. This method of defining location was chosen because it is widely used by both DIS and the RPR FOM, as well as most RPR FOM variants. FOMs or protocols that use geodetic (latitude, longitude, and altitude) locations must convert to geocentric coordinates before updating location data in the Portal.

All enumeration attributes use values defined in SISO-REF-010-2005, the Enumerations document used for both DIS and the RPR-FOM. The Portal uses a macro called DtDEC_ATTRIBUTE to declare attributes for objects and interactions. For example, an attribute called DamageState might be declared like this:

DtDEC_ATTRIBUTE(DtU32, DamageState, damageState);
Note
This macro resets the access level to protected. It is recommended that classes group this macro usage in one place, then set the access level as needed.

This macro will create two public functions like this:

DtU32 damageState() const { return myDamageState;}
void setDamageState(const DtU32 &val) { myDamageState = val;}

and a protected variable called:

DtU32 myDamageState;

[<< Introduction to The VR-Exchange API] [Home] [Top of Page] [The Portal API >>]


Document ID: Generated on Thu Jul 23 10:25:22 EDT 2015 from SVN revision 155065
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)