VR-Link API Documentation for HLA 4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
soundPdu.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 1992-2026 MAK Technologies, Inc
3 ** All rights reserved.
4 *********************************************************************/
5 
8 
9 #pragma once
10 
11 #if DtDIS
12 
13 #include "hostStructs.h"
14 #include "interaction.h"
15 #include "packets/soundP.h"
16 #include <matrix/vlMath.h>
17 
19 class DT_DLL_VL DtSoundPdu;
20 
22 typedef DtSoundPdu DtSoundInteraction;
23 
24 typedef void (*DtSoundInteractionCb)(DtSoundInteraction *inter, void *usr);
25 
28 class DT_DLL_VL DtSoundPdu : public DtInteraction
29 {
30 public:
31 
32  enum { PduStaticSize=sizeof(DtNetSoundPdu) };
33 
34 public:
35 
36  DtSoundPdu(DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER);
37 
38  DtSoundPdu(const DtNetSoundPdu *initial,
39  DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER, DtPduFactory* pduFactory = 0);
40 
41  DtSoundPdu(const DtEntityIdentifier &source,
42  const DtEntityType &soundType,
43  const DtVector& location,
44  const DtVector32& relativeLocation,
45  DtFloat32 decibelLevel,
47 
49  virtual ~DtSoundPdu();
50 
51  virtual const DtObjectId &sourceId() const;
52  virtual void setSourceId(const DtObjectId &id);
53 
54  virtual const DtEntityType &soundType() const;
55  virtual void setSoundType(const DtEntityType &type);
56 
57  virtual const DtVector& location() const;
58  virtual void setLocation(const DtVector& location);
59 
60  virtual const DtVector32& relativeLocation() const;
61  virtual void setRelativeLocation(const DtVector32& location);
62 
63  virtual DtFloat32 decibelLevel() const;
64  virtual void setDecibelLevel(DtFloat32 level);
65 
66  virtual void printData() const;
67  virtual void printDataToStream(std::ostream& stream) const;
68  virtual void printDataToString(DtString& str) const;
69 
70 public:
71 
72  static DtPdu *create(const DtNetPacket *initial,
73  DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER, DtPduFactory* pduFactory = 0);
74 
75  static void addCallback(DtExerciseConn *conn,
76  DtSoundInteractionCb cb, void *usr);
77  static void removeCallback(DtExerciseConn *conn,
78  DtSoundInteractionCb cb, void *usr);
79 
80 protected:
81 
82  DtPduKind internalGetPduKind() const { return DtSoundPduKind; }
83  DtObjectId src;
84  DtEntityType mySoundType;
85  DtVector loc;
86  DtVector32 relLoc;
87  DtFloat32 myDecibelLevel;
88 };
89 
90 #endif
DtInteraction is an abstract base class for representing HLA interactions (or events) (as opposed to ...
Definition: interactionHLA.h:33
Instances of DtSoundInteraction are used to represent Sound Interactions in the RPR FOM...
Definition: soundInteractionHLA.h:35
Instances of DtExerciseConn are used to provide an application&#39;s interface or connection to the netwo...
Definition: exerciseConnHLA.h:62
#define DT_DLL_VL
Definition: vlMachineTypes.h:120
Definition: pduHeader.h:14
Definition: disEnums.h:325
static void removeCallback(DtExerciseConn *conn, const std::vector< DtString > *classes, DtReceiveInteractionCb cb, void *usr, DtDDMRegionSP region=DtDDMRegionSP())
This file defines math constants and methods which may be useful in simulations.
virtual void printData() const
Print the interaction&#39;s data to DtInfo.
Definition: interactionHLA.h:358
This file is used as a convenience to group interaction concepts together.
virtual void printDataToStream(std::ostream &stream) const
Print the interaction&#39;s data to the stream.
Definition: interactionHLA.h:366
Definition: vlVector.h:224
DtPdu is the base class for all PDU&#39;s in VR-Link.
Definition: pdu.h:69
static void addCallback(DtExerciseConn *conn, const std::vector< DtString > *classes, DtReceiveInteractionCb cb, void *usr, DtDDMRegionSP region=DtDDMRegionSP())
Register/Deregister callback function cb with conn, on all interaction class name (char*) contained i...
Definition: vlVector.h:162
Instances of DtEntityIdentifier are used as a unique ID for entities in DIS.
Definition: entityIdentifier.h:31
Definition: soundP.h:16
void(* DtSoundInteractionCb)(DtSoundInteraction *inter, void *usr)
Sound interaction callback function signature.
Definition: soundInteractionHLA.h:29
This file is deprecated - Please see simulationAddress.h, entityIdentifier.h, entityType.h, burstDescriptor.h, and NetStructs.h.
struct DtBufferPlaceHolder * DtBufferPtr
Definition: vlBaseMsg.h:17
#define DtUSE_INTERNAL_BUFFER
Definition: vlBaseMsg.h:22
DtObjectId instances are used to represent RTI::ObjectInstances in VR-Link.
Definition: objectId.h:38
This file declares the class DtNetSoundPdu.
DtPduKind
([UID 4]) - PDU Type
Definition: disEnums.h:238
Instances of DtString are used to represent strings.
Definition: vlString.h:38
DtEntityType is used to represent the type an entity object.
Definition: entityType.h:26
virtual void printDataToString(DtString &buff) const
Print the interaction&#39;s data to the string provided.
Definition: interactionHLA.h:362
struct DtNetSoundPdu DtNetSoundPdu

Document ID: Generated on Mon Sep 28 00:09:32 EDT 2026 from SVN revision 295353
Copyright © 1992-2025 MAK Technologies. All Rights Reserved (www.mak.com)