Migrates AreaEffectSimulation to generated rtiddsgen API
Converts accessor calls to plain member access across aes service and plugin.
This commit is contained in:
102 files changed
+3307
-3313
No files matched your search
+16
-21
@@ -10,7 +10,6 @@
|
||||
|
||||
#include <aes.hpp>
|
||||
#include <AreaEffectSimulation/logger.h>
|
||||
#include <ElevationMap/elevation_map.h>
|
||||
#include <LtsCoordTrans/lts_coord_trans.h>
|
||||
#include <LtsCoordinate/lts_coord_vector.h>
|
||||
#include <LtsCoordinate/lts_coordinate.h>
|
||||
@@ -36,13 +35,9 @@
|
||||
|
||||
// Note: All polygones are open!
|
||||
|
||||
std::ostream &operator<<(std::ostream &stream, const QVector<QPointF> &value)
|
||||
{
|
||||
stream << "QVector<QPointF>(" << value.size() << "): ";
|
||||
for (const QPointF &item : value)
|
||||
stream << item << ";";
|
||||
return stream;
|
||||
}
|
||||
// operator<< for QVector<QPointF> removed: in Qt6 QVector is an alias of
|
||||
// QList, so the inline operator<<(std::ostream&, const QList<QPointF>&) in
|
||||
// INGLLogger.h (pulled in via logger.h) has the identical signature.
|
||||
|
||||
std::ostream &operator<<(std::ostream &stream, const QVector<LtsCoordTrans::UtmCoordinate> &value)
|
||||
{
|
||||
@@ -86,8 +81,8 @@ namespace Polygons
|
||||
// regarding ExplosionCluster:
|
||||
bool isPointSimilar(AreaEffectSimulation::AesExplosionGeometry geometry)
|
||||
{
|
||||
return (geometry.underlying() == AreaEffectSimulation::AesExplosionGeometry_def::EgAimPoint)
|
||||
|| (geometry.underlying() == AreaEffectSimulation::AesExplosionGeometry_def::EgPoint);
|
||||
return (geometry == AreaEffectSimulation::AesExplosionGeometry::EgAimPoint)
|
||||
|| (geometry == AreaEffectSimulation::AesExplosionGeometry::EgPoint);
|
||||
}
|
||||
|
||||
// AreaBottomLeft :
|
||||
@@ -427,7 +422,7 @@ QPolygonF explosionClusterArea(const Database::AesExplosionCluster &explosionClu
|
||||
QPolygonF poly;
|
||||
|
||||
const bool bIsPointSimilar = isPointSimilar(explosionCluster.explosionGeometryId);
|
||||
if (bIsPointSimilar || explosionCluster.explosionGeometryId.underlying() == AreaEffectSimulation::AesExplosionGeometry_def::EgRadial)
|
||||
if (bIsPointSimilar || explosionCluster.explosionGeometryId == AreaEffectSimulation::AesExplosionGeometry::EgRadial)
|
||||
{
|
||||
// get center ... (zog isn´t relevant yet)
|
||||
const double radius = explosionCluster.impactWidth / 2.0;
|
||||
@@ -626,7 +621,7 @@ QPolygonF effectClusterArea(const Database::AesEffectCluster &effectCluster)
|
||||
QPolygonF poly;
|
||||
|
||||
const bool bIsPointSimilar = isPointSimilar(effectCluster.explosionGeometryId);
|
||||
if (bIsPointSimilar || effectCluster.explosionGeometryId.underlying() == AreaEffectSimulation::AesExplosionGeometry_def::EgRadial)
|
||||
if (bIsPointSimilar || effectCluster.explosionGeometryId == AreaEffectSimulation::AesExplosionGeometry::EgRadial)
|
||||
{
|
||||
// get center ... (zog isn´t relevant yet)
|
||||
const double radius = effectCluster.impactWidth / 2.0;
|
||||
@@ -962,7 +957,7 @@ QVector<QPointF> explosionClusterSingleExplosionsGAUSS_Mtp(const Database::AesEx
|
||||
//
|
||||
// calculate the subAreas / mtps:
|
||||
//
|
||||
if (explosionCluster.explosionGeometryId.underlying() == AreaEffectSimulation::AesExplosionGeometry_def::EgRadial)
|
||||
if (explosionCluster.explosionGeometryId == AreaEffectSimulation::AesExplosionGeometry::EgRadial)
|
||||
mtps_asUtm = explosionClusterRadialToMtps(areaBlWithTla, numberOfMTPsRequested, firingOriginUtm, centerUtm, &singleWidthOut, &singleHeightOut);
|
||||
else
|
||||
mtps_asUtm = explosionClusterAreaToMtps(areaBlWithTla, numberOfMTPsRequested, &singleWidthOut, &singleHeightOut);
|
||||
@@ -1662,14 +1657,14 @@ LtsUtils::QPoint3D calculateFiringUnitCenterNonRecursive(const std::shared_ptr<P
|
||||
ppmDtc->waitForHistoricalDataParticipant(1000);
|
||||
|
||||
const ParticipantManagement::Participant &partData = ppmDtc->participant(unitParticipantId);
|
||||
if (partData.id() != unitParticipantId)
|
||||
if (partData.id != unitParticipantId)
|
||||
{
|
||||
ERROR_LOG(logger) << LOGFUNCTION << " ERROR, participant failed for id =" << unitParticipantId;
|
||||
return s_invalidPos;
|
||||
}
|
||||
ppmDtc->waitForHistoricalDataParticipantPosition(1000);
|
||||
|
||||
const std::vector<int> &childIds = partData.inferiorIds();
|
||||
const std::vector<int> &childIds = partData.inferiorIds;
|
||||
|
||||
singlePositionsOut.clear();
|
||||
singlePositionsOut.reserve(childIds.size());
|
||||
@@ -1681,21 +1676,21 @@ LtsUtils::QPoint3D calculateFiringUnitCenterNonRecursive(const std::shared_ptr<P
|
||||
for (int childId : qAsConst(childIds))
|
||||
{
|
||||
const ParticipantManagement::ParticipantPosition &childPos = ppmDtc->participantPosition(childId);
|
||||
if (childPos.participantId() != childId)
|
||||
if (childPos.participantId != childId)
|
||||
{
|
||||
// may happen in real life: so ERROR_LOG to DEBUG_LOG
|
||||
DEBUG_LOG(logger) << LOGFUNCTION << " ERROR, participantPosition failed for id =" << childId;
|
||||
return s_invalidPos;
|
||||
}
|
||||
const Core::GeoPosition &childGeoPos = childPos.pos();
|
||||
const Core::GeoPosition &childGeoPos = childPos.pos;
|
||||
|
||||
singlePositionsOut.emplace_back(childGeoPos);
|
||||
|
||||
const auto utm = LtsCoordTrans::UtmCoordinate::fromGeographic(childGeoPos.lon(), childGeoPos.lat(), utmZone);
|
||||
const auto utm = LtsCoordTrans::UtmCoordinate::fromGeographic(childGeoPos.lon, childGeoPos.lat, utmZone);
|
||||
if (utmZone == -1)
|
||||
utmZone = utm.zone;
|
||||
|
||||
pos += LtsUtils::QPoint3D(utm.x, utm.y, childGeoPos.z());
|
||||
pos += LtsUtils::QPoint3D(utm.x, utm.y, childGeoPos.z);
|
||||
++childCount;
|
||||
} // for
|
||||
|
||||
@@ -1743,7 +1738,7 @@ QVector<LtsCoordTrans::UtmCoordinate> geoVecToUtm(const std::vector<Core::GeoPos
|
||||
utmVec.reserve(vecPos.size());
|
||||
for (const auto &pos : vecPos)
|
||||
{
|
||||
const auto utm = LtsCoordTrans::UtmCoordinate::fromGeographic(pos.lon(), pos.lat(), utmZone);
|
||||
const auto utm = LtsCoordTrans::UtmCoordinate::fromGeographic(pos.lon, pos.lat, utmZone);
|
||||
if (utmZone == -1)
|
||||
utmZone = utm.zone;
|
||||
utmVec.append(utm);
|
||||
@@ -1757,7 +1752,7 @@ QVector<QPointF> geoVecToUtmPointF(const std::vector<Core::GeoPosition2D> &vecPo
|
||||
points.reserve(vecPos.size());
|
||||
for (const auto &pos : vecPos)
|
||||
{
|
||||
const auto utm = LtsCoordTrans::UtmCoordinate::fromGeographic(pos.lon(), pos.lat(), utmZone);
|
||||
const auto utm = LtsCoordTrans::UtmCoordinate::fromGeographic(pos.lon, pos.lat, utmZone);
|
||||
if (utmZone == -1)
|
||||
utmZone = utm.zone;
|
||||
points.append(QPointF(utm.x, utm.y));
|
||||
|
||||
Reference in new issue
Block a user