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 | Protected Attributes
makVrv::DtShipFlagSwitchTickable Class Reference

The DtShipFlagSwitchTickable class is responsible for switching nodes based on the current wind speed and ship speed. More...

Inheritance diagram for makVrv::DtShipFlagSwitchTickable:
Inheritance graph
[legend]

Public Member Functions

 DtShipFlagSwitchTickable (DtDe &de, DtElementID elementId, DtUniqueID sceneObjectId, DtUniqueID uniqueId, bool useInstancing, unsigned int nodeTypeIndex)
 CTOR.
virtual ~DtShipFlagSwitchTickable ()
 DTOR.
DtVector computeWindVec (DtSceneObject *sceneObj, float windDirRad)
 Convert the wind angle to a directional vector.
virtual void update (DtTime tNow)
 Update the switch node based on the wind speed.
void SetWindNodeSwitch (double windSpeed)
virtual bool needsUpdate (DtTime tNow)
 The check function called by DtTickableManager to verify if an update is required.
virtual void configure (osg::Node *n, const rapidjson::Value &windJsonData)
 Configure the meta file tickable object.
unsigned int getSwitchIndexForSpeed (double windSpeed)
 Get the switch index based on the wind speed (km/h)
- Public Member Functions inherited from makVrv::DtDynamicFeatureTickable
 DtDynamicFeatureTickable (DtDe &de, DtElementID elementId, DtUniqueID sceneObjectId, DtUniqueID uniqueId, bool useInstancing, unsigned int nodeTypeIndex)
 CTOR.
virtual ~DtDynamicFeatureTickable ()
 DTOR.
- Public Member Functions inherited from makVrv::DtTickable
virtual ~DtTickable ()
 Virtual DTOR.
