|
VR-Engage
2.2
|
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>
Public Member Functions | |
| DtVreModelSetEntry () | |
| DtVreModelSetEntry (const DtString &name, DtReaderWriterRegistry *const parentRegistry=NULL) | |
| DtVreModelSetEntry (const DtVreModelSetEntry &orig, DtReaderWriterRegistry *const parentRegistry=NULL) | |
| virtual DtVreModelSetEntry & | operator= (const DtVreModelSetEntry &orig) |
| virtual DtVreModelSetEntry & | operator= (const DtModelSetEntry &orig) override |
| virtual | ~DtVreModelSetEntry () override |
| virtual DtModelSetEntry * | clone () override |
| virtual bool | engageControllable () const |
| virtual std::vector< std::string > | roles () |
| virtual const DtEntityRoleDescriptor * | findRoleDescriptor (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 ¶mValue) |
| 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 > ¶meterOverrides) |
| virtual std::string | resolvePath (const std::string &path) const |
| virtual std::string | markupPath (const std::string &path) const |
Protected Attributes | |
| std::map< std::string, DtEntityRoleDescriptor > | myRoleDescriptors |
| std::string | myFilename |
| makVre::DtVreModelSetEntry::DtVreModelSetEntry | ( | ) |
Default constructor.
Creates an empty model set entry with no name or registry
Referenced by DtVreModelSetEntry(), operator=(), and operator=().
| makVre::DtVreModelSetEntry::DtVreModelSetEntry | ( | const DtString & | name, |
| DtReaderWriterRegistry *const | parentRegistry = NULL ) |
Named constructor with optional registry.
| name | The name of the model set entry |
| parentRegistry | Optional parent registry for resource loading |
| makVre::DtVreModelSetEntry::DtVreModelSetEntry | ( | const DtVreModelSetEntry & | orig, |
| DtReaderWriterRegistry *const | parentRegistry = NULL ) |
Copy constructor.
| orig | The model set entry to copy |
| parentRegistry | Optional parent registry for resource loading |
References DtVreModelSetEntry().
|
overridevirtual |
Virtual destructor.
Cleans up resources owned by the model set entry
|
virtual |
Assignment operator for VR-Engage model set entries.
| orig | The model set entry to copy from |
Performs a deep copy of the VR-Engage specific data
References DtVreModelSetEntry().
|
overridevirtual |
Assignment operator for base model set entries.
| orig | The base model set entry to copy from |
The override allows us to eventually call the derived assignment operator
References DtVreModelSetEntry().
|
overridevirtual |
Creates a copy of this model set entry.
|
virtual |
Checks if this entity can be controlled in VR-Engage.
|
virtual |
Gets the list of available roles for this entity.
|
virtual |
Finds a role descriptor by name.
| role | The name of the role to find |
|
virtual |
Adds a new role to the entity.
| role | The name of the role to add |
| rolePath | Path to the role configuration file |
| unlisted | Whether the role should be hidden from role selection panels |
|
virtual |
Adds a parameter to an existing role.
| role | The name of the role to add the parameter to |
| roleParameter | The name of the parameter to add |
| paramValue | The value of the parameter |
|
overridevirtual |
Loads model set entry information from the specified environment.
| e | The environment to read from |
| objectNode | The object node to read from |
| keepCurrentData | Whether 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.
|
overridevirtual |
Writes entry contents to the specified environment.
| e | The environment to write to |
| objectNode | The object node to write to |
| vec | Optional vector to track modified attributes |
| mse | Optional 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.
|
virtual |
Gets the filename associated with this entry.
|
static |
Factory method for creating model set entry instances.
| name | The name of the model set entry to create |
| parentRegistry | Optional parent registry for resource loading |
This static method creates a new instance of DtVreModelSetEntry. Used by the factory system.
|
protectedvirtual |
Gets parameter overrides from an environment node.
| e | The environment to read from |
| node | The node to read parameters from |
| parameterOverrides | Output map to store parameter name/value pairs |
Extracts parameter overrides from the given node, only including parameters that are immediate children of that node.
|
protectedvirtual |
Resolves path variables in a string.
| path | The path string to resolve |
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.
|
protectedvirtual |
Marks up a path with variables for XML storage.
| path | The path string to mark up |
Substitutes in $DATA_DIR or $SHARED_DATA_DIR variables for specific path prefixes, and replaces '$' with '@' (needed for XML files which cannot tolerate '$').
|
protected |
Map of role names to role descriptors.
Contains all the roles supported by this entity and their associated configuration
|
protected |
Cache of the filename used to create this entry.
Stores the path to the entity file that was loaded to create this entry