VR-Vantage 1.4.1 API Class Documentation
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions
DtStealthRemoteDrawer Class Reference

A Draw Control Object Manager. More...

List of all members.

Public Member Functions

 DtStealthRemoteDrawer (DtExerciseConn *exConn, const DtGlobalObjectDesignator &targetStealthId=SEND_TO_ALL, unsigned nextId=0)
 Construct a DtStealthRemoteDrawer for sending and receiving draw control using the given exercise connection.
 DtStealthRemoteDrawer (DtCustomRemoteControlSender *sender, const DtGlobalObjectDesignator &senderId, const DtGlobalObjectDesignator &targetStealthId=SEND_TO_ALL, unsigned nextId=0)
 Construct a DtStealthRemoteDrawer that can send draw control msgs using a custom message sender.
virtual ~DtStealthRemoteDrawer ()
 Destructor.
virtual unsigned nextId ()
 Unique Id Generator.
virtual void add (DtSdcObject *object)
 Add a draw control object to the controlled stealth(s)
virtual void addToLayer (unsigned id, unsigned layerId)
 Add a draw control object to a layer.
virtual DtSdcObjectremove (unsigned id)
 Remove a draw control object from the controlled stealth(s)
virtual void removeFromLayer (unsigned id, unsigned layerId)
 Add a draw control object to a layer.
virtual DtSdcObjectlookup (unsigned id)
 Get a pointer to a draw control object.
virtual void update (unsigned id)
 Update a draw control object.
virtual void show (unsigned id)
 Show a (previously hidden) draw control object.
virtual void showAttribute (unsigned groupId, unsigned attributeId)
 Show a (previously hidden) attribute.
virtual void hide (unsigned id)
 Hide a draw control object.
virtual void hideAttribute (unsigned groupId, unsigned attributeId)
 Hide an attribute.

Static Public Attributes

static const
DtGlobalObjectDesignator 
SEND_TO_ALL = DtEntityIdentifier::nullId()
 A wild-card send-to ID.

Protected Member Functions

virtual void update (DtSdcObject *object)

Protected Attributes

DtExerciseConn * myExConn
DtCustomRemoteControlSendermyCustomSender
unsigned myNextId
DtSdcObjectList myObjectList
bool myCreatedExConn
DtGlobalObjectDesignator myTargetId
DtGlobalObjectDesignator mySenderId

Private Member Functions

 DtStealthRemoteDrawer ()
 Default Constructor.
 DtStealthRemoteDrawer (const DtStealthRemoteDrawer &)
 Copy Constructor.
DtStealthRemoteDraweroperator= (const DtStealthRemoteDrawer &)
 Assignment Operator.

Detailed Description

A Draw Control Object Manager.

