VR-Engage  2.2
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 for the entity
66 //!
67 //! Returns a list of station names (roles) available for the entity with
68 //! the specified UUID. These are the roles that can be assigned to a player.
69 virtual QStringList lookupEngageStationData(const DtUUID& uuid);
70
71 //! \brief Determines if an entity type is VREngage-controllable
72 //! \param entityType The entity type to check
73 //! \return True if the entity type is VREngage-controllable, false otherwise
74 //!
75 //! Checks if the specified entity type is defined in a VREngage entity file,
76 //! indicating that it can be controlled by VREngage applications.
77 virtual bool isVreEntityType(const DtEntityType& entityType) const;
78
79 //! \brief Gets the singleton instance of the model set database
80 //! \param displayEngine The distributed environment to use
81 //! \return Reference to the singleton instance
82 //!
83 //! Returns the singleton instance of the model set database, creating it
84 //! if it doesn't already exist. This is the proper way to access the database.
85 static DtVreModelSetDb& instance(makVrv::DtDe& displayEngine);
86
87private:
88 //! \brief Constructor
89 //! \param de The distributed environment reference
90 //!
91 //! Initializes a new model set database. This constructor is private
92 //! because this class is a singleton and should only be accessed via instance().
93 DtVreModelSetDb(makVrv::DtDe& de);
94
95protected:
96 //! \brief The VREngage model set
97 //!
98 //! Contains information about VREngage entity types and station definitions.
100
101 //! \brief Reference to the distributed environment
102 //!
103 //! Used to access simulation state information.
104 makVrv::DtDe& myDe;
105};
106} // 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:104
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:99
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
Include export definitions for this library.
Definition glsVreMessageUtil.h:49
Definition appLauncherComponent.h:28
makVrv::DtDe * de()
Gets the display element pointer used by the plugin.