VR-Engage  2.2
Loading...
Searching...
No Matches
makVre::DtVreModelSetEntry Class Reference

Detailed Description

This class extends the base VR-Forces model set entry to provide VR-Engage specific functionality for managing entity roles, role parameters, and display configurations. It handles reading and writing role data to/from entity files.

#include <vreModelSetEntry.h>

Inheritance diagram for makVre::DtVreModelSetEntry:
[legend]

Public Member Functions

 DtVreModelSetEntry ()
 
 DtVreModelSetEntry (const DtString &name, DtReaderWriterRegistry *const parentRegistry=NULL)
 
 DtVreModelSetEntry (const DtVreModelSetEntry &orig, DtReaderWriterRegistry *const parentRegistry=NULL)
 
virtual DtVreModelSetEntryoperator= (const DtVreModelSetEntry &orig)
 
virtual DtVreModelSetEntryoperator= (const DtModelSetEntry &orig) override
 
virtual ~DtVreModelSetEntry () override
 
virtual DtModelSetEntry * clone () override
 
virtual bool engageControllable () const
 
virtual std::vector< std::string > roles ()
 
virtual const DtEntityRoleDescriptorfindRoleDescriptor (const std::string &role)
 
virtual void addRole (const std::string &role, const std::string &rolePath, bool unlisted=false)
 
virtual void addRoleParameter (const std::string &role, const std::string &roleParameter, const std::string &paramValue)
 
virtual void readFromEnvironment (DtEnvironmentSP e, DtEnvValueSP objectNode, bool keepCurrentData=false) override
 
virtual void writeToEnvironment (DtEnvironmentSP e, DtEnvValueSP objectNode, std::vector< DtString > *vec=nullptr, DtModelSetEntry *mse=nullptr) const override
 
virtual std::string filename () const
 

Static Public Member Functions

static DtModelSetEntry * Create (const DtString &name="model-set-entry", DtReaderWriterRegistry *const parentRegistry=nullptr)
 

Protected Member Functions

virtual void getParameterOverrides (DtEnvironmentSP e, DtEnvValueSP node, std::map< std::string, std::string > &parameterOverrides)
 
virtual std::string resolvePath (const std::string &path) const
 
virtual std::string markupPath (const std::string &path) const
 

Protected Attributes

std::map< std::string, DtEntityRoleDescriptormyRoleDescriptors
 
std::string myFilename
 

Constructor & Destructor Documentation

◆ DtVreModelSetEntry() [1/3]

makVre::DtVreModelSetEntry::DtVreModelSetEntry ( )

Default constructor.

Creates an empty model set entry with no name or registry

Referenced by DtVreModelSetEntry(), operator=(), and operator=().

◆ DtVreModelSetEntry() [2/3]

makVre::DtVreModelSetEntry::DtVreModelSetEntry ( const DtString & name,
DtReaderWriterRegistry *const parentRegistry = NULL )

Named constructor with optional registry.

Parameters
nameThe name of the model set entry
parentRegistryOptional parent registry for resource loading

◆ DtVreModelSetEntry() [3/3]

makVre::DtVreModelSetEntry::DtVreModelSetEntry ( const DtVreModelSetEntry & orig,
DtReaderWriterRegistry *const parentRegistry = NULL )

Copy constructor.

Parameters
origThe model set entry to copy
parentRegistryOptional parent registry for resource loading

References DtVreModelSetEntry().

◆ ~DtVreModelSetEntry()

virtual makVre::DtVreModelSetEntry::~DtVreModelSetEntry ( )
overridevirtual

Virtual destructor.

Cleans up resources owned by the model set entry

Member Function Documentation

◆ operator=() [1/2]

virtual DtVreModelSetEntry & makVre::DtVreModelSetEntry::operator= ( const DtVreModelSetEntry & orig)
virtual

Assignment operator for VR-Engage model set entries.

Parameters
origThe model set entry to copy from
Returns
Reference to this object

Performs a deep copy of the VR-Engage specific data

References DtVreModelSetEntry().

◆ operator=() [2/2]

virtual DtVreModelSetEntry & makVre::DtVreModelSetEntry::operator= ( const DtModelSetEntry & orig)
overridevirtual

Assignment operator for base model set entries.

Parameters
origThe base model set entry to copy from
Returns
Reference to this object

The override allows us to eventually call the derived assignment operator

References DtVreModelSetEntry().

◆ clone()

virtual DtModelSetEntry * makVre::DtVreModelSetEntry::clone ( )
overridevirtual

Creates a copy of this model set entry.

Returns
Pointer to the newly created copy

◆ engageControllable()

virtual bool makVre::DtVreModelSetEntry::engageControllable ( ) const
virtual

Checks if this entity can be controlled in VR-Engage.

Returns
True if the entity is controllable in VR-Engage, false otherwise

