Files
qt-migration-legatus/qt5-before/dlbo/Lts/Viewer/SituationMap/MathUtils/matrix2d.cpp
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

115 lines
2.7 KiB
C++

/**
**
** @RDE_HEADER@
** Implementation of 2d matrix operations
** $Id$
** $HeadURL$
** $Author$
**
** -----------------------------------------------------------------------------------------------
**
** Hardware-Environment: Intel-PC
** Software-Environment: Windows 7, Qt 5.4. ArcGIS 10.2.5
**
** Language ........: C++ 11
**
** -----------------------------------------------------------------------------------------------
**
** Author ...........: Jörg Turla, SPD G, Tel. 3132
**
** -----------------------------------------------------------------------------------------------
**
** Notes .........:
**
** 22.06.2016, JT : First edition for use with Qt5
**
** -----------------------------------------------------------------------------------------------
*/
#include "matrix2d.h"
#include <sstream>
namespace SituationMap { namespace MathUtils
{
QPointF Matrix2D::apply( const QPointF & v ) const
{
QGenericMatrix<1,3,qreal> vM;
vM(0,0) = v.x();
vM(1,0) = v.y();
vM(2,0) = 1.0;
QGenericMatrix<1,3,qreal> result = m_matrix * vM;
qreal x = result(0,0) / result(2,0);
qreal y = result(1,0) / result(2,0);
return QPointF(x,y);
} /* Matrix2D::apply */
void Matrix2D::putTranslation( const QPointF & t )
{
QGenericMatrix<3,3,qreal> tM;
tM(0,2) = t.x();
tM(1,2) = t.y();
m_matrix = tM * m_matrix;
} /* Matrix2D::putTranslation */
void Matrix2D::putScale( const QPointF & s)
{
QGenericMatrix<3,3,qreal> sM;
sM(0,0) = s.x();
sM(1,1) = s.y();
m_matrix = sM * m_matrix;
} /* Matrix2D::putScale */
void Matrix2D::putScale( const QPointF & s, qreal sinPhi, qreal cosPhi )
{
putRotate(QPointF(cosPhi,-sinPhi));
putScale(s);
putRotate(sinPhi,cosPhi);
} /* Matrix2D::putScale */
void Matrix2D::putRotate( qreal sinPhi, qreal cosPhi )
{
QGenericMatrix<3,3,qreal> rM;
rM(0,0) = cosPhi;
rM(0,1) = sinPhi;
rM(1,0) = -sinPhi;
rM(1,1) = cosPhi;
m_matrix = rM * m_matrix;
} /* Matrix2D::putRotate */
std::ostream & operator<< ( std::ostream & stream, const Matrix2D & mat )
{
stream << "Matrix2D:" << std::endl;
for (int r = 0; r < 3; ++r)
{
for (int c = 0; c < 3; ++c)
{
stream << "[" << r << "," << c << "] = " << mat(r,c) << " ";
}
stream << std::endl;
}
return stream;
} // std::ostream & operator<< ( std::ostream & stream, const Matrix2D & mat )
} } // namespace SituationMap::MathUtils