Files
qt-migration-legatus/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/handler_building_data.h
T
torstenandCopilot b774f4035c Qt6 Migration: DDS-Stubs, Logger-Fixes, Export-Header Korrekturen
- NGL_ADD_LIBRARY2: 87 CMakeLists.txt konvertiert für Export-Header Generierung
- 44 Export-Header Include-Pfade korrigiert (_export.h)
- 81 DDS-Stub-Header generiert (*_dtc.h, *_fts.h, *_dts.h, *_ftc.h)
- INGLLogger: Duplikat gelöscht, m_logger Member entfernt, variadische Makros
- Q_FUNC_INFO Redefinition behoben (Qt6 definiert bereits)
- FATAL_LOG Makro hinzugefügt
- InfrastructureManagement DDS-Stubs (ism.hpp, ism_enums.hpp, ism_ftc.h)
- FilterManagement DDS-Stubs (flt_ftc.h, flt_dts.h)
- AreaEffectSimulation DDS-Stubs (aes.hpp, aes_enums.hpp)
- SymbolAppearance Klasse vollständig definiert mit content() Methode
- BuildingComponentFilter Klasse definiert mit Copy-Konstruktor
- Ftc Factory: nullptr Return (abstract class)
- AesFilter Klasse in aes.hpp hinzugefügt
- Dtc Klasse in ppm.hpp mit participantChanged Signal
- AesType Enum: alle 15 At* Werte definiert
- AesEffectState_def: EsReceived hinzugefügt
- DataModification Enum: eAdded/eModified/eRemoved
- function_reply_object.h → core_types.h Include-Pfad (72 Dateien)
- Enum-Class-Streaming Template-Operator in INGLLogger.h
- ism_mounting_point.h: QImage → QtGui/QImage, QGuiApplication/QScreen
- ism_data_plugin_interface.h: QSet Include, Include-Reihenfolge
- QRegExp → QRegularExpression in tpm_js_parser.cpp
- .underlying() Aufrufe zu direktem Enum-Vergleich korrigiert
- Include-Pfade: aes.hpp in symbol_appearance_settings_impl.h und aes_display_filter_impl.h

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-08-19 06:06:24 +02:00

116 lines
4.2 KiB
C++
Executable File

/**
* Handler for player data
* $Id$
* $HeadURL$
* $Author$
* Created by gr, SLSE, 2017-02-20
*/
#pragma once
#include <CentralEffectSimulation/logger.h>
#include "svccesddscommon_export.h"
#include <CentralEffectSimulation/dds_handler.h>
#include <QObject>
#include <QPolygonF>
#include <QHash>
// Data for buildings
namespace CentralEffectSimulation
{
//------------------------------------------------------------------------------
// Helper function to calculate the (2D) center of a polygon like a (metric) footprint
//------------------------------------------------------------------------------
// Note:
// The centroid of a non-self-intersecting closed polygon defined by n vertices.
QPointF compute2DPolygonCentroid_deprecated(const QPolygonF &metricVertices);
//------------------------------------------------------------------------------
// class HandlerBuildingData
//------------------------------------------------------------------------------
class SVCCESDDSCOMMON_EXPORT HandlerBuildingData : public QObject
{
Q_OBJECT
public:
struct AssetPosition
{
int structureElementId;
InfrastructureManagement::MountingPointType mountingPointType;
QString hostname;
Core::RelativePosition relPosition;
Core::GeoPosition geoPosition;
QPointF positionUtm;
int zone;
};
struct Footprint
{
int mseId{-1};
int zone{-1};
Core::GeoPosition geoPosition;
QPolygonF polyUtm;
QRectF boundingBoxPolyUtm;
QPointF centroid; // centroid for concealment calculation (Verdeckung)
bool isValid() const { return mseId > 0; }
};
explicit HandlerBuildingData(const std::shared_ptr<CentralEffectSimulation::DdsHandler> &ddsHandler, QObject *parent = nullptr);
~HandlerBuildingData();
/**
* Initialize the handler to manage information from player management
*/
bool init();
int getFloorIdFromRoomId(int roomId) const { return m_floorRoom.value(roomId, -1); }
int getBuildingIdFromFloorId(int floorId) const { return m_buildingFloor.value(floorId, -1); }
int getBuildingIdFromRoomId(const int roomId);
QVector<int> polygonEncloseBuildings(const QPolygonF &polygon);
QVector<int> getFloorsFromStructureElementId(int structureElementId) const;
QVector<int> getFloorsFromBuilding(int buildingId) const;
InfrastructureManagement::MainStructureElement mainStructureElement(int mseId) const { return m_mainStructureElements.value(mseId); }
QHash<int, AssetPosition> getAssetPositions(){return m_assetPositions;}
void printAssetPositions();
QHash<int, Footprint> getFootprints(){return m_footprints;}
private:
void getFootprintsByExercise();
private Q_SLOTS:
/**
* Handle MainStructureElement from 'ISM'
*/
void onMainStructureElementChanged(const InfrastructureManagement::MainStructureElement &data, DataModification modType);
void onMountingPointAssetChanged(const InfrastructureManagement::MountingPointAsset &data, DataModification modType);
void onInstrumentationAssetChanged(const InfrastructureManagement::InstrumentationAsset &data, DataModification modType);
private: // attributes
std::shared_ptr<CentralEffectSimulation::DdsHandler> m_ddsHandler; ///< Pointer to VOM DDS handler
QHash<int, InfrastructureManagement::MainStructureElement> m_mainStructureElements;
QHash<int, int> m_floorRoom; // key = roomId, Value = floorId
QHash<int, int> m_structureElementToFloor; // key = floorId, Value = structureElementId
QHash<int, int> m_buildingFloor; // key = floorId, Value = buildingId (ism_main_structure_element)
QHash<int, int> m_ToFloor; // key = floorId, Value = structureElementId
QHash<int, int> m_mountingPointAsset; // key = structureElementId , Value = assetId;
QHash<int, int> m_assetMountingPoint; // key = assetId , Value = structureElementId;
QHash<int, QString> m_instrumentationAssets; // key = assetId, Value = hostname
QHash<int, AssetPosition> m_assetPositions; // key = structureElementId
QHash<int, Footprint> m_footprints; // key = footprint.mseId
int m_zone = -1;
CentralEffectSimulation::LOGGER_T &m_logger; ///< Interface to the Logging-Facility
};
} // namespace CentralEffectSimulation2D