VR-Link API Documentation for DIS
 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;
33 
36 
38  void *usr);
39 
43 {
44 public:
45 
46  enum { PduStaticSize=104 };
47 
48 public:
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 
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:
145 
154  unsigned myArtPartCount;
155  unsigned myAttPartCount;
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 base class for representing DIS PDUs which don&#39;t have state.
Definition: interactionDIS.h:24
A DtAttachedPartCollection is a collection of attached parts of an entity.
Definition: attachedPartCollection.h:24
DtEventID event
Definition: detonationPdu.h:149
Instances of DtExerciseConn are used to provide an application&#39;s interface or connection to the netwo...
Definition: exerciseConnDIS.h:61
#define DT_DLL_VL
Definition: vlMachineTypes.h:108
DtVector world
Definition: detonationPdu.h:151
DtBurstDescriptor theBurst
Definition: detonationPdu.h:152
DtDetonationPdu is used to represent the impact or detonation of a munition.
Definition: detonationPdu.h:42
DtPduKind internalGetPduKind() const
Returns the PDU kind associated with the derived PDU class.
Definition: detonationPdu.h:144
Definition: pduHeader.h:14
This file provides a declaration of the class DtArticulatedPartCollection.
DtDetonationResult
Definition: disEnums.h:207
class DtPduFactory:
Definition: pduFactory.h:38
virtual const std::vector< DtVPRecord * > * variableParameterList() const
Get the VP Records list.
Definition: detonationPdu.h:163
virtual void printDataToStream(std::ostream &stream) const
This file defines math constants and methods which may be useful in simulations.
This file is used as a convenience to group interaction concepts together.
unsigned myAttPartCount
Definition: detonationPdu.h:155
A DtArticulatedPartCollection is a collection of articulated parts typically of an entity...
Definition: articulatedPartCollection.h:29
Definition: detonationP.h:20
Definition: vlVector.h:224
DtObjectId tar
Definition: detonationPdu.h:147
This file provides protocol independence for Fire Interactions.
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
virtual void printDataToString(DtString &str) const
Represents Events in DIS.
Definition: eventId.h:154
Instances of DtEntityIdentifier are used as a unique ID for entities in DIS.
Definition: entityIdentifier.h:31
DtVector32 vel
Definition: detonationPdu.h:150
Instances of DtFireInteraction are used to represent the firing of a weapon.
Definition: firePdu.h:34
virtual void printData() const
Print the PDU&#39;s data (not including header).
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.
std::vector< DtVPRecord * > myVPRecordCollection
Definition: detonationPdu.h:159
struct DtBufferPlaceHolder * DtBufferPtr
Definition: vlBaseMsg.h:17
#define DtUSE_INTERNAL_BUFFER
Definition: vlBaseMsg.h:22
void(* DtDetonationInteractionCb)(DtDetonationInteraction *inter, void *usr)
Definition: detonationPdu.h:37
DtAttachedPartCollection myAttPartCollection
Definition: detonationPdu.h:157
DtDetonationPdu DtDetonationInteraction
DtDetonationInteraction is used to represent an impact or detonation of a munition.
Definition: detonationPdu.h:32
DtDetonatorFuze
SECTION 1.
Definition: disEnums.h:28
unsigned myArtPartCount
Definition: detonationPdu.h:154
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
DtObjectId att
Definition: detonationPdu.h:146
DtArticulatedPartCollection myArtPartCollection
Definition: detonationPdu.h:156
DtObjectId mun
Definition: detonationPdu.h:148
DtEntityType is used to represent the type an entity object.
Definition: entityType.h:26
DtEntityType myMunType
Definition: detonationPdu.h:153
This file provides a declaration of the class DtAttachedPartCollection.
This file declares the class DtNetDetonationPdu.

Document ID: Generated on Mon Apr 25 03:39:01 EDT 2022 from SVN revision 242502
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)