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 
59  virtual ~DtHumanStateComponentNextFrame() override;
60 
61  virtual const DtString diguyAppearance() const override;
62  virtual void setDiguyAppearance(const DtString&) override;
63 
64  virtual const DtString diguyType() const override;
65  virtual void setDiguyType(const DtString&) override;
66 
67  virtual const DtString diguyHeadAppearance() const override;
68  virtual void setDiguyHeadAppearance(const DtString&) override;
69 
70  virtual const DtString diguyItemAppearance() const override;
71  virtual void setDiguyItemAppearance(const DtString&) override;
72 
73  virtual const DtPatchIdentifier diguyPrimaryUnitPatch() const override;
74  virtual void setDiguyPrimaryUnitPatch( const DtPatchIdentifier& ) override;
75 
76  virtual const DtPatchIdentifier diguySecondaryUnitPatch() const override;
77  virtual void setDiguySecondaryUnitPatch( const DtPatchIdentifier& ) override;
78 
79  virtual const DtPatchIdentifier diguyRankPatch() const override;
80  virtual void setDiguyRankPatch( const DtPatchIdentifier& ) override;
81 
82  virtual const DtString diguyCharacterName() const override;
83  virtual void setDiguyCharacterName( const DtString& ) override;
84 
85  virtual const DtString diguyAction() const override;
86  virtual void setDiguyAction(const DtString&) override;
87 
88  virtual const double bodyWeight() const override;
89  virtual void setBodyWeight(const double&) override;
90 
91  virtual const bool diguyUsingAnimationOffset() const override;
92  virtual void setDiguyUsingAnimationOffset(const bool&) override;
93 
94  virtual const float diguyTransitionSpeed() const override;
95  virtual void setDiguyTransitionSpeed(const float&) override;
96 
97  virtual const DtVector diguyAnimationOffset() const override;
98  virtual void setDiguyAnimationOffset(const DtVector&) override;
99 
100  virtual void setDiguyType( const DtString& newType, const DtString& newAppearance ) override;
101 
103  virtual void makeWritable() override;
104 
106  virtual void makeReadOnly() override;
107 
108  protected:
109  VRF::WriteDIGuyAppearanceRepository myWriteHumanComponent;
110  LOM::WriteLifeformRepository myWriteLifeformRepository;
111  };
112 
115  {
116  public:
117 
119 
120  virtual ~DtHumanStateComponentCurrentFrame() override;
121 
122  virtual const DtString diguyAppearance() const override;
123  virtual const DtString diguyType() const override;
124  virtual const DtString diguyHeadAppearance() const override;
125  virtual const DtString diguyItemAppearance() const override;
126  virtual const DtPatchIdentifier diguyPrimaryUnitPatch() const override;
127  virtual const DtPatchIdentifier diguySecondaryUnitPatch() const override;
128  virtual const DtPatchIdentifier diguyRankPatch() const override;
129  virtual const DtString diguyCharacterName() const override;
130  virtual const DtString diguyAction() const override;
131  virtual const double bodyWeight() const override;
132  virtual const bool diguyUsingAnimationOffset() const override;
133  virtual const DtVector diguyAnimationOffset() const override;
134  virtual const float diguyTransitionSpeed() const override;
135 
136  bool readComponentValid() const;
137 
138  bool findReadComponent();
139 
140  protected:
141  VRF::ReadDIGuyAppearanceRepository myReadHumanComponent;
142  LOM::ReadLifeformRepository myReadLifeformRepository;
143  };
144 
148  {
149  public:
150 
152  virtual ~DtHumanStateComponentImplementation() override;
153 
154  bool isDoubleBuffered() { return true; };
155  virtual const DtFrameStateInterface* currentFrameState() const override { return &myCurrentFrameState; }
156  virtual DtFrameStateInterface* nextFrameState() override { return &myNextFrameState; };
157  virtual const DtFrameStateInterface* nextFrameState() const override { return &myNextFrameState; };
158 
159  virtual void updateDataStorage() override;
160 
161  virtual void updateStateData(DtStateData* sd) override
162  {
163  myCurrentFrameState.updateStateData(sd);
164  myNextFrameState.updateStateData(sd);
165  }
166 
168  virtual bool forceAdvance() override;
169 
171  virtual void firstFrameAdvance() override;
172 
173  virtual void aboutToBeDeleted() override
174  {
176  myCurrentFrameState.aboutToBeDeleted();
177  myNextFrameState.aboutToBeDeleted();
178  }
179 
180  protected:
181 
185 
186  };
187 
188 
192 
193 }
LOM::ReadLifeformRepository myReadLifeformRepository
Definition: humanStateComponent.h:142
virtual DtFrameStateInterface * nextFrameState() override
Definition: humanStateComponent.h:156
Definition: stateDataTypes.h:23
virtual void setDiguyType(const DtString &newType, const DtString &newAppearance)
Definition: humanStateComponent.h:50
Definition: stateComponent.h:269
LOM::WriteLifeformRepository myWriteLifeformRepository
Definition: humanStateComponent.h:110
VRF::ReadDIGuyAppearanceRepository myReadHumanComponent
Definition: humanStateComponent.h:141
virtual const DtFrameStateInterface * nextFrameState() const override
Definition: humanStateComponent.h:157
DtHumanStateComponentCurrentFrame myCurrentFrameState
Definition: humanStateComponent.h:182
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
virtual void updateStateData(DtStateData *sd) override
Implement to update data storage to the new state data.
Definition: humanStateComponent.h:161
Subclass from this to indicate that this will be a double buffered state component.
Definition: stateComponent.h:384
#define UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(Type, Member, Set)
Definition: doubleBufferedDataStorage.h:53
virtual void aboutToBeDeleted()
DtHumanStateComponentNextFrame myNextFrameState
Definition: humanStateComponent.h:183
In order to be a well defined state component, you must:
Definition: humanStateComponent.h:25
virtual const DtFrameStateInterface * currentFrameState() const override
Definition: humanStateComponent.h:155
VRF::WriteDIGuyAppearanceRepository myWriteHumanComponent
Definition: humanStateComponent.h:109
4) Define the state component that will contain the wrappers to the next and current frame states tha...
Definition: humanStateComponent.h:147
3) Define the current frame class. This will be used for read access.
Definition: humanStateComponent.h:114
DtStateComponentCreator< DtHumanStateComponentImplementation > DtHumanStateComponentCreator
5) Define the creator. This will need to be registered with the REGISTER_STATE_COMPONENT macro in the...
Definition: humanStateComponent.h:191
virtual void aboutToBeDeleted() override
Definition: humanStateComponent.h:173
#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:74
Contains the DtStateComponent class declaration.
bool isDoubleBuffered()
Definition: humanStateComponent.h:154
This is a simple base class that will be used to return a pointer to current or next frame state...
Definition: stateComponent.h:294
bool myFoundComponent
Definition: humanStateComponent.h:184
2) Define the next frame class. This will be used for write access.
Definition: humanStateComponent.h:54

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)