esp::metadata::attributes::SceneDatasetAttributes class

Base classes

class AbstractAttributes
Base class for all implemented attributes. Inherits from esp::core::managedContainers::AbstractFileBasedManagedObject so the attributes can be managed by a esp::core::managedContainers::ManagedContainer.

Public static functions

static auto getDatasetSummaryHeader() -> std::string
returns the header row of the summary string.

Constructors, destructors, conversion operators

SceneDatasetAttributes(const std::string& datasetName, const managers::PhysicsAttributesManager::ptr& physAttrMgr)
~SceneDatasetAttributes() override

Public functions

auto getAssetAttributesManager() const -> const managers::AssetAttributesManager::ptr&
Return manager for construction and access to asset attributes.
auto getObjectAttributesManager() const -> const managers::ObjectAttributesManager::ptr&
Return manager for construction and access to object attributes.
auto getAOAttributesManager() const -> const managers::AOAttributesManager::ptr&
Return manager for construction and access to articulated object attributes.
auto getLightLayoutAttributesManager() const -> const managers::LightLayoutAttributesManager::ptr&
Return manager for construction and access to light attributes.
auto getSceneInstanceAttributesManager() const -> const managers::SceneInstanceAttributesManager::ptr&
Return manager for construction and access to scene attributes.
auto getSemanticAttributesManager() const -> const managers::SemanticAttributesManager::ptr&
Return manager for construction and access to semantic attributes for current dataset.
auto getStageAttributesManager() const -> const managers::StageAttributesManager::ptr&
Return manager for construction and access to stage attributes.
auto getDefaultMaterialShaderType() const -> ObjectInstanceShaderType
Retrieve the shader type to use for the various default materials, either Phong of PBR.
void setDefaultMaterialIsPBR(bool default_material_is_pbr)
Set whether to use PBR or Phong for the default material values defined in resource Manager.
auto getNavmeshMap() const -> const std::map<std::string, std::string>&
Return the map for navmesh file locations.
auto editNavmeshMap() -> std::map<std::string, std::string>&
Only SceneDatasetAttributesManager should directly edit navemesh and semantic scene descriptor maps. Return the map for navmesh file locations for building/modification.
auto addNavmeshPathEntry(const std::string& key, const std::string& path, bool overwrite = false) -> std::pair<std::string, std::string>
Add an entry to the navmeshMap_ with the passed key. If overwrite then overwrite existing entry, otherwise will modify key and add value with modified key. Returns pair of added Key-Value.
auto addSemanticSceneDescrPathEntry(const std::string& semanticHandle, const attributes::StageAttributes::ptr& stageAttributes) -> std::string
Find or create a esp::metadata::attributes::SemanticAttributes entry with the passed key. If overwrite then overwrite existing entry, otherwise will modify key and add values from stage attributes with modified key. Returns the string handle of the semantic attributes.
void setSemanticAttrSSDFilenames(const std::map<std::string, std::string>& semanticPathnameMap)
Create or modify esp::metadata::attributes::SemanticAttributes corresponding to the keys in the passed map to hold the map's values as the semantic scene descriptor file.
void setCurrCfgVals(const std::string& lightSetup, bool frustumCulling)
copy current esp::sim::SimulatorConfiguration driven values, such as file paths, to make them available for stage attributes defaults.
void setPhysicsManagerHandle(const std::string& physMgrAttrHandle)
Set the name of the attributes used for the physics manager that governs this Dataset.
auto getPhysicsManagerHandle() const -> std::string
void setDefaultPbrShaderAttrHandle(const std::string& dfltPbrShaderAttrHandle)
Set the name of the attributes used for the default Pbr/Ibl shader configuration.
void setCurrScenePbrShaderAttrMappings(std::map<std::string, std::string> mappings)
Set the current scene's mapping from 'region' tags to PbrShaderAttributes handles.
auto getCurrPbrShaderHandleFromRegion(const std::string& region) -> std::string
retrieve the handle to the PbrShaderAttributes that corresponds to the passed region handle defined in the SceneInstanceAttributes.
auto getDefaultPbrShaderAttrHandle() const -> std::string
Get the name of the attributes used for the default Pbr/Ibl shader configuration.
auto addNewSceneInstanceToDataset(const attributes::SceneInstanceAttributes::ptr& sceneInstance) -> bool
Add the passed sceneInstance to the dataset, verifying that all the attributes and assets references in the scene instance exist, and if so adding them. This is to handle the addition of an existing sceneInstance that might reference stages, objects, navmeshes, etc. that do not exist in the dataset.
auto getNamedStageAttributesCopy(const std::string& stageAttrName) -> attributes::StageAttributes::ptr
Returns stage attributes corresponding to passed handle as substring. Assumes stage attributes with stageAttrName as substring exists in current dataset.
auto getNamedObjectAttributesCopy(const std::string& objAttrName) -> attributes::ObjectAttributes::ptr
Returns object attributes corresponding to passed handle as substring. Assumes object attributes with objAttrName as substring exists in current dataset.
auto getNamedArticulatedObjectAttributesCopy(const std::string& artObjAttrName) -> attributes::ArticulatedObjectAttributes::ptr
Returns articulated object attributes corresponding to passed handle as substring. Assumes articulated object attributes with artObjAttrName as substring exists in current dataset.
auto getNamedLightSetup(const std::string& lightSetupName) -> esp::gfx::LightSetup
Returns a lightsetup object configured by the attributes whose handle contains the passed lightSetupName.
auto getStageAttrFullHandle(const std::string& stageAttrName) -> std::string
Returns stage attributes handle in dataset corresponding to passed name as substring. Assumes stage attributes with stageAttrName as substring exists in this dataset.
auto getObjAttrFullHandle(const std::string& objAttrName) -> std::string
Returns object attributes handle in dataset corresponding to passed name as substring. Assumes object attributes with objAttrName as substring exists in this dataset.
auto getArticulatedObjModelFullHandle(const std::string& artObjModelName) -> std::string
Returns articulated object model file handle in dataset corresponding to passed name as substring. Assumes articulated object model with artObjModelName as substring exists in this dataset.
auto getArticulatedObjectModelFilenames() const -> std::map<std::string, std::string>
This is to be deprecated. Provide a map of the articulated object model filenames (.urdf) that have been referenced in the Scene Dataset via paths, either .urdf or .json. To be removed in favor of directly accessing these values through the AOAttributesMaanager.
auto getLightSetupFullHandle(const std::string& lightSetupName) -> std::string
Returns the full name of the lightsetup attributes whose handle contains the passed lightSetupName.
auto getDatasetSummary() const -> std::string
return a summary of this dataset

