VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
extDiGuyCustomPduDecoder.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (c) 2021 MAK Technologies, Inc.
3  * All rights reserved.
4  ****************************************************************************/
5 
9 
10 #pragma once
11 
12 // This class isn't used for anything at the moment, but is being left in makVrfVrlExt in case it
13 // is needed in the future. The class should only be enabled if something *REALLY* needs to be
14 // added at the makVrfVrlExt level and should be carefully tracked so it is removed once the
15 // logic makes it into VR-Link so the stale logic doesn't end up causing bugs in VRV/VRF *AGAIN*.
16 #define MAKVRFVRLEXT_USE_EXT_DIGUY_CUSTOM_PDU_DECODER_DIS 0
17 #if MAKVRFVRLEXT_USE_EXT_DIGUY_CUSTOM_PDU_DECODER_DIS
18 
19 #if DtDIS
20 
22 #include <vl/diGuyCustomPduDecoder.h>
23 
24 // Because there's a limit to the range of values defined inside VR-Link and we need more
25 // This enumeration must match the following enumerations:
26 // - VR-Link: include/vl/disEnums.h (DtDIGuyCustomPduMsgId)
27 // - DI-Guy: src/libs/libpeopleshop/src/diguy_dis_constants.h (diguyCustomPDUType)
28 enum DtExtDIGuyCustomPduMsgId
29 {
30  DtExtDIGuyMsgIdEscapeReserved = 0,
31  DtExtDIGuyMsgIdSetCharType = 1,
32  DtExtDIGuyMsgIdSetCharAppearance = 2,
33  DtExtDIGuyMsgIdSetCharAction = 3,
34  DtExtDIGuyMsgIdSetCharVisible = 4,
35  DtExtDIGuyMsgIdBeginAppearanceEffect = 34,
36  DtExtDIGuyMsgIdEndAppearanceEffect,
37  DtExtDIGuyMsgIdStopAppearanceEffect,
38  DtExtDIGuyMsgIdExecuteGesture = 41,
39  DtExtDIGuyMsgIdCharacterScale,
40  DtExtDIGuyMsgIdSetShapeVariation2,
41  DtExtDIGuyMsgIdEndGesture,
42  DtExtDIGuyMsgIdMax = 52
43 };
44 
45 // Used for allocating space for callback list.
46 #define DtEXTMAX_DIGUYMSG_KINDS 52
47 
48 // Adding functionality here only changes the legacy custom PDU behavior. Only add something here if you're
49 // certain it needs to be added to the legacy custom PDUs. New functionality should be added using extended
50 // attributes instead.
51 
52 // ======================================================================================
53 // Note: The following code is the same logic in DtDIGuyCustomPduDecoder in VR-Link and should be kept in sync.
54 // If making any changes to this class file a feature in VR-Link so the functionality can be ported over and
55 // include a note that the logic added here should be removed when the feature is complete so it's not forgotten.
56 // ======================================================================================
57 
62 class DT_DLL_vrfExtObjects DtExtDIGuyCustomPduDecoder : public DtDIGuyCustomPduDecoder
63 {
64 public:
65 
66  DtExtDIGuyCustomPduDecoder();
67  virtual ~DtExtDIGuyCustomPduDecoder();
68 
72  virtual void decode( DtPdu* pdu, DtEntityStateRepository* stateRep );
73  virtual DtPduDecoder* clone() const;
74  virtual void clearCallbacks();
75 
78  virtual void addDiGuyPduCallback( DtExtDIGuyCustomPduMsgId k, DtDIGuyPduCallbackFcn info );
79  virtual void removeDiGuyPduCallback( DtExtDIGuyCustomPduMsgId k, const DtDIGuyPduCallbackFcn& info );
80 
81 public:
82 
84  virtual void processDiGuyNewAttribute( DtDIGuyCustomPdu* pdu, DtEntityStateRepository* pEsr );
85 
86 protected:
87 
88  // We're replacing the array in the parent class because it wasn't big enough (std::set isn't expandable).
89  std::set<DtDIGuyPduCallbackFcn> myExtDiGuyCbList[DtEXTMAX_DIGUYMSG_KINDS];
90 
91 };
92 
93 #endif // DtDIS
94 #endif // MAKVRFVRLEXT_USE_EXT_DIGUY_CUSTOM_PDU_DECODER_DIS
DT_DLL_readerWriter const char * decode(DtString &val, const char *buffer)
Decodes a value from buffer and places the result in val of the type specified by val...
#define DT_DLL_vrfExtObjects
Definition: dllExport.h:23

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)