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 
133 
134 
135  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

Document ID: Generated on Fri Dec 2 02:42:08 EST 2016 from SVN revision 171416
Copyright © 2005-2016 VT MÄK. All Rights Reserved (www.mak.com)