Protected functions

void createSemanticAttribsFromDS(const std::string& semanticHandle, const std::string& dbgSourceAttribs)
will create a new esp::metadata::attributes::SemanticAttributes with the given handle if one does not exist.
auto getObjectInfoHeaderInternal() const -> std::string override
Retrieve a comma-separated string holding the header values for the info returned for this managed object, type-specific. Individual components handle this.
auto getObjectInfoInternal() const -> std::string override
Retrieve a comma-separated informational string about the contents of this managed object.
auto addNewValToMap(const std::string& key, const std::string& path, bool overwrite, std::map<std::string, std::string>& map, const std::string& descString) -> std::pair<std::string, std::string>
This will add a navmesh entry or a semantic scene descriptor entry to the appropriate map. It checks if a value already exists at the specified key , and if not adds the path to the map at the given key value. If a value does exist at the specified key, it checks if it is the same value as path . If so nothing is done, but if not, then it is either overwritten or the key is modified until an available key is found, which is then used to add the new entry, depending on overwrite .

Protected variables

managers::AssetAttributesManager::ptr assetAttributesManager_
Reference to AssetAttributesManager to give access to primitive attributes for object construction.
managers::LightLayoutAttributesManager::ptr lightLayoutAttributesManager_
Manages all construction and access to light attributes from this dataset.
managers::ObjectAttributesManager::ptr objectAttributesManager_
Manages all construction and access to object attributes from this dataset.
managers::AOAttributesManager::ptr artObjAttributesManager_
Manages all construction and access to articulated object attributes from this dataset.
managers::SceneInstanceAttributesManager::ptr sceneInstanceAttributesManager_
Manages all construction and access to metadata::attributes::SceneInstanceAttributes from this dataset.
managers::SemanticAttributesManager::ptr semanticAttributesManager_
Manages all construction and access to metadata::attributes::SemanticAttributes from this dataset.
managers::StageAttributesManager::ptr stageAttributesManager_
Manages all construction and access to stage attributes from this dataset.
std::map<std::string, std::string> navmeshMap_
Maps names specified in dataset_config file to paths for navmeshes.
std::map<std::string, std::string> currPbrShaderAttrRegionMap_

