Apply clang-format to Lts/Common and DTC/enum headers
- Formatted all CodeGen module files (9 files) - Formatted LtsAppDescriptor module files - Formatted LtsAppManager/AppChooser files - Applied clang-format to all DTC and enum headers across modules - Removed coordTransTests from CommonUnitTestsPlaceholder (moved to tests/) Cosmetic changes only, no functional modifications. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
848 files changed
+89305
-100020
No files matched your search
Executable → Regular
+2034
-2261
File diff suppressed because it is too large.
Load diff
Executable → Regular
+312
-334
@@ -1,25 +1,24 @@
|
||||
#pragma once
|
||||
|
||||
#include <dtEntity/entityid.h>
|
||||
#include <osg/BoundingBox>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <osg/Vec3>
|
||||
#include <osg/Vec4>
|
||||
#include <osg/Matrix>
|
||||
#include <osg/Geode>
|
||||
#include <dtEntity/message.h>
|
||||
#include "cameraviewposition.h"
|
||||
#include "logger.h"
|
||||
#include "viewerinterface.h"
|
||||
|
||||
#include <QMutex>
|
||||
#include <QMutexLocker>
|
||||
#include <QPolygonF>
|
||||
|
||||
#include <set>
|
||||
#include <map>
|
||||
#include <dtEntity/entityid.h>
|
||||
#include <dtEntity/message.h>
|
||||
#include <functional>
|
||||
#include "viewerinterface.h"
|
||||
#include "cameraviewposition.h"
|
||||
#include "logger.h"
|
||||
#include <map>
|
||||
#include <osg/BoundingBox>
|
||||
#include <osg/Geode>
|
||||
#include <osg/Matrix>
|
||||
#include <osg/Vec3>
|
||||
#include <osg/Vec4>
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace dtEntity
|
||||
{
|
||||
@@ -32,451 +31,430 @@ class IconComponent;
|
||||
class TextComponent;
|
||||
class ViewWidget;
|
||||
|
||||
|
||||
struct OBB
|
||||
{
|
||||
osg::Matrix mMatrix;
|
||||
osg::Matrix mMatrixInverse;
|
||||
osg::BoundingBox mBB;
|
||||
QPolygonF mPoly;
|
||||
dtEntity::StringId mBuilding = 0;
|
||||
osg::Matrix mMatrix;
|
||||
osg::Matrix mMatrixInverse;
|
||||
osg::BoundingBox mBB;
|
||||
QPolygonF mPoly;
|
||||
dtEntity::StringId mBuilding = 0;
|
||||
};
|
||||
|
||||
|
||||
struct BuildingData
|
||||
{
|
||||
std::string mDescription;
|
||||
std::string mDisplayName;
|
||||
std::string mFeatureId;
|
||||
std::string mFileName;
|
||||
std::string mBuildingXMLPath;
|
||||
double mX = 0;
|
||||
double mY = 0;
|
||||
double mZ = 0;
|
||||
double mOrientation = 0;
|
||||
int mBuildingGroup = 0;
|
||||
bool properlySpawned = false;
|
||||
bool roomBBoxedLoaded = false;
|
||||
std::string mDescription;
|
||||
std::string mDisplayName;
|
||||
std::string mFeatureId;
|
||||
std::string mFileName;
|
||||
std::string mBuildingXMLPath;
|
||||
double mX = 0;
|
||||
double mY = 0;
|
||||
double mZ = 0;
|
||||
double mOrientation = 0;
|
||||
int mBuildingGroup = 0;
|
||||
bool properlySpawned = false;
|
||||
bool roomBBoxedLoaded = false;
|
||||
};
|
||||
|
||||
|
||||
struct BuildingLevel
|
||||
{
|
||||
|
||||
dtEntity::EntityId mEntityId;
|
||||
|
||||
|
||||
int mFloorId;
|
||||
dtEntity::EntityId mEntityId;
|
||||
|
||||
|
||||
float mHeightAboveGround;
|
||||
int mFloorId;
|
||||
|
||||
|
||||
osg::Matrix mLocalToLevel;
|
||||
float mHeightAboveGround;
|
||||
|
||||
|
||||
osg::BoundingBox mBounds;
|
||||
osg::Matrix mLocalToLevel;
|
||||
|
||||
BuildingLevel(dtEntity::EntityId eid, int floorId, float h, const osg::BoundingBox &bb)
|
||||
: mEntityId(eid), mFloorId(floorId), mHeightAboveGround(h), mBounds(bb)
|
||||
{
|
||||
}
|
||||
osg::BoundingBox mBounds;
|
||||
|
||||
BuildingLevel(dtEntity::EntityId eid, int floorId, float h, const osg::BoundingBox& bb)
|
||||
: mEntityId(eid), mFloorId(floorId), mHeightAboveGround(h), mBounds(bb)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
struct PlayerPosition
|
||||
{
|
||||
osg::Vec2d mPosition;
|
||||
dtEntity::EntityId mWorldPlayerId = 0;
|
||||
osg::Vec2d mPosition;
|
||||
dtEntity::EntityId mWorldPlayerId = 0;
|
||||
};
|
||||
|
||||
|
||||
struct PlayerDisplay
|
||||
{
|
||||
dtEntity::EntityId mWorldPlayerId = 0;
|
||||
dtEntity::EntityId mLocalPlayerId = 0;
|
||||
IconComponent *mIcon = nullptr;
|
||||
dtEntity::EntityId mWorldPlayerId = 0;
|
||||
dtEntity::EntityId mLocalPlayerId = 0;
|
||||
IconComponent* mIcon = nullptr;
|
||||
};
|
||||
|
||||
|
||||
struct Device
|
||||
{
|
||||
dtEntity::EntityId mWorldPlayerId = 0;
|
||||
std::string mPath;
|
||||
osg::Vec3d mPosition;
|
||||
dtEntity::EntityId mWorldPlayerId = 0;
|
||||
std::string mPath;
|
||||
osg::Vec3d mPosition;
|
||||
};
|
||||
|
||||
|
||||
struct DeviceDisplay
|
||||
{
|
||||
Device *mDevice = nullptr;
|
||||
dtEntity::EntityId mWorldPlayerId = 0;
|
||||
dtEntity::EntityId mLocalPlayerId = 0;
|
||||
Device* mDevice = nullptr;
|
||||
dtEntity::EntityId mWorldPlayerId = 0;
|
||||
dtEntity::EntityId mLocalPlayerId = 0;
|
||||
};
|
||||
|
||||
|
||||
struct Name
|
||||
{
|
||||
dtEntity::EntityId mWorldPlayerId;
|
||||
std::string mtext;
|
||||
std::string mdistext;
|
||||
std::string mbuilding;
|
||||
osg::Vec3d mPosition;
|
||||
dtEntity::EntityId mWorldPlayerId;
|
||||
std::string mtext;
|
||||
std::string mdistext;
|
||||
std::string mbuilding;
|
||||
osg::Vec3d mPosition;
|
||||
};
|
||||
|
||||
|
||||
struct NameDisplay
|
||||
{
|
||||
Name* mName = nullptr;
|
||||
dtEntity::EntityId mWorldPlayerId = 0;
|
||||
dtEntity::EntityId mLocalPlayerId = 0;
|
||||
bool visible = false;
|
||||
Name* mName = nullptr;
|
||||
dtEntity::EntityId mWorldPlayerId = 0;
|
||||
dtEntity::EntityId mLocalPlayerId = 0;
|
||||
bool visible = false;
|
||||
};
|
||||
|
||||
|
||||
|
||||
class Shot
|
||||
{
|
||||
public:
|
||||
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,
|
||||
unsigned int duration_s,
|
||||
unsigned int durationMax_s,
|
||||
double simTimeCreated) :
|
||||
mId(id)
|
||||
, mShooterPos(shooterPos)
|
||||
, mTargetPos(targetPos)
|
||||
, mBuildingIdSrc(buildingIdSrc)
|
||||
, mRoomNumberSrc(rommNumberSrc)
|
||||
, mBuildingIdDst(buildingIdDst)
|
||||
, mRoomNumberDst(rommNumberDst)
|
||||
, mLineType(lineType)
|
||||
, mColor(color)
|
||||
, mDuration_s(duration_s)
|
||||
, m_DurationMax_s(durationMax_s)
|
||||
, mSimTimeCreated(simTimeCreated) {
|
||||
public:
|
||||
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,
|
||||
unsigned int duration_s, unsigned int durationMax_s, double simTimeCreated)
|
||||
: mId(id), mShooterPos(shooterPos), mTargetPos(targetPos), mBuildingIdSrc(buildingIdSrc),
|
||||
mRoomNumberSrc(rommNumberSrc), mBuildingIdDst(buildingIdDst), mRoomNumberDst(rommNumberDst),
|
||||
mLineType(lineType), mColor(color), mDuration_s(duration_s), m_DurationMax_s(durationMax_s),
|
||||
mSimTimeCreated(simTimeCreated)
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
void setDisplayTime(unsigned int duration_s)
|
||||
{
|
||||
if (duration_s > m_DurationMax_s)
|
||||
m_DurationMax_s = duration_s;
|
||||
mDuration_s = duration_s;
|
||||
}
|
||||
|
||||
void setDisplayTime(unsigned int duration_s) {
|
||||
if(duration_s > m_DurationMax_s)
|
||||
m_DurationMax_s = duration_s;
|
||||
mDuration_s = duration_s;
|
||||
}
|
||||
double simTimeCreated() const {
|
||||
return mSimTimeCreated;
|
||||
}
|
||||
double simTimeCreated() const
|
||||
{
|
||||
return mSimTimeCreated;
|
||||
}
|
||||
|
||||
double displayTime() const {
|
||||
return mSimTimeCreated + mDuration_s;
|
||||
}
|
||||
double displayTime() const
|
||||
{
|
||||
return mSimTimeCreated + mDuration_s;
|
||||
}
|
||||
|
||||
double lifeTime() const {
|
||||
return mSimTimeCreated + (m_DurationMax_s*2);
|
||||
}
|
||||
double lifeTime() const
|
||||
{
|
||||
return mSimTimeCreated + (m_DurationMax_s * 2);
|
||||
}
|
||||
|
||||
const osg::Vec3d& getShooterPos() const { return mShooterPos; }
|
||||
const osg::Vec3d& getTargetPos() const { return mTargetPos; }
|
||||
int getBuildingIdSrc() const { return mBuildingIdSrc; }
|
||||
double getSimeTimeCreated() const { return mSimTimeCreated; }
|
||||
int getRoomNumberSrc() const { return mRoomNumberSrc; }
|
||||
int getBuildingIdDst() const { return mBuildingIdDst; }
|
||||
int getRoomNumberDst() const { return mRoomNumberDst; }
|
||||
int getDuration() const { return mDuration_s; }
|
||||
int getLineType() const { return mLineType; }
|
||||
const osg::Vec3d& getShooterPos() const
|
||||
{
|
||||
return mShooterPos;
|
||||
}
|
||||
|
||||
const osg::Vec4& getColor() const { return mColor; }
|
||||
int32_t getId() const { return mId; }
|
||||
const osg::Vec3d& getTargetPos() const
|
||||
{
|
||||
return mTargetPos;
|
||||
}
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
int32_t mId;
|
||||
osg::Vec3d mShooterPos;
|
||||
osg::Vec3d mTargetPos;
|
||||
int mBuildingIdSrc;
|
||||
int mRoomNumberSrc;
|
||||
int mBuildingIdDst;
|
||||
int mRoomNumberDst;
|
||||
int mLineType;
|
||||
osg::Vec4 mColor;
|
||||
unsigned int mDuration_s, m_DurationMax_s;
|
||||
double mSimTimeCreated;
|
||||
int getBuildingIdSrc() const
|
||||
{
|
||||
return mBuildingIdSrc;
|
||||
}
|
||||
|
||||
double getSimeTimeCreated() const
|
||||
{
|
||||
return mSimTimeCreated;
|
||||
}
|
||||
|
||||
int getRoomNumberSrc() const
|
||||
{
|
||||
return mRoomNumberSrc;
|
||||
}
|
||||
|
||||
int getBuildingIdDst() const
|
||||
{
|
||||
return mBuildingIdDst;
|
||||
}
|
||||
|
||||
int getRoomNumberDst() const
|
||||
{
|
||||
return mRoomNumberDst;
|
||||
}
|
||||
|
||||
int getDuration() const
|
||||
{
|
||||
return mDuration_s;
|
||||
}
|
||||
|
||||
int getLineType() const
|
||||
{
|
||||
return mLineType;
|
||||
}
|
||||
|
||||
const osg::Vec4& getColor() const
|
||||
{
|
||||
return mColor;
|
||||
}
|
||||
|
||||
int32_t getId() const
|
||||
{
|
||||
return mId;
|
||||
}
|
||||
|
||||
private:
|
||||
NGL::INGLLogger& m_logger;
|
||||
int32_t mId;
|
||||
osg::Vec3d mShooterPos;
|
||||
osg::Vec3d mTargetPos;
|
||||
int mBuildingIdSrc;
|
||||
int mRoomNumberSrc;
|
||||
int mBuildingIdDst;
|
||||
int mRoomNumberDst;
|
||||
int mLineType;
|
||||
osg::Vec4 mColor;
|
||||
unsigned int mDuration_s, m_DurationMax_s;
|
||||
double mSimTimeCreated;
|
||||
};
|
||||
|
||||
|
||||
struct ShotDisplay
|
||||
{
|
||||
Shot *mShot = nullptr;
|
||||
osg::ref_ptr<osg::Geode> mGeode;
|
||||
Shot* mShot = nullptr;
|
||||
osg::ref_ptr<osg::Geode> mGeode;
|
||||
};
|
||||
|
||||
|
||||
struct Building;
|
||||
|
||||
|
||||
|
||||
|
||||
class OrthoMotionModelComponent;
|
||||
|
||||
struct BuildingDisplay
|
||||
{
|
||||
|
||||
unsigned int mContextId = 0;
|
||||
{
|
||||
|
||||
|
||||
dtEntity::EntityId mAttachPointId = 0;
|
||||
unsigned int mContextId = 0;
|
||||
|
||||
|
||||
std::vector<BuildingLevel> mLevels;
|
||||
dtEntity::EntityId mAttachPointId = 0;
|
||||
|
||||
|
||||
osg::BoundingBox mWorldBounds;
|
||||
std::vector<BuildingLevel> mLevels;
|
||||
|
||||
|
||||
osg::BoundingBox mLocalBounds;
|
||||
osg::BoundingBox mWorldBounds;
|
||||
|
||||
|
||||
dtEntity::EntityId mCameraId = 0;
|
||||
osg::BoundingBox mLocalBounds;
|
||||
|
||||
|
||||
dtEntity::EntityId mMotionModelId = 0;
|
||||
OrthoMotionModelComponent *pMotion = nullptr;
|
||||
dtEntity::EntityId mCameraId = 0;
|
||||
|
||||
|
||||
dtEntity::EntityId mLightId = 0;
|
||||
dtEntity::EntityId mMotionModelId = 0;
|
||||
OrthoMotionModelComponent* pMotion = nullptr;
|
||||
|
||||
|
||||
PlayerDisplayMode mPlayerDisplayMode = PlayerDisplayMode::Icons;
|
||||
dtEntity::EntityId mLightId = 0;
|
||||
|
||||
|
||||
ViewMode mViewMode = ViewMode::ISOMETRIC;
|
||||
PlayerDisplayMode mPlayerDisplayMode = PlayerDisplayMode::Icons;
|
||||
|
||||
|
||||
std::vector<PlayerDisplay> mPlayers;
|
||||
ViewMode mViewMode = ViewMode::ISOMETRIC;
|
||||
|
||||
|
||||
std::vector<ShotDisplay> mShotDisplays;
|
||||
std::vector<PlayerDisplay> mPlayers;
|
||||
|
||||
|
||||
std::vector<DeviceDisplay> mDeviceDisplays;
|
||||
std::vector<ShotDisplay> mShotDisplays;
|
||||
|
||||
|
||||
std::vector<NameDisplay> mNameDisplays;
|
||||
std::vector<DeviceDisplay> mDeviceDisplays;
|
||||
|
||||
|
||||
bool mLockRotation = false;
|
||||
std::vector<NameDisplay> mNameDisplays;
|
||||
|
||||
|
||||
bool mNameMode = false;
|
||||
bool mLockRotation = false;
|
||||
|
||||
|
||||
bool mLineMode = false;
|
||||
bool mNameMode = false;
|
||||
|
||||
BuildingDisplay() = default;
|
||||
bool mLineMode = false;
|
||||
|
||||
BuildingDisplay(unsigned int contextid, ViewMode vm)
|
||||
: mContextId(contextid)
|
||||
, mViewMode(vm)
|
||||
{
|
||||
}
|
||||
BuildingDisplay() = default;
|
||||
|
||||
BuildingDisplay(unsigned int contextid, ViewMode vm) : mContextId(contextid), mViewMode(vm) {}
|
||||
};
|
||||
|
||||
|
||||
struct Building
|
||||
{
|
||||
|
||||
dtEntity::EntityId mWorldBuildingId = 0;
|
||||
|
||||
|
||||
std::vector<BuildingDisplay> mDisplays;
|
||||
dtEntity::EntityId mWorldBuildingId = 0;
|
||||
|
||||
|
||||
osg::Matrix mWorldToLocal;
|
||||
std::vector<BuildingDisplay> mDisplays;
|
||||
|
||||
|
||||
osg::Matrix mLocalToWorld;
|
||||
osg::Matrix mWorldToLocal;
|
||||
|
||||
|
||||
std::string mNavMeshGrpName;
|
||||
osg::Matrix mLocalToWorld;
|
||||
|
||||
|
||||
std::vector<Shot *> mShots;
|
||||
std::string mNavMeshGrpName;
|
||||
|
||||
|
||||
std::vector<Device *> mDevices;
|
||||
std::vector<Shot*> mShots;
|
||||
|
||||
|
||||
std::string mBuildingDisplayName;
|
||||
std::vector<Device*> mDevices;
|
||||
|
||||
|
||||
std::vector<Name*> mNames;
|
||||
std::string mBuildingDisplayName;
|
||||
|
||||
|
||||
std::string mFeatureId;
|
||||
std::vector<Name*> mNames;
|
||||
|
||||
std::string mFeatureId;
|
||||
};
|
||||
|
||||
|
||||
class BuildingManager
|
||||
{
|
||||
|
||||
public:
|
||||
public:
|
||||
explicit BuildingManager(dtEntity::EntityManager& em);
|
||||
~BuildingManager();
|
||||
|
||||
explicit BuildingManager(dtEntity::EntityManager &em);
|
||||
~BuildingManager();
|
||||
void addBuilding(dtEntity::EntityId buildingid, const std::string& featureId);
|
||||
void deleteAllBuildings();
|
||||
|
||||
void addBuilding(dtEntity::EntityId buildingid, const std::string &featureId);
|
||||
void deleteAllBuildings();
|
||||
BuildingDisplay* getBuildingDisplay(unsigned int contextid);
|
||||
void applyViewModeToBuildingParts(const Building& bldg, BuildingDisplay& dspl) const;
|
||||
|
||||
BuildingDisplay *getBuildingDisplay(unsigned int contextid);
|
||||
void applyViewModeToBuildingParts(const Building &bldg, BuildingDisplay &dspl) const;
|
||||
bool displayBuilding(const std::string& featureId, unsigned int contextid, dtEntity::EntityId buildingid,
|
||||
const osg::Vec4& bgcolor, ViewMode viewmode, bool exactPos);
|
||||
bool displayBuilding(unsigned int contextid, dtEntity::EntityId buildingid, const osg::Vec4& bgcolor,
|
||||
ViewMode viewmode, bool exactPos);
|
||||
|
||||
bool displayBuilding(const std::string& featureId, unsigned int contextid, dtEntity::EntityId buildingid, const osg::Vec4 &bgcolor, ViewMode viewmode, bool exactPos);
|
||||
bool displayBuilding(unsigned int contextid, dtEntity::EntityId buildingid, const osg::Vec4 &bgcolor, ViewMode viewmode, bool exactPos);
|
||||
bool setCameraPosition(unsigned int contextid, const BuildingViewer::CameraViewPosition& pos);
|
||||
bool getCameraPosition(unsigned int contextid, BuildingViewer::CameraViewPosition& pos);
|
||||
bool setDefaultCameraPosition(unsigned int contextid);
|
||||
|
||||
bool setCameraPosition(unsigned int contextid, const BuildingViewer::CameraViewPosition& pos);
|
||||
bool getCameraPosition(unsigned int contextid, BuildingViewer::CameraViewPosition& pos);
|
||||
bool setDefaultCameraPosition(unsigned int contextid);
|
||||
void closeBuildingDisplay(unsigned int contextid);
|
||||
void changeViewMode(unsigned int contextId, ViewMode viewmode, bool useOriginViewPos = true);
|
||||
void changeLineMode(unsigned int contextId, bool line);
|
||||
void changeNameMode(unsigned int contextId, bool name);
|
||||
|
||||
void closeBuildingDisplay(unsigned int contextid);
|
||||
void changeViewMode(unsigned int contextId, ViewMode viewmode, bool useOriginViewPos = true);
|
||||
void changeLineMode(unsigned int contextId, bool line);
|
||||
void changeNameMode(unsigned int contextId, bool name);
|
||||
void applyMapRotation(const Building& bd, BuildingDisplay& dspl);
|
||||
void lockViewRotationToMapRotation(unsigned int contextId, bool lock);
|
||||
void setPlayerDisplayMode(unsigned int contextId, PlayerDisplayMode mode);
|
||||
void setWallTransparency(unsigned int contextId, float value);
|
||||
|
||||
void applyMapRotation(const Building &bd, BuildingDisplay &dspl);
|
||||
void lockViewRotationToMapRotation(unsigned int contextId, bool lock);
|
||||
void setPlayerDisplayMode(unsigned int contextId, PlayerDisplayMode mode);
|
||||
void setWallTransparency(unsigned int contextId, float value);
|
||||
float getMapRotation() const;
|
||||
void setMapRotation(float angle);
|
||||
|
||||
float getMapRotation() const;
|
||||
void setMapRotation(float angle);
|
||||
void openOverview(unsigned int contextid);
|
||||
|
||||
void openOverview(unsigned int contextid);
|
||||
void addPlayerToBuildings(const std::string& navmeshgrpname, dtEntity::EntityId eid, const osg::Vec4& color,
|
||||
const std::string& symbol, const osg::Vec3d& pos, bool visible);
|
||||
void removePlayerFromBuilding(const std::string& navmeshgrpname, dtEntity::EntityId eid,
|
||||
const std::string& roomname);
|
||||
void updatePlayerPosition(const std::string& navmeshgrpname, dtEntity::EntityId eid, const osg::Vec3d& pos,
|
||||
int roomNumber);
|
||||
|
||||
void addPlayerToBuildings(const std::string &navmeshgrpname, dtEntity::EntityId eid,
|
||||
const osg::Vec4 &color, const std::string &symbol,
|
||||
const osg::Vec3d &pos, bool visible);
|
||||
void removePlayerFromBuilding(const std::string &navmeshgrpname, dtEntity::EntityId eid, const std::string &roomname);
|
||||
void updatePlayerPosition(const std::string &navmeshgrpname, dtEntity::EntityId eid,
|
||||
const osg::Vec3d &pos, int roomNumber);
|
||||
osg::Vec3d remapPosition(const Building& bd, const BuildingDisplay& dspl, const osg::Vec3d& world,
|
||||
int roomNumber = -1);
|
||||
|
||||
osg::Vec3d remapPosition(const Building &bd, const BuildingDisplay &dspl, const osg::Vec3d &world, int roomNumber = -1);
|
||||
void setPlayerColor(dtEntity::EntityId eid, const osg::Vec4& color);
|
||||
void setPlayerIcon(dtEntity::EntityId eid, const std::string& path);
|
||||
void reloadPlayerIcons();
|
||||
void updatePlayerPartyColor(dtEntity::EntityId eid, const VCtrl::Color& col);
|
||||
void setShowPlayerSelection(dtEntity::EntityId eid, bool show);
|
||||
void setShowDisplayNamesSelection(dtEntity::EntityId eid, bool show);
|
||||
void setShowHidePlayer(dtEntity::EntityId eid, bool show);
|
||||
void setShowHideDisplayNames(dtEntity::EntityId eid, unsigned int contextId, bool show);
|
||||
void setRoomDestructionValue(dtEntity::EntityId eid, const std::string& roomname, float value);
|
||||
void setBuildingDestructionValue(dtEntity::EntityId eid, float value);
|
||||
void setBuildingDisplayName(const std::string& featureId, dtEntity::EntityId eid,
|
||||
const std::string& strDisplayName);
|
||||
void setBuildingDisplayName(dtEntity::EntityId eid, const std::string& strDisplayName);
|
||||
void setRoomDisplayName(const std::string& featureId, dtEntity::EntityId eid, const std::string& roomname,
|
||||
const std::string& strDisplayName);
|
||||
void setRoomDisplayName(Building* building, const std::string& roomname, const std::string& strDisplayName);
|
||||
|
||||
void setPlayerColor(dtEntity::EntityId eid, const osg::Vec4 &color);
|
||||
void setPlayerIcon(dtEntity::EntityId eid, const std::string &path);
|
||||
void reloadPlayerIcons();
|
||||
void updatePlayerPartyColor(dtEntity::EntityId eid, const VCtrl::Color& col);
|
||||
void setShowPlayerSelection(dtEntity::EntityId eid, bool show);
|
||||
void setShowDisplayNamesSelection(dtEntity::EntityId eid, bool show);
|
||||
void setShowHidePlayer(dtEntity::EntityId eid, bool show);
|
||||
void setShowHideDisplayNames(dtEntity::EntityId eid, unsigned int contextId, bool show);
|
||||
void setRoomDestructionValue(dtEntity::EntityId eid, const std::string &roomname, float value);
|
||||
void setBuildingDestructionValue(dtEntity::EntityId eid, float value);
|
||||
void setBuildingDisplayName(const std::string& featureId, dtEntity::EntityId eid, const std::string& strDisplayName);
|
||||
void setBuildingDisplayName(dtEntity::EntityId eid, const std::string& strDisplayName);
|
||||
void setRoomDisplayName(const std::string& featureId, dtEntity::EntityId eid, const std::string& roomname, const std::string& strDisplayName);
|
||||
void setRoomDisplayName(Building *building, const std::string &roomname, const std::string& strDisplayName);
|
||||
void removeShoot(int32_t id);
|
||||
void showShoot(int32_t id, dtEntity::EntityId shooter, dtEntity::EntityId target, const dtEntity::Vec3d& shooterPos,
|
||||
const dtEntity::Vec3d& targetPos, int buildingIdSrc, int roomNumberSrc, int buildingIdDst,
|
||||
int roomNumberDst, int lineType, float duration, double simTimeCreated);
|
||||
|
||||
void removeShoot(int32_t id);
|
||||
void showShoot(int32_t id, dtEntity::EntityId shooter, dtEntity::EntityId target,
|
||||
const dtEntity::Vec3d &shooterPos, const dtEntity::Vec3d &targetPos, int buildingIdSrc, int roomNumberSrc,
|
||||
int buildingIdDst, int roomNumberDst, int lineType, float duration, double simTimeCreated);
|
||||
dtEntity::EntityId getWorldPlayerIdFromLocalPlayer(dtEntity::EntityId local) const;
|
||||
dtEntity::EntityId getWorldNameIdFromLocalName(dtEntity::EntityId local, std::string& buildingName,
|
||||
std::string& room) const;
|
||||
|
||||
dtEntity::EntityId getWorldPlayerIdFromLocalPlayer(dtEntity::EntityId local) const;
|
||||
dtEntity::EntityId getWorldNameIdFromLocalName(dtEntity::EntityId local, std::string &buildingName, std::string &room) const;
|
||||
void addDeviceToBuilding(dtEntity::EntityId iconmainid, dtEntity::EntityId buildingid, const osg::Vec3d& pos,
|
||||
const std::string& iconpath);
|
||||
void removeDeviceFromBuilding(dtEntity::EntityId iconmainid);
|
||||
|
||||
void addDeviceToBuilding(dtEntity::EntityId iconmainid, dtEntity::EntityId buildingid,
|
||||
const osg::Vec3d &pos, const std::string &iconpath);
|
||||
void removeDeviceFromBuilding(dtEntity::EntityId iconmainid);
|
||||
bool AddRoomOBBs(const BuildingData&);
|
||||
|
||||
const std::map<std::string, VCtrl::OBB>& GetRoomOBBs() const
|
||||
{
|
||||
return mRooms;
|
||||
}
|
||||
|
||||
|
||||
bool AddRoomOBBs(const BuildingData &);
|
||||
const std::map<std::string, VCtrl::OBB> &GetRoomOBBs() const { return mRooms; }
|
||||
bool getRoomBounds(const std::string& bldgname, const std::string& roomname, VCtrl::OBB& obb) const;
|
||||
|
||||
|
||||
bool getRoomBounds(const std::string &bldgname, const std::string &roomname, VCtrl::OBB &obb) const;
|
||||
bool LoadBuildings(const std::string& path, std::vector<BuildingData>&);
|
||||
|
||||
size_t getNumBuildings() const;
|
||||
void getBuildingIds(std::vector<dtEntity::EntityId>& toFill) const;
|
||||
dtEntity::EntityId getNextBuilding(const osg::Vec3d& pos, float& distance, std::string& featureId) const;
|
||||
Building getBuildingFromFeatureId(const std::string& bldname) const;
|
||||
|
||||
bool LoadBuildings(const std::string &path, std::vector<BuildingData> &);
|
||||
using RoomPlayers = std::vector<PlayerPosition>;
|
||||
|
||||
size_t getNumBuildings() const;
|
||||
void getBuildingIds(std::vector<dtEntity::EntityId> &toFill) const;
|
||||
dtEntity::EntityId getNextBuilding(const osg::Vec3d &pos, float &distance, std::string &featureId) const;
|
||||
Building getBuildingFromFeatureId(const std::string &bldname) const;
|
||||
osg::Vec2d AddRoomUsages(const std::string& bldgname, const std::string& roomname, VCtrl::PlayerPosition& playPos);
|
||||
|
||||
|
||||
using RoomPlayers = std::vector<PlayerPosition>;
|
||||
|
||||
osg::Vec2d AddRoomUsages(const std::string& bldgname, const std::string& roomname, VCtrl::PlayerPosition& playPos);
|
||||
const std::map<std::string, RoomPlayers> &GetRoomUsages() const { return mUsedRooms; }
|
||||
|
||||
void deleteRoomUsagePlayer(const std::string& bldgname, const std::string& roomname, dtEntity::EntityId playerId);
|
||||
void SetExactPos(bool exactPos) { mExactPos = exactPos; }
|
||||
bool GetExactPos() const { return mExactPos; }
|
||||
void updateShotDuration(unsigned int newDuration_s);
|
||||
using CallbackCamPosChanged = std::function<void(unsigned int, const BuildingViewer::CameraViewPosition &)>;
|
||||
void setCallbackCamPosChanged(const CallbackCamPosChanged &cb);
|
||||
const std::map<std::string, RoomPlayers>& GetRoomUsages() const
|
||||
{
|
||||
return mUsedRooms;
|
||||
}
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void updateShots(const Building &bd, BuildingDisplay &dspl);
|
||||
void updateDevices(const Building &bd, BuildingDisplay &dspl);
|
||||
void createRoomNames(dtEntity::EntityId buildingid, Building& building);
|
||||
void updateNames(const Building& bd, BuildingDisplay& dspl);
|
||||
void repositionCamera(const Building &bd, const BuildingDisplay &dspl, bool useOriginViewPos = true);
|
||||
void updatePlayerPositions(const Building &bd, BuildingDisplay &dspl);
|
||||
void addPlayerToBuilding(const Building &bd, BuildingDisplay &dspl, dtEntity::EntityId eid,
|
||||
const osg::Vec4 &color, const std::string &symbol, const osg::Vec3d &pos,
|
||||
bool visible);
|
||||
static osg::Vec2d shiftPosition(const VCtrl::OBB& obb, const osg::Vec2d& pos, double& shiftValue);
|
||||
void cameraViewPositionChanged(unsigned int contextId, const BuildingViewer::CameraViewPosition &viewPos);
|
||||
void deleteRoomUsagePlayer(const std::string& bldgname, const std::string& roomname, dtEntity::EntityId playerId);
|
||||
|
||||
std::set<unsigned int> m_setInitialCameraPositionSet;
|
||||
void SetExactPos(bool exactPos)
|
||||
{
|
||||
mExactPos = exactPos;
|
||||
}
|
||||
|
||||
std::map<std::string, std::map<std::string, std::string>> m_mapBuildingRoomNames;
|
||||
std::map<std::string, std::string> m_mapBuildingDisplayNames;
|
||||
dtEntity::EntityManager *mEntityManager;
|
||||
bool GetExactPos() const
|
||||
{
|
||||
return mExactPos;
|
||||
}
|
||||
|
||||
std::vector<Building *> mBuildings;
|
||||
QMutex m_mutexShots;
|
||||
void updateShotDuration(unsigned int newDuration_s);
|
||||
using CallbackCamPosChanged = std::function<void(unsigned int, const BuildingViewer::CameraViewPosition&)>;
|
||||
void setCallbackCamPosChanged(const CallbackCamPosChanged& cb);
|
||||
|
||||
bool mShotOverview;
|
||||
bool mExactPos;
|
||||
float mMapRotation;
|
||||
dtEntity::MessageFunctor mTickFunctor;
|
||||
private:
|
||||
NGL::INGLLogger& m_logger;
|
||||
void updateShots(const Building& bd, BuildingDisplay& dspl);
|
||||
void updateDevices(const Building& bd, BuildingDisplay& dspl);
|
||||
void createRoomNames(dtEntity::EntityId buildingid, Building& building);
|
||||
void updateNames(const Building& bd, BuildingDisplay& dspl);
|
||||
void repositionCamera(const Building& bd, const BuildingDisplay& dspl, bool useOriginViewPos = true);
|
||||
void updatePlayerPositions(const Building& bd, BuildingDisplay& dspl);
|
||||
void addPlayerToBuilding(const Building& bd, BuildingDisplay& dspl, dtEntity::EntityId eid, const osg::Vec4& color,
|
||||
const std::string& symbol, const osg::Vec3d& pos, bool visible);
|
||||
static osg::Vec2d shiftPosition(const VCtrl::OBB& obb, const osg::Vec2d& pos, double& shiftValue);
|
||||
void cameraViewPositionChanged(unsigned int contextId, const BuildingViewer::CameraViewPosition& viewPos);
|
||||
|
||||
void Tick(const dtEntity::Message &message);
|
||||
std::set<unsigned int> m_setInitialCameraPositionSet;
|
||||
|
||||
std::map<std::string, VCtrl::OBB> mRooms;
|
||||
std::map<std::string, RoomPlayers> mUsedRooms;
|
||||
CallbackCamPosChanged mCbCamPosChanged;
|
||||
std::map<std::string, std::map<std::string, std::string>> m_mapBuildingRoomNames;
|
||||
std::map<std::string, std::string> m_mapBuildingDisplayNames;
|
||||
dtEntity::EntityManager* mEntityManager;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
bool getFloorOfRoom(const std::string &bdlgFeatureId, int roomNumber, int &floorOut) const;
|
||||
|
||||
|
||||
std::map<std::string, std::map<int,int> > mRoomToFloorPerBldg;
|
||||
std::vector<Building*> mBuildings;
|
||||
QMutex m_mutexShots;
|
||||
|
||||
bool mShotOverview;
|
||||
bool mExactPos;
|
||||
float mMapRotation;
|
||||
dtEntity::MessageFunctor mTickFunctor;
|
||||
|
||||
void Tick(const dtEntity::Message& message);
|
||||
|
||||
std::map<std::string, VCtrl::OBB> mRooms;
|
||||
std::map<std::string, RoomPlayers> mUsedRooms;
|
||||
CallbackCamPosChanged mCbCamPosChanged;
|
||||
|
||||
bool getFloorOfRoom(const std::string& bdlgFeatureId, int roomNumber, int& floorOut) const;
|
||||
|
||||
std::map<std::string, std::map<int, int>> mRoomToFloorPerBldg;
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace VCtrl
|
||||
Executable → Regular
+176
-285
@@ -1,41 +1,39 @@
|
||||
#pragma once
|
||||
|
||||
#include "buildingmanager.h"
|
||||
#include "exccommands.h"
|
||||
#include "logger.h"
|
||||
#include "viewerinterface.h"
|
||||
#include "viewwidgetcontainer.h"
|
||||
#include <dtEntity/mapcomponent.h>
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <algorithm>
|
||||
#include "viewwidgetstate.h"
|
||||
|
||||
#include <QPointer>
|
||||
#include <QWidget>
|
||||
|
||||
#include <dtEntity/mapcomponent.h>
|
||||
#include <dtEntity/core.h>
|
||||
#include <algorithm>
|
||||
#include <dtEntity/commandmessages.h>
|
||||
#include <dtEntity/core.h>
|
||||
#include <dtEntity/mapcomponent.h>
|
||||
#include <dtEntity/systemmessages.h>
|
||||
#include <dtEntity/windowinterface.h>
|
||||
#include <dtEntityOSG/cameracomponent.h>
|
||||
#include <dtEntityOSG/layercomponent.h>
|
||||
#include <dtEntityOSG/positionattitudetransformcomponent.h>
|
||||
#include <dtEntityOSG/osgsysteminterface.h>
|
||||
#include <dtEntityOSG/positionattitudetransformcomponent.h>
|
||||
#include <dtEntityOSG/staticmeshcomponent.h>
|
||||
#include <map>
|
||||
#include <osg/ComputeBoundsVisitor>
|
||||
#include <osg/io_utils>
|
||||
#include <osgDB/FileNameUtils>
|
||||
#include <osgDB/FileUtils>
|
||||
#include <osg/ComputeBoundsVisitor>
|
||||
#include <osgViewer/CompositeViewer>
|
||||
#include "buildingmanager.h"
|
||||
#include "exccommands.h"
|
||||
#include "viewwidgetstate.h"
|
||||
#include "logger.h"
|
||||
#include <string>
|
||||
|
||||
namespace dtEntity
|
||||
{
|
||||
class EntityManager;
|
||||
class MapSystem;
|
||||
class Message;
|
||||
}
|
||||
} // namespace dtEntity
|
||||
|
||||
namespace VCtrl
|
||||
{
|
||||
@@ -48,354 +46,247 @@ class CtrlMainWindow;
|
||||
|
||||
class CtrlImpl : public QObject, public ViewerInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
Q_OBJECT
|
||||
public:
|
||||
CtrlImpl(dtEntity::EntityManager& em, QWidget* parentWidget);
|
||||
~CtrlImpl();
|
||||
|
||||
CtrlImpl(dtEntity::EntityManager &em, QWidget *parentWidget);
|
||||
~CtrlImpl();
|
||||
void SetViewerCallback(ViewerCallback*) override;
|
||||
void RemoveViewerCallback() override;
|
||||
|
||||
void SetViewerCallback(ViewerCallback *) override;
|
||||
void RemoveViewerCallback() override;
|
||||
void SetProjectDataPaths(const std::vector<std::string>& paths) override;
|
||||
|
||||
|
||||
QWidget* getMainWindow() override;
|
||||
quintptr requestMainWindowHandle() override;
|
||||
|
||||
void SetProjectDataPaths(const std::vector<std::string> &paths) override;
|
||||
void openViews(const std::vector<std::string>& bldIds, bool exactPos) override;
|
||||
bool isViewOpen(const std::string& strBldId) const override;
|
||||
|
||||
QWidget* getMainWindow() override;
|
||||
quintptr requestMainWindowHandle() override;
|
||||
void closeViews(const std::vector<std::string>& vecFeatureIDs) override;
|
||||
void closeAllViews();
|
||||
|
||||
void UseExactPositioning(bool exactPos) override;
|
||||
|
||||
void openViews(const std::vector<std::string> &bldIds, bool exactPos) override;
|
||||
bool isViewOpen(const std::string &strBldId) const override;
|
||||
bool OpenView(const std::string& buildingid, const std::string& windowtitle, const Color& col, ViewMode viewmode,
|
||||
int screennum, bool fullscreen, int x, int y, int w, int h, unsigned int& contextid,
|
||||
bool exactPos = true) override;
|
||||
|
||||
void closeViews(const std::vector<std::string> &vecFeatureIDs) override;
|
||||
void closeAllViews();
|
||||
void CloseView(unsigned int contextid) override;
|
||||
|
||||
void UseExactPositioning(bool exactPos) override;
|
||||
void ChangeViewMode(unsigned int contextId, ViewMode viewmode) override;
|
||||
|
||||
|
||||
void LockViewRotationToMapRotation(unsigned int contextId, bool lock) override;
|
||||
|
||||
bool OpenView(const std::string &buildingid, const std::string &windowtitle, const Color &col,
|
||||
ViewMode viewmode, int screennum,
|
||||
bool fullscreen, int x, int y, int w, int h, unsigned int &contextid, bool exactPos = true) override;
|
||||
void SetPlayerDisplayMode(unsigned int contextId, PlayerDisplayMode mode) override;
|
||||
|
||||
void SetWallTransparency(unsigned int contextId, float transparency) override;
|
||||
|
||||
|
||||
float GetMapRotation() const override;
|
||||
|
||||
void CloseView(unsigned int contextid) override;
|
||||
void SetMapRotation(float angle) override;
|
||||
|
||||
|
||||
void OpenOverview() override;
|
||||
|
||||
void ChangeViewMode(unsigned int contextId, ViewMode viewmode) override;
|
||||
bool LoadBuildingPositionMap(const std::string& path, bool loadAllAvailableBuildings) override;
|
||||
|
||||
|
||||
void LoadAllBuildings();
|
||||
|
||||
void LockViewRotationToMapRotation(unsigned int contextId, bool lock) override;
|
||||
void CreatePlayer(const std::string& id, const std::string& iconpath, const Color& color) override;
|
||||
|
||||
|
||||
void DeletePlayer(const std::string& id, float seconds = 0) override;
|
||||
|
||||
void SetPlayerDisplayMode(unsigned int contextId, PlayerDisplayMode mode) override;
|
||||
void SetPlayerColor(const std::string& id, const Color& color) override;
|
||||
|
||||
|
||||
void SetPlayerIcon(const std::string& id, const std::string& path) override;
|
||||
|
||||
void SetWallTransparency(unsigned int contextId, float transparency) override;
|
||||
void reloadPlayerIcons() override;
|
||||
|
||||
|
||||
void UpdatePlayerPartyColors(const std::map<std::string, VCtrl::Color>& mapPlayerColors) override;
|
||||
|
||||
float GetMapRotation() const override;
|
||||
size_t GetNumPlayers() const override;
|
||||
|
||||
|
||||
void GetPlayerIds(std::vector<std::string>& toFill) override;
|
||||
|
||||
void SetMapRotation(float angle) override;
|
||||
void SetPlayerShown(const std::string& id, bool show, double when = -1) override;
|
||||
|
||||
|
||||
size_t GetNumBuildings() const override;
|
||||
|
||||
void OpenOverview() override;
|
||||
void GetBuildingIds(std::vector<std::string>& toFill) const override;
|
||||
|
||||
void SetShowSelectionBox(const std::string& id, bool show, float duration = -1) override;
|
||||
|
||||
|
||||
void Shoot(const int32_t id, const std::string& shooter, const std::string& target, const Vec3d& shooterPos,
|
||||
const Vec3d& targetPos, int buildingIdSrc, int roomNumberSrc, int buildingIdDst, int roomNumberDst,
|
||||
int lineType, double when) override;
|
||||
void Shoot(const int32_t id, const std::string& shooter, const std::string& targetBuildingId,
|
||||
const std::string& targetRoomId, const Vec3d& shooterPos, int lineType, double when) override;
|
||||
|
||||
bool LoadBuildingPositionMap(const std::string &path, bool loadAllAvailableBuildings) override;
|
||||
void removeShoot(const int32_t id) override;
|
||||
|
||||
void Teleport(const std::string& id, double when, const Vec3d& target, const std::string& bldgname, int roomNumber,
|
||||
const std::string& roomname, ZValue zval) override;
|
||||
|
||||
void LoadAllBuildings();
|
||||
void GetRoomNames(const std::string& id, std::vector<std::string>& names) override;
|
||||
|
||||
|
||||
bool SetRoomDestructionValue(const std::string& id, const std::string& roomname, float value) override;
|
||||
|
||||
void CreatePlayer(const std::string &id, const std::string &iconpath, const Color &color) override;
|
||||
bool SetBuildingDestructionValue(const std::string& id, float value) override;
|
||||
|
||||
|
||||
void GetDeviceNames(const std::string& buildingId, std::vector<std::string>& names) override;
|
||||
|
||||
void DeletePlayer(const std::string &id, float seconds = 0) override;
|
||||
bool ShowDeviceIcon(const std::string& id, const std::string& buildingid, const std::string& devicename,
|
||||
const std::string& iconpath) override;
|
||||
|
||||
|
||||
bool ShowDeviceIcon(const std::string& id, const std::string& buildingid, const Vec3d& position,
|
||||
const std::string& iconpath) override;
|
||||
|
||||
void SetPlayerColor(const std::string &id, const Color &color) override;
|
||||
void ChangeLineMode(unsigned int contextId, bool line) override;
|
||||
void ChangeNameMode(unsigned int contextId, bool name) override;
|
||||
|
||||
|
||||
bool SetDisplayName(const std::string& buildingid, const std::string& roomname,
|
||||
const std::string& strDisplayName) override;
|
||||
void ShowDisplayNames(const std::string& buildingid, bool show) override;
|
||||
void SetShowDisplayNamesSelectionBox(const std::string& buildingid, const std::string& id, bool show,
|
||||
float duration = -1) override;
|
||||
void setHitLineDuration(uint32_t durationSec) override;
|
||||
void setMountingPointAsset(const MountingPointDescription& asset) override;
|
||||
std::vector<BuildingState> getBuildingState() const override;
|
||||
|
||||
void SetPlayerIcon(const std::string &id, const std::string &path) override;
|
||||
bool HideDeviceIcon(const std::string& id) override;
|
||||
|
||||
float GetTimeScale() const override;
|
||||
|
||||
void reloadPlayerIcons() override;
|
||||
void SetTimeScale(float scale) override;
|
||||
|
||||
void UpdatePlayerPartyColors(const std::map<std::string, VCtrl::Color>& mapPlayerColors) override;
|
||||
void SetSimulationTime(double t) override;
|
||||
|
||||
|
||||
double GetSimulationTime() const override;
|
||||
|
||||
size_t GetNumPlayers() const override;
|
||||
void SetPaused(bool) override;
|
||||
|
||||
|
||||
bool GetPaused() const override;
|
||||
|
||||
void GetPlayerIds(std::vector<std::string> &toFill) override;
|
||||
void FastForwardSimulationTo(double t) override;
|
||||
|
||||
|
||||
void DeleteQueuedCommands() override;
|
||||
|
||||
void SetPlayerShown(const std::string &id, bool show, double when = -1) override;
|
||||
void SetNonRealtimeMode(bool on) override;
|
||||
|
||||
|
||||
bool GetNonRealtimeMode() const override;
|
||||
|
||||
size_t GetNumBuildings() const override;
|
||||
bool StartVideoRecording(unsigned int contextid, const std::string& path, int w, int h, int framerate,
|
||||
int quality) override;
|
||||
bool StartVideoRecording(const std::string& buildingId, const std::string& path, int w, int h, int framerate,
|
||||
int quality) override;
|
||||
|
||||
|
||||
bool StopVideoRecording(unsigned int contextid) override;
|
||||
bool StopVideoRecording(const std::string& buildingId) override;
|
||||
|
||||
void GetBuildingIds(std::vector<std::string> &toFill) const override;
|
||||
void setTransparency(double percent) override;
|
||||
void setViewMode(ViewMode m) override;
|
||||
void setDisplayMode(PlayerDisplayMode m) override;
|
||||
|
||||
|
||||
|
||||
void SetShowSelectionBox(const std::string &id,
|
||||
bool show,
|
||||
float duration = -1) override;
|
||||
|
||||
|
||||
|
||||
void Shoot(const int32_t id,
|
||||
const std::string &shooter,
|
||||
const std::string &target,
|
||||
const Vec3d &shooterPos,
|
||||
const Vec3d &targetPos,
|
||||
int buildingIdSrc, int roomNumberSrc, int buildingIdDst, int roomNumberDst,
|
||||
int lineType,
|
||||
double when) override;
|
||||
void Shoot(const int32_t id,
|
||||
const std::string &shooter,
|
||||
const std::string &targetBuildingId,
|
||||
const std::string &targetRoomId,
|
||||
const Vec3d &shooterPos, int lineType,
|
||||
double when) override;
|
||||
|
||||
void removeShoot(const int32_t id) override;
|
||||
|
||||
|
||||
|
||||
void Teleport(const std::string &id,
|
||||
double when,
|
||||
const Vec3d &target,
|
||||
const std::string &bldgname,
|
||||
int roomNumber,
|
||||
const std::string &roomname,
|
||||
ZValue zval) override;
|
||||
|
||||
|
||||
|
||||
void GetRoomNames(const std::string &id, std::vector<std::string> &names) override;
|
||||
|
||||
|
||||
|
||||
bool SetRoomDestructionValue(const std::string &id,
|
||||
const std::string &roomname,
|
||||
float value) override;
|
||||
|
||||
|
||||
|
||||
bool SetBuildingDestructionValue(const std::string &id, float value) override;
|
||||
|
||||
|
||||
|
||||
void GetDeviceNames(const std::string &buildingId, std::vector<std::string> &names) override;
|
||||
|
||||
|
||||
|
||||
bool ShowDeviceIcon(const std::string &id, const std::string &buildingid,
|
||||
const std::string &devicename, const std::string &iconpath) override;
|
||||
|
||||
|
||||
|
||||
bool ShowDeviceIcon(const std::string &id, const std::string &buildingid,
|
||||
const Vec3d &position, const std::string &iconpath) override;
|
||||
|
||||
void ChangeLineMode(unsigned int contextId, bool line) override;
|
||||
void ChangeNameMode(unsigned int contextId, bool name) override;
|
||||
|
||||
bool SetDisplayName(const std::string& buildingid, const std::string& roomname, const std::string& strDisplayName) override;
|
||||
void ShowDisplayNames(const std::string& buildingid, bool show) override;
|
||||
void SetShowDisplayNamesSelectionBox(const std::string& buildingid, const std::string& id, bool show, float duration = -1) override;
|
||||
void setHitLineDuration(uint32_t durationSec) override;
|
||||
void setMountingPointAsset(const MountingPointDescription &asset) override;
|
||||
std::vector<BuildingState> getBuildingState() const override;
|
||||
|
||||
|
||||
|
||||
bool HideDeviceIcon(const std::string &id) override;
|
||||
|
||||
|
||||
|
||||
float GetTimeScale() const override;
|
||||
|
||||
|
||||
|
||||
void SetTimeScale(float scale) override;
|
||||
|
||||
|
||||
|
||||
void SetSimulationTime(double t) override;
|
||||
|
||||
|
||||
|
||||
double GetSimulationTime() const override;
|
||||
|
||||
|
||||
|
||||
void SetPaused(bool) override;
|
||||
|
||||
|
||||
|
||||
bool GetPaused() const override;
|
||||
|
||||
|
||||
|
||||
void FastForwardSimulationTo(double t) override;
|
||||
|
||||
|
||||
|
||||
void DeleteQueuedCommands() override;
|
||||
|
||||
|
||||
|
||||
void SetNonRealtimeMode(bool on) override;
|
||||
|
||||
|
||||
|
||||
bool GetNonRealtimeMode() const override;
|
||||
|
||||
|
||||
|
||||
bool StartVideoRecording(unsigned int contextid, const std::string &path,
|
||||
int w, int h, int framerate, int quality) override;
|
||||
bool StartVideoRecording(const std::string &buildingId, const std::string &path,
|
||||
int w, int h, int framerate, int quality) override;
|
||||
|
||||
|
||||
|
||||
bool StopVideoRecording(unsigned int contextid) override;
|
||||
bool StopVideoRecording(const std::string &buildingId) override;
|
||||
|
||||
void setTransparency(double percent) override;
|
||||
void setViewMode(ViewMode m) override;
|
||||
void setDisplayMode(PlayerDisplayMode m) override;
|
||||
|
||||
int GetFrameRate() const { return mFrameRate; }
|
||||
void OnShowMsgBox(const std::string &strText);
|
||||
|
||||
bool allViewWindowsExposed() const
|
||||
{
|
||||
for (auto *vw : m_openedViewWidgets.getViewWidgets())
|
||||
int GetFrameRate() const
|
||||
{
|
||||
if (!vw->isOpenGlWindowExposed())
|
||||
return false;
|
||||
return mFrameRate;
|
||||
}
|
||||
return !m_openedViewWidgets.getViewWidgets().empty();
|
||||
}
|
||||
|
||||
private:
|
||||
void OnShowMsgBox(const std::string& strText);
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
bool open(const std::string& strFeatureID, bool exactPos);
|
||||
bool open(const std::vector<std::string> &vecFeatureIDs, bool exactPos);
|
||||
bool openAll(bool exactPos);
|
||||
bool allViewWindowsExposed() const
|
||||
{
|
||||
for (auto* vw : m_openedViewWidgets.getViewWidgets())
|
||||
{
|
||||
if (!vw->isOpenGlWindowExposed())
|
||||
return false;
|
||||
}
|
||||
return !m_openedViewWidgets.getViewWidgets().empty();
|
||||
}
|
||||
|
||||
void onEXCOpen(const QString& strIDs, bool exactPos);
|
||||
void onEXCClose(const QString& strIDs);
|
||||
void convertAssetsToPngFiles();
|
||||
private:
|
||||
NGL::INGLLogger& m_logger;
|
||||
bool open(const std::string& strFeatureID, bool exactPos);
|
||||
bool open(const std::vector<std::string>& vecFeatureIDs, bool exactPos);
|
||||
bool openAll(bool exactPos);
|
||||
|
||||
void OnTransformSend(const dtEntity::Message &m);
|
||||
void OnMapLoaded(const dtEntity::Message &m);
|
||||
void OnMapUnloaded(const dtEntity::Message &m);
|
||||
void OnNavMeshGroupChanged(const dtEntity::Message &m);
|
||||
void OnPlayerPicked(const dtEntity::Message &m);
|
||||
void OnHideSelection(const dtEntity::Message &m);
|
||||
|
||||
void OnShoot(const dtEntity::Message &m);
|
||||
void OnShowHidePlayer(const dtEntity::Message &m);
|
||||
void OnDisplayNameClicked(const dtEntity::Message& m);
|
||||
void onEXCOpen(const QString& strIDs, bool exactPos);
|
||||
void onEXCClose(const QString& strIDs);
|
||||
void convertAssetsToPngFiles();
|
||||
|
||||
bool SpawnBuilding(const BuildingData &b, bool useStaticMeshesFolder = true);
|
||||
void LoadBuilding(BuildingData& bd, bool useStaticMeshesFolder);
|
||||
void deleteAllBuildings();
|
||||
void OnTransformSend(const dtEntity::Message& m);
|
||||
void OnMapLoaded(const dtEntity::Message& m);
|
||||
void OnMapUnloaded(const dtEntity::Message& m);
|
||||
void OnNavMeshGroupChanged(const dtEntity::Message& m);
|
||||
void OnPlayerPicked(const dtEntity::Message& m);
|
||||
void OnHideSelection(const dtEntity::Message& m);
|
||||
|
||||
bool getBuildingString(const std::string &strFeatureID, std::string *strBuildingNameID);
|
||||
void OnShoot(const dtEntity::Message& m);
|
||||
void OnShowHidePlayer(const dtEntity::Message& m);
|
||||
void OnDisplayNameClicked(const dtEntity::Message& m);
|
||||
|
||||
bool OpenView(unsigned int contextId);
|
||||
bool CreateView(dtEntity::EntityId bid, const std::string &windowtitle, const Color &col, ViewMode viewmode,
|
||||
int screennum, bool fullscreen, int x, int y, int w, int h,
|
||||
unsigned int &contextid, bool exactPos);
|
||||
bool SpawnBuilding(const BuildingData& b, bool useStaticMeshesFolder = true);
|
||||
void LoadBuilding(BuildingData& bd, bool useStaticMeshesFolder);
|
||||
void deleteAllBuildings();
|
||||
|
||||
QPointer<CtrlMainWindow> m_pMainWindow;
|
||||
bool getBuildingString(const std::string& strFeatureID, std::string* strBuildingNameID);
|
||||
|
||||
dtEntity::EntityManager *mEntityManager;
|
||||
ViewerCallback *mViewerCallback;
|
||||
LogHandler* mLogHandler = nullptr;
|
||||
dtEntity::MapSystem *mMapSystem;
|
||||
PlayerSystem *mPlayerSystem;
|
||||
BuildingManager *mBuildingManager;
|
||||
bool OpenView(unsigned int contextId);
|
||||
bool CreateView(dtEntity::EntityId bid, const std::string& windowtitle, const Color& col, ViewMode viewmode,
|
||||
int screennum, bool fullscreen, int x, int y, int w, int h, unsigned int& contextid, bool exactPos);
|
||||
|
||||
float mTimeScale;
|
||||
double mSimTime;
|
||||
bool mPaused;
|
||||
bool mNonRealtimeMode;
|
||||
int mFrameRate;
|
||||
std::map<unsigned int, ViewWidget *> mViewWidgets;
|
||||
QPointer<CtrlMainWindow> m_pMainWindow;
|
||||
|
||||
dtEntity::EntityManager* mEntityManager;
|
||||
ViewerCallback* mViewerCallback;
|
||||
LogHandler* mLogHandler = nullptr;
|
||||
dtEntity::MapSystem* mMapSystem;
|
||||
PlayerSystem* mPlayerSystem;
|
||||
BuildingManager* mBuildingManager;
|
||||
|
||||
ViewWidget *GetViewWidget(unsigned int contextid);
|
||||
void storeWidget(ViewWidget *pWidget, const std::string &strBuildingNameID, unsigned int contextid, VCtrl::ViewMode vmode, VCtrl::PlayerDisplayMode displayMode);
|
||||
float mTimeScale;
|
||||
double mSimTime;
|
||||
bool mPaused;
|
||||
bool mNonRealtimeMode;
|
||||
int mFrameRate;
|
||||
std::map<unsigned int, ViewWidget*> mViewWidgets;
|
||||
|
||||
ViewWidget* GetViewWidget(unsigned int contextid);
|
||||
void storeWidget(ViewWidget* pWidget, const std::string& strBuildingNameID, unsigned int contextid,
|
||||
VCtrl::ViewMode vmode, VCtrl::PlayerDisplayMode displayMode);
|
||||
|
||||
const std::size_t m_maxParallelViewWidgets = 8;
|
||||
|
||||
unsigned int m_hitlineDuration_s = 10;
|
||||
double m_desiredTransparencyValue = 0.75;
|
||||
bool m_showHitLines = true;
|
||||
ViewWidget *CreateMainWindowView(dtEntity::EntityId bid, const std::string &featureId, unsigned int &contextid, bool exactPos);
|
||||
const std::size_t m_maxParallelViewWidgets = 8;
|
||||
|
||||
unsigned int m_hitlineDuration_s = 10;
|
||||
double m_desiredTransparencyValue = 0.75;
|
||||
bool m_showHitLines = true;
|
||||
ViewWidget* CreateMainWindowView(dtEntity::EntityId bid, const std::string& featureId, unsigned int& contextid,
|
||||
bool exactPos);
|
||||
|
||||
std::unordered_map<std::string, BuildingData> m_loadedBuildings;
|
||||
std::unordered_map<std::string, BuildingData> m_loadedBuildings;
|
||||
|
||||
ViewWidgetContainer m_openedViewWidgets;
|
||||
bool m_isInFullscreenMode = false;
|
||||
ViewWidgetContainer m_openedViewWidgets;
|
||||
bool m_isInFullscreenMode = false;
|
||||
|
||||
|
||||
ViewMode m_desiredViewMode = ViewMode::ORTHOGRAPHIC;
|
||||
VCtrl::PlayerDisplayMode m_desiredPlayerDisplayMode = VCtrl::PlayerDisplayMode::Icons;
|
||||
ViewMode m_desiredViewMode = ViewMode::ORTHOGRAPHIC;
|
||||
VCtrl::PlayerDisplayMode m_desiredPlayerDisplayMode = VCtrl::PlayerDisplayMode::Icons;
|
||||
|
||||
void CloseView(ViewWidget *pWidget);
|
||||
void CloseView(ViewWidget* pWidget);
|
||||
|
||||
void onExcRestoreViewState(const std::string &strFeatureID);
|
||||
void restoreViewWidgetStates(const std::vector<BuildingViewer::ViewWidgetState> &vecStates);
|
||||
void restoreViewWidgetStateDeferred(ViewWidget *pViewWidget);
|
||||
std::unordered_map<std::string, BuildingViewer::ViewWidgetState> m_deferredViewStates;
|
||||
void onExcRestoreViewState(const std::string& strFeatureID);
|
||||
void restoreViewWidgetStates(const std::vector<BuildingViewer::ViewWidgetState>& vecStates);
|
||||
void restoreViewWidgetStateDeferred(ViewWidget* pViewWidget);
|
||||
std::unordered_map<std::string, BuildingViewer::ViewWidgetState> m_deferredViewStates;
|
||||
|
||||
QJsonValue getViewState() const override;
|
||||
void setViewState(const QJsonValue &val) override;
|
||||
void highlightView(const std::string &buildingId) override;
|
||||
void setBuildingDisplayName(const std::string &buildingId, const std::string &displayName) override;
|
||||
|
||||
QJsonValue getViewState() const override;
|
||||
void setViewState(const QJsonValue& val) override;
|
||||
void highlightView(const std::string& buildingId) override;
|
||||
void setBuildingDisplayName(const std::string& buildingId, const std::string& displayName) override;
|
||||
|
||||
private slots:
|
||||
void onViewWidget_MaximizeRequest(ViewWidget *pWidget);
|
||||
void onViewWidget_MinimizeRequest(ViewWidget *pWidget);
|
||||
void onViewWidget_CloseRequest(ViewWidget *pWidget);
|
||||
void onViewWidget_FocusRequest(ViewWidget *pWidget);
|
||||
void onViewWidget_Zoom(ViewWidget *pWidget, bool zoomIn);
|
||||
private slots:
|
||||
void onViewWidget_MaximizeRequest(ViewWidget* pWidget);
|
||||
void onViewWidget_MinimizeRequest(ViewWidget* pWidget);
|
||||
void onViewWidget_CloseRequest(ViewWidget* pWidget);
|
||||
void onViewWidget_FocusRequest(ViewWidget* pWidget);
|
||||
void onViewWidget_Zoom(ViewWidget* pWidget, bool zoomIn);
|
||||
};
|
||||
}
|
||||
} // namespace VCtrl
|
||||
Reference in new issue
Block a user