VR-Link API Documentation for HLA 1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
detonationPdu.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 1992-2013 VT MAK
3 ** All rights reserved.
4 *********************************************************************/
5 
6 
9 
10 #pragma once
11 
12 #if DtDIS
13 
14 #include "interaction.h"
15 #include "packets/detonationP.h"
16 #include "hostStructs.h"
17 #include "eventId.h"
18 #include "fireInteraction.h"
19 #include <vl/vpRecord.h>
20 
23 #include <vlpi/artPartSpec.h>
24 
25 #include <matrix/vlMath.h>
26 
27 
28 
29 #define DtMaxNumDetArtParts 25
30 
31 class DtExerciseConn;
32 class DtDetonationPdu;
33 
35 typedef DtDetonationPdu DtDetonationInteraction;
36 
38  void *usr);
39 
42 class DT_DLL_VL DtDetonationPdu : public DtInteraction
43 {
44 public:
45 
46  enum { PduStaticSize=104 };
47 
48 public:
49  DtDetonationPdu(DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER);
50  DtDetonationPdu(const DtNetDetonationPdu *initial,
51  DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER, DtPduFactory* pduFactory = 0);
52 
53  DtDetonationPdu(const DtEntityIdentifier &attacker,
54  const DtEntityIdentifier &target,
55  const DtEntityIdentifier &munition,
56  const DtEventID &eventId,
57  const DtVector32& linVelocity,
58  const DtVector& location,
59  const DtBurstDescriptor &burst,
60  const DtVector32& entLocation,
61  DtDetonationResult result,
63 
65  DtDetonationPdu(const DtFireInteraction &fire,
67 
69  virtual ~DtDetonationPdu();
70 
71  static DtPdu *create(const DtNetPacket *initial,
72  DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER, DtPduFactory* pduFactory = 0);
73 
74  static void addCallback(DtExerciseConn *conn,
75  DtDetonationInteractionCb cb, void *usr);
76  static void removeCallback(DtExerciseConn *conn,
77  DtDetonationInteractionCb cb, void *usr);
78 
79  /****************** INSPECTOR FUNCTIONS *******************/
80  const DtObjectId &attackerId() const;
81  void setAttackerId(const DtObjectId &id);
82 
83  const DtObjectId &targetId() const;
84  void setTargetId(const DtObjectId &id);
85 
86  const DtObjectId &munitionId() const;
87  void setMunitionId(const DtObjectId &id);
88 
89  const DtEventID &eventId() const;
90  void setEventId(const DtEventID &id);
91 
92  const DtVector32& velocity() const;
93  void setVelocity(const DtVector32& velocity);
94 
95  const DtVector& worldLocation() const;
96  void setWorldLocation(const DtVector& location);
97 
98  const DtVector32& entityLocation() const;
99  void setEntityLocation(const DtVector32& location);
100 
101  DtDetonationResult result() const;
102  void setResult(DtDetonationResult result);
103 
104  DtDetonatorFuze fuseType() const;
105  void setFuseType(DtDetonatorFuze fuse);
106 
107  const DtEntityType &munitionType() const;
108  void setMunitionType(const DtEntityType &munType);
109 
110  int quantity() const;
111  void setQuantity(int quant);
112 
113  int rate() const;
114  void setRate(int rate);
115 
116  DtWarheadType warheadType() const;
117  void setWarheadType(DtWarheadType type);
118 
120  const DtBurstDescriptor &burst() const;
121  void setBurst(const DtBurstDescriptor &burst);
122 
123  void setArticulatedParts(const DtArticulatedPartCollection& apList);
124  const DtArticulatedPartCollection& articulatedParts() const;
125  DtArticulatedPartCollection& articulatedParts();
126 
127  void setAttachedParts(const DtAttachedPartCollection& apList);
128  const DtAttachedPartCollection& attachedParts() const;
129  DtAttachedPartCollection& attachedParts();
130 
132  virtual const std::vector<DtVPRecord*>* variableParameterList() const;
136  virtual std::vector<DtVPRecord*>* variableParameterList();
138 
139  virtual void printData() const;
140  virtual void printDataToStream(std::ostream& stream) const;
141  virtual void printDataToString(DtString& str) const;
142 
143 protected:
144  DtPduKind internalGetPduKind() const {return DtDetonationPduKind;}
145 
146  DtObjectId att;
147  DtObjectId tar;
148  DtObjectId mun;
149  DtEventID event;
150  DtVector32 vel, ent;
151  DtVector world;
152  DtBurstDescriptor theBurst;
153  DtEntityType myMunType;
154  unsigned myArtPartCount;
155  unsigned myAttPartCount;
156  mutable DtArticulatedPartCollection myArtPartCollection;
157  mutable DtAttachedPartCollection myAttPartCollection;
158 
159  std::vector<DtVPRecord*> myVPRecordCollection; //DIS 7 only.
160 };
161 
162 
163 inline const std::vector<DtVPRecord*>* DtDetonationPdu::variableParameterList() const
164 {
165  return &myVPRecordCollection;
166 }
167 
168 inline std::vector<DtVPRecord*>* DtDetonationPdu::variableParameterList()
169 {
170  return &myVPRecordCollection;
171 }
172 
173 #endif
DtInteraction is an abstract base class for representing HLA interactions (or events) (as opposed to ...
Definition: interactionHLA.h:33
Instances of DtDetonationInteraction are used to communicate information associated with the impact o...
Definition: detonationInteractionHLA.h:37
A DtAttachedPartCollection is a collection of attached parts of an entity.
Definition: attachedPartCollection.h:24
Instances of DtExerciseConn are used to provide an application&#39;s interface or connection to the netwo...
Definition: exerciseConnHLA.h:58
#define DT_DLL_VL
Definition: vlMachineTypes.h:108
Definition: pduHeader.h:14
This file provides a declaration of the class DtArticulatedPartCollection.
DtDetonationResult
Definition: disEnums.h:207
static void removeCallback(DtExerciseConn *conn, const std::set< 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:348
This file is used as a convenience to group interaction concepts together.
A DtArticulatedPartCollection is a collection of articulated parts typically of an entity...
Definition: articulatedPartCollection.h:29
Definition: detonationP.h:20
virtual void printDataToStream(std::ostream &stream) const
Print the interaction&#39;s data to the stream.
Definition: interactionHLA.h:356
Definition: vlVector.h:224
This file provides protocol independence for Fire Interactions.
Instances of DtFireInteraction are used to represent the firing of a weapon.
Definition: fireInteractionHLA.h:35
DtPdu is the base class for all PDU&#39;s in VR-Link.
Definition: pdu.h:69
Definition: disEnums.h:243
This file declares the struct DtArtPartSpec.
Definition: vlVector.h:162
Represents Events in the RPR FOM.
Definition: eventId.h:52
Instances of DtEntityIdentifier are used as a unique ID for entities in DIS.
Definition: entityIdentifier.h:31
static void addCallback(DtExerciseConn *conn, const std::set< DtString > *classes, DtReceiveInteractionCb cb, void *usr, DtDDMRegionSP region=DtDDMRegionSP())
Register/Deregister callback function cb with conn, on all interaction class name (char*) contained i...
Burst descriptors represent Fire and detonate descriptors in DIS and HLA.
Definition: burstDescriptor.h:24
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
void(* DtDetonationInteractionCb)(DtDetonationInteraction *inter, void *usr)
Detonation interaction callback function signature.
Definition: detonationInteractionHLA.h:30
DtDetonatorFuze
SECTION 1.
Definition: disEnums.h:28
Contains the DtEventId class declaration.
DtPduKind
([UID 4]) - PDU Type
Definition: disEnums.h:238
Instances of DtString are used to represent strings.
Definition: vlString.h:29
DtWarheadType
Definition: disEnums.h:42
DtEntityType is used to represent the type an entity object.
Definition: entityType.h:26
This file provides a declaration of the class DtAttachedPartCollection.
This file declares the class DtNetDetonationPdu.
virtual void printDataToString(DtString &buff) const
Print the interaction&#39;s data to the string provided.
Definition: interactionHLA.h:352

Document ID: Generated on Tue Feb 2 21:02:17 EST 2021 from SVN revision 223668
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)