Files
qt-migration-legatus/qt5-before/dlbo/Lts/Plugins/BuildingViewer/Common/bdv_controller.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

149 lines
4.8 KiB
C++

/**
* @RDE_HEADER@
* DDS IFC to BuildingViewer
* $Id$
* $HeadURL$
* $Author$
* Created by Philipp Last, SLSY, 2017-08-14
*/
#pragma once
#include <QObject>
#include <QTimer>
#include <QString>
#include <Common/buildingviewercommon_export.h>
#include <BuildingViewer/share/exccommands.h>
#include <LtsWidgets/lts_dialog.h>
#include <LtsSession/lts_session_data_dds.h>
#include <memory>
#include "logger.h"
#include "bdv_helper.h"
#include "BgViewer/viewerCtrl/mainloop.h"
class QWidget;
namespace LtsPluginManager
{
class LtsPluginManager;
}
/*
* Initialization sequence:
*
* CommunicationInterface:
* 1. BgViewer is started as an external application
* 1.1 A network connection is established
* 1.2 The BgViewer window is "stolen" by requesting the window id via network
* 1.3 Signal 'signalBgViewerInitFinished' is emitted
*
* BuildingViewerDdsController:
* 2. DdsController receives this signal and sets the current training area
* 2.1 BgViewer respectively emits 'signalBgViewerInitFinished' when the BgViewer loaded all models
* 2.2 Mounting points, teams, participants, etc. are transmitted to the BgViewer
* 2.3 DdsController emits 'signalDdsInitFinished'
*
* Finally, the signal 'signalDdsInitFinished' may be used to start requests to the BgViewer, e.g., requesting the Building list.
*/
namespace BuildingViewer
{
class CommunicationInterfaceInternal;
class BuildingViewerDdsController;
class PluginProvider;
class BUILDINGVIEWERCOMMON_EXPORT BgViewerController : public QObject
{
Q_OBJECT
public:
explicit BgViewerController(QObject *parent = nullptr);
~BgViewerController();
void clearInterfaces(const LtsSession::DdsConnectionParams &conParams);
bool isBgViewerApplicationRunning() const;
LtsSession::DdsConnectionParams currentDdsConnParams() const;
bool startBgViewerAppInSession(PluginProvider *pStartingSession);
void openBuilding(const QString &strBuildingFeatureId);
void closeBuilding(const QString &strBuildingFeatureId = QString()); // empty string = all
bool forceInit(PluginProvider *pSession);
void updatePlayerSymbols(int size);
void closeAll();
// Also for/by SkriptPlayer
QWidget *getBgViewerWidget();
bool init(PluginProvider *pSession, bool bStartRendering = false, const QString &modelPath = buildingModelPath());
PluginProvider *activeSession() const;
// from communication interface
void excConnect(const std::vector<std::string> &paths, const QString &strXMLFile = QString());
void excGetBuildingList();
void excGetViewState();
void excHighlightView(const QString &strFeatureID);
void excRestoreViewState(const QJsonValue &state);
void excSetGlobalDotsMode(bool useDots);
void excSetGlobalTransparency(double transparency);
void excSetGlobalViewMode(bool useOrtho);
void excSetHitlineDuration(uint32_t duration_s);
void excStartRecording(const QString &strPathOutputFolder,
const QString &strFeatureID = QStringLiteral("all"),
int w = 800, int h = 600,
int framerate = 20, int quality = 100);
void excStopRecording(const QString &strFeatureID = QStringLiteral("all"));
static QString buildingModelPath();
LtsPluginManager::LtsPluginManager *app() { return m_bgvApp; }
Q_SIGNALS:
void bgvAppIsInitialized();
// from communication interface
void signalBgViewerInitFinished();
void signalReceivedBuildingList(const QVector<BuildingTuple> &list);
void signalReceivedViewState(const QJsonValue &state);
void signalViewerEventButton();
void signalPlayerPicked(int playerId);
void signalAssetPicked(int structureElementId);
void signalViewerEventWidgetClosed(const QString &featureID);
void signalViewerEventWidgetMaximized(const QString &featureID);
void signalViewerEventWidgetMinimized(const QString &featureID);
void signalViewerEventWidgetFocused(const QString &featureID);
void signalViewerEventRoomNameClicked(const QString &featureID, const QString &roomID);
void signalViewerZoomChanged(const QString &featureId, double top, double left, double bottom, double right);
public slots:
void slotStartRecording(const QString &strFolderPath, const QJsonValue &state);
void slotStopRecording();
void hideLiveVideo();
private slots:
void slotLoadBuilding();
void slotWidgetReleased();
private:
void showBgViewerInfoMessageBox();
private:
VCtrl::MainLoop m_mainloop;
bool m_widgetStolen;
std::vector<std::string> m_buildingsToShow;
CommunicationInterfaceInternal *m_comIfc{nullptr};
VCtrl::ViewerInterface *m_viewerInterface{nullptr};
BuildingViewerDdsController *m_pBgViewerDDSController;
bool m_initExerciseWasSuccessful{false};
LtsSession::DdsConnectionParams m_currentDdsConnParams;
LtsPluginManager::LtsPluginManager *m_bgvApp;
bool m_bgvAppIsInitialized{false};
QTimer *m_tickTimer{nullptr};
QWidget *m_bgViewerBaseLayoutWidget{nullptr};
LOGGER_T m_logger;
};
}