VR-Engage  2.2
Loading...
Searching...
No Matches
roleTemplateUtilities.h
Go to the documentation of this file.
1/*******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4*******************************************************************************/
5
6//! \file roleTemplateUtilities.h
7//! \ingroup vreUtil
8//! \brief Utility functions for working with role configuration files
9//!
10//! This file provides utility functions for loading and managing role definition files,
11//! display configurations, and other role-related settings. It includes functions for
12//! loading table files, retrieving role templates, and managing display layouts.
13
14#pragma once
15
16#include "vreUtil/export.h"
18#include "vreUtil/initializer.h"
19
20#include <set>
21#include <string>
22
23namespace makVre
24{
25//! \brief Loads a table file from the specified path
26//! \param path The file path to the table file (e.g., a display configuration file)
27//! \param initializer Pointer to the initializer used to load the file
28//! \return DtInitTable containing the loaded table data
29//!
30//! This function loads a table file (typically a display configuration or other
31//! configuration file) from the specified path using the provided initializer.
32UTIL_DLL DtInitTable loadTableFile(const std::string& path, DtInitializer* initializer);
33
34//! \brief Loads a role definition file from the specified path
35//! \param path The file path to the role definition file
36//! \param initializer Pointer to the initializer used to load the file
37//! \return DtInitTable containing the loaded role template data
38//!
39//! This function loads a role definition file from the specified path and
40//! returns it as a DtInitTable structure for further processing.
41UTIL_DLL DtInitTable getRoleTemplateFromPath(const std::string& path, DtInitializer* initializer);
42
43//! \brief Retrieves a display configuration by name for a given role descriptor
44//! \param roleDescriptor The role descriptor containing display configurations
45//! \param name The name of the display configuration to retrieve
46//! \param initializer Pointer to the initializer used for loading
47//! \return DtInitTable containing the requested display layout configuration
48//!
49//! This function looks up and loads a display configuration by name. It first checks
50//! for the display configuration in the additional display configurations list,
51//! which contains any new configurations or overrides to what's in the role template file.
52//! If not found there, it then checks the role file itself.
54 DtEntityRoleDescriptor& roleDescriptor, const std::string& name, DtInitializer* initializer);
55
56//! \brief Retrieves the default display configuration for a role
57//! \param roleDescriptorPath The path to the role descriptor file
58//! \param initializer Pointer to the initializer used for loading
59//! \return DtInitTable containing the default display layout configuration
60//!
61//! This function loads the role descriptor from the specified path and then
62//! retrieves the default display configuration defined for that role.
63UTIL_DLL DtInitTable getDefaultDisplayLayout(const std::string& roleDescriptorPath, DtInitializer* initializer);
64
65//! \brief Retrieves all available display configuration names for a role
66//! \param roleDescriptor The role descriptor to get display configurations from
67//! \param initializer Pointer to the initializer used for loading
68//! \param displayConfigNames Output parameter to store the configuration names
69//!
70//! This function populates the provided set with the names of all display configurations
71//! available for the specified role descriptor. It includes configurations from
72//! both the role template file and any additional display configurations.
74 DtEntityRoleDescriptor& roleDescriptor, DtInitializer* initializer, std::set<std::string>& displayConfigNames);
75
76//! \brief Clears the role template cache
77//! \param initializer Pointer to the initializer whose cache should be cleared
78//!
79//! This function clears the entire role template cache in the provided initializer,
80//! forcing fresh loading of role templates on subsequent requests.
82} // namespace makVre
Table-based access to Lua state for configuration data.
Definition initializer.h:38
Configuration initializer for VREngage components.
Definition initializer.h:80
Defines data structures for entity role configurations.
Defines export macros for the VREngage Utility library.
#define UTIL_DLL
Export/import macro for non-Windows platforms.
Definition export.h:39
Provides configuration initialization for VREngage components.
Include export definitions for this library.
Definition glsVreMessageUtil.h:49
UTIL_DLL void getDisplayConfigNames(DtEntityRoleDescriptor &roleDescriptor, DtInitializer *initializer, std::set< std::string > &displayConfigNames)
Retrieves all available display configuration names for a role.
UTIL_DLL DtInitTable getDefaultDisplayLayout(const std::string &roleDescriptorPath, DtInitializer *initializer)
Retrieves the default display configuration for a role.
UTIL_DLL void clearRoleCache(DtInitializer *initializer)
Clears the role template cache.
UTIL_DLL DtInitTable getRoleTemplateFromPath(const std::string &path, DtInitializer *initializer)
Loads a role definition file from the specified path.
UTIL_DLL DtInitTable getDisplayLayout(DtEntityRoleDescriptor &roleDescriptor, const std::string &name, DtInitializer *initializer)
Retrieves a display configuration by name for a given role descriptor.
UTIL_DLL DtInitTable loadTableFile(const std::string &path, DtInitializer *initializer)
Loads a table file from the specified path.
Descriptor for an entity role.
Definition entityRoleDescriptorStructs.h:46