◆ roles()

virtual std::vector< std::string > makVre::DtVreModelSetEntry::roles ( )
virtual

Gets the list of available roles for this entity.

Returns
Vector of role names

◆ findRoleDescriptor()

virtual const DtEntityRoleDescriptor * makVre::DtVreModelSetEntry::findRoleDescriptor ( const std::string & role)
virtual

Finds a role descriptor by name.

Parameters
roleThe name of the role to find
Returns
Pointer to the role descriptor if found, nullptr otherwise

◆ addRole()

virtual void makVre::DtVreModelSetEntry::addRole ( const std::string & role,
const std::string & rolePath,
bool unlisted = false )
virtual

Adds a new role to the entity.

Parameters
roleThe name of the role to add
rolePathPath to the role configuration file
unlistedWhether the role should be hidden from role selection panels

◆ addRoleParameter()

virtual void makVre::DtVreModelSetEntry::addRoleParameter ( const std::string & role,
const std::string & roleParameter,
const std::string & paramValue )
virtual

Adds a parameter to an existing role.

Parameters
roleThe name of the role to add the parameter to
roleParameterThe name of the parameter to add
paramValueThe value of the parameter

◆ readFromEnvironment()

virtual void makVre::DtVreModelSetEntry::readFromEnvironment ( DtEnvironmentSP e,
DtEnvValueSP objectNode,
bool keepCurrentData = false )
overridevirtual

Loads model set entry information from the specified environment.

Parameters
eThe environment to read from
objectNodeThe object node to read from
keepCurrentDataWhether to retain existing data when reading

Looks for a variable in the environment called guiInformation and extracts attributes and role information from that node. VR-Engage specific data is read from the vrEngageRoles section if present.

◆ writeToEnvironment()

virtual void makVre::DtVreModelSetEntry::writeToEnvironment ( DtEnvironmentSP e,
DtEnvValueSP objectNode,
std::vector< DtString > * vec = nullptr,
DtModelSetEntry * mse = nullptr ) const
overridevirtual

Writes entry contents to the specified environment.

Parameters
eThe environment to write to
objectNodeThe object node to write to
vecOptional vector to track modified attributes
mseOptional model set entry for reference

Writes the model set entry information to the guiInformation section of the environment. VR-Engage specific role data is written to the vrEngageRoles section.

◆ filename()

virtual std::string makVre::DtVreModelSetEntry::filename ( ) const
virtual

Gets the filename associated with this entry.

Returns
The filename of the entity file that created this entry

◆ Create()

static DtModelSetEntry * makVre::DtVreModelSetEntry::Create ( const DtString & name = "model-set-entry",
DtReaderWriterRegistry *const parentRegistry = nullptr )
static

Factory method for creating model set entry instances.

Parameters
nameThe name of the model set entry to create
parentRegistryOptional parent registry for resource loading
Returns
Pointer to the newly created model set entry

This static method creates a new instance of DtVreModelSetEntry. Used by the factory system.

◆ getParameterOverrides()

virtual void makVre::DtVreModelSetEntry::getParameterOverrides ( DtEnvironmentSP e,
DtEnvValueSP node,
std::map< std::string, std::string > & parameterOverrides )
protectedvirtual

Gets parameter overrides from an environment node.

Parameters
eThe environment to read from
nodeThe node to read parameters from
parameterOverridesOutput map to store parameter name/value pairs

Extracts parameter overrides from the given node, only including parameters that are immediate children of that node.

◆ resolvePath()

virtual std::string makVre::DtVreModelSetEntry::resolvePath ( const std::string & path) const
protectedvirtual

Resolves path variables in a string.

Parameters
pathThe path string to resolve
Returns
The resolved path with variables expanded

Replaces instances of '@' with '$' (as '@' is used instead of '$' in XML files) and then resolves any $DATA_DIR or $SHARED_DATA_DIR variables in the path.

◆ markupPath()

virtual std::string makVre::DtVreModelSetEntry::markupPath ( const std::string & path) const
protectedvirtual

Marks up a path with variables for XML storage.

Parameters
pathThe path string to mark up
Returns
The marked up path with variables and XML-safe characters

Substitutes in $DATA_DIR or $SHARED_DATA_DIR variables for specific path prefixes, and replaces '$' with '@' (needed for XML files which cannot tolerate '$').

Member Data Documentation

◆ myRoleDescriptors

std::map<std::string, DtEntityRoleDescriptor> makVre::DtVreModelSetEntry::myRoleDescriptors
protected

Map of role names to role descriptors.

Contains all the roles supported by this entity and their associated configuration

◆ myFilename

std::string makVre::DtVreModelSetEntry::myFilename
protected

Cache of the filename used to create this entry.

Stores the path to the entity file that was loaded to create this entry


The documentation for this class was generated from the following file: