VR-Forces 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) 2023 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 
95  DtVector myLastPos;
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  boost::signalslib::connection myModelToBeDestroyedConnection;
122  };
123 
124 
126 }
static const char * theShipFlagSwitchFeatureName
Strings to get the different parts of the meta file Use these instead of hardcoded strings...
Definition: DtShipFlagSwitchTickable.h:76
DtTemplatedTickableCreator< DtShipFlagSwitchTickable, true > DtShipFlagSwitchTickableCreator
Definition: DtShipFlagSwitchTickable.h:125
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.
boost::signalslib::connection myModelToBeDestroyedConnection
Definition: DtShipFlagSwitchTickable.h:121
An articulated model manipulator for controlling an articulated model. Supports indirect rendering of...
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:113
std::vector< double > myWindSpeeds
Windspeeds.
Definition: DtShipFlagSwitchTickable.h:110
Definition: DtMetaObjectCreator.h:53
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:62
float myLastWindSpeed
Last update wind speed.
Definition: DtShipFlagSwitchTickable.h:92
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: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:44
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:56
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:76
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
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 Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)