WSF
WsfFormationFlyer.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 WSFFORMATIONFLYER_HPP
13#define WSFFORMATIONFLYER_HPP
14
15#include "wsf_mil_export.h"
16
17#include "WsfFollower.hpp"
18
19
22
23class WSF_MIL_EXPORT WsfFormationFlyer : public WsfFollower
24{
25public:
27 ~WsfFormationFlyer() override = default;
28
30
31 WsfMover* Clone() const override;
32 bool Initialize(double aSimTime) override;
33 bool ProcessInput(UtInput& aInput) override;
34 void Update(double aSimTime) override;
35 const char* GetScriptClassName() const override;
37
39
42
43 // void SetLeadAircraft(int aLeadNameId);
44 void SetLeadAircraft(WsfPlatform* aPlatformPtr);
45 WsfPlatform* GetLeadAircraft() const { return mLeadPlatPtr; }
46
47 void SetOffsetFromLeadECS(const double aOffsetFromLeadECS[3]); // ECS frame [meters]
48 void GetOffsetFromLeadECS(double aOffsetFromLeadECS[3]) const; // ECS frame [meters]
49
50 void SetFormationRollsWithLead(bool aValue) { mFormationRolls = aValue; }
51 bool GetFormationRollsWithLead() const { return mFormationRolls; }
53
55 void SwitchSides() { mNegateLateralOffset = !mNegateLateralOffset; }
56
57protected:
58 // Declare default copy constructor (for Clone())
61
62 void UpdateLeadInfo(double aSimTime);
63 void UpdateLeadPosAndVel(double aSimTime);
64
65private:
67 void OutputDiagnostic(double aSimTime, WsfPlatform* aLeadPlatPtr);
68 void PlatformDiagnostic(WsfPlatform* aPlatformPtr);
69
70
72 WsfStringId mLeadNameId;
73
75 size_t mLeadIndex;
76
78 WsfPlatform* mLeadPlatPtr;
79
81 double mOffsetFromLeadECS[3];
82
85 bool mFormationRolls;
86
88 bool mNegateLateralOffset;
89
92 bool mInitializeAtOffset;
93};
94
95#endif
UtStringId WsfStringId
WsfStringId – the same thing as UtStringId.
Definition WsfStringId.hpp:23
WsfSpatialDomain
A collection of enumerations and type definitions that are used across a number of components.
Definition WsfTypes.hpp:32
@ WSF_SPATIAL_DOMAIN_AIR
Cars, trucks, buildings, etc.
Definition WsfTypes.hpp:35
void Update(double aSimTime) override
Definition WsfFollower.cpp:255
void OutputDiagnostic(double aSimTime, WsfPlatform *aPlatformPtr)
Used to output data when debugging.
WsfMover * Clone() const override
Definition WsfFollower.cpp:118
bool ProcessInput(UtInput &aInput) override
Definition WsfFollower.cpp:159
WsfFollower()=delete
bool Initialize(double aSimTime) override
Definition WsfFollower.cpp:124
Definition WsfFormationFlyer.hpp:24
WsfPlatform * GetLeadAircraft() const
Definition WsfFormationFlyer.hpp:45
bool GetFormationRollsWithLead() const
Definition WsfFormationFlyer.hpp:51
void UpdateLeadInfo(double aSimTime)
Definition WsfFormationFlyer.cpp:283
WsfFormationFlyer(WsfScenario &aScenario)
Definition WsfFormationFlyer.cpp:77
void SetFormationRollsWithLead(bool aValue)
Definition WsfFormationFlyer.hpp:50
WsfSpatialDomain GetSpatialDomain() const override
Definition WsfFormationFlyer.hpp:38
WsfFormationFlyer & operator=(const WsfFormationFlyer &)=delete
void SwitchSides()
Used to switch sides when formation turns.
Definition WsfFormationFlyer.hpp:55
void UpdateLeadPosAndVel(double aSimTime)
Definition WsfFormationFlyer.cpp:314
~WsfFormationFlyer() override=default
WsfMover()=delete
const char * GetScriptClassName() const override
Definition WsfMover.cpp:616
Platforms represent a entity within the simulation.
Definition WsfPlatform.hpp:115
Contains the data required to create a simulation, and acts as the entry point for input file process...
Definition WsfScenario.hpp:111
Copyrights Multiple, All Rights Reserved