VR-Forces 4.10 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) 2020 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  class DtOsgArticulatedModel;
24  class DtModel;
25 
31  {
32  public:
33 
35  DtShipFlagSwitchTickable(DtDe& de, DtElementID elementId, DtUniqueID sceneObjectId,
36  DtUniqueID uniqueId, unsigned int nodeTypeIndex, DtOsgArticulatedModel* osgArticulatedModel);
37 
39  virtual ~DtShipFlagSwitchTickable();
40 
42  DtVector computeWindVec(DtSceneObject* sceneObj, float windDirRad);
43 
45  virtual void update( DtTime tNow );
46 
47  void SetWindNodeSwitch(double windSpeed);
48 
57  virtual bool needsUpdate( DtTime tNow );
58 
60  virtual void configure(osg::Node* n, const rapidjson::Value& windJsonData);
61 
63  unsigned int getSwitchIndexForSpeed(double windSpeed);
64 
66  virtual void modelToBeDestroyed(DtModel* model);
67  public:
68  // @{
71  static const char* theShipFlagSwitchFeatureName;
72  static const char* theTagWindSpeeds;
73  static const char* theTagSwitchIndices;
74  // @}
75  protected:
77  virtual void disconnectFromModel();
78 
79  protected:
82 
85 
88 
91 
94 
97 
99  osgSim::MultiSwitch* myWindSwitchNode;
100 
102  std::vector<double> myWindSpeeds;
103  std::vector<int> mySwitchIndices;
104 
106  };
107 
111  {
112 
113  public:
114 
117 
120 
122  virtual DtShipFlagSwitchTickable* create(DtDe& de, osg::Node* node,
123  DtOsgArticulatedModel* osgArticulatedModel,
124  const rapidjson::Value& jsonObject, const std::string& modelDefName,
125  const DtElementID elementId, const DtUniqueID uniqueId
126  , const unsigned int nodeTypeIndex);
127 
128  };
129 }
static const char * theShipFlagSwitchFeatureName
Strings to get the different parts of the meta file Use these instead of hardcoded strings...
Definition: DtShipFlagSwitchTickable.h:71
DtDynamicFeatureTickable is a tickable with extra information from .meta files for parameters for upd...
Definition: DtDynamicFeatureTickable.h:24
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
Contains makVrv::DtDynamicFeatureTickable class.
An articulated model manipulator for controlling an articulated model.
Definition: DtOsgArticulatedModel.h:67
DtUniqueID DtElementID
The ElementID is a specific type of unique ID used to represent VR-Vantage uniquely defined elements...
Definition: DtUniqueID.h:23
Definition: DtDoubleSmoother.h:18
DtOsgArticulatedModel * myOsgArticulatedModel
Definition: DtShipFlagSwitchTickable.h:105
std::vector< double > myWindSpeeds
Windspeeds.
Definition: DtShipFlagSwitchTickable.h:102
IMGUI_API void Value(const char *prefix, bool b)
DtSceneObject * mySceneObject
The scene object.
Definition: DtShipFlagSwitchTickable.h:81
DtTime myLastTime
Last update time.
Definition: DtShipFlagSwitchTickable.h:90
Utility class for doing global unit conversion.
Definition: DtDisplayUnitsSettingsManager.h:59
float myLastWindSpeed
Last update wind speed.
Definition: DtShipFlagSwitchTickable.h:84
unsigned long long DtUniqueID
Definition: DtUniqueID.h:19
The DtShipFlagSwitchTickable class is responsible for switching nodes based on the current wind speed...
Definition: DtShipFlagSwitchTickable.h:29
DtDoubleSmoother myFlagSpeedSmoother
Moving average of last 10 ship speeds.
Definition: DtShipFlagSwitchTickable.h:93
DtDisplayUnitsConverter & myConverter
To convert the wind speed to display units (km/h)
Definition: DtShipFlagSwitchTickable.h:96
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:72
A model which owns a single model instance.
Definition: DtModel.h:55
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:99
Contains the declaration for makVrv::DtDoubleSmoother.
DtVector myLastPos
Last position.
Definition: DtShipFlagSwitchTickable.h:87
std::vector< int > mySwitchIndices
Definition: DtShipFlagSwitchTickable.h:103
Contains makVrv::DtMetaObjectCreator class.
static const char * theTagSwitchIndices
Definition: DtShipFlagSwitchTickable.h:73
DtShipFlagSwitchTickableCreator class.
Definition: DtShipFlagSwitchTickable.h:110
Abstract dynamic feature creator class.
Definition: DtMetaObjectCreator.h:28
Contains DLL export macros.

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)