VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtShipFlagSwitchTickable.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2014 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
13 #include <vrvCore/vrvCore.h>
15 #include <matrix/vlVector.h>
16 #include <rapidjson/document.h>
17 #include <osgSim/MultiSwitch>
18 
19 namespace makVrv
20 {
21  class DtDisplayUnitsConverter;
22  class DtSceneObject;
23 
29  {
30  public:
31 
33  DtShipFlagSwitchTickable(DtDe& de, DtElementID elementId, DtUniqueID sceneObjectId,
34  DtUniqueID uniqueId, bool useInstancing, unsigned int nodeTypeIndex);
35 
37  virtual ~DtShipFlagSwitchTickable();
38 
40  DtVector computeWindVec(DtSceneObject* sceneObj, float windDirRad);
41 
43  virtual void update( DtTime tNow );
44 
45  void SetWindNodeSwitch(double windSpeed);
46 
55  virtual bool needsUpdate( DtTime tNow );
56 
58  virtual void configure(osg::Node* n, const rapidjson::Value& windJsonData);
59 
61  unsigned int getSwitchIndexForSpeed(double windSpeed);
62 
63  public:
64  // @{
67  static const char* theShipFlagSwitchFeatureName;
68  static const char* theTagWindSpeeds;
69  static const char* theTagSwitchIndices;
70  // @}
71 
72  protected:
75 
78 
81 
84 
87 
90 
92  osgSim::MultiSwitch* myWindSwitchNode;
93 
95  std::vector<double> myWindSpeeds;
96  std::vector<int> mySwitchIndices;
97  };
98 
102  {
103 
104  public:
105 
108 
111 
113  virtual DtShipFlagSwitchTickable* create(DtDe& de, osg::Node* node,
114  DtOsgArticulatedModel* osgArticulatedModel,
115  const rapidjson::Value& jsonObject, const std::string& modelDefName,
116  const DtElementID elementId, const DtUniqueID uniqueId,
117  const bool useInstancing, const unsigned int nodeTypeIndex);
118 
119  };
120 }
static const char * theShipFlagSwitchFeatureName
Strings to get the different parts of the meta file Use these instead of hardcoded strings...
Definition: DtShipFlagSwitchTickable.h:67
DtDynamicFeatureTickable is a tickable with extra information from .meta files for parameters for upd...
Definition: DtDynamicFeatureTickable.h:25
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
Contains makVrv::DtDynamicFeatureTickable class.
An articulated model manipulator for controlling an articulated model.
Definition: DtOsgArticulatedModel.h:56
DtUniqueID DtElementID
The ElementID is a specific type of unique ID used to represent VR-Vantage uniquely defined elements...
Definition: DtUniqueID.h:26
Definition: DtDoubleSmoother.h:18
std::vector< double > myWindSpeeds
Windspeeds.
Definition: DtShipFlagSwitchTickable.h:95
IMGUI_API void Value(const char *prefix, bool b)
DtSceneObject * mySceneObject
The scene object.
Definition: DtShipFlagSwitchTickable.h:74
DtTime myLastTime
Last update time.
Definition: DtShipFlagSwitchTickable.h:83
Utility class for doing global unit conversion.
Definition: DtDisplayUnitsSettingsManager.h:59
float myLastWindSpeed
Last update wind speed.
Definition: DtShipFlagSwitchTickable.h:77
unsigned long long DtUniqueID
Definition: DtUniqueID.h:22
The DtShipFlagSwitchTickable class is responsible for switching nodes based on the current wind speed...
Definition: DtShipFlagSwitchTickable.h:27
DtDoubleSmoother myFlagSpeedSmoother
Moving average of last 10 ship speeds.
Definition: DtShipFlagSwitchTickable.h:86
DtDisplayUnitsConverter & myConverter
To convert the wind speed to display units (km/h)
Definition: DtShipFlagSwitchTickable.h:89
A DtSceneObject represents an object that can be positioned in the scene by (possibly) attaching it t...
Definition: DtSceneObject.h:41
static const char * theTagWindSpeeds
Definition: DtShipFlagSwitchTickable.h:68
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
osgSim::MultiSwitch * myWindSwitchNode
The actual node that contains switch states.
Definition: DtShipFlagSwitchTickable.h:92
Contains the declaration for makVrv::DtDoubleSmoother.
DtVector myLastPos
Last position.
Definition: DtShipFlagSwitchTickable.h:80
std::vector< int > mySwitchIndices
Definition: DtShipFlagSwitchTickable.h:96
Contains makVrv::DtMetaObjectCreator class.
static const char * theTagSwitchIndices
Definition: DtShipFlagSwitchTickable.h:69
DtShipFlagSwitchTickableCreator class.
Definition: DtShipFlagSwitchTickable.h:101
Abstract dynamic feature creator class.
Definition: DtMetaObjectCreator.h:28
Contains DLL export macros.

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)