Function documentation

const managers::SemanticAttributesManager::ptr& esp::metadata::attributes::SceneDatasetAttributes::getSemanticAttributesManager() const

Return manager for construction and access to semantic attributes for current dataset.

Returns A shared pointer to the current dataset's esp::metadata::managers::SemanticAttributesManager

std::pair<std::string, std::string> esp::metadata::attributes::SceneDatasetAttributes::addNavmeshPathEntry(const std::string& key, const std::string& path, bool overwrite = false)

Add an entry to the navmeshMap_ with the passed key. If overwrite then overwrite existing entry, otherwise will modify key and add value with modified key. Returns pair of added Key-Value.

Parameters
key The handle for the navmesh path to add
path The path to the navmesh asset to add
overwrite Whether to overwrite existing entries or not
Returns Key-Value pair for path being added.

std::string esp::metadata::attributes::SceneDatasetAttributes::addSemanticSceneDescrPathEntry(const std::string& semanticHandle, const attributes::StageAttributes::ptr& stageAttributes)

Find or create a esp::metadata::attributes::SemanticAttributes entry with the passed key. If overwrite then overwrite existing entry, otherwise will modify key and add values from stage attributes with modified key. Returns the string handle of the semantic attributes.

Parameters
semanticHandle The handle for the SemanticSceneDescr attributes to reference or add.
stageAttributes The Stage attributes
Returns Handle in the SemanticAttributesManager referencing the desired esp::metadata::attributes::SemanticAttributes

void esp::metadata::attributes::SceneDatasetAttributes::setSemanticAttrSSDFilenames(const std::map<std::string, std::string>& semanticPathnameMap)

Create or modify esp::metadata::attributes::SemanticAttributes corresponding to the keys in the passed map to hold the map's values as the semantic scene descriptor file.

Parameters
semanticPathnameMap Map of keys corresponding to the keys that will references these semantic attributes in the scene instance and the filepaths to the appropriate SSD files.

void esp::metadata::attributes::SceneDatasetAttributes::setCurrCfgVals(const std::string& lightSetup, bool frustumCulling)

copy current esp::sim::SimulatorConfiguration driven values, such as file paths, to make them available for stage attributes defaults.

Parameters
lightSetup the config-specified light setup
frustumCulling whether or not (semantic) stage should be partitioned for culling.

bool esp::metadata::attributes::SceneDatasetAttributes::addNewSceneInstanceToDataset(const attributes::SceneInstanceAttributes::ptr& sceneInstance)

Add the passed sceneInstance to the dataset, verifying that all the attributes and assets references in the scene instance exist, and if so adding them. This is to handle the addition of an existing sceneInstance that might reference stages, objects, navmeshes, etc. that do not exist in the dataset.

Parameters
sceneInstance A pointer to a metadata::attributes::SceneInstanceAttributes. It is assumed the sceneInstance at least references a valid stage.
Returns whether this sceneInstance was successfully added to the dataset.

attributes::StageAttributes::ptr esp::metadata::attributes::SceneDatasetAttributes::getNamedStageAttributesCopy(const std::string& stageAttrName)

Returns stage attributes corresponding to passed handle as substring. Assumes stage attributes with stageAttrName as substring exists in current dataset.

Parameters
stageAttrName substring to handle of stage instance attributes that exists in current active dataset. The attributes will be found via substring search, so the name is expected to be sufficiently restrictive to have exactly 1 match in dataset.
Returns smart pointer to stage attributes if exists, nullptr otherwise.

attributes::ObjectAttributes::ptr esp::metadata::attributes::SceneDatasetAttributes::getNamedObjectAttributesCopy(const std::string& objAttrName)

Returns object attributes corresponding to passed handle as substring. Assumes object attributes with objAttrName as substring exists in current dataset.

Parameters
objAttrName substring to handle of object instance attributes that exists in current active dataset. The attributes will be found via substring search, so the name is expected to be sufficiently restrictive to have exactly 1 match in dataset.
Returns smart pointer to object attributes if exists, nullptr otherwise.

attributes::ArticulatedObjectAttributes::ptr esp::metadata::attributes::SceneDatasetAttributes::getNamedArticulatedObjectAttributesCopy(const std::string& artObjAttrName)

