WSF
WsfGeoPoint.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 WSFGEOPOINT_HPP
13#define WSFGEOPOINT_HPP
14
15#include "wsf_export.h"
16
17class UtCalendar;
18#include "UtEntity.hpp"
19class UtInput;
20#include "UtMemory.hpp"
21class WsfPlatform;
22class WsfScenario;
24
29{
30public:
31 static void RegisterComponentFactory(WsfScenario& aScenario);
32
34 explicit WsfGeoPoint(const double aPointWCS[3]);
35 WsfGeoPoint(double aLat, double aLon, double aAlt);
36 WsfGeoPoint(const WsfGeoPoint& aSrc);
38 ~WsfGeoPoint() override = default;
39
41
42 WsfComponent* CloneComponent() const override { return Clone(); }
43 void* QueryInterface(int aRole) override { return (aRole == mRoles[0]) ? this : nullptr; }
45
46 virtual WsfGeoPoint* Clone() const { return new WsfGeoPoint(*this); }
47
48 bool ProcessInput(UtInput& aInput) override;
49
50 void GetLocationWCS(double aLocationWCS[3]) const;
51
52 double GetDistanceFrom(double aLocationWCS[3]) const;
53
54 double GetDistanceFrom(const WsfGeoPoint& aRefPoint) const;
55
56 void SetLocationWCS(const double aLocationWCS[3]);
57
58 void GetLocationECI(const UtCalendar& aTime, double aLocationECI[3]) const;
59
60 double GetLat() const;
61
62 double GetLon() const;
63
64 double GetAlt() const;
65
66 void GetLocationLLA(double& aLat, double& aLon, double& aAlt) const;
67
68 void SetLocationLLA(double aLat, double aLon, double aAlt);
69
70 void AddOffset(double aHeading, const double aOffset[3]);
71
72 void AddOffsetNED(const double aOffsetNED[3]);
73
74 void Extrapolate(double aHeading, double aDistance);
75
76 void SetAltitudeMSL(double aAltitude);
77
78 double TrueBearingTo(const WsfGeoPoint& aRhs) const;
79
80 double GroundRangeTo(const WsfGeoPoint& aRhs) const;
81
82 double GetApparentTime(const UtCalendar& aEpoch) const;
83
84 double SlantRangeTo(const WsfGeoPoint& aRhs, const bool aUseSpherical = true) const;
85
87 template<typename AR>
88 void Serialize(AR& aAr)
89 {
90 aAr& mRefPointWCS[0] & mRefPointWCS[1] & mRefPointWCS[2] & mRefLat& mRefLon& mRefAlt;
91 }
92
93private:
94 UtEntity& GetReferenceEntity() const;
95 void UpdateLLA_Location() const;
96 void UpdateWCS_Location() const;
97 const ut::CentralBody& GetCentralBody() const;
98
99 mutable UtVec3d mRefPointWCS;
100 mutable double mRefLat{0.0};
101 mutable double mRefLon{0.0};
102 mutable double mRefAlt{0.0};
103 mutable bool mWCS_LocationValid{false};
104 mutable bool mLLA_LocationValid{true};
105
106 mutable std::unique_ptr<UtEntity> mEntityPtr{nullptr};
107 mutable std::unique_ptr<ut::CentralBody> mCentralBodyPtr{nullptr};
108};
109
111
112#endif
#define WSF_DECLARE_COMPONENT_ROLE_TYPE(TYPE, ROLE)
Definition WsfComponentRoles.hpp:44
@ cWSF_COMPONENT_GEOPOINT
A 'geopoint' component (WsfGeoPoint).
Definition WsfComponentRoles.hpp:111
aObjectPtr GetLocationLLA(lla[0], lla[1], lla[2])
pointPtr SetLocationWCS(finalPos.GetData())
WsfSimpleComponentT< WsfPlatformComponent > WsfSimplePlatformComponent
Definition WsfSimpleComponent.hpp:126
#define WSF_EXPORT
Definition WsfXIO_Export.hpp:35
Definition WsfComponent.hpp:39
virtual bool ProcessInput(UtInput &aInput)
Definition WsfComponent.cpp:100
Definition WsfGeoPoint.hpp:29
void * QueryInterface(int aRole) override
Definition WsfGeoPoint.hpp:43
~WsfGeoPoint() override=default
WsfGeoPoint()
Definition WsfGeoPoint.cpp:68
virtual WsfGeoPoint * Clone() const
Definition WsfGeoPoint.hpp:46
WsfComponent * CloneComponent() const override
Definition WsfGeoPoint.hpp:42
static void RegisterComponentFactory(WsfScenario &aScenario)
Definition WsfGeoPoint.cpp:62
void Serialize(AR &aAr)
For XIO (de)serialization.
Definition WsfGeoPoint.hpp:88
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
WsfSimpleComponentT & operator=(const WsfSimpleComponentT &aRhs)
Definition WsfSimpleComponent.hpp:84
int mRoles[2]
Definition WsfSimpleComponent.hpp:116
Copyrights Multiple, All Rights Reserved