VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtWindSwitchTickable.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
11 #include <vrvCore/vrvCore.h>
12 #include <osgSim/MultiSwitch>
15 
16 
17 namespace makVrv
18 {
19  class DtDisplayUnitsConverter;
20  class DtOsgArticulatedModel;
21  class DtModel;
22 
28  {
29  public:
30 
32  DtWindSwitchTickable(DtDe& de, DtElementID elementId, DtUniqueID sceneObjectId,
33  DtUniqueID uniqueId, unsigned int nodeTypeIndex, DtOsgArticulatedModel* osgArticulatedModel);
34 
36  virtual ~DtWindSwitchTickable();
37 
39  virtual void update( DtTime tNow );
40 
49  virtual bool needsUpdate( DtTime tNow );
50 
52  virtual void configure(osg::Node* n, DtOsgArticulatedModel* osgArticulatedModel, const rapidjson::Value& windJsonData);
53 
55  unsigned int getSwitchIndexForSpeed(double windSpeedMperS);
56 
58  virtual void modelToBeDestroyed(DtModel* model);
59  public:
60  // @{
63  static const char* theWindSwitchFeatureName;
64  static const char* theTagWindSpeeds;
65  static const char* theTagSwitchIndices;
66  // @}
67  protected:
69  virtual void disconnectFromModel();
70 
71  protected:
74 
77 
79  osgSim::MultiSwitch* myWindSwitchNode;
80 
82  std::vector<double> myWindSpeeds;
83  std::vector<int> mySwitchIndices;
84 
86  };
87 
91  {
92 
93  public:
94 
97 
99  virtual ~DtWindSwitchTickableCreator();
100 
102  virtual DtWindSwitchTickable* create(DtDe& de, osg::Node* node,
103  DtOsgArticulatedModel* osgArticulatedModel,
104  const rapidjson::Value& jsonObject, const std::string& modelDefName,
105  const DtElementID elementId, const DtUniqueID uniqueId
106  , const unsigned int nodeTypeIndex);
107 
108  };
109 }
float myLastWindSpeed
Last update wind speed.
Definition: DtWindSwitchTickable.h:73
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.
std::vector< int > mySwitchIndices
Definition: DtWindSwitchTickable.h:83
An articulated model manipulator for controlling an articulated model. Supports indirect rendering of...
Definition: DtOsgArticulatedModel.h:69
osgSim::MultiSwitch * myWindSwitchNode
The actual node that contains switch states.
Definition: DtWindSwitchTickable.h:79
static const char * theWindSwitchFeatureName
Strings to get the different parts of the meta file Use these instead of hardcoded strings...
Definition: DtWindSwitchTickable.h:63
IMGUI_API void Value(const char *prefix, bool b)
std::vector< double > myWindSpeeds
Windspeeds.
Definition: DtWindSwitchTickable.h:82
static const char * theTagWindSpeeds
Strings to get the different parts of the meta file Use these instead of hardcoded strings...
Definition: DtWindSwitchTickable.h:64
Utility class for doing global unit conversion. All conversions functions use the following naming co...
Definition: DtDisplayUnitsSettingsManager.h:60
const DtDisplayUnitsConverter & myConverter
To convert the wind speed to display units (km/h)
Definition: DtWindSwitchTickable.h:76
DtWindSwitchTickableCreator class.
Definition: DtWindSwitchTickable.h:90
The DtWindSwitchTickable class is responsible for switching nodes based on the current wind speed...
Definition: DtWindSwitchTickable.h:26
static const char * theTagSwitchIndices
Strings to get the different parts of the meta file Use these instead of hardcoded strings...
Definition: DtWindSwitchTickable.h:65
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
Contains makVrv::DtMetaObjectCreator class.
DtOsgArticulatedModel * myOsgArticulatedModel
Definition: DtWindSwitchTickable.h:85
Abstract dynamic feature creator class. A dynamic feature retrieves data from a .meta file and applie...
Definition: DtMetaObjectCreator.h:28
Contains DLL export macros.

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)