Returns articulated object attributes corresponding to passed handle as substring. Assumes articulated object attributes with artObjAttrName as substring exists in current dataset.

Parameters
artObjAttrName substring to handle of articulated object instance attributes that exists in current active dataset. The attributes will be found via substring search, so the name is expected to be sufficiently restrictive to have exactly 1 match in dataset.
Returns smart pointer to articulated object attributes if exists, nullptr otherwise.

esp::gfx::LightSetup esp::metadata::attributes::SceneDatasetAttributes::getNamedLightSetup(const std::string& lightSetupName)

Returns a lightsetup object configured by the attributes whose handle contains the passed lightSetupName.

Parameters
lightSetupName Name of the attributes to be used to build the lightsetup. The attributes will be found via substring search, so the name is expected to be sufficiently restrictive to have exactly 1 match in dataset.
Returns the lightsetup corresponding to lightSetupName.

std::string esp::metadata::attributes::SceneDatasetAttributes::getStageAttrFullHandle(const std::string& stageAttrName)

Returns stage attributes handle in dataset corresponding to passed name as substring. Assumes stage attributes with stageAttrName as substring exists in this dataset.

Parameters
stageAttrName substring to handle of stage instance attributes that exists in this dataset. The attributes will be found via substring search, so the name is expected to be sufficiently restrictive to have exactly 1 match in dataset.
Returns name of stage attributes with handle containing stageAttrName , or empty string if none.

std::string esp::metadata::attributes::SceneDatasetAttributes::getObjAttrFullHandle(const std::string& objAttrName)

Returns object attributes handle in dataset corresponding to passed name as substring. Assumes object attributes with objAttrName as substring exists in this dataset.

Parameters
objAttrName substring to handle of object instance attributes that exists in this dataset. The attributes will be found via substring search, so the name is expected to be sufficiently restrictive to have exactly 1 match in dataset.
Returns name of object attributes with handle containing objAttrName or empty string if none.

std::string esp::metadata::attributes::SceneDatasetAttributes::getArticulatedObjModelFullHandle(const std::string& artObjModelName)

Returns articulated object model file handle in dataset corresponding to passed name as substring. Assumes articulated object model with artObjModelName as substring exists in this dataset.

Parameters
artObjModelName substring to handle of AO model that exists in this dataset. The actual model name will be found via substring search in the manager, so the name is expected to be sufficiently restrictive to have exactly 1 match in dataset.
Returns name of AO model with handle containing artObjModelName or empty string if none.

std::string esp::metadata::attributes::SceneDatasetAttributes::getLightSetupFullHandle(const std::string& lightSetupName)

Returns the full name of the lightsetup attributes whose handle contains the passed lightSetupName.

Parameters
lightSetupName Name of the attributes desired. The attributes will be found via substring search, so the name is expected to be sufficiently restrictive to have exactly 1 match in dataset.
Returns the full attributes name corresponding to lightSetupName , or predefined No-Light and Default_lighting key strings.

void esp::metadata::attributes::SceneDatasetAttributes::createSemanticAttribsFromDS(const std::string& semanticHandle, const std::string& dbgSourceAttribs) protected

will create a new esp::metadata::attributes::SemanticAttributes with the given handle if one does not exist.

Parameters
semanticHandle The name of the attributes to create.
dbgSourceAttribs The name of the caller, for debug purposes should this fail.

std::pair<std::string, std::string> esp::metadata::attributes::SceneDatasetAttributes::addNewValToMap(const std::string& key, const std::string& path, bool overwrite, std::map<std::string, std::string>& map, const std::string& descString) protected

This will add a navmesh entry or a semantic scene descriptor entry to the appropriate map. It checks if a value already exists at the specified key , and if not adds the path to the map at the given key value. If a value does exist at the specified key, it checks if it is the same value as path . If so nothing is done, but if not, then it is either overwritten or the key is modified until an available key is found, which is then used to add the new entry, depending on overwrite .

Parameters
key The key to attempt to add the new value at. This key may be modified if collisions are found and overwrite is false.
path The location of the desired asset being added to the path.
overwrite Whether to overwrite a found, existing entry at key .
map The map to modify
descString The calling method, to provide context for log messages.
Returns the key-value pair that is actually added to the map.

Variable documentation

std::map<std::string, std::string> esp::metadata::attributes::SceneDatasetAttributes::currPbrShaderAttrRegionMap_ protected

list of key-value pairs of region names to PbrShaderConfigs