Eaagles::Simulation::Otw Class Reference

Inherits Eaagles::Basic::LcComponent.

Inherited by Eaagles::Otw::OtwPC.

Inheritance diagram for Eaagles::Simulation::Otw:

Inheritance graph
[legend]
Collaboration diagram for Eaagles::Simulation::Otw:

Collaboration graph
[legend]
List of all members.

Public Types

enum  TableType { MODEL_TABLE, HOT_TABLE }

Public Member Functions

 Otw ()
const PlayergetOwnship () const
unsigned int getMaxModels () const
unsigned int getMaxElevations () const
LCreal getMaxRange () const
double getRefLatitude () const
double getRefLongitude () const
virtual bool isResetInProgress () const
virtual bool setRefLatitude (const double v)
virtual bool setRefLongitude (const double v)
virtual void setOwnship (Player *const newOwnship)
virtual void setPlayerList (Basic::LcPairStream *const newPlayerList)
bool setMaxRange (const LCreal r)
bool setMaxModels (const unsigned int n)
bool setMaxElevations (const unsigned int n)
virtual bool setSlotMaxRange (const Basic::LcDistance *const msg)
virtual bool setSlotMaxRange (const Basic::LcNumber *const msg)
virtual bool setSlotMaxModels (const Basic::LcNumber *const msg)
virtual bool setSlotMaxElevations (const Basic::LcNumber *const msg)
virtual bool setSlotRefLatitude (const Basic::LcNumber *const msg)
virtual bool setSlotRefLongitude (const Basic::LcNumber *const msg)
virtual bool setSlotOtwModelTypes (const Basic::LcPairStream *const msg)
virtual void updateTC (const LCreal dt=0.0f)
virtual void reset ()

Protected Member Functions

virtual LCreal computeRangeToPlayer (const Player *const ip) const
virtual OtwModelfindModel (const unsigned short playerID, const Basic::LcString *const federateName, const TableType type)
virtual OtwModelfindModel (const Player *const player, const TableType type)
virtual bool addModelToList (OtwModel *const model, const TableType type)
virtual void removeModelFromList (OtwModel *const model, const TableType type)
virtual void removeModelFromList (const int idx, const TableType type)
unsigned int getModelTableSize () const
unsigned int getElevationTableSize () const
OtwModel ** getModelTable ()
OtwModel ** getElevationTable ()
virtual OtwModelmodelFactory ()=0
virtual OtwModelhotFactory ()=0
virtual void sendOwnshipAndModels ()=0
virtual void sendElevationRequests ()=0
virtual void recvElevations ()=0
virtual void frameSync ()=0

Private Member Functions

void processesModels ()
void processesElevations ()
void resetTables ()
void clearOtwModelTypes ()
void mapPlayerList2ModelTable ()
void mapPlayers2ElevTable ()
OtwModelnewModelEntry (Player *const ip)
OtwModelnewElevEntry (Player *const ip)

Static Private Member Functions

static int compareKey2Model (const void *key, const void *nib)

Private Attributes

LCreal maxRange
unsigned int maxModels
unsigned int maxElevations
double refLat
double refLon
Playerownship
Basic::LcPairStreamplayerList
bool rstFlg
bool rstReq
OtwModelmodelTbl [MAX_MODELS]
unsigned int nModels
OtwModelhotTbl [MAX_MODELS]
unsigned int nHots
const OtmotwModelTypes [MAX_MODELS_TYPES]
unsigned int nOtwModelTypes

Static Private Attributes

static const int MAX_MODELS = 400
static const int MAX_MODELS_TYPES = 400

Classes

struct  OtwModelKey
 OtwModel quick lookup key. More...

Detailed Description

Abstract Out-The-Window (OTW) visual system interface class

    Notes:
       1) Derived versions of this class are used to interface with various
          visual systems and HUDs (see the Otw project).

       2) One or more Otw objects can be attached to and managed by a Station object.

       3) To allow different visual database to be used with the same scenario,
          the visual database reference point, which is used by this class,
          is a different reference point then the Simulation class.
          Player's (see Player.h) position vectors [ x y z ] are north(x),
          east(y) and down(z) from the reference point.

    Form name: Otw
    Slots:
       maxRange       (Distance)     Max range of visual system
       maxRange       (Number)       Max range of visual system (meters)

       maxModels      (Number)       Max number of active, in-range player/models

       maxElevations  (Number)       Max number of player terrain elevation requests

       latitude       (Number)       Visual database reference latitude (deg)

       longitude      (Number)       Visual database reference longitude (deg)

       otwModelTypes  (PairStream)   OTW system's model type IDs (list of Otm objects) 


Member Enumeration Documentation

enum Eaagles::Simulation::Otw::TableType

Enumerator:
MODEL_TABLE  Model table -- maps players to visual system models.
HOT_TABLE  Height-Of-Terrain request table.


Constructor & Destructor Documentation

Eaagles::Simulation::Otw::Otw (  ) 


