Close bld/OSG floor: OSG 3.4.1 from source + port osgQt to Qt6 + wire BgViewer dtEntity
Migrate BuildingViewer (16 files: DDS members, m_logger inits, QOpenGLWidget); gui:3:bld.info + gui:3:bdv now load
This commit is contained in:
17 files changed
+360
-219
No files matched your search
+2
-1
@@ -125,7 +125,8 @@ class Shot
|
|||||||
Shot(const int32_t id, const osg::Vec3d& shooterPos, const osg::Vec3d& targetPos, int buildingIdSrc,
|
Shot(const int32_t id, const osg::Vec3d& shooterPos, const osg::Vec3d& targetPos, int buildingIdSrc,
|
||||||
int rommNumberSrc, int buildingIdDst, int rommNumberDst, int lineType, const osg::Vec4& color,
|
int rommNumberSrc, int buildingIdDst, int rommNumberDst, int lineType, const osg::Vec4& color,
|
||||||
unsigned int duration_s, unsigned int durationMax_s, double simTimeCreated)
|
unsigned int duration_s, unsigned int durationMax_s, double simTimeCreated)
|
||||||
: mId(id), mShooterPos(shooterPos), mTargetPos(targetPos), mBuildingIdSrc(buildingIdSrc),
|
: m_logger(BuildingViewer::getLogger("Shot")), mId(id), mShooterPos(shooterPos),
|
||||||
|
mTargetPos(targetPos), mBuildingIdSrc(buildingIdSrc),
|
||||||
mRoomNumberSrc(rommNumberSrc), mBuildingIdDst(buildingIdDst), mRoomNumberDst(rommNumberDst),
|
mRoomNumberSrc(rommNumberSrc), mBuildingIdDst(buildingIdDst), mRoomNumberDst(rommNumberDst),
|
||||||
mLineType(lineType), mColor(color), mDuration_s(duration_s), m_DurationMax_s(durationMax_s),
|
mLineType(lineType), mColor(color), mDuration_s(duration_s), m_DurationMax_s(durationMax_s),
|
||||||
mSimTimeCreated(simTimeCreated)
|
mSimTimeCreated(simTimeCreated)
|
||||||
|
|||||||
+1
@@ -180,6 +180,7 @@ CtrlImpl::CtrlImpl(dtEntity::EntityManager &em, QWidget *parentWidget)
|
|||||||
, mPaused(false)
|
, mPaused(false)
|
||||||
, mNonRealtimeMode(false)
|
, mNonRealtimeMode(false)
|
||||||
, mFrameRate(30)
|
, mFrameRate(30)
|
||||||
|
, m_logger(BuildingViewer::getLogger("CtrlImpl"))
|
||||||
{
|
{
|
||||||
if (!mEntityManager->GetES(mMapSystem) ||
|
if (!mEntityManager->GetES(mMapSystem) ||
|
||||||
!mEntityManager->GetES(mPlayerSystem))
|
!mEntityManager->GetES(mPlayerSystem))
|
||||||
|
|||||||
+2
-2
@@ -3,7 +3,7 @@
|
|||||||
#include <QtWidgets/QApplication>
|
#include <QtWidgets/QApplication>
|
||||||
#include <QtWidgets/QVBoxLayout>
|
#include <QtWidgets/QVBoxLayout>
|
||||||
#include <QtCore/QEvent>
|
#include <QtCore/QEvent>
|
||||||
#include <QGLWidget>
|
#include <QtOpenGLWidgets/QOpenGLWidget>
|
||||||
#include <QWindow>
|
#include <QWindow>
|
||||||
#include <dtEntity/log.h>
|
#include <dtEntity/log.h>
|
||||||
|
|
||||||
@@ -176,7 +176,7 @@ void ViewWidget::viewModeChanged()
|
|||||||
|
|
||||||
bool ViewWidget::isOpenGlWindowExposed() const
|
bool ViewWidget::isOpenGlWindowExposed() const
|
||||||
{
|
{
|
||||||
QGLWidget *gl = qobject_cast<QGLWidget*>(m_pView);
|
QOpenGLWidget *gl = qobject_cast<QOpenGLWidget*>(m_pView);
|
||||||
if (!gl || !gl->windowHandle())
|
if (!gl || !gl->windowHandle())
|
||||||
return false;
|
return false;
|
||||||
return gl->windowHandle()->isExposed();
|
return gl->windowHandle()->isExposed();
|
||||||
|
|||||||
+4
-4
@@ -4,7 +4,6 @@
|
|||||||
#include <osg/Material>
|
#include <osg/Material>
|
||||||
#include <osg/BlendFunc>
|
#include <osg/BlendFunc>
|
||||||
#include <osg/BlendColor>
|
#include <osg/BlendColor>
|
||||||
#include <QStringRef>
|
|
||||||
#include <QtCore/QVector>
|
#include <QtCore/QVector>
|
||||||
|
|
||||||
namespace VCtrl
|
namespace VCtrl
|
||||||
@@ -87,10 +86,11 @@ void SplitVisitor::apply(osg::Group &node)
|
|||||||
for (unsigned int i = 0; i < node.getNumDescriptions(); ++i)
|
for (unsigned int i = 0; i < node.getNumDescriptions(); ++i)
|
||||||
{
|
{
|
||||||
QString descr = QString::fromStdString(node.getDescription(i));
|
QString descr = QString::fromStdString(node.getDescription(i));
|
||||||
const QVector<QStringRef> descprt = descr.splitRef(QLatin1Char(';'));
|
// Qt6: QStringRef removed; split()/splitRef() both return QVector<QString>
|
||||||
for (const QStringRef &prt : descprt)
|
const QVector<QString> descprt = descr.split(QLatin1Char(';'));
|
||||||
|
for (const QString &prt : descprt)
|
||||||
{
|
{
|
||||||
const QVector<QStringRef> items = prt.split(QLatin1Char('='));
|
const QVector<QString> items = prt.split(QLatin1Char('='));
|
||||||
if (items.size() == 2 && items[0] == QLatin1String("base_height"))
|
if (items.size() == 2 && items[0] == QLatin1String("base_height"))
|
||||||
h = items[1].toFloat();
|
h = items[1].toFloat();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -113,6 +113,7 @@ if(QT6_GUI_AVAILABLE)
|
|||||||
NGL_TARGET_LINK_LIBRARIES(BuildingViewerCommon
|
NGL_TARGET_LINK_LIBRARIES(BuildingViewerCommon
|
||||||
PRIVATE
|
PRIVATE
|
||||||
Qt6::OpenGL
|
Qt6::OpenGL
|
||||||
|
Qt6::OpenGLWidgets
|
||||||
${OPENGL_LIBRARIES}
|
${OPENGL_LIBRARIES}
|
||||||
${BGVIEWER_DTENTITYOSG_LIBRARY}
|
${BGVIEWER_DTENTITYOSG_LIBRARY}
|
||||||
${BGVIEWER_DTENTITY_LIBRARY}
|
${BGVIEWER_DTENTITY_LIBRARY}
|
||||||
@@ -126,6 +127,7 @@ NGL_TARGET_INCLUDE_DIRECTORIES(BuildingViewerCommon
|
|||||||
${CMAKE_CURRENT_SOURCE_DIR}/BgViewer/viewerCtrl
|
${CMAKE_CURRENT_SOURCE_DIR}/BgViewer/viewerCtrl
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/../share
|
${CMAKE_CURRENT_SOURCE_DIR}/../share
|
||||||
${OSG_INCLUDE_DIR}
|
${OSG_INCLUDE_DIR}
|
||||||
|
${BGVIEWER_INCLUDE_DIR}
|
||||||
)
|
)
|
||||||
|
|
||||||
IF (NOT WIN32)
|
IF (NOT WIN32)
|
||||||
|
|||||||
+11
-8
@@ -3,6 +3,7 @@
|
|||||||
#include "bdv_communication_interface_internal.h"
|
#include "bdv_communication_interface_internal.h"
|
||||||
|
|
||||||
#include <ParticipantManagement/ppm_translation.h>
|
#include <ParticipantManagement/ppm_translation.h>
|
||||||
|
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||||
#include <QtCore/QTimer>
|
#include <QtCore/QTimer>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
@@ -29,7 +30,8 @@ static inline std::string createRoomNumberString(int roomNumber)
|
|||||||
}
|
}
|
||||||
|
|
||||||
CommunicationInterfaceInternal::CommunicationInterfaceInternal(VCtrl::ViewerInterface* pviewerInterface)
|
CommunicationInterfaceInternal::CommunicationInterfaceInternal(VCtrl::ViewerInterface* pviewerInterface)
|
||||||
: m_pviewerInterface(pviewerInterface)
|
: m_pviewerInterface(pviewerInterface),
|
||||||
|
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("BuildingViewer.CommunicationInterfaceInternal"))
|
||||||
{
|
{
|
||||||
assert(m_pviewerInterface);
|
assert(m_pviewerInterface);
|
||||||
}
|
}
|
||||||
@@ -203,10 +205,10 @@ void CommunicationInterfaceInternal::setTeamConfiguration(const QMap<qint32, Par
|
|||||||
for (const ParticipantManagement::Party& party : parties)
|
for (const ParticipantManagement::Party& party : parties)
|
||||||
{
|
{
|
||||||
BdvParty bdvParty;
|
BdvParty bdvParty;
|
||||||
bdvParty.id = party.id();
|
bdvParty.id = party.id;
|
||||||
bdvParty.name = ParticipantManagement::trPartyName(party.name());
|
bdvParty.name = ParticipantManagement::trPartyName(party.name);
|
||||||
|
|
||||||
const uint32_t argb = party.color();
|
const uint32_t argb = party.color;
|
||||||
bdvParty.color.w = (((argb >> 24) & 0xff) / 255.);
|
bdvParty.color.w = (((argb >> 24) & 0xff) / 255.);
|
||||||
bdvParty.color.x = (((argb >> 16) & 0xff) / 255.);
|
bdvParty.color.x = (((argb >> 16) & 0xff) / 255.);
|
||||||
bdvParty.color.y = (((argb >> 8) & 0xff) / 255.);
|
bdvParty.color.y = (((argb >> 8) & 0xff) / 255.);
|
||||||
@@ -256,9 +258,9 @@ void CommunicationInterfaceInternal::systemSetMountingPoint(const Infrastructure
|
|||||||
{
|
{
|
||||||
int buildingId = data.buildingId();
|
int buildingId = data.buildingId();
|
||||||
const QString& mountingPointName = filename;
|
const QString& mountingPointName = filename;
|
||||||
double x = data.relPosition().offsetX();
|
double x = data.relPosition().offsetX;
|
||||||
double y = data.relPosition().offsetY();
|
double y = data.relPosition().offsetY;
|
||||||
double z = data.relPosition().offsetZ();
|
double z = data.relPosition().offsetZ;
|
||||||
|
|
||||||
const std::string buildingIdStr = createBuildingIdString(buildingId);
|
const std::string buildingIdStr = createBuildingIdString(buildingId);
|
||||||
|
|
||||||
@@ -446,7 +448,8 @@ static inline bool isPlayerId(const std::string& playerIdString, int* playerId)
|
|||||||
const QString playerIdQString(QString::fromStdString(playerIdString));
|
const QString playerIdQString(QString::fromStdString(playerIdString));
|
||||||
bool bOk = false;
|
bool bOk = false;
|
||||||
if (playerIdQString.startsWith(QLatin1String(PLAYER_PREFIX)))
|
if (playerIdQString.startsWith(QLatin1String(PLAYER_PREFIX)))
|
||||||
*playerId = playerIdQString.midRef(QLatin1String(PLAYER_PREFIX).size()).toInt(&bOk);
|
// Qt6: QString::midRef removed; mid() returns the same substring by value.
|
||||||
|
*playerId = playerIdQString.mid(QLatin1String(PLAYER_PREFIX).size()).toInt(&bOk);
|
||||||
return bOk;
|
return bOk;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
#include <LtsAppManager/lts_app_manager.h>
|
#include <LtsAppManager/lts_app_manager.h>
|
||||||
#include <LtsPluginManager/lts_plugin_manager.h>
|
#include <LtsPluginManager/lts_plugin_manager.h>
|
||||||
#include <LtsSession/lts_session.h>
|
#include <LtsSession/lts_session.h>
|
||||||
|
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||||
#include <QtCore/QDir>
|
#include <QtCore/QDir>
|
||||||
#include <QtWidgets/QMessageBox>
|
#include <QtWidgets/QMessageBox>
|
||||||
#include <ngltools/ngltools_filesystem.h>
|
#include <ngltools/ngltools_filesystem.h>
|
||||||
@@ -22,7 +23,8 @@ static char* argv_dummy[] = {(char*)"Dummy"};
|
|||||||
|
|
||||||
BgViewerController::BgViewerController(QObject* parent)
|
BgViewerController::BgViewerController(QObject* parent)
|
||||||
: QObject(parent), m_mainloop(argc_dummy, argv_dummy, nullptr), m_widgetStolen(false), m_comIfc(nullptr),
|
: QObject(parent), m_mainloop(argc_dummy, argv_dummy, nullptr), m_widgetStolen(false), m_comIfc(nullptr),
|
||||||
m_pBgViewerDDSController(nullptr), m_bgvApp(nullptr), m_tickTimer(new QTimer(this))
|
m_pBgViewerDDSController(nullptr), m_bgvApp(nullptr), m_tickTimer(new QTimer(this)),
|
||||||
|
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("BuildingViewer.BgViewerController"))
|
||||||
{
|
{
|
||||||
m_tickTimer->setInterval(1000 / 25);
|
m_tickTimer->setInterval(1000 / 25);
|
||||||
connect(m_tickTimer, &QTimer::timeout, this, [this]() { m_mainloop.tick(); });
|
connect(m_tickTimer, &QTimer::timeout, this, [this]() { m_mainloop.tick(); });
|
||||||
|
|||||||
+164
-163
@@ -322,11 +322,11 @@ void BuildingViewerDdsController::uninitialize()
|
|||||||
|
|
||||||
QPointF BuildingViewerDdsController::toRelativePosition(const Core::GeoPosition& geoPos) const
|
QPointF BuildingViewerDdsController::toRelativePosition(const Core::GeoPosition& geoPos) const
|
||||||
{
|
{
|
||||||
if (std::isnan(geoPos.lon()) || std::isnan(geoPos.lat()) || qIsNull(geoPos.lon()) || qIsNull(geoPos.lat()))
|
if (std::isnan(geoPos.lon) || std::isnan(geoPos.lat) || qIsNull(geoPos.lon) || qIsNull(geoPos.lat))
|
||||||
return {};
|
return {};
|
||||||
|
|
||||||
LtsCoordTrans::UtmCoordinate coord(
|
LtsCoordTrans::UtmCoordinate coord(
|
||||||
LtsCoordTrans::UtmCoordinate::fromGeographic(geoPos.lon(), geoPos.lat(), m_baseCoordinate.zone));
|
LtsCoordTrans::UtmCoordinate::fromGeographic(geoPos.lon, geoPos.lat, m_baseCoordinate.zone));
|
||||||
return coord.relativeTo(m_baseCoordinate);
|
return coord.relativeTo(m_baseCoordinate);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -335,7 +335,7 @@ LtsUtils::QPoint3D BuildingViewerDdsController::toRelative3D(const Core::GeoPosi
|
|||||||
const auto ret = toRelativePosition(geoPos);
|
const auto ret = toRelativePosition(geoPos);
|
||||||
if (ret.isNull())
|
if (ret.isNull())
|
||||||
return {};
|
return {};
|
||||||
return LtsUtils::QPoint3D(ret.x(), ret.y(), geoPos.z());
|
return LtsUtils::QPoint3D(ret.x(), ret.y(), geoPos.z);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BuildingViewerDdsController::clear()
|
bool BuildingViewerDdsController::clear()
|
||||||
@@ -371,12 +371,12 @@ bool BuildingViewerDdsController::calcBaseCoordinate(
|
|||||||
if (!bAtLeasOneFound)
|
if (!bAtLeasOneFound)
|
||||||
{
|
{
|
||||||
bAtLeasOneFound = true;
|
bAtLeasOneFound = true;
|
||||||
geoPosition = mse.geoPosition();
|
geoPosition = mse.geoPosition;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
geoPosition.lat() = std::min(geoPosition.lat(), mse.geoPosition().lat());
|
geoPosition.lat = std::min(geoPosition.lat, mse.geoPosition.lat);
|
||||||
geoPosition.lon() = std::min(geoPosition.lon(), mse.geoPosition().lon());
|
geoPosition.lon = std::min(geoPosition.lon, mse.geoPosition.lon);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!bAtLeasOneFound)
|
if (!bAtLeasOneFound)
|
||||||
@@ -384,7 +384,7 @@ bool BuildingViewerDdsController::calcBaseCoordinate(
|
|||||||
WARNING_LOG(m_logger) << "No building available in exercise " << m_exerciseId;
|
WARNING_LOG(m_logger) << "No building available in exercise " << m_exerciseId;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
m_baseCoordinate = LtsCoordTrans::UtmCoordinate::fromGeographic(geoPosition.lon(), geoPosition.lat());
|
m_baseCoordinate = LtsCoordTrans::UtmCoordinate::fromGeographic(geoPosition.lon, geoPosition.lat);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -422,11 +422,11 @@ bool BuildingViewerDdsController::writeBuildingDataToXML(const QString& modelPat
|
|||||||
const auto bi = BuildingInfo::fromJson(ele.toObject());
|
const auto bi = BuildingInfo::fromJson(ele.toObject());
|
||||||
if (!bi.isValid())
|
if (!bi.isValid())
|
||||||
continue;
|
continue;
|
||||||
mse.id(bi.id);
|
mse.id = bi.id;
|
||||||
mse.angle(bi.angleDegree);
|
mse.angle = bi.angleDegree;
|
||||||
mse.geoPosition(Core::GeoPosition(bi.position.x(), bi.position.y(), bi.position.z()));
|
mse.geoPosition = Core::GeoPosition(bi.position.x(), bi.position.y(), bi.position.z());
|
||||||
mse.name(bi.name.toStdString());
|
mse.name = bi.name.toStdString();
|
||||||
mseMap.insert(mse.id(), mse);
|
mseMap.insert(mse.id, mse);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -435,17 +435,17 @@ bool BuildingViewerDdsController::writeBuildingDataToXML(const QString& modelPat
|
|||||||
const auto mMap = m_ismDtc->mainStructureElements();
|
const auto mMap = m_ismDtc->mainStructureElements();
|
||||||
for (const auto& mse : mMap)
|
for (const auto& mse : mMap)
|
||||||
{
|
{
|
||||||
if (mse.modelId() == 0)
|
if (mse.modelId == 0)
|
||||||
continue;
|
continue;
|
||||||
if (!m_ismDtc->isElementAssignedToExercise(mse, m_exerciseId))
|
if (!m_ismDtc->isElementAssignedToExercise(mse, m_exerciseId))
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger)
|
DEBUG_LOG(m_logger)
|
||||||
<< "Not writing mse with id " << mse.id()
|
<< "Not writing mse with id " << mse.id
|
||||||
<< " to building xml file since it is not assigned to the current exercise which has id "
|
<< " to building xml file since it is not assigned to the current exercise which has id "
|
||||||
<< m_exerciseId;
|
<< m_exerciseId;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
mseMap.insert(mse.id(), mse);
|
mseMap.insert(mse.id, mse);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
INFO_LOG(m_logger) << getSessionInfo()
|
INFO_LOG(m_logger) << getSessionInfo()
|
||||||
@@ -460,7 +460,7 @@ bool BuildingViewerDdsController::writeBuildingDataToXML(const QString& modelPat
|
|||||||
QXmlStreamWriter sw(&f);
|
QXmlStreamWriter sw(&f);
|
||||||
sw.setAutoFormatting(true);
|
sw.setAutoFormatting(true);
|
||||||
sw.setAutoFormattingIndent(2);
|
sw.setAutoFormattingIndent(2);
|
||||||
sw.setCodec("UTF-8");
|
// Qt6: QXmlStreamWriter::setCodec removed; it writes UTF-8 by default.
|
||||||
sw.writeStartDocument(QStringLiteral("1.0"), true);
|
sw.writeStartDocument(QStringLiteral("1.0"), true);
|
||||||
sw.writeStartElement(QStringLiteral("MetaData"));
|
sw.writeStartElement(QStringLiteral("MetaData"));
|
||||||
{
|
{
|
||||||
@@ -478,28 +478,28 @@ bool BuildingViewerDdsController::writeBuildingDataToXML(const QString& modelPat
|
|||||||
|
|
||||||
for (const InfrastructureManagement::MainStructureElement& mse : std::as_const(mseMap))
|
for (const InfrastructureManagement::MainStructureElement& mse : std::as_const(mseMap))
|
||||||
{
|
{
|
||||||
m_knownBuildings += mse.id();
|
m_knownBuildings += mse.id;
|
||||||
|
|
||||||
sw.writeStartElement(QStringLiteral("Model"));
|
sw.writeStartElement(QStringLiteral("Model"));
|
||||||
sw.writeAttribute(QStringLiteral("Type"), QStringLiteral("House"));
|
sw.writeAttribute(QStringLiteral("Type"), QStringLiteral("House"));
|
||||||
{
|
{
|
||||||
const QString name(QString::fromStdString(mse.name()));
|
const QString name(QString::fromStdString(mse.name));
|
||||||
sw.writeStartElement(QStringLiteral("Description"));
|
sw.writeStartElement(QStringLiteral("Description"));
|
||||||
sw.writeAttribute(QStringLiteral("Name"), name);
|
sw.writeAttribute(QStringLiteral("Name"), name);
|
||||||
sw.writeEndElement();
|
sw.writeEndElement();
|
||||||
sw.writeStartElement(QStringLiteral("Feature"));
|
sw.writeStartElement(QStringLiteral("Feature"));
|
||||||
sw.writeAttribute(QStringLiteral("Id"), BuildingViewer::databaseId2FeatureId(mse.id()));
|
sw.writeAttribute(QStringLiteral("Id"), BuildingViewer::databaseId2FeatureId(mse.id));
|
||||||
sw.writeEndElement();
|
sw.writeEndElement();
|
||||||
sw.writeStartElement(QStringLiteral("Orientation"));
|
sw.writeStartElement(QStringLiteral("Orientation"));
|
||||||
|
|
||||||
sw.writeAttribute(QStringLiteral("Angle"), QString::number(360 - mse.angle()));
|
sw.writeAttribute(QStringLiteral("Angle"), QString::number(360 - mse.angle));
|
||||||
sw.writeEndElement();
|
sw.writeEndElement();
|
||||||
|
|
||||||
const QPointF offset(toRelativePosition(mse.geoPosition()));
|
const QPointF offset(toRelativePosition(mse.geoPosition));
|
||||||
sw.writeStartElement(QStringLiteral("Position"));
|
sw.writeStartElement(QStringLiteral("Position"));
|
||||||
sw.writeAttribute(QStringLiteral("X"), QString::number(offset.x(), 'f', 13));
|
sw.writeAttribute(QStringLiteral("X"), QString::number(offset.x(), 'f', 13));
|
||||||
sw.writeAttribute(QStringLiteral("Y"), QString::number(offset.y(), 'f', 13));
|
sw.writeAttribute(QStringLiteral("Y"), QString::number(offset.y(), 'f', 13));
|
||||||
sw.writeAttribute(QStringLiteral("Z"), QString::number(mse.geoPosition().z(), 'f', 13));
|
sw.writeAttribute(QStringLiteral("Z"), QString::number(mse.geoPosition.z, 'f', 13));
|
||||||
sw.writeEndElement();
|
sw.writeEndElement();
|
||||||
sw.writeStartElement(QStringLiteral("File"));
|
sw.writeStartElement(QStringLiteral("File"));
|
||||||
sw.writeAttribute(QStringLiteral("Name"), name + QStringLiteral(".flt"));
|
sw.writeAttribute(QStringLiteral("Name"), name + QStringLiteral(".flt"));
|
||||||
@@ -552,7 +552,7 @@ void BuildingViewerDdsController::onReplayChanged(const SituationReplay::SitRepl
|
|||||||
{
|
{
|
||||||
Q_UNUSED(modType)
|
Q_UNUSED(modType)
|
||||||
|
|
||||||
switch (srp.state())
|
switch (srp.state)
|
||||||
{
|
{
|
||||||
case SituationReplay::SrpState::Stopped:
|
case SituationReplay::SrpState::Stopped:
|
||||||
m_connection->setSimuationPace(1.0);
|
m_connection->setSimuationPace(1.0);
|
||||||
@@ -560,7 +560,7 @@ void BuildingViewerDdsController::onReplayChanged(const SituationReplay::SitRepl
|
|||||||
break;
|
break;
|
||||||
case SituationReplay::SrpState::Started:
|
case SituationReplay::SrpState::Started:
|
||||||
case SituationReplay::SrpState::Resumed:
|
case SituationReplay::SrpState::Resumed:
|
||||||
m_connection->setSimuationPace(srp.pace());
|
m_connection->setSimuationPace(srp.pace);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case SituationReplay::SrpState::Paused:
|
case SituationReplay::SrpState::Paused:
|
||||||
@@ -629,7 +629,7 @@ void BuildingViewerDdsController::handleMountingPoint(const InfrastructureManage
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
QVector3D position(mp.relPosition().offsetX(), mp.relPosition().offsetY(), mp.relPosition().offsetZ());
|
QVector3D position(mp.relPosition().offsetX, mp.relPosition().offsetY, mp.relPosition().offsetZ);
|
||||||
QString strfeatureID = BuildingViewer::databaseId2FeatureId(mp.buildingId());
|
QString strfeatureID = BuildingViewer::databaseId2FeatureId(mp.buildingId());
|
||||||
QString strMountingPointID = strfeatureID + QStringLiteral("_MountingPoint_") + QString::number(mountingPointId);
|
QString strMountingPointID = strfeatureID + QStringLiteral("_MountingPoint_") + QString::number(mountingPointId);
|
||||||
|
|
||||||
@@ -712,7 +712,7 @@ void BuildingViewerDdsController::setCurrentTrainingAreaMap(const QString& model
|
|||||||
|
|
||||||
bool BuildingViewerDdsController::isValidParticipant(const ParticipantManagement::Participant& participant) const
|
bool BuildingViewerDdsController::isValidParticipant(const ParticipantManagement::Participant& participant) const
|
||||||
{
|
{
|
||||||
if (participant.id() == 0)
|
if (participant.id == 0)
|
||||||
{
|
{
|
||||||
if (m_logger.isDebugEnabled())
|
if (m_logger.isDebugEnabled())
|
||||||
DEBUG_LOG(m_logger) << getSessionInfo()
|
DEBUG_LOG(m_logger) << getSessionInfo()
|
||||||
@@ -720,32 +720,32 @@ bool BuildingViewerDdsController::isValidParticipant(const ParticipantManagement
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (participant.isDeleted())
|
if (participant.isDeleted)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << getSessionInfo() << "isValidParticipant: Not handling participant with id "
|
DEBUG_LOG(m_logger) << getSessionInfo() << "isValidParticipant: Not handling participant with id "
|
||||||
<< participant.id() << " since it is marked as 'deleted'";
|
<< participant.id << " since it is marked as 'deleted'";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_session == nullptr)
|
if (m_session == nullptr)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!m_session->isVisibleParty(participant.partyId()))
|
if (!m_session->isVisibleParty(participant.partyId))
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << getSessionInfo() << "isValidParticipant: Not handling participant with id "
|
DEBUG_LOG(m_logger) << getSessionInfo() << "isValidParticipant: Not handling participant with id "
|
||||||
<< participant.id() << " since it is not visible for party with id "
|
<< participant.id << " since it is not visible for party with id "
|
||||||
<< participant.partyId();
|
<< participant.partyId;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m_ppmDtc)
|
if (!m_ppmDtc)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
ParticipantManagement::TypeClass tc = m_ppmDtc->type(participant.typeId()).typeClass();
|
ParticipantManagement::TypeClass tc = m_ppmDtc->type(participant.typeId).typeClass;
|
||||||
if (tc == ParticipantManagement::TypeClass::SupportUnit || tc == ParticipantManagement::TypeClass::Unit)
|
if (tc == ParticipantManagement::TypeClass::SupportUnit || tc == ParticipantManagement::TypeClass::Unit)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << getSessionInfo() << "isValidParticipant: Not handling participant with id "
|
DEBUG_LOG(m_logger) << getSessionInfo() << "isValidParticipant: Not handling participant with id "
|
||||||
<< participant.id() << " since its type is 'SupportUnit', 'Unit' or 'Structure'";
|
<< participant.id << " since its type is 'SupportUnit', 'Unit' or 'Structure'";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -787,7 +787,7 @@ void BuildingViewerDdsController::createParticipants()
|
|||||||
auto cb = [this, &positionMap, sizeL](const ParticipantManagement::Participant& part) {
|
auto cb = [this, &positionMap, sizeL](const ParticipantManagement::Participant& part) {
|
||||||
if (!isValidParticipant(part))
|
if (!isValidParticipant(part))
|
||||||
return;
|
return;
|
||||||
createParticipant(part, positionMap.value(part.id()), sizeL);
|
createParticipant(part, positionMap.value(part.id), sizeL);
|
||||||
};
|
};
|
||||||
m_ppmDtc->participants(cb);
|
m_ppmDtc->participants(cb);
|
||||||
|
|
||||||
@@ -826,7 +826,7 @@ void BuildingViewerDdsController::onBoobyTrapChanged(const AreaEffectSimulation:
|
|||||||
switch (modType)
|
switch (modType)
|
||||||
{
|
{
|
||||||
case DataModification::eModified:
|
case DataModification::eModified:
|
||||||
deleteParticipant(990000 + boobyTrap.id());
|
deleteParticipant(990000 + boobyTrap.id);
|
||||||
Q_FALLTHROUGH();
|
Q_FALLTHROUGH();
|
||||||
case DataModification::eAdded: {
|
case DataModification::eAdded: {
|
||||||
int sizeL = LtsUtils::OperatorSettings::getInstance()
|
int sizeL = LtsUtils::OperatorSettings::getInstance()
|
||||||
@@ -836,7 +836,7 @@ void BuildingViewerDdsController::onBoobyTrapChanged(const AreaEffectSimulation:
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case DataModification::eRemoved: {
|
case DataModification::eRemoved: {
|
||||||
deleteParticipant(990000 + boobyTrap.id());
|
deleteParticipant(990000 + boobyTrap.id);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -851,17 +851,17 @@ void BuildingViewerDdsController::onParticipantChanged(const ParticipantManageme
|
|||||||
switch (modType)
|
switch (modType)
|
||||||
{
|
{
|
||||||
case DataModification::eModified:
|
case DataModification::eModified:
|
||||||
deleteParticipant(participant.id());
|
deleteParticipant(participant.id);
|
||||||
Q_FALLTHROUGH();
|
Q_FALLTHROUGH();
|
||||||
case DataModification::eAdded: {
|
case DataModification::eAdded: {
|
||||||
int sizeL = LtsUtils::OperatorSettings::getInstance()
|
int sizeL = LtsUtils::OperatorSettings::getInstance()
|
||||||
->value(QStringLiteral("BgViewer"), QStringLiteral("PlayerSymbolSize"), 20)
|
->value(QStringLiteral("BgViewer"), QStringLiteral("PlayerSymbolSize"), 20)
|
||||||
.toInt();
|
.toInt();
|
||||||
createParticipant(participant, m_ppmDtc->participantPosition(participant.id()), sizeL);
|
createParticipant(participant, m_ppmDtc->participantPosition(participant.id), sizeL);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case DataModification::eRemoved: {
|
case DataModification::eRemoved: {
|
||||||
deleteParticipant(participant.id());
|
deleteParticipant(participant.id);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -878,8 +878,8 @@ void BuildingViewerDdsController::onDynParticipantChanged(const ParticipantManag
|
|||||||
case DataModification::eAdded:
|
case DataModification::eAdded:
|
||||||
case DataModification::eModified:
|
case DataModification::eModified:
|
||||||
if (m_ppmDtc)
|
if (m_ppmDtc)
|
||||||
createParticipant(m_ppmDtc->participant(data.participantId()),
|
createParticipant(m_ppmDtc->participant(data.participantId),
|
||||||
m_ppmDtc->participantPosition(data.participantId()), sizeL);
|
m_ppmDtc->participantPosition(data.participantId), sizeL);
|
||||||
break;
|
break;
|
||||||
case DataModification::eRemoved: {
|
case DataModification::eRemoved: {
|
||||||
break;
|
break;
|
||||||
@@ -890,12 +890,12 @@ void BuildingViewerDdsController::onDynParticipantChanged(const ParticipantManag
|
|||||||
void BuildingViewerDdsController::onHitLineInfoChanged(const ParticipantManagement::HitLineInfo& hli,
|
void BuildingViewerDdsController::onHitLineInfoChanged(const ParticipantManagement::HitLineInfo& hli,
|
||||||
DataModification modType)
|
DataModification modType)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << "X 0000 onHitLineInfoChanged id=" << hli.id();
|
DEBUG_LOG(m_logger) << "X 0000 onHitLineInfoChanged id=" << hli.id;
|
||||||
|
|
||||||
if (modType == DataModification::eRemoved)
|
if (modType == DataModification::eRemoved)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << "onHitLineInfoChanged removeHit id=" << hli.id();
|
DEBUG_LOG(m_logger) << "onHitLineInfoChanged removeHit id=" << hli.id;
|
||||||
m_connection->removeRoomHit(hli.id());
|
m_connection->removeRoomHit(hli.id);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -903,24 +903,24 @@ void BuildingViewerDdsController::onHitLineInfoChanged(const ParticipantManageme
|
|||||||
return;
|
return;
|
||||||
m_ppmDtc->waitForHistoricalDataParticipant();
|
m_ppmDtc->waitForHistoricalDataParticipant();
|
||||||
|
|
||||||
const ParticipantManagement::Participant& partSrc = m_ppmDtc->participant(hli.originatorParticipantId());
|
const ParticipantManagement::Participant& partSrc = m_ppmDtc->participant(hli.originatorParticipantId);
|
||||||
const ParticipantManagement::Participant& partDst = m_ppmDtc->participant(hli.injuryParticipantId());
|
const ParticipantManagement::Participant& partDst = m_ppmDtc->participant(hli.injuryParticipantId);
|
||||||
if (partSrc.id() == 0 || partDst.id() == 0)
|
if (partSrc.id == 0 || partDst.id == 0)
|
||||||
{
|
{
|
||||||
ERROR_LOG(m_logger) << "no knownn part: " << partSrc.id() << " dst: " << partDst.id();
|
ERROR_LOG(m_logger) << "no knownn part: " << partSrc.id << " dst: " << partDst.id;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString& strFeatureID = BuildingViewer::databaseId2FeatureId(hli.injuryBuildingId());
|
const QString& strFeatureID = BuildingViewer::databaseId2FeatureId(hli.injuryBuildingId);
|
||||||
if (!m_viewerInterface->isViewOpen(strFeatureID.toStdString()))
|
if (!m_viewerInterface->isViewOpen(strFeatureID.toStdString()))
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << "building not opened: hli.buildingId()=" << hli;
|
DEBUG_LOG(m_logger) << "building not opened: hli.buildingId()=" << hli;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hli.injuryBuildingId() != 0)
|
if (hli.injuryBuildingId != 0)
|
||||||
{
|
{
|
||||||
auto itBuildingHit = m_buildingHits.constFind(hli.injuryBuildingId());
|
auto itBuildingHit = m_buildingHits.constFind(hli.injuryBuildingId);
|
||||||
if (itBuildingHit != m_buildingHits.constEnd())
|
if (itBuildingHit != m_buildingHits.constEnd())
|
||||||
{
|
{
|
||||||
const QVector<BuildingHit>& bHits = itBuildingHit.value();
|
const QVector<BuildingHit>& bHits = itBuildingHit.value();
|
||||||
@@ -929,14 +929,14 @@ void BuildingViewerDdsController::onHitLineInfoChanged(const ParticipantManageme
|
|||||||
for (const BuildingHit& bh : bHits)
|
for (const BuildingHit& bh : bHits)
|
||||||
{
|
{
|
||||||
|
|
||||||
const bool testFlag = (bh.chargeTypeId == hli.chargeTypeId() &&
|
const bool testFlag = (bh.chargeTypeId == hli.chargeTypeId &&
|
||||||
bh.originatorParticipantId == hli.originatorParticipantId() &&
|
bh.originatorParticipantId == hli.originatorParticipantId &&
|
||||||
hli.sampleTime() - m_hitlineDuration_ms < bh.sampleTime);
|
hli.sampleTime - m_hitlineDuration_ms < bh.sampleTime);
|
||||||
DEBUG_LOG(m_logger) << "testFlag " << testFlag;
|
DEBUG_LOG(m_logger) << "testFlag " << testFlag;
|
||||||
|
|
||||||
if (bh.chargeTypeId == hli.chargeTypeId() &&
|
if (bh.chargeTypeId == hli.chargeTypeId &&
|
||||||
bh.originatorParticipantId == hli.originatorParticipantId() &&
|
bh.originatorParticipantId == hli.originatorParticipantId &&
|
||||||
hli.sampleTime() - m_hitlineDuration_ms < bh.sampleTime)
|
hli.sampleTime - m_hitlineDuration_ms < bh.sampleTime)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -950,32 +950,32 @@ void BuildingViewerDdsController::onHitLineInfoChanged(const ParticipantManageme
|
|||||||
DEBUG_LOG(m_logger) << "onHitLineInfoChanged createPlayerSymbols";
|
DEBUG_LOG(m_logger) << "onHitLineInfoChanged createPlayerSymbols";
|
||||||
createPlayerSymbols(partDst, sizeL);
|
createPlayerSymbols(partDst, sizeL);
|
||||||
|
|
||||||
LtsUtils::QPoint3D originatorSrc = toRelative3D(hli.originatorPos());
|
LtsUtils::QPoint3D originatorSrc = toRelative3D(hli.originatorPos);
|
||||||
LtsUtils::QPoint3D injuryDest = toRelative3D(hli.injuryPos());
|
LtsUtils::QPoint3D injuryDest = toRelative3D(hli.injuryPos);
|
||||||
|
|
||||||
DEBUG_LOG(m_logger) << "onHitLineInfoChanged playerHit"
|
DEBUG_LOG(m_logger) << "onHitLineInfoChanged playerHit"
|
||||||
<< " hli.originatorPos() z=" << hli.originatorPos().z()
|
<< " hli.originatorPos() z=" << hli.originatorPos.z
|
||||||
<< " hli.injuryPos() z=" << hli.injuryPos().z() << " Src=" << originatorSrc.x() << "/"
|
<< " hli.injuryPos() z=" << hli.injuryPos.z << " Src=" << originatorSrc.x() << "/"
|
||||||
<< originatorSrc.y() << "/" << originatorSrc.z() << " Dest= " << injuryDest.x() << "/"
|
<< originatorSrc.y() << "/" << originatorSrc.z() << " Dest= " << injuryDest.x() << "/"
|
||||||
<< injuryDest.y() << "/" << injuryDest.z()
|
<< injuryDest.y() << "/" << injuryDest.z()
|
||||||
<< " hli.originatorBuildingId=" << hli.originatorBuildingId()
|
<< " hli.originatorBuildingId=" << hli.originatorBuildingId
|
||||||
<< " hli.originatorRoomId=" << hli.originatorRoomId()
|
<< " hli.originatorRoomId=" << hli.originatorRoomId
|
||||||
<< " hli.injuryBuildingId=" << hli.injuryBuildingId()
|
<< " hli.injuryBuildingId=" << hli.injuryBuildingId
|
||||||
<< " hli.injuryRoomId=" << hli.injuryRoomId();
|
<< " hli.injuryRoomId=" << hli.injuryRoomId;
|
||||||
|
|
||||||
DEBUG_LOG(m_logger) << "Before z-correction:"
|
DEBUG_LOG(m_logger) << "Before z-correction:"
|
||||||
<< " Src=" << originatorSrc.x() << "/" << originatorSrc.y() << "/" << originatorSrc.z()
|
<< " Src=" << originatorSrc.x() << "/" << originatorSrc.y() << "/" << originatorSrc.z()
|
||||||
<< " Dest= " << injuryDest.x() << "/" << injuryDest.y() << "/" << injuryDest.z();
|
<< " Dest= " << injuryDest.x() << "/" << injuryDest.y() << "/" << injuryDest.z();
|
||||||
|
|
||||||
double zAddOriginator = m_buildingHeight.value(hli.originatorBuildingId(), 0);
|
double zAddOriginator = m_buildingHeight.value(hli.originatorBuildingId, 0);
|
||||||
double zAddInjury = m_buildingHeight.value(hli.injuryBuildingId(), 0);
|
double zAddInjury = m_buildingHeight.value(hli.injuryBuildingId, 0);
|
||||||
DEBUG_LOG(m_logger) << "z-correction: zAddOriginator=" << zAddOriginator;
|
DEBUG_LOG(m_logger) << "z-correction: zAddOriginator=" << zAddOriginator;
|
||||||
DEBUG_LOG(m_logger) << "z-correction: zAddInjury=" << zAddInjury;
|
DEBUG_LOG(m_logger) << "z-correction: zAddInjury=" << zAddInjury;
|
||||||
|
|
||||||
if (hli.originatorBuildingId() <= 0)
|
if (hli.originatorBuildingId <= 0)
|
||||||
zAddOriginator = zAddInjury;
|
zAddOriginator = zAddInjury;
|
||||||
|
|
||||||
if (hli.injuryBuildingId() <= 0)
|
if (hli.injuryBuildingId <= 0)
|
||||||
zAddInjury = zAddOriginator;
|
zAddInjury = zAddOriginator;
|
||||||
|
|
||||||
originatorSrc.setZ(originatorSrc.z() + zAddInjury);
|
originatorSrc.setZ(originatorSrc.z() + zAddInjury);
|
||||||
@@ -988,54 +988,55 @@ void BuildingViewerDdsController::onHitLineInfoChanged(const ParticipantManageme
|
|||||||
int buildingIdSrc = -1;
|
int buildingIdSrc = -1;
|
||||||
int roomNumberSrc = -1;
|
int roomNumberSrc = -1;
|
||||||
{
|
{
|
||||||
auto itId2Number = m_roomId2RoomNumber.constFind(hli.originatorBuildingId());
|
auto itId2Number = m_roomId2RoomNumber.constFind(hli.originatorBuildingId);
|
||||||
if (itId2Number != m_roomId2RoomNumber.constEnd())
|
if (itId2Number != m_roomId2RoomNumber.constEnd())
|
||||||
{
|
{
|
||||||
const auto& mapRooms = itId2Number.value();
|
const auto& mapRooms = itId2Number.value();
|
||||||
const auto itRoom = mapRooms.constFind(hli.originatorRoomId());
|
const auto itRoom = mapRooms.constFind(hli.originatorRoomId);
|
||||||
if (itRoom != mapRooms.constEnd())
|
if (itRoom != mapRooms.constEnd())
|
||||||
{
|
{
|
||||||
buildingIdSrc = hli.originatorBuildingId();
|
buildingIdSrc = hli.originatorBuildingId;
|
||||||
roomNumberSrc = itRoom.value();
|
roomNumberSrc = itRoom.value();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
WARNING_LOG(m_logger) << "onHitLineInfoChanged: Room id can not be mapped! Building id: "
|
WARNING_LOG(m_logger) << "onHitLineInfoChanged: Room id can not be mapped! Building id: "
|
||||||
<< hli.injuryBuildingId() << ", originatorRoomId: " << hli.originatorRoomId();
|
<< hli.injuryBuildingId << ", originatorRoomId: " << hli.originatorRoomId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int buildingIdDst = -1;
|
int buildingIdDst = -1;
|
||||||
int roomNumberDst = -1;
|
int roomNumberDst = -1;
|
||||||
{
|
{
|
||||||
auto itId2Number = m_roomId2RoomNumber.constFind(hli.injuryBuildingId());
|
auto itId2Number = m_roomId2RoomNumber.constFind(hli.injuryBuildingId);
|
||||||
if (itId2Number != m_roomId2RoomNumber.constEnd())
|
if (itId2Number != m_roomId2RoomNumber.constEnd())
|
||||||
{
|
{
|
||||||
const auto& mapRooms = itId2Number.value();
|
const auto& mapRooms = itId2Number.value();
|
||||||
const auto itRoom = mapRooms.constFind(hli.injuryRoomId());
|
const auto itRoom = mapRooms.constFind(hli.injuryRoomId);
|
||||||
if (itRoom != mapRooms.constEnd())
|
if (itRoom != mapRooms.constEnd())
|
||||||
{
|
{
|
||||||
buildingIdDst = hli.injuryBuildingId();
|
buildingIdDst = hli.injuryBuildingId;
|
||||||
roomNumberDst = itRoom.value();
|
roomNumberDst = itRoom.value();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
WARNING_LOG(m_logger) << "onHitLineInfoChanged: Room id can not be mapped! Building id: "
|
WARNING_LOG(m_logger) << "onHitLineInfoChanged: Room id can not be mapped! Building id: "
|
||||||
<< hli.injuryBuildingId() << ", room id: " << hli.injuryRoomId();
|
<< hli.injuryBuildingId << ", room id: " << hli.injuryRoomId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DEBUG_LOG(m_logger) << "After translate buildingId, roomId:"
|
DEBUG_LOG(m_logger) << "After translate buildingId, roomId:"
|
||||||
<< " hli.originatorBuildingId=" << hli.originatorBuildingId() << " -> " << buildingIdSrc
|
<< " hli.originatorBuildingId=" << hli.originatorBuildingId << " -> " << buildingIdSrc
|
||||||
<< " hli.originatorRoomId=" << hli.originatorRoomId() << " -> " << roomNumberSrc
|
<< " hli.originatorRoomId=" << hli.originatorRoomId << " -> " << roomNumberSrc
|
||||||
<< " hli.injuryBuildingId=" << hli.injuryBuildingId() << " -> " << buildingIdDst
|
<< " hli.injuryBuildingId=" << hli.injuryBuildingId << " -> " << buildingIdDst
|
||||||
<< " hli.injuryRoomId=" << hli.injuryBuildingId() << " -> " << roomNumberDst
|
<< " hli.injuryRoomId=" << hli.injuryBuildingId << " -> " << roomNumberDst
|
||||||
<< " hli.sampleTime=" << hli.sampleTime();
|
<< " hli.sampleTime=" << hli.sampleTime;
|
||||||
int lineType = 2;
|
int lineType = 2;
|
||||||
m_pdmDtc->chargeType(hli.chargeTypeId());
|
m_pdmDtc->chargeType(hli.chargeTypeId);
|
||||||
|
|
||||||
lineType = m_pdmDtc->getChargeTypeSpecialProperty(hli.chargeTypeId(), 0, 0);
|
// DDS enums are enum class; lineType is int.
|
||||||
|
lineType = static_cast<int>(m_pdmDtc->getChargeTypeSpecialProperty(hli.chargeTypeId, 0, 0));
|
||||||
|
|
||||||
m_connection->playerHit(hli.id(), partSrc.id(), partDst.id(), originatorSrc, injuryDest, buildingIdSrc,
|
m_connection->playerHit(hli.id, partSrc.id, partDst.id, originatorSrc, injuryDest, buildingIdSrc,
|
||||||
roomNumberSrc, buildingIdDst, roomNumberDst, lineType, hli.sampleTime());
|
roomNumberSrc, buildingIdDst, roomNumberDst, lineType, hli.sampleTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BuildingViewerDdsController::onPartyChanged(const ParticipantManagement::Party& party, DataModification modType)
|
void BuildingViewerDdsController::onPartyChanged(const ParticipantManagement::Party& party, DataModification modType)
|
||||||
@@ -1046,7 +1047,7 @@ void BuildingViewerDdsController::onPartyChanged(const ParticipantManagement::Pa
|
|||||||
int sizeL = LtsUtils::OperatorSettings::getInstance()
|
int sizeL = LtsUtils::OperatorSettings::getInstance()
|
||||||
->value(QStringLiteral("BgViewer"), QStringLiteral("PlayerSymbolSize"), 20)
|
->value(QStringLiteral("BgViewer"), QStringLiteral("PlayerSymbolSize"), 20)
|
||||||
.toInt();
|
.toInt();
|
||||||
updatePlayerSymbols(sizeL, party.id());
|
updatePlayerSymbols(sizeL, party.id);
|
||||||
syncTeams();
|
syncTeams();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1063,35 +1064,35 @@ void BuildingViewerDdsController::onPositionChanged(const ParticipantManagement:
|
|||||||
|
|
||||||
int buildingID = -1;
|
int buildingID = -1;
|
||||||
int roomNumber = -1;
|
int roomNumber = -1;
|
||||||
auto itId2Number = m_roomId2RoomNumber.constFind(position.buildingId());
|
auto itId2Number = m_roomId2RoomNumber.constFind(position.buildingId);
|
||||||
if (itId2Number != m_roomId2RoomNumber.constEnd())
|
if (itId2Number != m_roomId2RoomNumber.constEnd())
|
||||||
{
|
{
|
||||||
const auto& mapRooms = itId2Number.value();
|
const auto& mapRooms = itId2Number.value();
|
||||||
const auto itRoom = mapRooms.constFind(position.roomId());
|
const auto itRoom = mapRooms.constFind(position.roomId);
|
||||||
if (itRoom != mapRooms.constEnd())
|
if (itRoom != mapRooms.constEnd())
|
||||||
{
|
{
|
||||||
buildingID = position.buildingId();
|
buildingID = position.buildingId;
|
||||||
roomNumber = itRoom.value();
|
roomNumber = itRoom.value();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
WARNING_LOG(m_logger) << "onPositionChanged: Room id can not be mapped! Building id: "
|
WARNING_LOG(m_logger) << "onPositionChanged: Room id can not be mapped! Building id: "
|
||||||
<< position.buildingId() << ", room id: " << position.roomId();
|
<< position.buildingId << ", room id: " << position.roomId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((roomNumber < 0) && (buildingID <= 0) && (position.buildingId() > 0) &&
|
if ((roomNumber < 0) && (buildingID <= 0) && (position.buildingId > 0) &&
|
||||||
(position.reportingSource() == Core::PositionReportingSource::Ops ||
|
(position.reportingSource == Core::PositionReportingSource::Ops ||
|
||||||
position.reportingSource() == Core::PositionReportingSource::Wls))
|
position.reportingSource == Core::PositionReportingSource::Wls))
|
||||||
{
|
{
|
||||||
buildingID = position.buildingId();
|
buildingID = position.buildingId;
|
||||||
}
|
}
|
||||||
|
|
||||||
const int playerId = position.participantId();
|
const int playerId = position.participantId;
|
||||||
auto it = m_lastPositionTime.find(playerId);
|
auto it = m_lastPositionTime.find(playerId);
|
||||||
if (it == m_lastPositionTime.end())
|
if (it == m_lastPositionTime.end())
|
||||||
{
|
{
|
||||||
m_lastPositionTime.insert(playerId, position.sampleTime());
|
m_lastPositionTime.insert(playerId, position.sampleTime);
|
||||||
if (isOutdatedPosition(position))
|
if (isOutdatedPosition(position))
|
||||||
m_connection->setPlayerVisible(playerId, false);
|
m_connection->setPlayerVisible(playerId, false);
|
||||||
}
|
}
|
||||||
@@ -1099,7 +1100,7 @@ void BuildingViewerDdsController::onPositionChanged(const ParticipantManagement:
|
|||||||
{
|
{
|
||||||
if (isOutdatedPosition(it.value()) && !isOutdatedPosition(position))
|
if (isOutdatedPosition(it.value()) && !isOutdatedPosition(position))
|
||||||
m_connection->setPlayerVisible(playerId, true);
|
m_connection->setPlayerVisible(playerId, true);
|
||||||
it.value() = position.sampleTime();
|
it.value() = position.sampleTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (buildingID <= 0 && roomNumber <= 0)
|
if (buildingID <= 0 && roomNumber <= 0)
|
||||||
@@ -1118,8 +1119,8 @@ void BuildingViewerDdsController::onPositionChanged(const ParticipantManagement:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_connection->playerPlace(position.participantId(), toRelative3D(position.pos()), buildingID, roomNumber,
|
m_connection->playerPlace(position.participantId, toRelative3D(position.pos), buildingID, roomNumber,
|
||||||
position.reportingSource());
|
position.reportingSource);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BuildingViewerDdsController::onParticipantGearEventChanged(const ParticipantManagement::ParticipantGearEvent& data,
|
void BuildingViewerDdsController::onParticipantGearEventChanged(const ParticipantManagement::ParticipantGearEvent& data,
|
||||||
@@ -1129,12 +1130,12 @@ void BuildingViewerDdsController::onParticipantGearEventChanged(const Participan
|
|||||||
{
|
{
|
||||||
case DataModification::eAdded:
|
case DataModification::eAdded:
|
||||||
case DataModification::eModified: {
|
case DataModification::eModified: {
|
||||||
m_participantGearEvents[data.participantId()] = data.sampleTime();
|
m_participantGearEvents[data.participantId] = data.sampleTime;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case DataModification::eRemoved: {
|
case DataModification::eRemoved: {
|
||||||
|
|
||||||
const int playerId = data.participantId();
|
const int playerId = data.participantId;
|
||||||
m_participantGearEvents.remove(playerId);
|
m_participantGearEvents.remove(playerId);
|
||||||
m_connection->playerUpdatePlayerSymbol(playerId, buildPlayerSymbolFilePath(playerId, cColorSymbolId));
|
m_connection->playerUpdatePlayerSymbol(playerId, buildPlayerSymbolFilePath(playerId, cColorSymbolId));
|
||||||
break;
|
break;
|
||||||
@@ -1158,44 +1159,44 @@ void BuildingViewerDdsController::createParticipant(const ParticipantManagement:
|
|||||||
|
|
||||||
createPlayerSymbols(participant, sizeL);
|
createPlayerSymbols(participant, sizeL);
|
||||||
|
|
||||||
m_connection->playerCreate(participant.id(), participant.partyId(), buildPlayerSymbolFilePath(participant.id()),
|
m_connection->playerCreate(participant.id, participant.partyId, buildPlayerSymbolFilePath(participant.id),
|
||||||
toRelative3D(position.pos()), position.buildingId(),
|
toRelative3D(position.pos), position.buildingId,
|
||||||
m_roomId2RoomNumber.value(position.buildingId()).value(position.roomId()),
|
m_roomId2RoomNumber.value(position.buildingId).value(position.roomId),
|
||||||
position.reportingSource());
|
position.reportingSource);
|
||||||
|
|
||||||
const bool isOutdated = isOutdatedPosition(position);
|
const bool isOutdated = isOutdatedPosition(position);
|
||||||
const int participantId = participant.id();
|
const int participantId = participant.id;
|
||||||
const bool isValid =
|
const bool isValid =
|
||||||
(position.buildingId() > 0 && m_roomId2RoomNumber.value(position.buildingId()).value(position.roomId()) > 0);
|
(position.buildingId > 0 && m_roomId2RoomNumber.value(position.buildingId).value(position.roomId) > 0);
|
||||||
m_connection->setPlayerVisible(participantId, (!isOutdated && isValid));
|
m_connection->setPlayerVisible(participantId, (!isOutdated && isValid));
|
||||||
m_lastPositionTime.insert(participantId, position.sampleTime());
|
m_lastPositionTime.insert(participantId, position.sampleTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BuildingViewerDdsController::createBoobyTrap(const AreaEffectSimulation::BoobyTrap& trap, int sizeL)
|
void BuildingViewerDdsController::createBoobyTrap(const AreaEffectSimulation::BoobyTrap& trap, int sizeL)
|
||||||
{
|
{
|
||||||
if (trap.effectStateId() != AreaEffectSimulation::AesEffectState::EsActivated &&
|
if (trap.effectStateId != AreaEffectSimulation::AesEffectState::EsActivated &&
|
||||||
trap.effectStateId() != AreaEffectSimulation::AesEffectState::EsPrepared)
|
trap.effectStateId != AreaEffectSimulation::AesEffectState::EsPrepared)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ParticipantManagement::Participant participant;
|
ParticipantManagement::Participant participant;
|
||||||
if (trap.partyId().has_value())
|
if (trap.partyId.has_value())
|
||||||
participant.partyId() = trap.partyId().get();
|
participant.partyId = trap.partyId.get();
|
||||||
participant.designator() = trap.name();
|
participant.designator = trap.name;
|
||||||
participant.designator() = trap.name();
|
participant.designator = trap.name;
|
||||||
participant.id() = trap.id() + 990000;
|
participant.id = trap.id + 990000;
|
||||||
participant.sampleTime() = trap.sampleTime();
|
participant.sampleTime = trap.sampleTime;
|
||||||
participant.symbol() = "AP6D|CMPL|10011500002104000000";
|
participant.symbol = "AP6D|CMPL|10011500002104000000";
|
||||||
|
|
||||||
createPlayerSymbols(participant, sizeL);
|
createPlayerSymbols(participant, sizeL);
|
||||||
Core::GeoPosition pos;
|
Core::GeoPosition pos;
|
||||||
pos.lat() = trap.impactPosition().lat();
|
pos.lat = trap.impactPosition.lat;
|
||||||
pos.lon() = trap.impactPosition().lon();
|
pos.lon = trap.impactPosition.lon;
|
||||||
|
|
||||||
DEBUG_LOG(m_logger) << "Try create Booby trap with id " << trap.id() << " internal id " << participant.id();
|
DEBUG_LOG(m_logger) << "Try create Booby trap with id " << trap.id << " internal id " << participant.id;
|
||||||
DEBUG_LOG(m_logger) << "Try create Booby trap with pos " << pos.lat() << " " << pos.lon();
|
DEBUG_LOG(m_logger) << "Try create Booby trap with pos " << pos.lat << " " << pos.lon;
|
||||||
m_connection->playerCreate(participant.id(), participant.partyId(), buildPlayerSymbolFilePath(participant.id()),
|
m_connection->playerCreate(participant.id, participant.partyId, buildPlayerSymbolFilePath(participant.id),
|
||||||
toRelative3D(pos), -1, -1, Core::PositionReportingSource::External);
|
toRelative3D(pos), -1, -1, Core::PositionReportingSource::External);
|
||||||
m_connection->setPlayerVisible(participant.id(), true);
|
m_connection->setPlayerVisible(participant.id, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BuildingViewerDdsController::updatePlayerSymbols(const int sizeL, const int forParty)
|
void BuildingViewerDdsController::updatePlayerSymbols(const int sizeL, const int forParty)
|
||||||
@@ -1207,7 +1208,7 @@ void BuildingViewerDdsController::updatePlayerSymbols(const int sizeL, const int
|
|||||||
if (!isValidParticipant(participant))
|
if (!isValidParticipant(participant))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (forParty == -1 || participant.partyId() == forParty)
|
if (forParty == -1 || participant.partyId == forParty)
|
||||||
createPlayerSymbols(participant, sizeL);
|
createPlayerSymbols(participant, sizeL);
|
||||||
};
|
};
|
||||||
m_ppmDtc->participants(cb);
|
m_ppmDtc->participants(cb);
|
||||||
@@ -1219,9 +1220,9 @@ void BuildingViewerDdsController::createPlayerSymbols(const ParticipantManagemen
|
|||||||
SymbolInfo symbolinfo;
|
SymbolInfo symbolinfo;
|
||||||
for (int i = 0; i < m_vecFlashColors.size(); ++i)
|
for (int i = 0; i < m_vecFlashColors.size(); ++i)
|
||||||
{
|
{
|
||||||
Q_ASSERT(participant.id() != 0);
|
Q_ASSERT(participant.id != 0);
|
||||||
symbolinfo.participantId = participant.id();
|
symbolinfo.participantId = participant.id;
|
||||||
symbolinfo.strPathToSymbolFile = buildPlayerSymbolFilePath(participant.id(), i);
|
symbolinfo.strPathToSymbolFile = buildPlayerSymbolFilePath(participant.id, i);
|
||||||
symbolinfo.color = m_vecFlashColors.at(i);
|
symbolinfo.color = m_vecFlashColors.at(i);
|
||||||
symbolinfo.useThisSymbolNow = !symbolinfo.color.isValid();
|
symbolinfo.useThisSymbolNow = !symbolinfo.color.isValid();
|
||||||
createSymbolResultWatcher(participant, symbolinfo, sizeL);
|
createSymbolResultWatcher(participant, symbolinfo, sizeL);
|
||||||
@@ -1304,7 +1305,7 @@ void BuildingViewerDdsController::reCheckHitLine()
|
|||||||
|
|
||||||
for (const auto& hli : hitMap)
|
for (const auto& hli : hitMap)
|
||||||
{
|
{
|
||||||
if (hli.sampleTime() < (m_session->partitionTime() - 3000))
|
if (hli.sampleTime < (m_session->partitionTime() - 3000))
|
||||||
onBuildingHitLineInfoChanged(hli, DataModification::eAdded);
|
onBuildingHitLineInfoChanged(hli, DataModification::eAdded);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1332,17 +1333,17 @@ void BuildingViewerDdsController::updateBuildingRoomNames(
|
|||||||
const InfrastructureManagement::MainStructureElement& building)
|
const InfrastructureManagement::MainStructureElement& building)
|
||||||
{
|
{
|
||||||
|
|
||||||
const std::vector<InfrastructureManagement::StructureElement>& vecElements = building.elements();
|
const std::vector<InfrastructureManagement::StructureElement>& vecElements = building.elements;
|
||||||
|
|
||||||
int32_t buildingDatabaseId = building.id();
|
int32_t buildingDatabaseId = building.id;
|
||||||
QString featureID = BuildingViewer::databaseId2FeatureId(buildingDatabaseId);
|
QString featureID = BuildingViewer::databaseId2FeatureId(buildingDatabaseId);
|
||||||
for (const auto& se : vecElements)
|
for (const auto& se : vecElements)
|
||||||
{
|
{
|
||||||
if (se.structureElementTypeId() == InfrastructureManagement::StructureElementType::Building)
|
if (se.structureElementTypeId == InfrastructureManagement::StructureElementType::Building)
|
||||||
m_connection->excSetBuildingDisplayName(featureID, QString::fromStdString(se.displayName()));
|
m_connection->excSetBuildingDisplayName(featureID, QString::fromStdString(se.displayName));
|
||||||
if (se.structureElementTypeId() == InfrastructureManagement::StructureElementType::Room)
|
if (se.structureElementTypeId == InfrastructureManagement::StructureElementType::Room)
|
||||||
m_connection->excSetRoomDisplayName(featureID, QString::number(se.mountingPointId()),
|
m_connection->excSetRoomDisplayName(featureID, QString::number(se.mountingPointId),
|
||||||
QString::fromStdString(se.displayName()));
|
QString::fromStdString(se.displayName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1429,25 +1430,25 @@ void BuildingViewerDdsController::onBuildingStateChanged(const Buildings::Buildi
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
QMap<int, int> roomDestructions;
|
QMap<int, int> roomDestructions;
|
||||||
for (const Buildings::RoomState& rs : data.roomStates())
|
for (const Buildings::RoomState& rs : data.roomStates)
|
||||||
{
|
{
|
||||||
roomDestructions.insert(rs.mountingPointId(), rs.damagePercent());
|
roomDestructions.insert(rs.mountingPointId, rs.damagePercent);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_connection->buildingHit(data.id(), data.id(), data.damagePercent(), roomDestructions);
|
m_connection->buildingHit(data.id, data.id, data.damagePercent, roomDestructions);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BuildingViewerDdsController::onBuildingHitLineInfoChanged(const Buildings::BuildingHitLineInfo& hli,
|
void BuildingViewerDdsController::onBuildingHitLineInfoChanged(const Buildings::BuildingHitLineInfo& hli,
|
||||||
DataModification modType)
|
DataModification modType)
|
||||||
{
|
{
|
||||||
int topidId = static_cast<int>(hli.id());
|
int topidId = static_cast<int>(hli.id);
|
||||||
|
|
||||||
DEBUG_LOG(m_logger) << "onBuildingHitLineInfoChanged: " << hli;
|
DEBUG_LOG(m_logger) << "onBuildingHitLineInfoChanged: " << hli;
|
||||||
|
|
||||||
const QString& strFeatureID = BuildingViewer::databaseId2FeatureId(hli.buildingId());
|
const QString& strFeatureID = BuildingViewer::databaseId2FeatureId(hli.buildingId);
|
||||||
if (!m_viewerInterface->isViewOpen(strFeatureID.toStdString()))
|
if (!m_viewerInterface->isViewOpen(strFeatureID.toStdString()))
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << "building not opened: hli.buildingId()=" << hli.buildingId();
|
DEBUG_LOG(m_logger) << "building not opened: hli.buildingId()=" << hli.buildingId;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1457,28 +1458,28 @@ void BuildingViewerDdsController::onBuildingHitLineInfoChanged(const Buildings::
|
|||||||
if (isRemove)
|
if (isRemove)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << "onBuildingHitLineInfoChanged: remove ";
|
DEBUG_LOG(m_logger) << "onBuildingHitLineInfoChanged: remove ";
|
||||||
QVector<BuildingHit>& bhl = m_buildingHits[hli.buildingId()];
|
QVector<BuildingHit>& bhl = m_buildingHits[hli.buildingId];
|
||||||
|
|
||||||
auto it = std::find_if(bhl.begin(), bhl.end(), [hli](const BuildingHit& bh) { return (bh.id == hli.id()); });
|
auto it = std::find_if(bhl.begin(), bhl.end(), [hli](const BuildingHit& bh) { return (bh.id == hli.id); });
|
||||||
|
|
||||||
if (it != bhl.end())
|
if (it != bhl.end())
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << "bhl.erase(it)";
|
DEBUG_LOG(m_logger) << "bhl.erase(it)";
|
||||||
bhl.erase(it);
|
bhl.erase(it);
|
||||||
}
|
}
|
||||||
m_connection->removeRoomHit(hli.id());
|
m_connection->removeRoomHit(hli.id);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
BuildingHit bh;
|
BuildingHit bh;
|
||||||
bh.id = hli.id();
|
bh.id = hli.id;
|
||||||
bh.sampleTime = hli.sampleTime();
|
bh.sampleTime = hli.sampleTime;
|
||||||
bh.originatorParticipantId = hli.originatorParticipantId();
|
bh.originatorParticipantId = hli.originatorParticipantId;
|
||||||
bh.chargeTypeId = hli.chargeTypeId();
|
bh.chargeTypeId = hli.chargeTypeId;
|
||||||
|
|
||||||
bool contains = false;
|
bool contains = false;
|
||||||
for (const auto& it : m_buildingHits[hli.buildingId()])
|
for (const auto& it : m_buildingHits[hli.buildingId])
|
||||||
{
|
{
|
||||||
if (it.id == bh.id)
|
if (it.id == bh.id)
|
||||||
contains = true;
|
contains = true;
|
||||||
@@ -1486,13 +1487,13 @@ void BuildingViewerDdsController::onBuildingHitLineInfoChanged(const Buildings::
|
|||||||
if (!contains)
|
if (!contains)
|
||||||
{
|
{
|
||||||
|
|
||||||
m_buildingHits[hli.buildingId()].push_back(bh);
|
m_buildingHits[hli.buildingId].push_back(bh);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int lineType = 2;
|
int lineType = 2;
|
||||||
|
|
||||||
m_connection->roomHit(topidId, hli.originatorParticipantId(), hli.buildingId(), hli.hitOnRoomId(),
|
m_connection->roomHit(topidId, hli.originatorParticipantId, hli.buildingId, hli.hitOnRoomId,
|
||||||
toRelative3D(hli.originatorPos()), lineType, isRemove ? 0 : hli.sampleTime());
|
toRelative3D(hli.originatorPos), lineType, isRemove ? 0 : hli.sampleTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BuildingViewerDdsController::onCleanupBuildingHitlines()
|
void BuildingViewerDdsController::onCleanupBuildingHitlines()
|
||||||
@@ -1509,33 +1510,33 @@ void BuildingViewerDdsController::onCleanupBuildingHitlines()
|
|||||||
void BuildingViewerDdsController::onMainStructureElementChanged(
|
void BuildingViewerDdsController::onMainStructureElementChanged(
|
||||||
const InfrastructureManagement::MainStructureElement& mse, DataModification modType)
|
const InfrastructureManagement::MainStructureElement& mse, DataModification modType)
|
||||||
{
|
{
|
||||||
if (!isBuildingKnown(mse.id()))
|
if (!isBuildingKnown(mse.id))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
switch (modType)
|
switch (modType)
|
||||||
{
|
{
|
||||||
case DataModification::eAdded:
|
case DataModification::eAdded:
|
||||||
case DataModification::eModified: {
|
case DataModification::eModified: {
|
||||||
if (mse.modelId() != 0 && m_ismDtc->isElementAssignedToExercise(mse, m_exerciseId))
|
if (mse.modelId != 0 && m_ismDtc->isElementAssignedToExercise(mse, m_exerciseId))
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << "m_buildingHeight.insert id=" << mse.id() << " z=" << mse.geoPosition().z();
|
DEBUG_LOG(m_logger) << "m_buildingHeight.insert id=" << mse.id << " z=" << mse.geoPosition.z;
|
||||||
m_buildingHeight.insert(mse.id(), mse.geoPosition().z());
|
m_buildingHeight.insert(mse.id, mse.geoPosition.z);
|
||||||
QHash<int, int> roomId2RoomNumber;
|
QHash<int, int> roomId2RoomNumber;
|
||||||
for (const InfrastructureManagement::StructureElement& se : mse.elements())
|
for (const InfrastructureManagement::StructureElement& se : mse.elements)
|
||||||
{
|
{
|
||||||
if (se.structureElementTypeId() != InfrastructureManagement::StructureElementType::Room)
|
if (se.structureElementTypeId != InfrastructureManagement::StructureElementType::Room)
|
||||||
continue;
|
continue;
|
||||||
roomId2RoomNumber[se.id()] = se.mountingPointId();
|
roomId2RoomNumber[se.id] = se.mountingPointId;
|
||||||
}
|
}
|
||||||
m_roomId2RoomNumber[mse.id()] = roomId2RoomNumber;
|
m_roomId2RoomNumber[mse.id] = roomId2RoomNumber;
|
||||||
|
|
||||||
updateBuildingRoomNames(mse);
|
updateBuildingRoomNames(mse);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case DataModification::eRemoved:
|
case DataModification::eRemoved:
|
||||||
m_roomId2RoomNumber.remove(mse.id());
|
m_roomId2RoomNumber.remove(mse.id);
|
||||||
m_buildingHeight.remove(mse.id());
|
m_buildingHeight.remove(mse.id);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -89,7 +89,7 @@ class BuildingViewerDdsController : public QObject
|
|||||||
|
|
||||||
inline bool isOutdatedPosition(const ParticipantManagement::ParticipantPosition& position) const
|
inline bool isOutdatedPosition(const ParticipantManagement::ParticipantPosition& position) const
|
||||||
{
|
{
|
||||||
return position.participantId() <= 0 || isOutdatedPosition(position.sampleTime());
|
return position.participantId <= 0 || isOutdatedPosition(position.sampleTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool calcBaseCoordinate(const QMap<qint32, InfrastructureManagement::MainStructureElement>& mseMap);
|
bool calcBaseCoordinate(const QMap<qint32, InfrastructureManagement::MainStructureElement>& mseMap);
|
||||||
|
|||||||
@@ -22,7 +22,8 @@ int32_t featureId2DatabaseId(const QString &strFeatureId)
|
|||||||
if (!strFeatureId.startsWith(gStrFeatureIdPrefix))
|
if (!strFeatureId.startsWith(gStrFeatureIdPrefix))
|
||||||
return -1;
|
return -1;
|
||||||
bool isOk = false;
|
bool isOk = false;
|
||||||
int32_t buildingDatabaseId = strFeatureId.midRef(gStrFeatureIdPrefix.size()).toInt(&isOk);
|
// Qt6: QString::midRef removed; mid() returns the same substring by value.
|
||||||
|
int32_t buildingDatabaseId = strFeatureId.mid(gStrFeatureIdPrefix.size()).toInt(&isOk);
|
||||||
return isOk ? buildingDatabaseId : -1;
|
return isOk ? buildingDatabaseId : -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+16
-14
@@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
#include "bdv_edit_item.h"
|
#include "bdv_edit_item.h"
|
||||||
#include "ui_bdv_building_edit.h"
|
#include "ui_bdv_building_edit.h"
|
||||||
|
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||||
|
|
||||||
#include <Buildings/bld.hpp>
|
#include <Buildings/bld.hpp>
|
||||||
#include <Buildings/bld_ftc.h>
|
#include <Buildings/bld_ftc.h>
|
||||||
@@ -16,7 +17,8 @@ namespace BuildingViewer
|
|||||||
{
|
{
|
||||||
BuildingEdit::BuildingEdit(QWidget* parent)
|
BuildingEdit::BuildingEdit(QWidget* parent)
|
||||||
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::OkApplyCancel),
|
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::OkApplyCancel),
|
||||||
m_requestHelper(new LtsUtils::RequestHelper(this)), m_ui(new Ui::BuildingEdit)
|
m_requestHelper(new LtsUtils::RequestHelper(this)), m_ui(new Ui::BuildingEdit),
|
||||||
|
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("BuildingViewer.BuildingEdit"))
|
||||||
{
|
{
|
||||||
m_ui->setupUi(this);
|
m_ui->setupUi(this);
|
||||||
|
|
||||||
@@ -69,7 +71,7 @@ bool BuildingEdit::init(int32_t buildingDatabaseId,
|
|||||||
m_bldFtc = bldFtc;
|
m_bldFtc = bldFtc;
|
||||||
|
|
||||||
InfrastructureManagement::MainStructureElement building = m_ismDtc->mainStructureElement(m_buildingDatabaseId);
|
InfrastructureManagement::MainStructureElement building = m_ismDtc->mainStructureElement(m_buildingDatabaseId);
|
||||||
m_buildingId = building.id();
|
m_buildingId = building.id;
|
||||||
|
|
||||||
buildModel();
|
buildModel();
|
||||||
m_buildingName = m_model->getBuildingName();
|
m_buildingName = m_model->getBuildingName();
|
||||||
@@ -158,14 +160,14 @@ bool BuildingEdit::apply()
|
|||||||
{
|
{
|
||||||
m_requestHelper->addRequest([this, fortifyFactors]() {
|
m_requestHelper->addRequest([this, fortifyFactors]() {
|
||||||
Buildings::SetFortifyFactorRequest fortifyRequest;
|
Buildings::SetFortifyFactorRequest fortifyRequest;
|
||||||
fortifyRequest.buildingId(m_buildingDatabaseId);
|
fortifyRequest.buildingId = m_buildingDatabaseId;
|
||||||
|
|
||||||
fortifyRequest.fortifyFactors().reserve(fortifyFactors.size());
|
fortifyRequest.fortifyFactors.reserve(fortifyFactors.size());
|
||||||
for (const auto& e : fortifyFactors)
|
for (const auto& e : fortifyFactors)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << "push_back= databaseId=" << e.structureElementId()
|
DEBUG_LOG(m_logger) << "push_back= databaseId=" << e.structureElementId()
|
||||||
<< " fortifyFactor=" << e.fortifyFactor();
|
<< " fortifyFactor=" << e.fortifyFactor();
|
||||||
fortifyRequest.fortifyFactors().push_back(
|
fortifyRequest.fortifyFactors.push_back(
|
||||||
Buildings::FortifyFactor(e.structureElementId(), e.fortifyFactor()));
|
Buildings::FortifyFactor(e.structureElementId(), e.fortifyFactor()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -184,12 +186,12 @@ bool BuildingEdit::apply()
|
|||||||
for (const auto& treeItem : displayNames)
|
for (const auto& treeItem : displayNames)
|
||||||
{
|
{
|
||||||
|
|
||||||
for (const auto& room : building.elements())
|
for (const auto& room : building.elements)
|
||||||
{
|
{
|
||||||
if (room.id() == treeItem.structureElementId())
|
if (room.id == treeItem.structureElementId())
|
||||||
{
|
{
|
||||||
auto copy = room;
|
auto copy = room;
|
||||||
copy.displayName(treeItem.displayName().toStdString());
|
copy.displayName = treeItem.displayName().toStdString();
|
||||||
vecModifiedRooms.push_back(copy);
|
vecModifiedRooms.push_back(copy);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -231,7 +233,7 @@ void BuildingEdit::slotMainStructureElementChanged(const InfrastructureManagemen
|
|||||||
if (modType == DataModification::eRemoved)
|
if (modType == DataModification::eRemoved)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (mse.id() == m_buildingDatabaseId)
|
if (mse.id == m_buildingDatabaseId)
|
||||||
{
|
{
|
||||||
|
|
||||||
slotHandleExternalDdsChange();
|
slotHandleExternalDdsChange();
|
||||||
@@ -243,7 +245,7 @@ void BuildingEdit::slotBuildingStateChanged(const Buildings::BuildingState& stat
|
|||||||
if (modType == DataModification::eRemoved)
|
if (modType == DataModification::eRemoved)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (state.id() == m_buildingDatabaseId)
|
if (state.id == m_buildingDatabaseId)
|
||||||
{
|
{
|
||||||
|
|
||||||
slotHandleExternalDdsChange();
|
slotHandleExternalDdsChange();
|
||||||
@@ -265,11 +267,11 @@ bool BuildingEdit::sendBuildingStateRequest(ProjectDataManagement::Vulnerability
|
|||||||
buildings.resize(1);
|
buildings.resize(1);
|
||||||
Buildings::SetBuildingStatesRequest requestData;
|
Buildings::SetBuildingStatesRequest requestData;
|
||||||
|
|
||||||
building.buildingId(m_buildingId);
|
building.buildingId = m_buildingId;
|
||||||
building.roomIds().set(structureElementIds);
|
building.roomIds.set(structureElementIds);
|
||||||
buildings[0] = building;
|
buildings[0] = building;
|
||||||
requestData.buildings(buildings);
|
requestData.buildings = buildings;
|
||||||
requestData.vulnerabilityState(state);
|
requestData.vulnerabilityState = state;
|
||||||
|
|
||||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "currentData: " << state;
|
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "currentData: " << state;
|
||||||
|
|
||||||
|
|||||||
+17
-15
@@ -17,11 +17,13 @@ namespace BuildingViewer
|
|||||||
BuildingEditModel::BuildingEditModel(QObject* parent,
|
BuildingEditModel::BuildingEditModel(QObject* parent,
|
||||||
const std::shared_ptr<InfrastructureManagement::Interface::Dtc>& ismDtc,
|
const std::shared_ptr<InfrastructureManagement::Interface::Dtc>& ismDtc,
|
||||||
const std::shared_ptr<Buildings::Interface::Dtc>& bldDtc)
|
const std::shared_ptr<Buildings::Interface::Dtc>& bldDtc)
|
||||||
: NGLTreeModel(parent, new NGLTreeItem(QVariant()), ,
|
: NGLTreeModel(parent, new NGLTreeItem(QVariant()), {
|
||||||
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()){
|
|
||||||
tr("Selected Building"), QStringLiteral("Name (DEBUG)"),
|
tr("Selected Building"), QStringLiteral("Name (DEBUG)"),
|
||||||
QStringLiteral("MountingPointId (DEBUG)"), QStringLiteral("StructureElementId (DEBUG)"),
|
QStringLiteral("MountingPointId (DEBUG)"), QStringLiteral("StructureElementId (DEBUG)"),
|
||||||
tr("Fortify Factor"), tr("Damage Percent")}),
|
tr("Fortify Factor"), tr("Damage Percent")}),
|
||||||
|
// m_logger moved out of the NGLTreeModel(...) call (it is a member init);
|
||||||
|
// getNGLLogger() returns the INGLLogger& the reference member binds to.
|
||||||
|
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("BuildingViewer.BuildingEditModel")),
|
||||||
m_ismDtc(ismDtc), m_bldDtc(bldDtc), m_buildingName(QString())
|
m_ismDtc(ismDtc), m_bldDtc(bldDtc), m_buildingName(QString())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -125,11 +127,11 @@ bool BuildingEditModel::init(int32_t mseId)
|
|||||||
int rootId = 0;
|
int rootId = 0;
|
||||||
qint32 mapId = 0;
|
qint32 mapId = 0;
|
||||||
|
|
||||||
const std::vector<InfrastructureManagement::StructureElement>& vecElements = building.elements();
|
const std::vector<InfrastructureManagement::StructureElement>& vecElements = building.elements;
|
||||||
for (const auto& se : vecElements)
|
for (const auto& se : vecElements)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << "se: " << se;
|
DEBUG_LOG(m_logger) << "se: " << se;
|
||||||
if (se.structureElementTypeId() == InfrastructureManagement::StructureElementType::Building)
|
if (se.structureElementTypeId == InfrastructureManagement::StructureElementType::Building)
|
||||||
{
|
{
|
||||||
BuildingViewer::TreeItem rootItemBuilding(se);
|
BuildingViewer::TreeItem rootItemBuilding(se);
|
||||||
rootName = rootItemBuilding.name();
|
rootName = rootItemBuilding.name();
|
||||||
@@ -142,12 +144,12 @@ bool BuildingEditModel::init(int32_t mseId)
|
|||||||
for (const auto& se : vecElements)
|
for (const auto& se : vecElements)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << "se: =" << se;
|
DEBUG_LOG(m_logger) << "se: =" << se;
|
||||||
if (se.structureElementTypeId() == InfrastructureManagement::StructureElementType::Floor)
|
if (se.structureElementTypeId == InfrastructureManagement::StructureElementType::Floor)
|
||||||
{
|
{
|
||||||
BuildingViewer::TreeItem itemRoom(se);
|
BuildingViewer::TreeItem itemRoom(se);
|
||||||
itemRoom.setSuperior(rootId);
|
itemRoom.setSuperior(rootId);
|
||||||
|
|
||||||
lookupFloorId2TreeId[se.id()] = mapId;
|
lookupFloorId2TreeId[se.id] = mapId;
|
||||||
treemap[mapId++] = itemRoom;
|
treemap[mapId++] = itemRoom;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -158,20 +160,20 @@ bool BuildingEditModel::init(int32_t mseId)
|
|||||||
auto bs = m_bldDtc->buildingState(mseId);
|
auto bs = m_bldDtc->buildingState(mseId);
|
||||||
|
|
||||||
QMap<int32_t, Buildings::RoomState> roomStates;
|
QMap<int32_t, Buildings::RoomState> roomStates;
|
||||||
for (const auto& e : bs.roomStates())
|
for (const auto& e : bs.roomStates)
|
||||||
roomStates[e.id()] = e;
|
roomStates[e.id] = e;
|
||||||
|
|
||||||
for (const auto& se : vecElements)
|
for (const auto& se : vecElements)
|
||||||
{
|
{
|
||||||
if (se.structureElementTypeId() == InfrastructureManagement::StructureElementType::Room)
|
if (se.structureElementTypeId == InfrastructureManagement::StructureElementType::Room)
|
||||||
{
|
{
|
||||||
|
|
||||||
double fortifyFactor = 1.0;
|
double fortifyFactor = 1.0;
|
||||||
qint32 damagePercent = bs.damagePercent();
|
qint32 damagePercent = bs.damagePercent;
|
||||||
if (roomStates.contains(se.id()))
|
if (roomStates.contains(se.id))
|
||||||
{
|
{
|
||||||
fortifyFactor = roomStates[se.id()].fortifyFactor();
|
fortifyFactor = roomStates[se.id].fortifyFactor;
|
||||||
damagePercent = roomStates[se.id()].damagePercent();
|
damagePercent = roomStates[se.id].damagePercent;
|
||||||
}
|
}
|
||||||
|
|
||||||
BuildingViewer::TreeItem itemRoom(se, fortifyFactor, damagePercent);
|
BuildingViewer::TreeItem itemRoom(se, fortifyFactor, damagePercent);
|
||||||
@@ -179,13 +181,13 @@ bool BuildingEditModel::init(int32_t mseId)
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
||||||
int32_t floorID = se.path()[1];
|
int32_t floorID = se.path[1];
|
||||||
itemRoom.setSuperior(lookupFloorId2TreeId[floorID]);
|
itemRoom.setSuperior(lookupFloorId2TreeId[floorID]);
|
||||||
}
|
}
|
||||||
catch (const std::out_of_range& e)
|
catch (const std::out_of_range& e)
|
||||||
{
|
{
|
||||||
WARNING_LOG(m_logger) << "Caught exception while trying to get superior id for building " << rootName
|
WARNING_LOG(m_logger) << "Caught exception while trying to get superior id for building " << rootName
|
||||||
<< " with room with mounting point id: " << se.mountingPointId() << ": "
|
<< " with room with mounting point id: " << se.mountingPointId << ": "
|
||||||
<< e.what();
|
<< e.what();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-1
@@ -1,6 +1,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "bdv_thread_video_exporter.h"
|
#include "bdv_thread_video_exporter.h"
|
||||||
|
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||||
|
|
||||||
#include "bdv_replay_handler.h"
|
#include "bdv_replay_handler.h"
|
||||||
|
|
||||||
@@ -11,7 +12,9 @@
|
|||||||
|
|
||||||
namespace BuildingViewer
|
namespace BuildingViewer
|
||||||
{
|
{
|
||||||
VideoExporter::VideoExporter(QObject* parent) : QObject(parent)
|
VideoExporter::VideoExporter(QObject* parent)
|
||||||
|
: QObject(parent),
|
||||||
|
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("BuildingViewer.VideoExporter"))
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << "ThreadVideoExporter has been created";
|
DEBUG_LOG(m_logger) << "ThreadVideoExporter has been created";
|
||||||
}
|
}
|
||||||
|
|||||||
+10
-8
@@ -1,6 +1,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "bdv_topic_replay_interface.h"
|
#include "bdv_topic_replay_interface.h"
|
||||||
|
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||||
|
|
||||||
#include "bdv_replay_handler.h"
|
#include "bdv_replay_handler.h"
|
||||||
#include "bdv_thread_video_exporter.h"
|
#include "bdv_thread_video_exporter.h"
|
||||||
@@ -26,7 +27,8 @@ namespace BuildingViewer
|
|||||||
{
|
{
|
||||||
|
|
||||||
TopicReplayInterface::TopicReplayInterface(BgViewerController* bgvController, LtsSession::LtsSession* session)
|
TopicReplayInterface::TopicReplayInterface(BgViewerController* bgvController, LtsSession::LtsSession* session)
|
||||||
: m_bgvController(bgvController), m_session(session)
|
: m_bgvController(bgvController), m_session(session),
|
||||||
|
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("BuildingViewer.TopicReplayInterface"))
|
||||||
{
|
{
|
||||||
session->getForeignGuiInterface<SituationReplay::ForeignGuiInterface>(m_replayIfc);
|
session->getForeignGuiInterface<SituationReplay::ForeignGuiInterface>(m_replayIfc);
|
||||||
}
|
}
|
||||||
@@ -240,20 +242,20 @@ bool TopicReplayInterface::exportBuildings(const QVector<int>& buildingIds) cons
|
|||||||
for (const int buildingId : buildingIds)
|
for (const int buildingId : buildingIds)
|
||||||
{
|
{
|
||||||
const auto mse = ismDtc->mainStructureElement(buildingId);
|
const auto mse = ismDtc->mainStructureElement(buildingId);
|
||||||
if (mse.id() != buildingId)
|
if (mse.id != buildingId)
|
||||||
{
|
{
|
||||||
WARNING_LOG(m_logger) << "Could not find MainStructureElement for building with id " << buildingId
|
WARNING_LOG(m_logger) << "Could not find MainStructureElement for building with id " << buildingId
|
||||||
<< " - skipping";
|
<< " - skipping";
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
const QString fnIve = QString::fromStdString(mse.name()) + QStringLiteral(".flt.ive");
|
const QString fnIve = QString::fromStdString(mse.name) + QStringLiteral(".flt.ive");
|
||||||
const QString fnXml = QString::fromStdString(mse.name()) + QStringLiteral(".flt.xml");
|
const QString fnXml = QString::fromStdString(mse.name) + QStringLiteral(".flt.xml");
|
||||||
if (!copyFile(fnIve, modelPath, outputPath) || !copyFile(fnXml, modelPath, outputPath))
|
if (!copyFile(fnIve, modelPath, outputPath) || !copyFile(fnXml, modelPath, outputPath))
|
||||||
return false;
|
return false;
|
||||||
bi.name = QString::fromStdString(mse.name());
|
bi.name = QString::fromStdString(mse.name);
|
||||||
bi.position = LtsUtils::QPoint3D(mse.geoPosition().lon(), mse.geoPosition().lat(), mse.geoPosition().z());
|
bi.position = LtsUtils::QPoint3D(mse.geoPosition.lon, mse.geoPosition.lat, mse.geoPosition.z);
|
||||||
bi.angleDegree = mse.angle();
|
bi.angleDegree = mse.angle;
|
||||||
bi.id = mse.id();
|
bi.id = mse.id;
|
||||||
|
|
||||||
knownBuildings += bi;
|
knownBuildings += bi;
|
||||||
}
|
}
|
||||||
|
|||||||
+2
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "bdv_viewer_data_dialog.h"
|
#include "bdv_viewer_data_dialog.h"
|
||||||
|
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||||
#include "ui_bdv_viewer_data_dialog.h"
|
#include "ui_bdv_viewer_data_dialog.h"
|
||||||
|
|
||||||
#include <LtsSession/lts_session_data.h>
|
#include <LtsSession/lts_session_data.h>
|
||||||
@@ -12,6 +13,7 @@ namespace BuildingViewer
|
|||||||
BgViewerDataViewDialog::BgViewerDataViewDialog(QWidget *parent)
|
BgViewerDataViewDialog::BgViewerDataViewDialog(QWidget *parent)
|
||||||
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::CloseOnly)
|
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::CloseOnly)
|
||||||
, m_ui(new Ui::BgViewerDataViewDialog)
|
, m_ui(new Ui::BgViewerDataViewDialog)
|
||||||
|
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("BuildingViewer.BgViewerDataViewDialog"))
|
||||||
{
|
{
|
||||||
m_ui->setupUi(this);
|
m_ui->setupUi(this);
|
||||||
|
|
||||||
|
|||||||
+2
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "bdv_viewer_data_view.h"
|
#include "bdv_viewer_data_view.h"
|
||||||
|
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||||
#include "ui_bdv_viewer_data_view.h"
|
#include "ui_bdv_viewer_data_view.h"
|
||||||
#include "bdv_viewer_data_model.h"
|
#include "bdv_viewer_data_model.h"
|
||||||
|
|
||||||
@@ -15,6 +16,7 @@ BgViewerDataView::BgViewerDataView(QWidget *parent)
|
|||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
, m_ui(new Ui::BgViewerDataView)
|
, m_ui(new Ui::BgViewerDataView)
|
||||||
, m_pModel(new BgViewerDataViewModel(this))
|
, m_pModel(new BgViewerDataViewModel(this))
|
||||||
|
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("BuildingViewer.BgViewerDataView"))
|
||||||
{
|
{
|
||||||
m_ui->setupUi(this);
|
m_ui->setupUi(this);
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,117 @@
|
|||||||
|
# FindOpenSceneGraph.cmake
|
||||||
|
#
|
||||||
|
# Locate an installed OpenSceneGraph and expose the module variables that the
|
||||||
|
# Legatus BuildingViewer stack links against:
|
||||||
|
# OSG_INCLUDE_DIR, OPENSCENEGRAPH_INCLUDE_DIRS
|
||||||
|
# OPENSCENEGRAPH_LIBRARIES (the OSG component libs that were found)
|
||||||
|
# OPENTHREADS_LIBRARIES
|
||||||
|
# OPENSCENEGRAPH_FOUND, OPENSCENEGRAPH_VERSION
|
||||||
|
#
|
||||||
|
# NOTE (Qt6-migration port): OSG 3.4.1 ships no FindOpenSceneGraph.cmake and
|
||||||
|
# installs no OpenSceneGraphConfig.cmake, so this module is supplied to close
|
||||||
|
# the bld/OSG floor. It finds the 3.4.1 build installed under CMAKE_PREFIX_PATH
|
||||||
|
# (the component libs live under <prefix>/lib64) and honours the requested
|
||||||
|
# components -- including the ported Qt6 osgQt (see the .osg-port notes).
|
||||||
|
#
|
||||||
|
# Mirrors the classic OSG Find-module variable names that BuildingViewer/Common
|
||||||
|
# links: ${OSG_INCLUDE_DIR}, ${OPENSCENEGRAPH_LIBRARIES}, ${OPENTHREADS_LIBRARIES}.
|
||||||
|
|
||||||
|
SET(OSG_SEARCH_PREFIXES ${CMAKE_PREFIX_PATH} /usr/local /usr)
|
||||||
|
|
||||||
|
# Include dir: locate the osg/Version header.
|
||||||
|
FIND_PATH(OSG_INCLUDE_DIR
|
||||||
|
NAMES osg/Version
|
||||||
|
PATHS ${OSG_SEARCH_PREFIXES}
|
||||||
|
PATH_SUFFIXES include)
|
||||||
|
|
||||||
|
# OpenThreads support library (distinct SONAME: libOpenThreads.so.20 for 3.4.1).
|
||||||
|
FIND_LIBRARY(OPENTHREADS_LIBRARY
|
||||||
|
NAMES OpenThreads
|
||||||
|
PATHS ${OSG_SEARCH_PREFIXES}
|
||||||
|
PATH_SUFFIXES lib lib64)
|
||||||
|
|
||||||
|
# OSG component libraries. Find each that exists and collect them so
|
||||||
|
# OPENSCENEGRAPH_LIBRARIES covers the transitive dependency set the BgViewer
|
||||||
|
# SDK and BuildingViewerCommon link (the SDK's NEEDED entries require
|
||||||
|
# osg/DB/GA/Qt/Shadow/Sim/Text/Util/Viewer/Particle/Manipulator/Animation).
|
||||||
|
SET(OSG_COMPONENT_LIBS
|
||||||
|
osg
|
||||||
|
osgDB
|
||||||
|
osgUtil
|
||||||
|
osgGA
|
||||||
|
osgText
|
||||||
|
osgViewer
|
||||||
|
osgAnimation
|
||||||
|
osgManipulator
|
||||||
|
osgParticle
|
||||||
|
osgShadow
|
||||||
|
osgSim
|
||||||
|
osgWidget
|
||||||
|
osgQt)
|
||||||
|
|
||||||
|
SET(OPENSCENEGRAPH_LIBRARIES "")
|
||||||
|
FOREACH(_osg_lib ${OSG_COMPONENT_LIBS})
|
||||||
|
FIND_LIBRARY(OSG_LIBRARY_${_osg_lib}
|
||||||
|
NAMES ${_osg_lib}
|
||||||
|
PATHS ${OSG_SEARCH_PREFIXES}
|
||||||
|
PATH_SUFFIXES lib lib64)
|
||||||
|
IF(OSG_LIBRARY_${_osg_lib})
|
||||||
|
LIST(APPEND OPENSCENEGRAPH_LIBRARIES ${OSG_LIBRARY_${_osg_lib}})
|
||||||
|
SET(OPENSCENEGRAPH_${_osg_lib}_FOUND TRUE)
|
||||||
|
ELSE()
|
||||||
|
SET(OPENSCENEGRAPH_${_osg_lib}_FOUND FALSE)
|
||||||
|
ENDIF()
|
||||||
|
ENDFOREACH()
|
||||||
|
|
||||||
|
# Core libs are mandatory for the package to count as found.
|
||||||
|
SET(_osg_core_ok TRUE)
|
||||||
|
IF(NOT OSG_LIBRARY_osg OR NOT OSG_LIBRARY_osgDB OR NOT OSG_LIBRARY_osgUtil
|
||||||
|
OR NOT OSG_LIBRARY_osgGA OR NOT OSG_LIBRARY_osgViewer OR NOT OPENTHREADS_LIBRARY)
|
||||||
|
SET(_osg_core_ok FALSE)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# Any requested component that is missing makes the package not found.
|
||||||
|
FOREACH(_osg_req ${OpenSceneGraph_FIND_COMPONENTS})
|
||||||
|
IF(NOT OSG_LIBRARY_${_osg_req})
|
||||||
|
SET(_osg_core_ok FALSE)
|
||||||
|
MESSAGE(STATUS "OpenSceneGraph: required component '${_osg_req}' not found")
|
||||||
|
ENDIF()
|
||||||
|
ENDFOREACH()
|
||||||
|
|
||||||
|
# Version string from the installed header's OPENSCENEGRAPH_*_VERSION macros.
|
||||||
|
IF(OSG_INCLUDE_DIR)
|
||||||
|
FILE(READ "${OSG_INCLUDE_DIR}/osg/Version" _osg_version_header)
|
||||||
|
STRING(REGEX MATCH "#define[ \t]+OPENSCENEGRAPH_MAJOR_VERSION[ \t]+[0-9]+"
|
||||||
|
_osg_m "${_osg_version_header}")
|
||||||
|
STRING(REGEX MATCH "#define[ \t]+OPENSCENEGRAPH_MINOR_VERSION[ \t]+[0-9]+"
|
||||||
|
_osg_n "${_osg_version_header}")
|
||||||
|
STRING(REGEX MATCH "#define[ \t]+OPENSCENEGRAPH_PATCH_VERSION[ \t]+[0-9]+"
|
||||||
|
_osg_p "${_osg_version_header}")
|
||||||
|
STRING(REGEX REPLACE "[^0-9]" "" _osg_major "${_osg_m}")
|
||||||
|
STRING(REGEX REPLACE "[^0-9]" "" _osg_minor "${_osg_n}")
|
||||||
|
STRING(REGEX REPLACE "[^0-9]" "" _osg_patch "${_osg_p}")
|
||||||
|
IF(_osg_major AND _osg_minor AND _osg_patch)
|
||||||
|
SET(OPENSCENEGRAPH_VERSION "${_osg_major}.${_osg_minor}.${_osg_patch}")
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(OSG_INCLUDE_DIR AND _osg_core_ok)
|
||||||
|
SET(OPENSCENEGRAPH_FOUND TRUE)
|
||||||
|
SET(OPENSCENEGRAPH_INCLUDE_DIRS ${OSG_INCLUDE_DIR})
|
||||||
|
SET(OPENTHREADS_LIBRARIES ${OPENTHREADS_LIBRARY})
|
||||||
|
ELSE()
|
||||||
|
SET(OPENSCENEGRAPH_FOUND FALSE)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
INCLUDE(FindPackageHandleStandardArgs)
|
||||||
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenSceneGraph
|
||||||
|
FOUND_VAR OPENSCENEGRAPH_FOUND
|
||||||
|
VERSION_VAR OPENSCENEGRAPH_VERSION
|
||||||
|
REQUIRED_VARS OPENSCENEGRAPH_INCLUDE_DIRS OPENSCENEGRAPH_LIBRARIES OPENTHREADS_LIBRARIES)
|
||||||
|
|
||||||
|
MARK_AS_ADVANCED(
|
||||||
|
OSG_INCLUDE_DIR OPENTHREADS_LIBRARY
|
||||||
|
OSG_LIBRARY_osg OSG_LIBRARY_osgDB OSG_LIBRARY_osgUtil OSG_LIBRARY_osgGA
|
||||||
|
OSG_LIBRARY_osgText OSG_LIBRARY_osgViewer OSG_LIBRARY_osgAnimation
|
||||||
|
OSG_LIBRARY_osgManipulator OSG_LIBRARY_osgParticle OSG_LIBRARY_osgShadow
|
||||||
|
OSG_LIBRARY_osgSim OSG_LIBRARY_osgWidget OSG_LIBRARY_osgQt)
|
||||||
Reference in new issue
Block a user