VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
waterSurfaceStateComponent.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2023 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 #pragma once
7 
12 
13 
14 
15 
16 namespace makVrf
17 {
18 
21  {
23  : myWaterCurrentSpeed(0.)
24  , myWaterCurrentDirection(0.)
25  , myTidalOffset(0.)
26  , mySwellState(0)
27  , mySwellStateDirection(0.)
28  , mySeaState(0)
29  , mySeaStateDirection(0.)
30  , mySurfaceTransparency(0.)
31  , myWindDrivenSeaStateEnabled(false)
32  , myChoppiness(0.)
33  , mySurgeDepth(0.)
34  , myPriority(0)
35  {};
36 
38  {
39  *this = orig;
40  };
41 
43  {
44  {
45  myWaterCurrentSpeed = orig.myWaterCurrentSpeed;
46  myWaterCurrentDirection = orig.myWaterCurrentDirection;
47  myTidalOffset = orig.myTidalOffset;
48  mySwellState = orig.mySwellState;
49  mySwellStateDirection = orig.mySwellStateDirection;
50  mySeaState = orig.mySeaState;
51  mySeaStateDirection = orig.mySeaStateDirection;
52  mySurfaceTransparency = orig.mySurfaceTransparency;
53  myWindDrivenSeaStateEnabled = orig.myWindDrivenSeaStateEnabled;
54  myChoppiness = orig.myChoppiness;
55  mySurgeDepth = orig.mySurgeDepth;
56  myPriority = orig.myPriority;
57  }
58  return *this;
59  };
60  ACCESSOR_MUTATOR_MEMBER(double, waterCurrentSpeed, WaterCurrentSpeed);
61  ACCESSOR_MUTATOR_MEMBER(double, waterCurrentDirection, WaterCurrentDirection);
62  ACCESSOR_MUTATOR_MEMBER(double, tidalOffset, TidalOffset);
63  ACCESSOR_MUTATOR_MEMBER(int, swellState, SwellState);
64  ACCESSOR_MUTATOR_MEMBER(double, swellStateDirection, SwellStateDirection);
65  ACCESSOR_MUTATOR_MEMBER(int, seaState, SeaState);
66  ACCESSOR_MUTATOR_MEMBER(double, seaStateDirection, SeaStateDirection);
67  ACCESSOR_MUTATOR_MEMBER(double, surfaceTransparency, SurfaceTransparency);
68  ACCESSOR_MUTATOR_MEMBER(bool, windDrivenSeaStateEnabled, WindDrivenSeaStateEnabled);
69  ACCESSOR_MUTATOR_MEMBER(double, choppiness, Choppiness);
70  ACCESSOR_MUTATOR_MEMBER(double, surgeDepth, SurgeDepth);
71  ACCESSOR_MUTATOR_MEMBER(int, priority, Priority);
72  };
73 
77  {
78  public:
80 
82  : DtFrameStateInterface(storage)
83  {
84  }
85 
86  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(double, waterCurrentSpeed, WaterCurrentSpeed);
87  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(double, waterCurrentDirection, WaterCurrentDirection);
88  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(double, tidalOffset, TidalOffset);
89  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(int, swellState, SwellState);
90  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(double, swellStateDirection, SwellStateDirection);
91  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(int, seaState, SeaState);
92  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(double, seaStateDirection, SeaStateDirection);
93  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(double, surfaceTransparency, SurfaceTransparency);
94  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(bool, windDrivenSeaStateEnabled, WindDrivenSeaStateEnabled);
95  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(double, choppiness, Choppiness);
96  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(double, surgeDepth, SurgeDepth);
97  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(int, priority, Priority);
98 
99  void setIsRemoteComponent(bool b) { myIsRemoteComponent = b; };
100 
101  protected:
102  bool myIsRemoteComponent = false;
103  };
104 
106  class DT_DLL_vrfStateData DtWaterSurfaceStateComponentNextFrame : public DtStateComponentNextFrameTemplate< DtWaterSurfaceStateComponent, DtWaterSurfaceStateComponentData >
107  {
108  public:
111  {
112 
113  };
115  {};
116 
117  NEXTFRAME_ACCESSOR_MUTATOR_WITHLOCK(double, waterCurrentSpeed, WaterCurrentSpeed);
118  NEXTFRAME_ACCESSOR_MUTATOR_WITHLOCK(double, waterCurrentDirection, WaterCurrentDirection);
119  NEXTFRAME_ACCESSOR_MUTATOR_WITHLOCK(double, tidalOffset, TidalOffset);
120  NEXTFRAME_ACCESSOR_MUTATOR_WITHLOCK(int, swellState, SwellState);
121  NEXTFRAME_ACCESSOR_MUTATOR_WITHLOCK(double, swellStateDirection, SwellStateDirection);
122  NEXTFRAME_ACCESSOR_MUTATOR_WITHLOCK(int, seaState, SeaState);
123  NEXTFRAME_ACCESSOR_MUTATOR_WITHLOCK(double, seaStateDirection, SeaStateDirection);
124  NEXTFRAME_ACCESSOR_MUTATOR_WITHLOCK(double, surfaceTransparency, SurfaceTransparency);
125  NEXTFRAME_ACCESSOR_MUTATOR_WITHLOCK(bool, windDrivenSeaStateEnabled, WindDrivenSeaStateEnabled);
126  NEXTFRAME_ACCESSOR_MUTATOR_WITHLOCK(double, choppiness, Choppiness);
127  NEXTFRAME_ACCESSOR_MUTATOR_WITHLOCK(double, surgeDepth, SurgeDepth);
128  NEXTFRAME_ACCESSOR_MUTATOR_WITHLOCK(int, priority, Priority);
129 
130  protected:
131  mutable tbb::spin_rw_mutex myMutex;
132  };
133 
135  class DT_DLL_vrfStateData DtWaterSurfaceStateComponentCurrentFrame : public DtStateComponentCurrentFrameTemplate< DtWaterSurfaceStateComponent, DtWaterSurfaceStateComponentNextFrame, DtWaterSurfaceStateComponentData>
136  {
137  public:
140  {
141  };
142 
143  CURRENTFRAME_ACCESSOR(double, waterCurrentSpeed, WaterCurrentSpeed);
144  CURRENTFRAME_ACCESSOR(double, waterCurrentDirection, WaterCurrentDirection);
145  CURRENTFRAME_ACCESSOR(double, tidalOffset, TidalOffset);
146  CURRENTFRAME_ACCESSOR(int, swellState, SwellState);
147  CURRENTFRAME_ACCESSOR(double, swellStateDirection, SwellStateDirection);
148  CURRENTFRAME_ACCESSOR(int, seaState, SeaState);
149  CURRENTFRAME_ACCESSOR(double, seaStateDirection, SeaStateDirection);
150  CURRENTFRAME_ACCESSOR(double, surfaceTransparency, SurfaceTransparency);
151  CURRENTFRAME_ACCESSOR(bool, windDrivenSeaStateEnabled, WindDrivenSeaStateEnabled);
152  CURRENTFRAME_ACCESSOR(double, choppiness, Choppiness);
153  CURRENTFRAME_ACCESSOR(double, surgeDepth, SurgeDepth);
154  CURRENTFRAME_ACCESSOR(int, priority, Priority);
155  };
156 
160 
164 
165 }
#define NEXTFRAME_ACCESSOR_MUTATOR_WITHLOCK(MemberType, Accessor, MutatorAndMember)
Definition: stateComponentImplementationTemplate.h:53
DtWaterSurfaceStateComponentData()
Definition: waterSurfaceStateComponent.h:22
DtWaterSurfaceStateComponentData & operator=(const DtWaterSurfaceStateComponentData &orig)
Definition: waterSurfaceStateComponent.h:42
Definition: stateComponentImplementationTemplate.h:68
Definition: stateComponent.h:266
DtWaterSurfaceStateComponentData(const DtWaterSurfaceStateComponentData &orig)
Definition: waterSurfaceStateComponent.h:37
3) Define the current frame class. This will be used for read access.
Definition: waterSurfaceStateComponent.h:135
#define CURRENTFRAME_ACCESSOR(MemberType, Accessor, MutatorAndMember)
Definition: stateComponentImplementationTemplate.h:61
ACCESSOR_MUTATOR_MEMBER(double, waterCurrentSpeed, WaterCurrentSpeed)
1) Define the interface class that will be used to represent the next and current frames...
Definition: waterSurfaceStateComponent.h:76
Definition: stateComponentImplementationTemplate.h:89
The overall structure of the DtStateData mechanism is: The DtStateData contains a list of double buff...
Definition: stateData.h:339
#define DEFINE_STATE_COMPONENT_TYPE(CreatedComponent)
Definition: stateComponent.h:228
DtStateComponentCreator< DtWaterSurfaceStateComponentImplementation > DtWaterSurfaceStateComponentCreator
5) Define the creator. This will need to be registered with the REGISTER_STATE_COMPONENT macro in the...
Definition: waterSurfaceStateComponent.h:163
#define UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(Type, Member, Set)
Definition: doubleBufferedDataStorage.h:53
0) Define the State Component Data. This struct replaces the legion stuff
Definition: waterSurfaceStateComponent.h:20
void setIsRemoteComponent(bool b)
Definition: waterSurfaceStateComponent.h:99
DtWaterSurfaceStateComponentCurrentFrame(DtStateData *sd)
Definition: waterSurfaceStateComponent.h:138
#define DT_DLL_vrfStateData
This file is used to determine how to build Disable inconsistent dll linkage warning Visual Studio 6...
Definition: vrfStateDataDefines.h:26
2) Define the next frame class. This will be used for write access.
Definition: waterSurfaceStateComponent.h:106
virtual ~DtWaterSurfaceStateComponentNextFrame()
Definition: waterSurfaceStateComponent.h:114
DtStateComponentImplementationTemplate< DtWaterSurfaceStateComponent, DtWaterSurfaceStateComponentCurrentFrame, DtWaterSurfaceStateComponentNextFrame > DtWaterSurfaceStateComponentImplementation
4) Define the state component that will contain the wrappers to the next and current frame states tha...
Definition: waterSurfaceStateComponent.h:159
Contains the DtStateComponent class declaration.
This is a simple base class that will be used to return a pointer to current or next frame state...
Definition: stateComponent.h:291
Definition: stateComponentImplementationTemplate.h:137
tbb::spin_rw_mutex myMutex
Definition: waterSurfaceStateComponent.h:131
DtWaterSurfaceStateComponentNextFrame(DtStateData *sd)
Definition: waterSurfaceStateComponent.h:109

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)