VR-Engage  2.3
Loading...
Searching...
No Matches
vreModelSetDb.h
Go to the documentation of this file.
1/*******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4*******************************************************************************/
5
6//! \file vreModelSetDb.h
7//! \ingroup vreManager
8//! \brief VREngage model set database for entity and station information
9//!
10//! This file defines the DtVreModelSetDb class, which manages entity information
11//! and station definitions for VREngage-controllable entities.
12
13#pragma once
14
15#include "vreManager/export.h"
16#include <vrvUtil/DtVirtualBaseClass.h>
17#include <vrfobjparam/modelSet.h>
18#include <vrfutil/rwUUID.h>
19
20#include <QStringList>
21
22#include <vector>
23
24namespace makVrv
25{
26class DtDe;
27}
28
29namespace makVre
30{
31class DtVreModelSet;
32
33//! \brief Database for VREngage entity and station information
34//!
35//! This singleton class manages model set information specific to VREngage entities,
36//! including loading and accessing entity definition files (.entity) and providing
37//! information about available stations/roles for VREngage-controllable entities.
38class VREMANAGER_DLL DtVreModelSetDb : public makVrv::DtVirtualBaseClass
39{
40public:
41 //! \brief Virtual destructor
42 //!
43 //! Cleans up resources used by the model set database.
44 virtual ~DtVreModelSetDb() override;
45
46 //! \brief Loads entity definition files
47 //! \param baseDir The base directory to search in
48 //! \param paths Additional search paths for entity files
49 //!
50 //! Loads files of type .entity from the specified directories. These files
51 //! define the available stations/roles for VREngage-controllable entities.
52 virtual void loadEntityFiles(const std::string& baseDir, const std::vector<DtFilename>& paths);
53
54 //! \brief Finds a model set entry matching an entity type
55 //! \param entityType The entity type to find a matching pattern for
56 //! \return Pointer to the matching model set entry, or NULL if not found
57 //!
58 //! Searches the model set for an entry that matches the specified entity type.
59 //! Used to determine if an entity can be controlled by VREngage and which
60 //! stations/roles are available for it.
61 virtual DtModelSetEntry* findMatchingPattern(const DtEntityType& entityType) const;
62
63 //! \brief Looks up available station data for an entity
64 //! \param uuid The UUID of the entity to look up stations for
65 //! \return List of available station names, or an empty list for spot reports
66 //! and entities without assignable roles
67 //!
68 //! Returns a list of station names (roles) available for the entity with
69 //! the specified UUID. These are the roles that can be assigned to a player.
70 virtual QStringList lookupEngageStationData(const DtUUID& uuid);
71
72 //! \brief Determines if an entity type is VREngage-controllable
73 //! \param entityType The entity type to check
74 //! \return True if the entity type is VREngage-controllable, false otherwise
75 //!
76 //! Checks if the specified entity type is defined in a VREngage entity file,
77 //! indicating that it can be controlled by VREngage applications.
78 virtual bool isVreEntityType(const DtEntityType& entityType) const;
79
80 //! \brief Gets the singleton instance of the model set database
81 //! \param displayEngine The distributed environment to use
82 //! \return Reference to the singleton instance
83 //!
84 //! Returns the singleton instance of the model set database, creating it
85 //! if it doesn't already exist. This is the proper way to access the database.
86 static DtVreModelSetDb& instance(makVrv::DtDe& displayEngine);
87
88private:
89 //! \brief Constructor
90 //! \param de The distributed environment reference
91 //!
92 //! Initializes a new model set database. This constructor is private
93 //! because this class is a singleton and should only be accessed via instance().
94 DtVreModelSetDb(makVrv::DtDe& de);
95
96protected:
97 //! \brief The VREngage model set
98 //!
99 //! Contains information about VREngage entity types and station definitions.
101
102 //! \brief Reference to the distributed environment
103 //!
104 //! Used to access simulation state information.
105 makVrv::DtDe& myDe;
106};
107} // namespace makVre
virtual DtModelSetEntry * findMatchingPattern(const DtEntityType &entityType) const
Finds a model set entry matching an entity type.
static DtVreModelSetDb & instance(makVrv::DtDe &displayEngine)
Gets the singleton instance of the model set database.
makVrv::DtDe & myDe
Reference to the distributed environment.
Definition vreModelSetDb.h:105
virtual void loadEntityFiles(const std::string &baseDir, const std::vector< DtFilename > &paths)
Loads entity definition files.
virtual QStringList lookupEngageStationData(const DtUUID &uuid)
Looks up available station data for an entity.
virtual bool isVreEntityType(const DtEntityType &entityType) const
Determines if an entity type is VREngage-controllable.
virtual ~DtVreModelSetDb() override
Virtual destructor.
DtVreModelSet * myModelSet
The VREngage model set.
Definition vreModelSetDb.h:100
DtVreModelSetDb(makVrv::DtDe &de)
Constructor.
VREngage-specific model set implementation.
Definition vreModelSet.h:30
Export macros for the VREngage Manager library.
#define VREMANAGER_DLL
Platform-specific export/import macro for VREngage Manager library.
Definition export.h:28
!
Definition glsVreMessageUtil.h:50
Definition appLauncherComponent.h:28
makVrv::DtDe * de()
Gets the display element pointer used by the plugin.