WSF
WsfExtDetonation.hpp
Go to the documentation of this file.
1// ****************************************************************************
2// CUI
3//
4// The Advanced Framework for Simulation, Integration, and Modeling (AFSIM)
5//
6// Copyright 2003-2015 The Boeing Company. All rights reserved.
7//
8// The use, dissemination or disclosure of data in this file is subject to
9// limitation or restriction. See accompanying README and LICENSE for details.
10// ****************************************************************************
11
12#ifndef WSFEXTDETONATION_HPP
13#define WSFEXTDETONATION_HPP
14
15#include "wsf_mil_export.h"
16
17#include <map>
18#include <set>
19#include <string>
20
21class UtInput;
22#include "UtVec3.hpp"
23class WsfPlatform;
24#include "WsfStringId.hpp"
26class WsfExtInterface;
28
30class WSF_MIL_EXPORT WsfExtDetonation
31{
32public:
72
92
93 WsfExtDetonation(WsfExtInterface* aInterfacePtr);
94
96 void SetFiringEntity(WsfPlatform* aPlatformPtr) { mFiringEntityPtr = aPlatformPtr; }
97
99 void SetTargetEntity(WsfPlatform* aPlatformPtr) { mTargetEntityPtr = aPlatformPtr; }
100
101 void SetWeaponEntity(WsfPlatform* aPlatformPtr);
102
104 void SetWeaponEntityType(WsfStringId aWeaponTypeId) { mWeaponTypeId = aWeaponTypeId; }
105
107 void SetResult(unsigned int aResult) { mResult = aResult; }
108
109 std::string GetResultName() const;
110
111 bool DebugEnabled();
112
114 void SetDetonateLocation(double aDetonateLocationWCS[3]) { mDetonateLocationWCS.Set(aDetonateLocationWCS); }
115 void SetRelativeDetonationLocation(double aDetonationLocationECS[3])
116 {
117 mRelativeDetonationLocationECS.Set(aDetonationLocationECS);
118 }
119
121 void Execute(double aSimTime, Result& aResult);
122
123 std::string GetDefaultWeaponEffectName();
125
127
128private:
129 void PrintDetonation(double aSimTime, Result& aResult);
130
131 WsfPlatform* FindTargetPlatform(WsfPlatform* aReferencePlatformPtr);
132
133 void PerformSimpleDetonation(double aSimTime, Result& aResult, WsfWeaponEngagement* aEngagementPtr);
134
135 WsfStringId SelectWeaponEffect(WsfPlatform* aWeaponPlatformPtr, bool& aExcludeSimpleDetonation);
136
137 // Detonation Inputs
138 WsfExtInterface* mInterfacePtr;
139 WsfMilExtInterface* mMilInterfacePtr;
140 WsfPlatform* mFiringEntityPtr;
141 WsfPlatform* mTargetEntityPtr;
142 WsfPlatform* mWeaponEntityPtr;
143 UtVec3d mDetonateLocationWCS;
144 UtVec3d mRelativeDetonationLocationECS;
145 unsigned int mResult;
146 WsfStringId mWeaponTypeId;
147};
148#endif
UtStringId WsfStringId
WsfStringId – the same thing as UtStringId.
Definition WsfStringId.hpp:23
void SetWeaponEntityType(WsfStringId aWeaponTypeId)
Set the weapon platform type (used for implicit weapons).
Definition WsfExtDetonation.hpp:104
WsfSimulation * GetSimulation() const
Definition WsfExtDetonation.cpp:607
WsfWeaponEffects * GetDefaultWeaponEffect()
void SetResult(unsigned int aResult)
Set the expected result given by the external interface.
Definition WsfExtDetonation.hpp:107
void SetRelativeDetonationLocation(double aDetonationLocationECS[3])
Definition WsfExtDetonation.hpp:115
void SetTargetEntity(WsfPlatform *aPlatformPtr)
Set target platform pointer.
Definition WsfExtDetonation.hpp:99
DetonationResult
Detonation result codes from IEEE 1278 SISO-REF-010 (aka 'The DIS Enumerations Document').
Definition WsfExtDetonation.hpp:35
@ cENVIRONMENT_OBJECT_IMPACT
Definition WsfExtDetonation.hpp:58
@ cKILL_WITH_FRAGMENT_TYPE_1_AFTER_FLYOUT_FAILURE
Definition WsfExtDetonation.hpp:65
@ cKILL_WITH_FRAGMENT_TYPE_1
Definition WsfExtDetonation.hpp:62
@ cDIRT_BLAST_MEDIUM
Definition WsfExtDetonation.hpp:48
@ cHE_HIT_MEDIUM
Definition WsfExtDetonation.hpp:44
@ cGROUND_PROXIMATE_DETONATION
Definition WsfExtDetonation.hpp:40
@ cMINE_CLEARING_LINE_CHARGE
Definition WsfExtDetonation.hpp:57
@ cBUILDING_HIT_MEDIUM
Definition WsfExtDetonation.hpp:55
@ cWATER_BLAST_SMALL
Definition WsfExtDetonation.hpp:50
@ cRESULT_CODE_COUNT
Definition WsfExtDetonation.hpp:70
@ cKILL_WITH_FRAGMENT_TYPE_2_AFTER_FLYOUT_FAILURE
Definition WsfExtDetonation.hpp:66
@ cNONE
Definition WsfExtDetonation.hpp:42
@ cENVIRONMENT_OBJECT_PROXIMATE_DETONATION
Definition WsfExtDetonation.hpp:59
@ cAIRBURST
Definition WsfExtDetonation.hpp:61
@ cBUILDING_HIT_SMALL
Definition WsfExtDetonation.hpp:54
@ cHE_HIT_LARGE
Definition WsfExtDetonation.hpp:45
@ cARMOR_PIERCING_HIT
Definition WsfExtDetonation.hpp:46
@ cMISS_DUE_TO_ENDGAME_FAILURE
Definition WsfExtDetonation.hpp:68
@ cGROUND_IMPACT
Definition WsfExtDetonation.hpp:39
@ cMISS_DUE_TO_FLYOUT_AND_ENDGAME_FAILURE
Definition WsfExtDetonation.hpp:69
@ cWATER_BLAST_LARGE
Definition WsfExtDetonation.hpp:52
@ cMISS_DUE_TO_FLYOUT_FAILURE
Definition WsfExtDetonation.hpp:67
@ cDIRT_BLAST_SMALL
Definition WsfExtDetonation.hpp:47
@ cENTITY_IMPACT
Definition WsfExtDetonation.hpp:37
@ cDIRT_BLAST_LARGE
Definition WsfExtDetonation.hpp:49
@ cWATER_BLAST_MEDIUM
Definition WsfExtDetonation.hpp:51
@ cKILL_WITH_FRAGMENT_TYPE_3
Definition WsfExtDetonation.hpp:64
@ cENTITY_PROXIMATE_DETONATION
Definition WsfExtDetonation.hpp:38
@ cOTHER
Definition WsfExtDetonation.hpp:36
@ cDETONATION
Definition WsfExtDetonation.hpp:41
@ cKILL_WITH_FRAGMENT_TYPE_2
Definition WsfExtDetonation.hpp:63
@ cAIR_HIT
Definition WsfExtDetonation.hpp:53
@ cBUILDING_HIT_LARGE
Definition WsfExtDetonation.hpp:56
@ cWATER_IMPACT
Definition WsfExtDetonation.hpp:60
@ cHE_HIT_SMALL
Definition WsfExtDetonation.hpp:43
void SetDetonateLocation(double aDetonateLocationWCS[3])
Sets the detonation location. This is used to search for a target if the target entity is not set.
Definition WsfExtDetonation.hpp:114
WsfExtDetonation(WsfExtInterface *aInterfacePtr)
Definition WsfExtDetonation.cpp:86
void SetFiringEntity(WsfPlatform *aPlatformPtr)
Set firing platform pointer.
Definition WsfExtDetonation.hpp:96
The WSF Ext is code which is shared between common external interfaces like DIS and HLA.
Definition WsfExtInterface.hpp:183
Definition WsfMilExtInterface.hpp:23
Platforms represent a entity within the simulation.
Definition WsfPlatform.hpp:115
The main controller for a simulation.
Definition WsfSimulation.hpp:109
Definition WsfWeaponEffects.hpp:48
Definition WsfWeaponEngagement.hpp:43
GeometryResult
Definition WsfWeaponEngagement.hpp:46
Contains the result of a detonation.
Definition WsfExtDetonation.hpp:75
WsfWeaponEngagement::GeometryResult mGeometryResult
Definition WsfExtDetonation.hpp:86
UtVec3d mTargetLocationWCS
Definition WsfExtDetonation.hpp:89
Result()
Definition WsfExtDetonation.hpp:76
UtVec3d mDetonateLocationWCS
Definition WsfExtDetonation.hpp:88
bool mIgnored
Definition WsfExtDetonation.hpp:85
WsfPlatform * mTargetPlatformPtr
Definition WsfExtDetonation.hpp:90
double mMissDistance
Definition WsfExtDetonation.hpp:87
Copyrights Multiple, All Rights Reserved