VR-Forces 5.0.3 Developer's Guide
 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) 2022 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
13 
14 #include <vrvCore/vrvCore.h>
16 
18 
19 #include <matrix/vlVector.h>
20 #include <rapidjson/document.h>
21 #include <osgSim/MultiSwitch>
22 
23 namespace makVrv
24 {
25  class DtDisplayUnitsConverter;
26  class DtSceneObject;
27  class DtOsgArticulatedModel;
28  class DtModel;
29  class DtCoordinateSystem;
30 
36  {
37  public:
38 
40  DtShipFlagSwitchTickable(DtDe& de, DtElementID elementId, DtUniqueID sceneObjectId,
41  DtUniqueID uniqueId, unsigned int nodeTypeIndex, DtOsgArticulatedModel* osgArticulatedModel);
42 
44  virtual ~DtShipFlagSwitchTickable();
45 
47  DtVector computeWindVec(DtSceneObject* sceneObj, float windDirRad);
48 
50  virtual void update( DtTime tNow );
51 
52  void SetWindNodeSwitch(double windSpeed);
53 
62  virtual bool needsUpdate( DtTime tNow );
63 
65  virtual void configure(osg::Node* n, const rapidjson::Value& windJsonData);
66 
68  unsigned int getSwitchIndexForSpeed(double windSpeed);
69 
71  virtual void modelToBeDestroyed(DtModel* model);
72  public:
73  // @{
76  static const char* theShipFlagSwitchFeatureName;
77  static const char* theTagWindSpeeds;
78  static const char* theTagSwitchIndices;
79  // @}
80  protected:
82  virtual void disconnectFromModel();
83 
85  virtual void slot_coordinateSystemChanged();
86 
87  protected:
90 
93 
96 
99 
102 
105 
107  osgSim::MultiSwitch* myWindSwitchNode;
108 
110  std::vector<double> myWindSpeeds;
111  std::vector<int> mySwitchIndices;
112 
114 
116 
119  DtCoordinateSystem* myCoordinateSystem = nullptr;
120  };
121 
125  {
126 
127  public:
128 
131 
134 
136  virtual DtShipFlagSwitchTickable* create(DtDe& de, osg::Node* node,
137  DtOsgArticulatedModel* osgArticulatedModel,
138  const rapidjson::Value& jsonObject, const std::string& modelDefName,
139  const DtElementID elementId, const DtUniqueID uniqueId
140  , const unsigned int nodeTypeIndex);
141 
142  };
143 }
static const char * theShipFlagSwitchFeatureName
Strings to get the different parts of the meta file Use these instead of hardcoded strings...
Definition: DtShipFlagSwitchTickable.h:76
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. Supports indirect rendering of...
Definition: DtOsgArticulatedModel.h:69
Definition: DtDoubleSmoother.h:18
DtOsgArticulatedModel * myOsgArticulatedModel
Definition: DtShipFlagSwitchTickable.h:113
std::vector< double > myWindSpeeds
Windspeeds.
Definition: DtShipFlagSwitchTickable.h:110
IMGUI_API void Value(const char *prefix, bool b)
DtSceneObject * mySceneObject
The scene object.
Definition: DtShipFlagSwitchTickable.h:89
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
DtTime myLastTime
Last update time.
Definition: DtShipFlagSwitchTickable.h:98
Utility class for doing global unit conversion. All conversions functions use the following naming co...
Definition: DtDisplayUnitsSettingsManager.h:61
float myLastWindSpeed
Last update wind speed.
Definition: DtShipFlagSwitchTickable.h:92
The DtShipFlagSwitchTickable class is responsible for switching nodes based on the current wind speed...
Definition: DtShipFlagSwitchTickable.h:34
The DtCoordinateSystem is used to manage the current coordinate system of the scene.
Definition: DtCoordinateSystem.h:40
DtDoubleSmoother myFlagSpeedSmoother
Moving average of last 10 ship speeds.
Definition: DtShipFlagSwitchTickable.h:101
DtSignalConnectionManager myConnections
Definition: DtShipFlagSwitchTickable.h:115
Base class to provide boost signal/slot management.
A DtSceneObject represents an object that can be positioned in the scene by (possibly) attaching it t...
Definition: DtSceneObject.h:42
static const char * theTagWindSpeeds
Strings to get the different parts of the meta file Use these instead of hardcoded strings...
Definition: DtShipFlagSwitchTickable.h:77
A model which owns a single model instance. A DtModel is a managing container for a single DtModelIns...
Definition: DtModel.h:55
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:70
osgSim::MultiSwitch * myWindSwitchNode
The actual node that contains switch states.
Definition: DtShipFlagSwitchTickable.h:107
Contains the declaration for makVrv::DtDoubleSmoother.
DtVector myLastPos
Last position.
Definition: DtShipFlagSwitchTickable.h:95
std::vector< int > mySwitchIndices
Definition: DtShipFlagSwitchTickable.h:111
Contains makVrv::DtMetaObjectCreator class.
static const char * theTagSwitchIndices
Strings to get the different parts of the meta file Use these instead of hardcoded strings...
Definition: DtShipFlagSwitchTickable.h:78
DtShipFlagSwitchTickableCreator class.
Definition: DtShipFlagSwitchTickable.h:124
Abstract dynamic feature creator class. A dynamic feature retrieves data from a .meta file and applie...
Definition: DtMetaObjectCreator.h:28
Contains DLL export macros.
const DtDisplayUnitsConverter & myConverter
To convert the wind speed to display units (km/h)
Definition: DtShipFlagSwitchTickable.h:104

Document ID: Generated on Thu Jun 1 17:58:13 EDT 2023 from SVN revision 255404
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)