Member Function Documentation

const Player* Eaagles::Simulation::Otw::getOwnship (  )  const [inline]

Our ownship -- the player that we're following.

unsigned int Eaagles::Simulation::Otw::getMaxModels (  )  const [inline]

Max number of active, in-range player/models.

unsigned int Eaagles::Simulation::Otw::getMaxElevations (  )  const [inline]

Max number of terrain elevation requests.

LCreal Eaagles::Simulation::Otw::getMaxRange (  )  const [inline]

Max range of active player/models.

double Eaagles::Simulation::Otw::getRefLatitude (  )  const [inline]

Visual database reference latitude (degs).

double Eaagles::Simulation::Otw::getRefLongitude (  )  const [inline]

Visual database reference longitude (degs).

bool Eaagles::Simulation::Otw::isResetInProgress (  )  const [virtual]

True if visual system is resetting.

bool Eaagles::Simulation::Otw::setRefLatitude ( const double  v  )  [virtual]

Sets the visual database reference latitude (degs).

bool Eaagles::Simulation::Otw::setRefLongitude ( const double  v  )  [virtual]

Sets the visual database reference longitude (degs).

void Eaagles::Simulation::Otw::setOwnship ( Player *const   newOwnship  )  [virtual]

Sets our ownship player.

void Eaagles::Simulation::Otw::setPlayerList ( Basic::LcPairStream *const   newPlayerList  )  [virtual]

Sets the player list that we're to use to generate player/models.

bool Eaagles::Simulation::Otw::setMaxRange ( const LCreal  r  ) 

Sets the max range (meters).

bool Eaagles::Simulation::Otw::setMaxModels ( const unsigned int  n  ) 

Sets the max number of active, in-range player/models.

bool Eaagles::Simulation::Otw::setMaxElevations ( const unsigned int  n  ) 

Sets the max number of player terrain elevation requests.

bool Eaagles::Simulation::Otw::setSlotMaxRange ( const Basic::LcDistance *const   msg  )  [virtual]

Sets the max range (Distance) slot.

Slot functions

bool Eaagles::Simulation::Otw::setSlotMaxRange ( const Basic::LcNumber *const  msg  )  [virtual]

Sets the max range (meters) slot.

bool Eaagles::Simulation::Otw::setSlotMaxModels ( const Basic::LcNumber *const  msg  )  [virtual]

Sets the max number of active, in-range player/models slot.

bool Eaagles::Simulation::Otw::setSlotMaxElevations ( const Basic::LcNumber *const  msg  )  [virtual]

Sets the max number of player terrain elevation requests slot.

bool Eaagles::Simulation::Otw::setSlotRefLatitude ( const Basic::LcNumber *const  msg  )  [virtual]

Sets the visual database reference latitude (degs) slot.

bool Eaagles::Simulation::Otw::setSlotRefLongitude ( const Basic::LcNumber *const  msg  )  [virtual]

Sets the visual database reference longitude (degs) slot.

bool Eaagles::Simulation::Otw::setSlotOtwModelTypes ( const Basic::LcPairStream *const  msg  )  [virtual]

Sets the list of OTW model type IDs (Otm objects).

void Eaagles::Simulation::Otw::updateTC ( const LCreal  dt = 0.0f  )  [virtual]

Basic::LcComponent interface.

Reimplemented from Eaagles::Basic::LcComponent.

void Eaagles::Simulation::Otw::reset (  )  [virtual]

Reinitialize this component to its state at the beginning of the simulation.

Reimplemented from Eaagles::Basic::LcComponent.

Reimplemented in Eaagles::Otw::OtwPC.

LCreal Eaagles::Simulation::Otw::computeRangeToPlayer ( const Player *const  ip  )  const [protected, virtual]

Computers the range (meters) from our ownship to this player.

OtwModel * Eaagles::Simulation::Otw::findModel ( const unsigned short  playerID,
const Basic::LcString *const  federateName,
const TableType  type 
) [protected, virtual]

Find a player's model object in table 'type' by the player IDs.

OtwModel * Eaagles::Simulation::Otw::findModel ( const Player *const  player,
const TableType  type 
) [protected, virtual]

Find a player's model object in table 'type' using a pointer to the player.

bool Eaagles::Simulation::Otw::addModelToList ( OtwModel *const  model,
const TableType  type 
) [protected, virtual]

Add a player's model object to table 'type'.

void Eaagles::Simulation::Otw::removeModelFromList ( OtwModel *const  model,
const TableType  type 
) [protected, virtual]

Remove a player's model object from table 'type'.

void Eaagles::Simulation::Otw::removeModelFromList ( const int  idx,
const TableType  type 
) [protected, virtual]

Remove model object at index, 'idx', from table 'type'.

unsigned int Eaagles::Simulation::Otw::getModelTableSize (  )  const [inline, protected]

Derived class' access to the tables.

unsigned int Eaagles::Simulation::Otw::getElevationTableSize (  )  const [inline, protected]

