VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
humanStateComponent.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (c) 2021 MAK Technologies, Inc.
3  * All rights reserved.
4  ****************************************************************************/
5 
6 #pragma once
7 
10 #include <vrfOM/sets/writeDIGuyAppearanceRepository.hpp>
11 #include <vrfOM/sets/readDIGuyAppearanceRepository.hpp>
12 #include <legionStandardOM/sets/writeLifeformRepository.hpp>
13 #include <legionStandardOM/sets/readLifeformRepository.hpp>
14 #include <vlpi/patchIdentifier.h>
15 #include <matrix/vlVector.h>
16 
18 namespace makVrf
19 {
20 
22 
26  {
27  public:
28 
30 
32  : DtFrameStateInterface( sd )
33  {
34  }
35 
36  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR( DtString, diguyAppearance, DiguyAppearance );
37  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR( DtString, diguyType, DiguyType );
38  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR( DtString, diguyHeadAppearance, DiguyHeadAppearance );
39  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR( DtString, diguyItemAppearance, DiguyItemAppearance );
40  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR( DtPatchIdentifier, diguyPrimaryUnitPatch, DiguyPrimaryUnitPatch );
41  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR( DtPatchIdentifier, diguySecondaryUnitPatch, DiguySecondaryUnitPatch );
42  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR( DtPatchIdentifier, diguyRankPatch, DiguyRankPatch );
43  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR( DtString, diguyCharacterName, DiguyCharacterName );
44  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR( DtString, diguyAction, DiguyAction );
45  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR( double, bodyWeight, BodyWeight );
46  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR( bool, diguyUsingAnimationOffset, DiguyUsingAnimationOffset );
47  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR( DtVector, diguyAnimationOffset, DiguyAnimationOffset );
48  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR( float, diguyTransitionSpeed, DiguyTransitionSpeed );
49 
50  virtual void setDiguyType( const DtString& newType, const DtString& newAppearance ) { throw DtUnimplementedMethod("setDiguyType() is not implemented for this class"); };
51  };
52 
55  {
56  public:
57 
60 
61  const DtString diguyAppearance() const;
62  void setDiguyAppearance(const DtString&);
63 
64  const DtString diguyType() const;
65  void setDiguyType(const DtString&);
66 
67  const DtString diguyHeadAppearance() const;
68  void setDiguyHeadAppearance(const DtString&);
69 
70  const DtString diguyItemAppearance() const;
71  void setDiguyItemAppearance(const DtString&);
72 
73  const DtPatchIdentifier diguyPrimaryUnitPatch() const;
74  void setDiguyPrimaryUnitPatch( const DtPatchIdentifier& );
75 
76  const DtPatchIdentifier diguySecondaryUnitPatch() const;
77  void setDiguySecondaryUnitPatch( const DtPatchIdentifier& );
78 
79  const DtPatchIdentifier diguyRankPatch() const;
80  void setDiguyRankPatch( const DtPatchIdentifier& );
81 
82  const DtString diguyCharacterName() const;
83  void setDiguyCharacterName( const DtString& );
84 
85  const DtString diguyAction() const;
86  void setDiguyAction(const DtString&);
87 
88  const double bodyWeight() const;
89  void setBodyWeight(const double&);
90 
91  const bool diguyUsingAnimationOffset() const;
92  void setDiguyUsingAnimationOffset(const bool&);
93 
94  const float diguyTransitionSpeed() const;
95  void setDiguyTransitionSpeed(const float&);
96 
97  const DtVector diguyAnimationOffset() const;
98  void setDiguyAnimationOffset(const DtVector&);
99 
100  void setDiguyType( const DtString& newType, const DtString& newAppearance );
101 
103  virtual void makeWritable();
104 
106  virtual void makeReadOnly();
107 
108  protected:
109 
110  VRF::WriteDIGuyAppearanceRepository myWriteHumanComponent;
111  LOM::WriteLifeformRepository myWriteLifeformRepository;
113 
114  };
115 
118  {
119  public:
120 
122 
124 
125  const DtString diguyAppearance() const;
126  const DtString diguyType() const;
127  const DtString diguyHeadAppearance() const;
128  const DtString diguyItemAppearance() const;
129  const DtPatchIdentifier diguyPrimaryUnitPatch() const;
130  const DtPatchIdentifier diguySecondaryUnitPatch() const;
131  const DtPatchIdentifier diguyRankPatch() const;
132  const DtString diguyCharacterName() const;
133  const DtString diguyAction() const;
134  const double bodyWeight() const;
135  const bool diguyUsingAnimationOffset() const;
136  const DtVector diguyAnimationOffset() const;
137  const float diguyTransitionSpeed() const;
138 
139  bool readComponentValid() const;
140 
141  bool findReadComponent();
142 
143  protected:
144 
145  VRF::ReadDIGuyAppearanceRepository myReadHumanComponent;
146  LOM::ReadLifeformRepository myReadLifeformRepository;
148 
149  };
150 
154  {
155  public:
156 
159 
160  bool isDoubleBuffered() { return true; };
161  const DtFrameStateInterface* currentFrameState() const { return &myCurrentFrameState; }
162  virtual DtFrameStateInterface* nextFrameState() { return &myNextFrameState; };
163  virtual const DtFrameStateInterface* nextFrameState() const { return &myNextFrameState; };
164 
165  void updateDataStorage();
166 
168  {
169  myCurrentFrameState.updateStateData(sd);
170  myNextFrameState.updateStateData(sd);
171  }
172 
174  virtual bool forceAdvance();
175 
177  virtual void firstFrameAdvance() override;
178 
179  virtual void aboutToBeDeleted() override
180  {
182  myCurrentFrameState.aboutToBeDeleted();
183  myNextFrameState.aboutToBeDeleted();
184  }
185 
186  protected:
187 
191 
192  };
193 
194 
198 
199 }
LOM::ReadLifeformRepository myReadLifeformRepository
Definition: humanStateComponent.h:146
Definition: stateDataTypes.h:23
virtual void setDiguyType(const DtString &newType, const DtString &newAppearance)
Definition: humanStateComponent.h:50
DtStateData * myStateData
Definition: humanStateComponent.h:147
virtual DtFrameStateInterface * nextFrameState()
Definition: humanStateComponent.h:162
Definition: stateComponent.h:266
LOM::WriteLifeformRepository myWriteLifeformRepository
Definition: humanStateComponent.h:111
VRF::ReadDIGuyAppearanceRepository myReadHumanComponent
Definition: humanStateComponent.h:145
DtHumanStateComponentCurrentFrame myCurrentFrameState
Definition: humanStateComponent.h:188
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
Subclass from this to indicate that this will be a double buffered state component.
Definition: stateComponent.h:379
#define UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(Type, Member, Set)
Definition: doubleBufferedDataStorage.h:53
void updateStateData(DtStateData *sd)
Implement to update data storage to the new state data.
Definition: humanStateComponent.h:167
virtual void aboutToBeDeleted()
virtual const DtFrameStateInterface * nextFrameState() const
Definition: humanStateComponent.h:163
DtHumanStateComponentNextFrame myNextFrameState
Definition: humanStateComponent.h:189
In order to be a well defined state component, you must:
Definition: humanStateComponent.h:25
DtStateData * myStateData
Definition: humanStateComponent.h:112
VRF::WriteDIGuyAppearanceRepository myWriteHumanComponent
Definition: humanStateComponent.h:110
4) Define the state component that will contain the wrappers to the next and current frame states tha...
Definition: humanStateComponent.h:153
3) Define the current frame class. This will be used for read access.
Definition: humanStateComponent.h:117
DtStateComponentCreator< DtHumanStateComponentImplementation > DtHumanStateComponentCreator
5) Define the creator. This will need to be registered with the REGISTER_STATE_COMPONENT macro in the...
Definition: humanStateComponent.h:197
virtual void aboutToBeDeleted() override
Definition: humanStateComponent.h:179
#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
Definition: stateComponent.h:71
const DtFrameStateInterface * currentFrameState() const
Definition: humanStateComponent.h:161
Contains the DtStateComponent class declaration.
bool isDoubleBuffered()
Definition: humanStateComponent.h:160
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 myFoundComponent
Definition: humanStateComponent.h:190
2) Define the next frame class. This will be used for write access.
Definition: humanStateComponent.h:54

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)