Files
qt-migration-legatus/qt5-before/dlbo/Lts/Viewer/SituationMap/MathUtils/simple_helper.h
T
torstenandCopilot 7173785915 Qt6 Migration: Complete migration with DDS/RTI support and build validation
Major Changes:
- Merged latest Qt5 devel content from dlbo (292 files changed, 7 new dirs)
- Consolidated forward-declarations and include folders
- Removed unneeded modules per Niklas' repo check list

Build System Fixes:
- Fixed CMake VERSION_GREATER syntax in ParticipantManagement/CMakeLists.txt
- Added VLC packages (libvlc-dev, vlc-plugin-base) to docker_build.sh
- Added PostgreSQL dev packages (libpq-dev, postgresql-server-dev-all) to Dockerfile
- Fixed locale warnings (ANSI_X3.4-1968 → C.UTF-8)
- Fixed ArcGIS SDK path warnings when BUILD_ARCGIS=OFF

Code Generation Fixes:
- Fixed IDL enum collisions (PortType→CorePortType/DdsutPortType, PdmEventType)
- Fixed Grantlee template svc_translation.cpp.grantlee:
  - Changed {{ idl_enum.name }}_def:: to {{ idl_enum.name }}::
  - Fixed .underlying() calls for C++11 scoped enums (enum class)
- Removed generated files from repo (moc_*, *_dtc.h, *_ftc.h)

Validation:
- BUILD_RTI=ON: SUCCESS
- BUILD_RTI=OFF: SUCCESS
- C++17 standard maintained for RTI 7.7 compatibility
- Ubuntu 26.04 Docker environment verified

Remaining Warnings (expected):
- BgViewer, KDChart, KDReports, Poppler-Qt6 not found (optional features)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-09-15 18:20:26 +00:00

131 lines
3.5 KiB
C++

/**
* @RDE_HEADER@
* Helper functions related to CoordinateTranslation
* $Id$
* $HeadURL$
* $Author$
*/
#pragma once
// Own
#include "situation_map_export.h"
#include <Map/point3D.h>
// Qt
#include <QPointF>
#include <QPolygonF>
// ESRI
//----------------------------------------------------------------------------
namespace SituationMap
{
namespace MathUtils
{
/**
@brief Rotate a 2 dimensional point
@param p point to rotate
@param center center point of rotation
@param sinA sinus of rotation angle
@param cosA cosinus of rotation angle
*/
QPointF SITUATIONMAP_EXPORT rotate(const QPointF &p, const QPointF &center, qreal sinA, qreal cosA);
/**
@brief Rotate a 2 dimensional point
@param p point to rotate
@param center center point of rotation
@param phi rotation angle in rad
*/
QPointF SITUATIONMAP_EXPORT rotate(const QPointF &p, const QPointF &center, qreal phi);
/**
* @brief Get math angle in radiant from orientation vector
* @param oVec orientation vector, must be normalized to length 1
* @return mathematical angle in rad
*/
qreal SITUATIONMAP_EXPORT getMathAngle(const QPointF &oVec);
/**
* @brief Get math angle in radiant from sinus and cosinus
* @param sinPhi sinus of angle, is equal to y component of orientation vector
* @param cosPhi cosinus of angle, is equal to x component of orientation vector
* @return mathematical angle in rad
*/
qreal SITUATIONMAP_EXPORT getMathAngle(qreal sinPhi, qreal cosPhi);
double SITUATIONMAP_EXPORT getAngleDegreeNorth(const QPointF &p1, const QPointF &p2);
/**
* @brief Get North angle from Math angle
* @param mathematical orientated angle in degree
* @return north (0° = 12h) orientated angle in degree
*/
qreal SITUATIONMAP_EXPORT getAngleDegree2North(qreal angleDeg);
/**
* @brief Get North angle from Math angle
* @param mathematical orientated angle in degree
* @return math (0° = 3h) orientated angle in degree
*/
qreal SITUATIONMAP_EXPORT getAngleDegree2Math(qreal angleDeg);
/**
* @brief Get the position on a given line (for positioning a text)
* @param p1 startPoint of line
* @param p2 endPoint of line
* @param position_0_to_1 value from 0.0 up to 1.0.
* 0.0 -> 0% -> startPoint
* 0.5 -> 50% -> middle between startPoint and endPoint
* 1.0 -> 100% -> endPoint
* @return position between start and end.
*/
QPointF SITUATIONMAP_EXPORT getPointOnLine(const QPointF &p1, const QPointF &p2, double position_0_to_1);
Point3D SITUATIONMAP_EXPORT getPointOnLine(const Point3D &p1, const Point3D &p2, double position_0_to_1);
/**
* @brief getCircleSectorPolygon
* @param centerPoint [geo coordinates]
* @param radius [m]
* @param rotationAngleDeg (orientation of segment)
* @param centralAngleDeg
* @return polygon describing the circle sector
*/
QPolygonF SITUATIONMAP_EXPORT getCircleSectorPolygon(const QPointF &centerPoint, qreal radius, double rotationAngleDeg, double centralAngleDeg);
/**
* @brief Rotate a point around with another point as center.
* @param pToBeRotated Point to be rotated
* @param center Center
* @param angleDegree Angle in degree (clockwise).
*/
void SITUATIONMAP_EXPORT rotatePoint(QPointF &pToBeRotated,
const QPointF &center,
double angleDegree);
QList<QPointF> SITUATIONMAP_EXPORT mineFieldCenterLineToOutline(const QList<QPointF> &centerLine,
double width);
} // namespace MathUtils
} // namespace SituationMap