DtStealthRemoteDrawer can provide unique ids for and store draw control objects for later retrieval. More importantly, it can send those objects through an exercise connection provided to it or create its own to a specific stealth or all stealths in an exercise / federation. It can also manage draw control layers, and send commands to show and hide individual draw control objects or entire layers. It can also send messages to show or hide attributes within a group or attribute templates (showing or hiding attributes in all groups using that template.


Constructor & Destructor Documentation

DtStealthRemoteDrawer::DtStealthRemoteDrawer ( DtExerciseConn *  exConn,
const DtGlobalObjectDesignator &  targetStealthId = SEND_TO_ALL,
unsigned  nextId = 0 
)

Construct a DtStealthRemoteDrawer for sending and receiving draw control using the given exercise connection.

Parameters:
exConnDtExerciseConn to use for sending draw control messages
targetStealthIdThe stealth that should respond to these messages. By default, SEND_TO_ALL is used
nextIdThe starting value to use when generating ids. It's therefore possible for a single application to have multiple drawers if there is an architectural need to do so

References myExConn, and mySenderId.

DtStealthRemoteDrawer::DtStealthRemoteDrawer ( DtCustomRemoteControlSender sender,
const DtGlobalObjectDesignator &  senderId,
const DtGlobalObjectDesignator &  targetStealthId = SEND_TO_ALL,
unsigned  nextId = 0 
)

Construct a DtStealthRemoteDrawer that can send draw control msgs using a custom message sender.

Use this creator if you would like to send draw control msgs without a VR-Link license.

Parameters:
senderCustom sender object for sending draw control messages
senderIdWhen the VR-Link exercise connection is used, it's own site/host pair or federate type can be used as the senderId. When a custom sender is employed, the user must provide a unique senderId.
targetStealthIdThe stealth that should respond to these messages. By default, SEND_TO_ALL is used
nextIdThe starting value to use when generating ids. It's therefore possible for a single application to have multiple drawers if there is an architectural need to do so
DtStealthRemoteDrawer::DtStealthRemoteDrawer ( ) [private]

Default Constructor.

Not implemented; a method for sending and a send-to ID must be provided to construct a DtStealthRemoteDrawer

DtStealthRemoteDrawer::DtStealthRemoteDrawer ( const DtStealthRemoteDrawer ) [private]

Copy Constructor.

Not implemented; copying a DtStealthRemoteDrawer is not supported

DtStealthRemoteDrawer::~DtStealthRemoteDrawer ( ) [virtual]

Destructor.

Note Well! The destructor for the DtStealthRemoteDrawer deletes all objects added to it. However it does NOT send remove messages for each (so this should be done before deleting the DtStealthRemoteDrawer).

References myCreatedExConn, myExConn, and myObjectList.


Member Function Documentation

DtStealthRemoteDrawer& DtStealthRemoteDrawer::operator= ( const DtStealthRemoteDrawer ) [private]

Assignment Operator.

Not implemented; assigning a DtStealthRemoteDrawer to another is not supported

unsigned DtStealthRemoteDrawer::nextId ( ) [virtual]

Unique Id Generator.

Returns:
A unique (for this drawer) id.

References myNextId.

void DtStealthRemoteDrawer::add ( DtSdcObject object) [virtual]

Add a draw control object to the controlled stealth(s)

Add an object that should be managed by the drawer. The object added is automatically sent to the network. Note that while Attribute Templates are DtSdcObjects, they should not be added directly; they are managed as part of the Attribute Group Template object used to create them, so only that object needs to be added. NOTE WELL - adding an object to the drawer cedes control over the object's memory to the drawer. If the drawer is deleted before explicitly removing the object from the drawer, the drawer's destructor will delete that object. That also means that objects given to the drawer should be allocated using 'new', not created on the stack. \ param object The object to add

References myObjectList, and update().

void DtStealthRemoteDrawer::addToLayer ( unsigned  id,
unsigned  layerId 
) [virtual]

Add a draw control object to a layer.

Put a draw control object onto a draw layer. Draw control objects that are associated with a layer are shown and hidden when a layer is shown or hidden. This makes it easier to manage sets of objects that should be shown or hidden as a group.

Parameters:
idThe draw control object id of the object to add to the layer
idThe draw control object id of the layer to add the object to
DtSdcObject * DtStealthRemoteDrawer::remove ( unsigned  id) [virtual]

Remove a draw control object from the controlled stealth(s)

Remove a draw control object from stealth(s) drawing it, and also remove it from the drawer's control.

Parameters:
idThe draw control object id of the object to remove

References myObjectList.

void DtStealthRemoteDrawer::removeFromLayer ( unsigned  id,
unsigned  layerId 
) [virtual]

Add a draw control object to a layer.

Put a draw control object onto a draw layer. Draw control objects that are associated with a layer are shown and hidden when a layer is shown or hidden. This makes it easier to manage sets of objects that should be shown or hidden as a group.

Parameters:
idThe draw control object id of the object to add to the layer
idThe draw control object id of the layer to add the object to
DtSdcObject * DtStealthRemoteDrawer::lookup ( unsigned  id) [virtual]

Get a pointer to a draw control object.

This function returns a pointer to an object previously added using the add() method.

Parameters:
idid of the draw control object to return
Returns:
DtSdcObject pointer to the object with the id specified

References myObjectList.

Referenced by hide(), show(), and update().

void DtStealthRemoteDrawer::update ( unsigned  id) [virtual]

Update a draw control object.

Once a draw control object has been added to the drawer, it can be modified using any of its mutators to change its appearance, position, attribute values, etc. After making changes, call update to send those changes to the stealth(s) drawing the draw control object

Parameters:
drawcontrol object id of the object to update

References lookup().

Referenced by add(), hide(), and show().

void DtStealthRemoteDrawer::show ( unsigned  id) [virtual]

Show a (previously hidden) draw control object.

Draw control objects (including attribute groups and attribute group templates) that have been previously hidden can be made visible again

Parameters:
idid of the draw control object to show

References lookup(), and update().

void DtStealthRemoteDrawer::showAttribute ( unsigned  groupId,
unsigned  attributeId 
) [virtual]

Show a (previously hidden) attribute.

Attributes may be shown for a specific group or for all groups using a specific attribute template. If the first parameter specified is the id of an attribute group, then the attribute referred to by attributeId will be shown. If the first parameter is the id of an attribute group template, then the attributes corresponding to the attributeId specified will be shown in all groups based on that template

Parameters:
groupIdid of an attribute group or attribute group template
attributeIdId of the attribute template describing the attribute to show
void DtStealthRemoteDrawer::hide ( unsigned  id) [virtual]

Hide a draw control object.

Tell the stealth(s) to not draw this draw control object. It is NOT removed (and can be shown using a show command OR from the stealth GUI).

Parameters:
idid of the draw control object to hide

References lookup(), and update().

void DtStealthRemoteDrawer::hideAttribute ( unsigned  groupId,
unsigned  attributeId 
) [virtual]

Hide an attribute.

Attributes may be hidden for a specific group or for all groups using a specific attribute template. If the first parameter specified is the id of an attribute group, then the attribute referred to by attributeId will be hidden. If the first parameter is the id of an attribute group template, then the attributes corresponding to the attributeId specified will be hidden in all groups based on that template.

Parameters:
groupIdid of an attribute group or attribute group template
attributeIdId of the attribute template describing the attribute to hide
void DtStealthRemoteDrawer::update ( DtSdcObject object) [protected, virtual]

Member Data Documentation

const DtGlobalObjectDesignator DtStealthRemoteDrawer::SEND_TO_ALL = DtEntityIdentifier::nullId() [static]

A wild-card send-to ID.

DtExerciseConn* DtStealthRemoteDrawer::myExConn [protected]
unsigned DtStealthRemoteDrawer::myNextId [protected]

Referenced by nextId().

Referenced by ~DtStealthRemoteDrawer().

DtGlobalObjectDesignator DtStealthRemoteDrawer::myTargetId [protected]
DtGlobalObjectDesignator DtStealthRemoteDrawer::mySenderId [protected]

Referenced by DtStealthRemoteDrawer().


The documentation for this class was generated from the following files:


Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)