VR-Forces Development_Version Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions
DtStealthRemoteDrawer Class Reference

A Draw Control Object Manager. More...

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.
 DtStealthRemoteDrawer (const char *execName, const char *federateType, DtFomMapper *mapper=DtRprFomMapper::create(NULL), const char *fedFileName=NULL, const DtGlobalObjectDesignator &targetStealthId=SEND_TO_ALL, unsigned nextId=0)
 Construct a DtStealthRemoteDrawer that also constructs its own exercise connection for HLA.
 DtStealthRemoteDrawer (const char *execName, const char *federateType, const char *dsoName, const char *fedFileName=NULL, void *fomMapInitData=NULL, const DtGlobalObjectDesignator &targetStealthId=SEND_TO_ALL, unsigned nextId=0)
 Construct a DtStealthRemoteDrawer that also constructs its own exercise connection for HLA.
 DtStealthRemoteDrawer (int port, int exerciseId, int siteId, int applicationNum, const DtGlobalObjectDesignator &targetStealthId=SEND_TO_ALL, unsigned nextId=0)
 Construct a DtStealthRemoteDrawer that also constructs its own exercise connection for DIS using a specified port.
 DtStealthRemoteDrawer (int port, const DtInetAddr &destAddr, int exerciseId, int siteId, int applicationNum, const DtGlobalObjectDesignator &targetStealthId=SEND_TO_ALL, unsigned nextId=0)
 Construct a DtStealthRemoteDrawer that also constructs its own exercise connection for DIS using a specified port and a specified destination IP Address.
 DtStealthRemoteDrawer (DtInetSocket *skt, int exerciseId, int siteId, int applicationNum, const DtGlobalObjectDesignator &targetStealthId=SEND_TO_ALL, unsigned nextId=0)
 Construct a DtStealthRemoteDrawer that also constructs its own exercise connection for DIS using a previously created DtSocket.
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
 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
DtStealthControlInteraction mySendInter

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
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 ( const char execName,
const char federateType,
DtFomMapper *  mapper = DtRprFomMapper::create(NULL),
const char fedFileName = NULL,
const DtGlobalObjectDesignator &  targetStealthId = SEND_TO_ALL,
unsigned  nextId = 0 
)

Construct a DtStealthRemoteDrawer that also constructs its own exercise connection for HLA.

Parameters
execNameThe name of the federation execution to join
federateTypeThis federate's type
mapperMapper is a pointer to a new'ed FOM Mapper to use. The FOM Mapper's init() function will be called by the DtExerciseConn constructor. The default value for mapper is a new'ed DtRprFomMapper. The mapper is deleted by DtExerciseConn destructor. If mapper is NULL, we create one using the creator function passed to setFomMapperCreator (default is an empty FOM Mapper). The FOM Mapper's init function is called after the RTI is initialized.
fedFileNameName of the Fed file to use. If fedFileName is NULL, <execName>.fed is used.
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 ( const char execName,
const char federateType,
const char dsoName,
const char fedFileName = NULL,
void *  fomMapInitData = NULL,
const DtGlobalObjectDesignator &  targetStealthId = SEND_TO_ALL,
unsigned  nextId = 0 
)

Construct a DtStealthRemoteDrawer that also constructs its own exercise connection for HLA.

Parameters
execNameThe name of the federation execution to join
federateTypeThis federate's type
dsoNameThe name of a shared library (DSO or DLL) that contains a FOM Mapper creation function called DtCreateFomMapper (and a FOM Mapper destruction function called DtDeleteFomMapper).
fedFileNameName of the Fed file to use. If fedFileName is NULL, <execName>.fed is used.
fomMapInitDataa pointer to arbitrary data that you wish to have passed to the FOM Mapper creation function in your FOM Mapper shared library.
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 ( int  port,
int  exerciseId,
int  siteId,
int  applicationNum,
const DtGlobalObjectDesignator &  targetStealthId = SEND_TO_ALL,
unsigned  nextId = 0 
)

Construct a DtStealthRemoteDrawer that also constructs its own exercise connection for DIS using a specified port.

Parameters
portThe udp port to use for messages The DIS exercise id to use
siteIdThe first part of the sender id (which is on 2 parts for historical reasons)
applicationNumThe second part of the sender id (which is on 2 parts for historical reasons)
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 ( int  port,
const DtInetAddr &  destAddr,
int  exerciseId,
int  siteId,
int  applicationNum,
const DtGlobalObjectDesignator &  targetStealthId = SEND_TO_ALL,
unsigned  nextId = 0 
)

Construct a DtStealthRemoteDrawer that also constructs its own exercise connection for DIS using a specified port and a specified destination IP Address.

Parameters
portThe udp port to use for messages
destAddrThe IP address to send to (instead of the default broadcast)
exerciseIdThe DIS exercise id to use
siteIdThe first part of the sender id (which is on 2 parts for historical reasons)
applicationNumThe second part of the sender id (which is on 2 parts for historical reasons)
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 ( DtInetSocket *  skt,
int  exerciseId,
int  siteId,
int  applicationNum,
const DtGlobalObjectDesignator &  targetStealthId = SEND_TO_ALL,
unsigned  nextId = 0 
)

Construct a DtStealthRemoteDrawer that also constructs its own exercise connection for DIS using a previously created DtSocket.

Parameters
DtSocketA DtSocket to use for sending draw control messages
exerciseIdThe DIS exercise id to use
siteIdThe first part of the sender id (which is on 2 parts for historical reasons)
applicationNumThe second part of the sender id (which is on 2 parts for historical reasons)
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

virtual 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).

Member Function Documentation

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

Assignment Operator.

Not implemented; assigning a DtStealthRemoteDrawer to another is not supported

virtual unsigned DtStealthRemoteDrawer::nextId ( )
virtual

Unique Id Generator.

Returns
A unique (for this drawer) id.
virtual 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

virtual 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
virtual 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
virtual 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
virtual 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
virtual 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
virtual 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
virtual 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
virtual 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
virtual 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
virtual void DtStealthRemoteDrawer::update ( DtSdcObject object)
protectedvirtual

Member Data Documentation

const DtGlobalObjectDesignator DtStealthRemoteDrawer::SEND_TO_ALL
static

A wild-card send-to ID.

DtExerciseConn* DtStealthRemoteDrawer::myExConn
protected
DtCustomRemoteControlSender* DtStealthRemoteDrawer::myCustomSender
protected
unsigned DtStealthRemoteDrawer::myNextId
protected
DtSdcObjectList DtStealthRemoteDrawer::myObjectList
protected
bool DtStealthRemoteDrawer::myCreatedExConn
protected
DtGlobalObjectDesignator DtStealthRemoteDrawer::myTargetId
protected
DtGlobalObjectDesignator DtStealthRemoteDrawer::mySenderId
protected
DtStealthControlInteraction DtStealthRemoteDrawer::mySendInter
protected

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

Document ID: Generated on Mon Jul 4 01:00:18 EDT 2016 from SVN revision 166489
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)