WSF
WsfPathState.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// Updated by Infoscitex, a DCS Company.
13// ****************************************************************************
14
15#ifndef WSFPATHSTATE_HPP
16#define WSFPATHSTATE_HPP
17
18#include <cmath>
19
20#include "UtEntity.hpp"
21
22// Represents the state of an entity moving along a WsfPathList
24{
25 WsfPathState() = default;
26 WsfPathState(const WsfPathState& aSrc) { *this = aSrc; }
27 WsfPathState(UtEntity& aEntity) { *this = aEntity; }
28
30 {
31 mLatitude = aRhs.mLatitude;
33 mAltitude = aRhs.mAltitude;
37 mVelocityNED[0] = aRhs.mVelocityNED[0];
38 mVelocityNED[1] = aRhs.mVelocityNED[1];
39 mVelocityNED[2] = aRhs.mVelocityNED[2];
43 return *this;
44 }
45
46 WsfPathState& operator=(UtEntity& aRhs)
47 {
48 aRhs.GetLocationLLA(mLatitude, mLongitude, mAltitude);
49 aRhs.GetOrientationNED(mOrientationNED[0], mOrientationNED[1], mOrientationNED[2]);
50 aRhs.GetVelocityNED(mVelocityNED);
51 aRhs.GetAccelerationNED(mAccelerationNED);
52 return *this;
53 }
54
55 void CopyToEntity(UtEntity& aEntity) const
56 {
57 aEntity.SetLocationLLA(mLatitude, mLongitude, mAltitude);
58 aEntity.SetOrientationNED(mOrientationNED[0], mOrientationNED[1], mOrientationNED[2]);
59 aEntity.SetVelocityNED(mVelocityNED);
60 aEntity.SetAccelerationNED(mAccelerationNED);
61 }
62
63 // Convenience method to allow direct replacement of calls to WsfPlatform::GetLocationLLA().
64 void GetLocationLLA(double& aLatitude, double& aLongitude, double& aAltitude) const
65 {
66 aLatitude = mLatitude;
67 aLongitude = mLongitude;
68 aAltitude = mAltitude;
69 }
70
71 double GetSpeed() const
72 {
73 return sqrt(mVelocityNED[0] * mVelocityNED[0] + mVelocityNED[1] * mVelocityNED[1] +
75 }
76
77 double mLatitude;
78 double mLongitude;
79 double mAltitude;
80 double mOrientationNED[3];
81 double mVelocityNED[3];
83};
84
85#endif
WsfPathState()=default
WsfPathState(const WsfPathState &aSrc)
Definition WsfPathState.hpp:26
double mLatitude
Definition WsfPathState.hpp:77
double mLongitude
Definition WsfPathState.hpp:78
WsfPathState & operator=(UtEntity &aRhs)
Definition WsfPathState.hpp:46
double mAccelerationNED[3]
Definition WsfPathState.hpp:82
void GetLocationLLA(double &aLatitude, double &aLongitude, double &aAltitude) const
Definition WsfPathState.hpp:64
void CopyToEntity(UtEntity &aEntity) const
Definition WsfPathState.hpp:55
double mVelocityNED[3]
Definition WsfPathState.hpp:81
WsfPathState(UtEntity &aEntity)
Definition WsfPathState.hpp:27
double GetSpeed() const
Definition WsfPathState.hpp:71
double mOrientationNED[3]
Definition WsfPathState.hpp:80
WsfPathState & operator=(const WsfPathState &aRhs)
Definition WsfPathState.hpp:29
double mAltitude
Definition WsfPathState.hpp:79
Copyrights Multiple, All Rights Reserved