12#ifndef WSFZONEDEFINITION_HPP
13#define WSFZONEDEFINITION_HPP
15#include "wsf_export.h"
42 const double aViewedPointWCS[3],
43 const double aEyePointWCS[3],
44 const double aLookHeading,
45 const double aDeltaDownRange = 0.0)
override;
72 void SetReference(UtEntity& aReference);
75 void SetReference(
const WsfGeoPoint& aReference,
double aReferenceHeading);
78 void SetReference(
double aReferenceWCS[3],
double aReferenceHeading);
81 void SetReference(
double aReferenceLat,
double aReferenceLon,
double aReferenceHeading);
85 void SetShapeType(ShapeType aType);
86 void SetRelativeType(RelativeToType aType);
88 void SetAltBounds(
double aMinAlt,
double aMaxAlt);
90 void SetRadialBounds(
double aMinRadius,
double aMaxRadius);
92 void SetAngleBounds(
double aStartAngle,
double aStopAngle);
94 void SetEllipticalAxes(
double aLatAxisLen,
double aLonAxisLen);
96 void SetPolyPoints(
const std::vector<WsfGeoPoint>& aPoints);
97 void SetPolyPointsRelative(
const std::vector<UtVec3d>& aPoints);
99 const std::vector<WsfZone::Point>&
GetPoints()
const {
return mPoints; }
100 void GetPoints(std::vector<WsfGeoPoint>& aPoints)
const;
119 bool GetLatLonExtrema(
double& aSouthernLat,
double& aWesternLon,
double& aNorthernLat,
double& aEasternLon)
const override;
122 double GetRadius()
const;
123 double GetMinRadius()
const;
126 double GetReferenceHeading()
const;
127 double GetLatAxisLength()
const;
128 double GetLonAxisLength()
const;
129 void GetAngleBounds(
double& aStartAngle,
double& aStopAngle)
const;
130 void GetAltBounds(
double& aMinAlt,
double& aMaxAlt)
const;
134 void VerticesIn(
double aMinX,
double aMinY,
double aMaxX,
double aMaxY, std::vector<Point>& aPointsVector)
const;
137 void DrawRelative(
WsfDraw& aDraw,
const double aEyePointWCS[3],
const double aLookHeading)
override;
146 bool WithinPolygonSides(
const double aXorLatValue,
const double aYorLonValue)
const;
151 void AddPoint(
const Point& aPoint);
154 void CalculateArea();
155 void CalculateCentroid();
157 void ConvertWCSToLocalFrame(
const double aWCSLocation[3],
158 const double aEyePointWCS[3],
159 const double aLookHeading,
160 double aPointInMyFrame[3])
const;
162 bool PointIsInsidePrivate(
const double aViewedPointWCS[3],
163 const double aEyePointWCS[3],
164 const double aLookHeading,
165 const double aDeltaDownRange)
const;
167 void SetReference(
double aReferenceLat,
double aReferenceLon,
double aReferenceHeading,
double aReferenceWCS[3]);
173 bool WithinAltitudeBounds(
const double aViewedPointWCS[3],
174 const double aEyePointWCS[3],
178 bool& aLLAValid)
const;
180 bool WithinAngleBounds(
const double aPointInMyFrame[3],
double& aViewedAngle)
const;
182 bool WithinRadialBounds(
const double aPointInMyFrame[3],
183 const double aViewedPointWCS[3],
184 const double aEyePointWCS[3],
185 double& aViewedRadiusSquared)
const;
190 bool WithinAltitudeBounds(
const double aViewedAlt)
const;
191 bool WithinGrossXYBounds(
const double aXorLatValue,
const double aYorLonValue)
const;
193 double ExtrudedZonePenetrationDistance(
const double aLLA1[3],
const double aLLA2[3]);
195 double SphericalZonePenetrationDistance(
const double aLLA1[3],
const double aLLA2[3]);
197 bool Penetration2D(
const UtVec2d& aP0,
const UtVec2d& aP1, UtVec2d& aI1, UtVec2d& aI2);
199 bool PenetrationIntoPolygon(
const UtVec2d& aP0,
const UtVec2d& aP1, UtVec2d& aI1, UtVec2d& aI2);
201 bool PenetrationIntoCircle(
const UtVec2d& aP0,
const UtVec2d& aP1, UtVec2d& aI1, UtVec2d& aI2);
203 bool PenetrationIntoEllipse(
const UtVec2d& aP0,
const UtVec2d& aP1, UtVec2d& aI1, UtVec2d& aI2);
207 std::vector<Point> mPoints;
210 ShapeType mShapeType;
213 double mLongitudinalAxis;
217 bool mPointsAreLatLon;
218 bool mPointsInputIsMGRS;
219 bool mPointsInputIsPolar;
231 RelativeToType mRelativeTo;
232 double mReferenceWCS[3];
233 double mReferenceLat;
234 double mReferenceLon;
235 double mReferenceHeading;
236 bool mHasAbsoluteLatLon;
238 size_t mReferencePlatformIndex;
UtStringId WsfStringId
WsfStringId – the same thing as UtStringId.
Definition WsfStringId.hpp:23
#define WSF_EXPORT
Definition WsfXIO_Export.hpp:35
Provides the capability to draw shapes into the WSF replay file.
Definition WsfDraw.hpp:35
Definition WsfGeoPoint.hpp:29
Contains the data required to create a simulation, and acts as the entry point for input file process...
Definition WsfScenario.hpp:111
The main controller for a simulation.
Definition WsfSimulation.hpp:109
A class for defining a zone.
Definition WsfZoneDefinition.hpp:32
void SetPointsAreLatLon(bool aValue)
Definition WsfZoneDefinition.hpp:116
WsfStringId GetReferencePlatformName() const
Definition WsfZoneDefinition.hpp:107
RelativeToType
Definition WsfZoneDefinition.hpp:54
@ cOBSERVER
The Zone is relative to the observer (movable to fit the current context).
Definition WsfZoneDefinition.hpp:55
@ cINTERNAL
The Zone is fixed at some location or relative to a reference platform.
Definition WsfZoneDefinition.hpp:56
bool HasAbsoluteLatLon() const
Definition WsfZoneDefinition.hpp:114
WsfZoneDefinition()
Definition WsfZoneDefinition.cpp:64
~WsfZoneDefinition() override=default
const std::vector< WsfZone::Point > & GetPoints() const
Definition WsfZoneDefinition.hpp:99
double GetReferenceLon() const
Definition WsfZoneDefinition.hpp:109
double GetReferenceLat() const
Definition WsfZoneDefinition.hpp:108
ShapeType
Definition WsfZoneDefinition.hpp:60
@ cCIRCULAR
The shape of this Zone is a vertical cylinder.
Definition WsfZoneDefinition.hpp:62
@ cELLIPTICAL
The shape of this Zone is a vertical extruded ellipse.
Definition WsfZoneDefinition.hpp:63
@ cSPHERICAL
The shape of this Zone is a 3-dimensional sphere.
Definition WsfZoneDefinition.hpp:65
@ cNO_SHAPE
The shape of this Zone has not yet been determined.
Definition WsfZoneDefinition.hpp:61
@ cPOLYGONAL
The shape of this Zone is a vertical extruded polygon.
Definition WsfZoneDefinition.hpp:64
WsfZoneDefinition & operator=(const WsfZoneDefinition &)=delete
bool PointsAreLatLon()
Definition WsfZoneDefinition.hpp:117
ShapeType GetShapeType() const
Definition WsfZoneDefinition.hpp:105
bool IsNegative() const
Returns true the zone is a 'negative' zone and returns the opposite value for PointIsInside().
Definition WsfZoneDefinition.hpp:112
RelativeToType GetRelativeType() const
Definition WsfZoneDefinition.hpp:106
Definition WsfZone.hpp:63
virtual bool GetLatLonExtrema(double &aSouthernLat, double &aWesternLon, double &aNorthernLat, double &aEasternLon) const
Definition WsfZone.cpp:132
virtual void DebugDrawBounds(WsfDraw &aDraw)
Definition WsfZone.hpp:139
bool Initialize(double aSimTime) override
Definition WsfZone.cpp:123
virtual double CheckIntersections(const double aLLA1[3], const double aLLA2[3])
Definition WsfZone.hpp:114
virtual ut::optional< UtColor > GetFillColor() const
Definition WsfZone.hpp:157
virtual void DebugDrawZone(WsfDraw &aDraw)
Definition WsfZone.hpp:141
virtual void DrawCentroid(WsfDraw &aDraw)
Definition WsfZone.hpp:135
WsfZone()
Definition WsfZone.cpp:21
virtual WsfGeoPoint Reference()=0
virtual ut::optional< UtColor > GetLineColor() const
Definition WsfZone.hpp:158
WsfZone * Clone() const override=0
The standard Clone() method (virtual copy constructor).
WsfZone & operator=(const WsfZone &)=delete
virtual bool PointIsInside(WsfSimulation *aSimulationPtr, const double aViewedPointWCS[3], const double aEyePointWCS[3], const double aLookHeading, const double aDeltaDownRange=0.0)
Definition WsfZone.cpp:160
virtual void Draw(WsfDraw &aDraw)
Definition WsfZone.hpp:136
virtual void DebugDrawZoneRelative(WsfDraw &aDraw, const double aEyePointWCS[3], const double aLookHeading)
Definition WsfZone.hpp:142
virtual void DebugDrawCentroid(WsfDraw &aDraw)
Definition WsfZone.hpp:140
virtual void DrawRelative(WsfDraw &aDraw, const double aEyePointWCS[3], const double aLookHeading)
Definition WsfZone.hpp:137
bool ProcessInput(UtInput &aInput) override
Definition WsfZone.cpp:78
virtual void DrawBounds(WsfDraw &aDraw)
Definition WsfZone.hpp:134