virtual void setUpdatePeriod (unsigned int period)
 Specify how often (in # of frames) this tickable should call update.
virtual unsigned int updatePeriod () const
 Specify how often (in # of frames) this tickable should call update.
- Public Member Functions inherited from makVrv::DtVirtualBaseClass
 DtVirtualBaseClass ()
 Do nothing constructor.
virtual ~DtVirtualBaseClass ()
 Virtual do nothing destructor.

Static Public Attributes

static const chartheShipFlagSwitchFeatureName
 Strings to get the different parts of the meta file Use these instead of hardcoded strings.
static const chartheTagWindSpeeds
 Strings to get the different parts of the meta file Use these instead of hardcoded strings.
static const chartheTagSwitchIndices
 Strings to get the different parts of the meta file Use these instead of hardcoded strings.

Protected Attributes

DtSceneObjectmySceneObject
 The scene object.
float myLastWindSpeed
 Last update wind speed.
DtVector myLastPos
 Last position.
DtTime myLastTime
 Last update time.
DtDoubleSmoother myFlagSpeedSmoother
 Moving average of last 10 ship speeds.
DtDisplayUnitsConvertermyConverter
 To convert the wind speed to display units (km/h)
osgSim::MultiSwitch * myWindSwitchNode
 The actual node that contains switch states.
std::vector< double > myWindSpeeds
 Windspeeds.
std::vector< int > mySwitchIndices
- Protected Attributes inherited from makVrv::DtDynamicFeatureTickable
DtDemyDe
 The display engine.
DtElementID myElementId
 Object element id.
DtUniqueID mySceneObjectId
 To retrieve the scene object if needed.
DtInstanceManagermyInstanceManager
 The instance manager in case we have instancing on.
bool myUseInstancing
 Is instancing enabled?
unsigned int myNodeTypeIndex
 For the node type used in the tickable, the index in the instancing array for that node type (so we update the right one)
DtUniqueID myUniqueId
 For retrieving the instance state from the instance manager.
std::string myFeatureName
 The name of the feature in the .meta file.
- Protected Attributes inherited from makVrv::DtTickable
DtTickableManagerInterfacemyManager
 Pointer to manager for removal during destruction.
DtSignalConnectionManager myConnections
unsigned int myFrameCounter
unsigned int myFrameToUpdate
unsigned int myUpdatePeriod

Additional Inherited Members

- Protected Member Functions inherited from makVrv::DtTickable
 DtTickable (DtTickableManagerInterface *manager)
 CTOR.
 DtTickable ()
 Unimplemented default CTOR.
virtual void slot_managerAboutToBeDeleted ()

Detailed Description

The DtShipFlagSwitchTickable class is responsible for switching nodes based on the current wind speed and ship speed.

Constructor & Destructor Documentation

makVrv::DtShipFlagSwitchTickable::DtShipFlagSwitchTickable ( DtDe de,
DtElementID  elementId,
DtUniqueID  sceneObjectId,
DtUniqueID  uniqueId,
bool  useInstancing,
unsigned int  nodeTypeIndex 
)

CTOR.

virtual makVrv::DtShipFlagSwitchTickable::~DtShipFlagSwitchTickable ( )
virtual

DTOR.

Member Function Documentation

DtVector makVrv::DtShipFlagSwitchTickable::computeWindVec ( DtSceneObject sceneObj,
float  windDirRad 
)

Convert the wind angle to a directional vector.

virtual void makVrv::DtShipFlagSwitchTickable::update ( DtTime  tNow)
virtual

Update the switch node based on the wind speed.

Implements makVrv::DtTickable.

void makVrv::DtShipFlagSwitchTickable::SetWindNodeSwitch ( double  windSpeed)
virtual bool makVrv::DtShipFlagSwitchTickable::needsUpdate ( DtTime  tNow)
virtual

The check function called by DtTickableManager to verify if an update is required.

If this function returns true, the DtTickableManager will then call update().

Parameters
[in]tNowis the current time-stamp.
Return values
trueif this object needs to be ticked.
falseotherwise.

Reimplemented from makVrv::DtTickable.

virtual void makVrv::DtShipFlagSwitchTickable::configure ( osg::Node *  n,
const rapidjson::Value &  windJsonData 
)
virtual

Configure the meta file tickable object.

unsigned int makVrv::DtShipFlagSwitchTickable::getSwitchIndexForSpeed ( double  windSpeed)

Get the switch index based on the wind speed (km/h)

Member Data Documentation

const char* makVrv::DtShipFlagSwitchTickable::theShipFlagSwitchFeatureName
static

Strings to get the different parts of the meta file Use these instead of hardcoded strings.

const char* makVrv::DtShipFlagSwitchTickable::theTagWindSpeeds
static

Strings to get the different parts of the meta file Use these instead of hardcoded strings.

const char* makVrv::DtShipFlagSwitchTickable::theTagSwitchIndices
static

Strings to get the different parts of the meta file Use these instead of hardcoded strings.

DtSceneObject* makVrv::DtShipFlagSwitchTickable::mySceneObject
protected

The scene object.

float makVrv::DtShipFlagSwitchTickable::myLastWindSpeed
protected

Last update wind speed.

DtVector makVrv::DtShipFlagSwitchTickable::myLastPos
protected

Last position.

DtTime makVrv::DtShipFlagSwitchTickable::myLastTime
protected

Last update time.

DtDoubleSmoother makVrv::DtShipFlagSwitchTickable::myFlagSpeedSmoother
protected

Moving average of last 10 ship speeds.

DtDisplayUnitsConverter& makVrv::DtShipFlagSwitchTickable::myConverter
protected

To convert the wind speed to display units (km/h)

osgSim::MultiSwitch* makVrv::DtShipFlagSwitchTickable::myWindSwitchNode
protected

The actual node that contains switch states.

std::vector<double> makVrv::DtShipFlagSwitchTickable::myWindSpeeds
protected

Windspeeds.

std::vector<int> makVrv::DtShipFlagSwitchTickable::mySwitchIndices
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)