Files
T

68 lines
2.8 KiB
C++
Executable File

#pragma once
#include <QVector>
#include <QRectF>
#include <memory>
namespace InfrastructureManagement
{
class MainStructureElement;
namespace Interface
{
class Dtc;
}
}
namespace ParticipantManagement
{
namespace Interface
{
class Dtc;
}
}
class QLineF;
class QPointF;
class QPolygonF;
namespace CollateralDamageSimulation
{
namespace Calculations
{
struct ParticipantProtectionInfo
{
QVector<int> withProtection;
QVector<int> withoutProtection;
QVector<int> participantsInUnderground;
};
QHash<int, QPolygonF> getBuildingFootprints(const QVector<int> &buildingIds, const std::shared_ptr<InfrastructureManagement::Interface::Dtc> &ismDtc, const QPointF &impactPosition);
QVector<int> getDirectlyHitBuildings(const QHash<int, QPolygonF> &footprints, const QPointF &impactPosition);
int getNearestBlockedBuildingId(const QLineF &ray, const QHash<int, QPolygonF> &buildings);
QPolygonF getBuildingFootprint(int buildingId, const std::shared_ptr<InfrastructureManagement::Interface::Dtc> &ismDtc);
QVector<QPolygonF> getProtectionAreas(const QHash<int, QPolygonF> &buildingFootprints, double radius, const QPointF &impactPosition);
bool isPointVisible(const QPointF &center, const QPointF &point, const QPolygonF &polygon);
bool doLinesIntersect(const QPointF &a1, const QPointF &a2, const QPointF &b1, const QPointF &b2);
void addOuterBounds(QPolygonF &polygon, const QPointF &center, double radius);
QPointF getStartPosForOuterBounds(const QPolygonF &polygon, const QPolygonF &circle);
QPointF getEndPosForOuterBounds(const QPolygonF &polygon, const QPolygonF &circle);
QPointF firstIntersection(const QLineF &line, const QPolygonF &circle);
ParticipantProtectionInfo getParticipantProtectionInfo(const QVector<int> &participantIds,
const QVector<QPolygonF> &protectionAreas,
const QVector<int> &undergroundBuildingIds,
const QVector<int> &directlyHitBuildingIds,
const QHash<int, QPolygonF> &buildingFootprints,
const std::shared_ptr<ParticipantManagement::Interface::Dtc> &ppmDtc,
const std::shared_ptr<InfrastructureManagement::Interface::Dtc> &ismDtc);
bool isPointInAnyPolygon(const QHash<int, QPolygonF> &polygons, const QPointF &point);
QVector<QPolygonF> mergePolygons(const QVector<QPolygonF> &geoPolygons);
QVector<QPolygonF> getScaledPolygons(const QVector<QPolygonF> &polygons, double factor);
QVector<int> getUndergroundBuildingIds(const QVector<int> &buildingIds, const std::shared_ptr<InfrastructureManagement::Interface::Dtc> &ismDtc);
QList<QPointF> getGeoRect(const QPointF &center, double edgeLength);
}
}