OtwModel** Eaagles::Simulation::Otw::getModelTable (  )  [inline, protected]

OtwModel** Eaagles::Simulation::Otw::getElevationTable (  )  [inline, protected]

virtual OtwModel* Eaagles::Simulation::Otw::modelFactory (  )  [protected, pure virtual]

Create OtwModel objects to manage player/models OTW/HUD system unique versions must be implemented by derived classes

Implemented in Eaagles::Otw::OtwPC.

virtual OtwModel* Eaagles::Simulation::Otw::hotFactory (  )  [protected, pure virtual]

Create OtwModel objects to manage player terrain elevation requests OTW/HUD system unique versions must be implemented by derived classes

Implemented in Eaagles::Otw::OtwPC.

virtual void Eaagles::Simulation::Otw::sendOwnshipAndModels (  )  [protected, pure virtual]

Manages the sending of ownship and player/model state data OTW/HUD system unique versions must be implemented by derived classes

Implemented in Eaagles::Otw::OtwPC.

virtual void Eaagles::Simulation::Otw::sendElevationRequests (  )  [protected, pure virtual]

Manages the sending of player terrain elevation requests OTW/HUD system unique versions must be implemented by derived classes

Implemented in Eaagles::Otw::OtwPC.

virtual void Eaagles::Simulation::Otw::recvElevations (  )  [protected, pure virtual]

Handles received player terrain elevation data OTW/HUD system unique versions must be implemented by derived classes

Implemented in Eaagles::Otw::OtwPC.

virtual void Eaagles::Simulation::Otw::frameSync (  )  [protected, pure virtual]

Send frame sync (if any) OTW/HUD system unique versions must be implemented by derived classes

Implemented in Eaagles::Otw::OtwPC.

void Eaagles::Simulation::Otw::processesModels (  )  [private]

Process ownship & player models.

void Eaagles::Simulation::Otw::processesElevations (  )  [private]

Process terrain elevation requests.

void Eaagles::Simulation::Otw::resetTables (  )  [private]

Resets the tables.

void Eaagles::Simulation::Otw::clearOtwModelTypes (  )  [private]

Clear the OTW model types table.

void Eaagles::Simulation::Otw::mapPlayerList2ModelTable (  )  [private]

Map the player list to the model table.

void Eaagles::Simulation::Otw::mapPlayers2ElevTable (  )  [private]

Map player list to terrain elevation table.

OtwModel * Eaagles::Simulation::Otw::newModelEntry ( Player *const   ip  )  [private]

Create a new model entry for this player & return the table index.

OtwModel * Eaagles::Simulation::Otw::newElevEntry ( Player *const   ip  )  [private]

Create a new elevation entry for this player & return the table index.

int Eaagles::Simulation::Otw::compareKey2Model ( const void *  key,
const void *  nib 
) [static, private]

bsearch callbacks: object name compare function -- True types are (const OtwModelKey* key, const OtwModel** model)


Member Data Documentation

const int Eaagles::Simulation::Otw::MAX_MODELS = 400 [static, private]

Max model table size.

const int Eaagles::Simulation::Otw::MAX_MODELS_TYPES = 400 [static, private]

Max OTW model type table size.

LCreal Eaagles::Simulation::Otw::maxRange [private]

Parameters Max range of visual system (meters)

unsigned int Eaagles::Simulation::Otw::maxModels [private]

Max number of models (must be <= MAX_MODELS).

unsigned int Eaagles::Simulation::Otw::maxElevations [private]

Max number of terrain elevation requests.

double Eaagles::Simulation::Otw::refLat [private]

Visual database reference latitude (deg).

Ref position

double Eaagles::Simulation::Otw::refLon [private]

Visual database reference longitude (deg).

Player* Eaagles::Simulation::Otw::ownship [private]

Simulation inputs Current ownship

Basic::LcPairStream* Eaagles::Simulation::Otw::playerList [private]

Current player list.

bool Eaagles::Simulation::Otw::rstFlg [private]

Reset in progress.

bool Eaagles::Simulation::Otw::rstReq [private]

Reset request flag.

OtwModel* Eaagles::Simulation::Otw::modelTbl[MAX_MODELS] [private]

Model table The table of models

unsigned int Eaagles::Simulation::Otw::nModels [private]

Number of models.

OtwModel* Eaagles::Simulation::Otw::hotTbl[MAX_MODELS] [private]

Height-Of-Terrain request table.

unsigned int Eaagles::Simulation::Otw::nHots [private]

Number of HOTs requests.

const Otm* Eaagles::Simulation::Otw::otwModelTypes[MAX_MODELS_TYPES] [private]

Table of pointers to OTW type mappers; Otm objects.

OTW model type table

unsigned int Eaagles::Simulation::Otw::nOtwModelTypes [private]

Number of type mappers (Otm objects) in the table, 'otwModelTable'.


Generated on Tue Dec 19 16:28:30 2006 for Eaagles by  doxygen 1.5.0