VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
staticLocationStateComponent.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 
9 #include <tbb/mutex.h>
10 
11 class Coordinate_System;
12 
13 namespace makVrf
14 {
17 
21  {
22  public:
24 
26  : DtLocationStateComponent(storage)
27  {
28  }
29  };
30 
33  {
34  public:
37 
38  const DtUUID& hostGlobalId() const;
39  void setHostGlobalId( const DtUUID& id);
40 
41  const DtVector location() const;
42  void setLocation(const DtVector&);
43 
44  const bool locationChanged() const;
45 
46  const double heading() const;
47  const double pitch() const;
48  const double roll() const;
49 
50  const int objectAttachMode() const;
51  const DtVector& worldPosition() const;
52  const DtVector& relativePosition() const;
53  const DtVector& parentPosition() const;
54  const DtVector& localPosition() const;
55  const DtDcm& worldOrientationMatrix() const;
56  const bool localPositionIsValid() const;
57  const bool frozen() const;
58  void setFrozen(const bool&);
59 
60  const DtDcm& parentOrientationMatrix() const;
61  void setLocalOrientationMatrix(const DtDcm&);
62 
63  const DtDcm& localOrientationMatrix() const;
64 
65  void setLocalPosition(const DtVector&);
66  void setWorldPosition(const DtVector&);
67  void setParentPosition(const DtVector&);
68  void setWorldOrientationMatrix(const DtDcm&);
69 
70  const DtTaitBryan orientation() const;
71  void setOrientation(const DtTaitBryan&);
72 
73  const DtTaitBryan& worldOrientation() const;
74  const DtTaitBryan& topographicOrientation() const;
75  const DtTaitBryan& parentOrientation() const;
76  const DtTaitBryan& localOrientation() const;
77 
78  void setLocalOrientation(const DtTaitBryan&);
79  void setLocalOrientationWrtDatabase(const DtTaitBryan&);
80  const DtTaitBryan& localOrientationWrtDatabase() const;
81  void setWorldOrientation(const DtTaitBryan&);
82  void setParentOrientation(const DtTaitBryan&);
83 
84  void setCoordinateSystem(const Coordinate_System* cs);
85  void setKinematicState(const DtRwVrfKinematicState&);
86  const DtRwVrfKinematicState& kinematicState() const;
87 
88  const bool spatiallyFrozen() const;
89 
91  virtual void makeWritable();
92 
94  virtual void makeReadOnly();
95 
96  void advanceFrame();
97 
98  protected:
101  };
102 
105  {
106  public:
109 
110  const DtUUID& hostGlobalId() const;
111 
112  const bool localPositionIsValid() const;
113  const DtVector location() const;
114 
115  const DtVector& worldPosition() const;
116  const DtVector& relativePosition() const;
117  const DtVector& parentPosition() const;
118 
119  const DtDcm& parentOrientationMatrix() const;
120 
121  const DtVector& localPosition() const;
122 
123  const int objectAttachMode() const;
124  const DtDcm& worldOrientationMatrix() const;
125  const DtDcm& localOrientationMatrix() const;
126  const DtTaitBryan& localOrientationWrtDatabase() const;
127 
128  const double heading() const;
129  const double pitch() const;
130  const double roll() const;
131 
132  const DtTaitBryan orientation() const;
133  const DtTaitBryan& worldOrientation() const;
134  const DtTaitBryan& topographicOrientation() const;
135  const DtTaitBryan& parentOrientation() const;
136  const DtTaitBryan& localOrientation() const;
137  const bool frozen() const;
138 
139  const bool locationChanged() const;
140 
141  void setCoordinateSystem(const Coordinate_System* cs);
142  void refreshKinematicState() const;
143  const DtRwVrfKinematicState& kinematicState() const;
144 
145  const bool spatiallyFrozen() const;
146 
147  protected:
149  void setLocationChanged(bool);
150  void setKinematicState(const DtRwVrfKinematicState&);
151 
152  protected:
153  mutable tbb::mutex myKinematicStateMutex;
157  };
158 
162  {
163  public:
165 
166  bool isDoubleBuffered() { return true; };
167  const DtFrameStateInterface* currentFrameState() const { return &myCurrentFrameState; }
168  virtual DtFrameStateInterface* nextFrameState() { return &myNextFrameState; };
169  virtual const DtFrameStateInterface* nextFrameState() const { return &myNextFrameState; };
170 
172  virtual void setCoordinateSystem(const Coordinate_System*);
173 
174  void updateDataStorage();
175 
177  {
178  myCurrentFrameState.updateStateData(sd);
179  myNextFrameState.updateStateData(sd);
180  }
181 
182  virtual bool forceAdvance() override;
183 
184  virtual void aboutToBeDeleted() override
185  {
187  myCurrentFrameState.aboutToBeDeleted();
188  myNextFrameState.aboutToBeDeleted();
189  }
190 
191  protected:
194  };
195 
199 }
200 
UUID is a unique ID wrapper class.
Definition: uuid.h:59
DtStaticLocationStateComponentNextFrame myNextFrameState
Definition: staticLocationStateComponent.h:193
DtRwVrfKinematicState * myKinematicState
Definition: staticLocationStateComponent.h:100
void updateStateData(DtStateData *sd)
Implement to update data storage to the new state data.
Definition: staticLocationStateComponent.h:176
virtual void aboutToBeDeleted() override
Definition: staticLocationStateComponent.h:184
The DtLocationStateComponent interface contains the interface that all DtLocationStateComponents can ...
Definition: locationStateComponent.h:25
virtual const DtFrameStateInterface * nextFrameState() const
Definition: staticLocationStateComponent.h:169
The location only state component will simply deal with kinematic state. This is an object whose loca...
Definition: staticLocationStateComponent.h:20
Definition: stateComponent.h:266
3) Define the current frame class. This will be used for read access.
Definition: staticLocationStateComponent.h:104
2) Define the next frame class. This will be used for write access.
Definition: staticLocationStateComponent.h:32
virtual DtFrameStateInterface * nextFrameState()
Definition: staticLocationStateComponent.h:168
Definition: coordSystem.h:54
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
4) Define the state component that will contain the wrappers to the next and current frame states tha...
Definition: staticLocationStateComponent.h:161
Subclass from this to indicate that this will be a double buffered state component.
Definition: stateComponent.h:379
virtual void aboutToBeDeleted()
bool myLocationChanged
Definition: staticLocationStateComponent.h:156
tbb::mutex myKinematicStateMutex
Definition: staticLocationStateComponent.h:153
DtStaticLocationStateComponentCurrentFrame myCurrentFrameState
Definition: staticLocationStateComponent.h:192
DtStateData * myStateData
Definition: staticLocationStateComponent.h:155
Definition: rwVrfKinematicState.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
DtStateData * myStateData
Definition: staticLocationStateComponent.h:99
const DtFrameStateInterface * currentFrameState() const
Definition: staticLocationStateComponent.h:167
DtRwVrfKinematicState * myKinematicState
Definition: staticLocationStateComponent.h:154
DtStateComponentCreator< DtStaticLocationStateComponentImplementation > DtStaticLocationStateComponentCreator
5) Define the creator. This will need to be registered with the REGISTER_STATE_COMPONENT macro in the...
Definition: staticLocationStateComponent.h:198
This is a simple base class that will be used to return a pointer to current or next frame state...
Definition: stateComponent.h:291
bool isDoubleBuffered()
Definition: staticLocationStateComponent.h:166

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)