Files
qt5-legatus-legacy/Lts/Services/InfrastructureManagement/handler_effect_area.h
T
2026-08-13 18:33:10 +02:00

60 lines
1.6 KiB
C++
Executable File

/**
* @RDE_HEADER@
* ISM Handler Sound Areas
* $Id$
* $HeadURL$
* $Author$
* Created by Filip Biedziak, NLE, 2020-08-05
*/
#pragma once
#include <QHash>
#include "base.h"
namespace InfrastructureManagement
{
class ObjectEffectArea;
class MainHandler;
class HandlerEffectArea final : public Base
{
public:
explicit HandlerEffectArea(MainHandler *mainHandler);
~HandlerEffectArea();
bool init();
ObjectEffectArea *createEffectAreaForMse(const InfrastructureManagement::MainStructureElement &mse);
QHash<int, ObjectEffectArea *> getObjectEffectAreaMap() const { return m_objectEffectAreaMap; }
ObjectEffectArea *getEffectAreaFromId(int32_t id) const { return m_objectEffectAreaMap.value(id, nullptr); }
private:
int getSeId(const int mountPointId, const InfrastructureManagement::MainStructureElement &mse) const;
/**
* @brief assetIdsFromJsonArray reads the EGCU IDs of the sound area from a Json object.
* @param jsonObj Json object with an entry 'egcuMountpoints'
* @return vector with EGCU IDs
*/
std::vector<int32_t> egcuIdsFromJsonObject(const QJsonObject &jsonObj, const MainStructureElement &mse) const;
/**
* @brief geometryFromJsonArray reads the vertices of the sound area from a Json object.
* @param jsonObj Json object with an entry 'geometry'
* @return vector with 2D geo coordinates
*/
std::vector<Core::GeoPosition2D> geometryFromJsonObject(const QJsonObject &jsonObj) const;
private:
QHash<int32_t, ObjectEffectArea *> m_objectEffectAreaMap;
};
} // namespace InfrastructureManagement