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  , myDepthOffset(0.)
35  , myWindFetch(0.)
36  , myPriority(0)
37  {};
38 
40  {
41  *this = orig;
42  };
43 
45  {
46  {
47  myWaterCurrentSpeed = orig.myWaterCurrentSpeed;
48  myWaterCurrentDirection = orig.myWaterCurrentDirection;
49  myTidalOffset = orig.myTidalOffset;
50  mySwellState = orig.mySwellState;
51  mySwellStateDirection = orig.mySwellStateDirection;
52  mySeaState = orig.mySeaState;
53  mySeaStateDirection = orig.mySeaStateDirection;
54  mySurfaceTransparency = orig.mySurfaceTransparency;
55  myWindDrivenSeaStateEnabled = orig.myWindDrivenSeaStateEnabled;
56  myChoppiness = orig.myChoppiness;
57  mySurgeDepth = orig.mySurgeDepth;
58  myDepthOffset = orig.myDepthOffset;
59  myWindFetch = orig.myWindFetch;
60  myPriority = orig.myPriority;
61  }
62  return *this;
63  };
64  ACCESSOR_MUTATOR_MEMBER(double, waterCurrentSpeed, WaterCurrentSpeed);
65  ACCESSOR_MUTATOR_MEMBER(double, waterCurrentDirection, WaterCurrentDirection);
66  ACCESSOR_MUTATOR_MEMBER(double, tidalOffset, TidalOffset);
67  ACCESSOR_MUTATOR_MEMBER(int, swellState, SwellState);
68  ACCESSOR_MUTATOR_MEMBER(double, swellStateDirection, SwellStateDirection);
69  ACCESSOR_MUTATOR_MEMBER(int, seaState, SeaState);
70  ACCESSOR_MUTATOR_MEMBER(double, seaStateDirection, SeaStateDirection);
71  ACCESSOR_MUTATOR_MEMBER(double, surfaceTransparency, SurfaceTransparency);
72  ACCESSOR_MUTATOR_MEMBER(bool, windDrivenSeaStateEnabled, WindDrivenSeaStateEnabled);
73  ACCESSOR_MUTATOR_MEMBER(double, choppiness, Choppiness);
74  ACCESSOR_MUTATOR_MEMBER(double, surgeDepth, SurgeDepth);
75  ACCESSOR_MUTATOR_MEMBER(double, depthOffset, DepthOffset);
76  ACCESSOR_MUTATOR_MEMBER(double, windFetch, WindFetch);
77  ACCESSOR_MUTATOR_MEMBER(int, priority, Priority);
78  };
79 
83  {
84  public:
86 
88  : DtFrameStateInterface(storage)
89  {
90  }
91 
92  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(double, waterCurrentSpeed, WaterCurrentSpeed);
93  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(double, waterCurrentDirection, WaterCurrentDirection);
94  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(double, tidalOffset, TidalOffset);
95  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(int, swellState, SwellState);
96  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(double, swellStateDirection, SwellStateDirection);
97  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(int, seaState, SeaState);
98  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(double, seaStateDirection, SeaStateDirection);
99  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(double, surfaceTransparency, SurfaceTransparency);
100  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(bool, windDrivenSeaStateEnabled, WindDrivenSeaStateEnabled);
101  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(double, choppiness, Choppiness);
102  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(double, surgeDepth, SurgeDepth);
103  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(double, depthOffset, DepthOffset);
104  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(double, windFetch, WindFetch);
105  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(int, priority, Priority);
106 
107  void setIsRemoteComponent(bool b) { myIsRemoteComponent = b; };
108 
109  protected:
110  bool myIsRemoteComponent = false;
111  };
112 
114  class DT_DLL_vrfStateData DtWaterSurfaceStateComponentNextFrame : public DtStateComponentNextFrameTemplate< DtWaterSurfaceStateComponent, DtWaterSurfaceStateComponentData >
115  {
116  public:
119  {
120 
121  };
123 
124  NEXTFRAME_ACCESSOR_MUTATOR_WITHLOCK(double, waterCurrentSpeed, WaterCurrentSpeed);
125  NEXTFRAME_ACCESSOR_MUTATOR_WITHLOCK(double, waterCurrentDirection, WaterCurrentDirection);
126  NEXTFRAME_ACCESSOR_MUTATOR_WITHLOCK(double, tidalOffset, TidalOffset);
127  NEXTFRAME_ACCESSOR_MUTATOR_WITHLOCK(int, swellState, SwellState);
128  NEXTFRAME_ACCESSOR_MUTATOR_WITHLOCK(double, swellStateDirection, SwellStateDirection);
129  NEXTFRAME_ACCESSOR_MUTATOR_WITHLOCK(int, seaState, SeaState);
130  NEXTFRAME_ACCESSOR_MUTATOR_WITHLOCK(double, seaStateDirection, SeaStateDirection);
131  NEXTFRAME_ACCESSOR_MUTATOR_WITHLOCK(double, surfaceTransparency, SurfaceTransparency);
132  NEXTFRAME_ACCESSOR_MUTATOR_WITHLOCK(bool, windDrivenSeaStateEnabled, WindDrivenSeaStateEnabled);
133  NEXTFRAME_ACCESSOR_MUTATOR_WITHLOCK(double, choppiness, Choppiness);
134  NEXTFRAME_ACCESSOR_MUTATOR_WITHLOCK(double, surgeDepth, SurgeDepth);
135  NEXTFRAME_ACCESSOR_MUTATOR_WITHLOCK(double, depthOffset, DepthOffset);
136  NEXTFRAME_ACCESSOR_MUTATOR_WITHLOCK(double, windFetch, WindFetch);
137  NEXTFRAME_ACCESSOR_MUTATOR_WITHLOCK(int, priority, Priority);
138 
139  protected:
140  mutable tbb::spin_rw_mutex myMutex;
141  };
142 
144  class DT_DLL_vrfStateData DtWaterSurfaceStateComponentCurrentFrame : public DtStateComponentCurrentFrameTemplate< DtWaterSurfaceStateComponent, DtWaterSurfaceStateComponentNextFrame, DtWaterSurfaceStateComponentData>
145  {
146  public:
149  {
150  };
151 
152  CURRENTFRAME_ACCESSOR(double, waterCurrentSpeed, WaterCurrentSpeed);
153  CURRENTFRAME_ACCESSOR(double, waterCurrentDirection, WaterCurrentDirection);
154  CURRENTFRAME_ACCESSOR(double, tidalOffset, TidalOffset);
155  CURRENTFRAME_ACCESSOR(int, swellState, SwellState);
156  CURRENTFRAME_ACCESSOR(double, swellStateDirection, SwellStateDirection);
157  CURRENTFRAME_ACCESSOR(int, seaState, SeaState);
158  CURRENTFRAME_ACCESSOR(double, seaStateDirection, SeaStateDirection);
159  CURRENTFRAME_ACCESSOR(double, surfaceTransparency, SurfaceTransparency);
160  CURRENTFRAME_ACCESSOR(bool, windDrivenSeaStateEnabled, WindDrivenSeaStateEnabled);
161  CURRENTFRAME_ACCESSOR(double, choppiness, Choppiness);
162  CURRENTFRAME_ACCESSOR(double, surgeDepth, SurgeDepth);
163  CURRENTFRAME_ACCESSOR(double, depthOffset, DepthOffset);
164  CURRENTFRAME_ACCESSOR(double, windFetch, WindFetch);
165  CURRENTFRAME_ACCESSOR(int, priority, Priority);
166  };
167 
171 
175 
176 }
#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:44
Definition: stateComponentImplementationTemplate.h:68
Definition: stateComponent.h:269
DtWaterSurfaceStateComponentData(const DtWaterSurfaceStateComponentData &orig)
Definition: waterSurfaceStateComponent.h:39
3) Define the current frame class. This will be used for read access.
Definition: waterSurfaceStateComponent.h:144
#define CURRENTFRAME_ACCESSOR(MemberType, Accessor, MutatorAndMember)
Definition: stateComponentImplementationTemplate.h:61
1) Define the interface class that will be used to represent the next and current frames...
Definition: waterSurfaceStateComponent.h:82
Definition: stateComponentImplementationTemplate.h:87
The overall structure of the DtStateData mechanism is: The DtStateData contains a list of double buff...
Definition: stateData.h:398
#define DEFINE_STATE_COMPONENT_TYPE(CreatedComponent)
Definition: stateComponent.h:231
DtStateComponentCreator< DtWaterSurfaceStateComponentImplementation > DtWaterSurfaceStateComponentCreator
5) Define the creator. This will need to be registered with the REGISTER_STATE_COMPONENT macro in the...
Definition: waterSurfaceStateComponent.h:174
#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:107
DtWaterSurfaceStateComponentCurrentFrame(DtStateData *sd)
Definition: waterSurfaceStateComponent.h:147
#define ACCESSOR_MUTATOR_MEMBER(MemberType, Accessor, MutatorAndMember)
Definition: stateComponentImplementationTemplate.h:25
#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:114
virtual ~DtWaterSurfaceStateComponentNextFrame() override
Definition: waterSurfaceStateComponent.h:122
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:294
Definition: stateComponentImplementationTemplate.h:135
tbb::spin_rw_mutex myMutex
Definition: waterSurfaceStateComponent.h:140
DtWaterSurfaceStateComponentNextFrame(DtStateData *sd)
Definition: waterSurfaceStateComponent.h:117

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)