/** * Exercise object * $Id$ * $HeadURL$ * $Author$ */ #pragma once #include "logger.h" #include "handler_pdm_data.h" #include #include #include #include namespace EffectShowManagement { /** * @brief Creates the Effect Show data from the Area Effect Simulation data for mine areas. * * For the Effect Show data to be created see ICD GUEZSB60_ICD-0046C. * For calculations the mathematical x-axis is mapped to east; the y-axis is mapped to north. * * List of features:\n * (1)The area for the effect show is limited to 300m x 300m in a grid of 50m.\n * (2)One effect show area is mapped to the middle segment of the segments of the mine area.\n * (3)The number of volleys is fixed to 18 volleys\n * (4)The duration of the effect show is set to "duration of mine area" / 10.\n * (5)The start time of the effect show is calculated as follows:\n * "start time mine area" + "duration mine area" - "duration of the effect show"\n * (6)The type of ammunition is determined by the chargeType of the mine area and the * "tas code indirect" of the Project Data Management.\n */ class EffectShowMineArea { public: explicit EffectShowMineArea(const AreaEffectSimulation::MineArea &mineArea); /** * @brief Returns the Effect Show. * @return The Effect Show */ Database::EsmEffectShow getEffectShow(); /** * @brief Updates the following data: startTime, duration, typeOfAmmunition. * @param[in] data The Effect Show to be updated * @param[out] data The updated Effect Show */ void updateEffectShow(Database::EsmEffectShow &data); /** * @brief Returns the segment of the mine area to be used for effect show. * The middle segment shall be used for the effect show. * @return Segment of the mine area to be used for the effect show */ static const AreaEffectSimulation::MineSegment &getEffectShowSegment(const AreaEffectSimulation::MineArea &mineArea) { return mineArea.segments().at(mineArea.segments().size() / 2); } private: /** * @brief Calculates the center position and the lower left position of the effect area. */ void calculatePositions(); /** * @brief Returns the width of the effect area. * Width is the length of the mine area segment. * @return Width of the effect area. The resolution of the value is 50m. (Max: 300m) */ int getEffectAreaWidth() const; /** * @brief Returns the Depth of the effect area. * Depth is the width of the mine area segment. * @return Depth of the effect area. The resolution of the value is 50m. (Max: 300m) */ int getEffectAreaDepth() const; /** * @brief Turns position p arround position c. * @param[in] p Point to be rotated * @param[in] c Center point of rotation * @param[in] angle Angle of rotation * @return Depth of the effect area. The resolution of the value is 50m. (Max: 300m) */ static LtsCoordTrans::UtmCoordinate rotate(const LtsCoordTrans::UtmCoordinate &p, const LtsCoordTrans::UtmCoordinate &c, double angle); private: AreaEffectSimulation::MineArea const m_mineArea; const AreaEffectSimulation::MineSegment &m_segment; int m_utmZone; LtsCoordTrans::UtmCoordinate m_centerPos; LtsCoordTrans::UtmCoordinate m_lowerLeftPos; double m_rotation; // math angle [degree] NGL::INGLLogger &m_logger; }; }