esp::metadata::attributes::SceneInstanceAttributes 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.

Constructors, destructors, conversion operators

SceneInstanceAttributes(const std::string& handle) explicit
SceneInstanceAttributes(const SceneInstanceAttributes& otr)
SceneInstanceAttributes(SceneInstanceAttributes&& otr) noexcept

Public functions

auto operator=(const SceneInstanceAttributes& otr) -> SceneInstanceAttributes&
auto operator=(SceneInstanceAttributes&& otr) -> SceneInstanceAttributes& noexcept
void setTranslationOrigin(const std::string& translation_origin)
Set a value representing the mechanism used to create this scene instance - should map to an enum value in @InstanceTranslationOriginMap. This acts as an instance-specific override to the scene-instance-wide setting.
auto getTranslationOrigin() const -> SceneInstanceTranslationOrigin
Get the value representing the mechanism used to create this scene instance - should map to an enum value in @InstanceTranslationOriginMap. This acts as an instance-specific override to the scene-instance-wide setting.
void setLightingHandle(const std::string& lightingHandle)
Set the name of the template that describes the scene's default lighting.
auto getLightingHandle() const -> std::string
Get the name of the template that describes the scene's default lighting.
void setNavmeshHandle(const std::string& navmeshHandle)
Set the name of the navmesh for the scene.
auto getNavmeshHandle() const -> std::string
Get the name of the navmesh for the scene.
void setSemanticSceneHandle(const std::string& semanticSceneDesc)
Set the name of the semantic scene descriptor.
auto getSemanticSceneHandle() const -> std::string
Get the name of the semantic scene descriptor.
void setStageInstanceAttrs(SceneObjectInstanceAttributes::ptr _stageInstance)
Set the description of the stage placement for this scene instance. Scene instance will always have only 1 stage instance reference.
auto getStageInstance() const -> SceneObjectInstanceAttributes::cptr
Get a shared_pointer to the SceneObjectInstanceAttributes descibing the stage placement for this scene instance.
auto addObjectInstanceAttrs(SceneObjectInstanceAttributes::ptr _objInstance, bool _validateUnique) -> bool
Add an object instance attributes to this scene instance. Returns false if not added due to a duplicate to _objInstance found in objInstConfig_ during uniqueness validation.
auto getObjectInstances() const -> std::vector<SceneObjectInstanceAttributes::cptr>
Get the object instance descriptions for this scene.
auto getNumObjInstances() const -> int
Return the number of defined SceneObjectInstanceAttributes subconfigs in this scene instance.
void clearObjectInstances()
Clears current objInstConfig_ values.
auto addArticulatedObjectInstanceAttrs(SceneAOInstanceAttributes::ptr _artObjInstance, bool _validateUnique) -> bool
Add an articulated object instance's attributes to this scene instance. Returns false if not added due to a duplicate to _artObjInstance found in artObjInstConfig_ .
auto getArticulatedObjectInstances() const -> std::vector<SceneAOInstanceAttributes::cptr>
Get the articulated object instance descriptions for this scene.
auto getNumAOInstances() const -> int
Return the number of defined SceneAOInstanceAttributes subconfigs in this scene instance.
void clearArticulatedObjectInstances()
Clears current artObjInstConfig_ values.
void setDefaultPbrShaderAttributesHandle(const std::string& handle)
Set the handle of the PbrShaderAttributes that would serve as the default or is otherwise intended to be used across all semantic regions in the scene not otherwise covered.
auto getDefaultPbrShaderAttributesHandle() const -> std::string
Get the handle of the PbrShaderAttributes that would serve as the default or is otherwise intended to be used across all semantic regions in the scene not otherwise covered.
void addRegionPbrShaderAttributesHandle(const std::string& region, const std::string& handle)
Add the handle of a PbrShaderAttributes, keyed by semantic region in scene where the config should be applied.
auto getRegionPbrShaderAttributesHandles() const -> std::map<std::string, std::string>
Get a vector of pairs of string,string, where the first value is a region name, and the second is the handle to the PbrShaderAttributes to apply to that region.
auto getNumRegionPbrShaderAttributes() const -> int
return how many PbrShaderAttributes handles have been found in the SceneInstance.
void writeValuesToJson(io::JsonGenericValue& jsonObj, io::JsonAllocator& allocator) const override
Populate a JSON object with all the first-level values held in this configuration. Default is overridden to handle special cases for SceneInstanceAttributes.
void writeSubconfigsToJson(io::JsonGenericValue& jsonObj, io::JsonAllocator& allocator) const override
Populate a JSON object with all the data from the subconfigurations, held in JSON sub-objects, for this SceneInstance. Have special handling for ao instances and object instances before handling other subConfigs.

Protected functions

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.
auto getObjectInfoInternal() const -> std::string override
Retrieve a comma-separated informational string about the contents of this managed object.

Protected variables

std::shared_ptr<Configuration> objInstConfig_
Smartpointer to created object instance configuration. The configuration is created on SceneInstanceAttributes construction.
std::deque<int> availableObjInstIDs_
Deque holding all released IDs to consume for object instances when one is deleted, before using size of objectInstances_ container.
std::shared_ptr<Configuration> artObjInstConfig_
Smartpointer to created articulated object instance configuration. The configuration is created on SceneInstanceAttributes construction.
std::deque<int> availableArtObjInstIDs_
Deque holding all released IDs to consume for articulated object instances when one is deleted, before using size of articulatedObjectInstances_ container.
std::shared_ptr<Configuration> pbrShaderRegionConfigHandles_
Smartpointer to the subconfiguration holding the handles of the PbrShaderConfiguration, keyed by the region they apply to.

Function documentation

bool esp::metadata::attributes::SceneInstanceAttributes::addObjectInstanceAttrs(SceneObjectInstanceAttributes::ptr _objInstance, bool _validateUnique)

Add an object instance attributes to this scene instance. Returns false if not added due to a duplicate to _objInstance found in objInstConfig_ during uniqueness validation.

Parameters
_objInstance The object instance to add to the owning subconfiguration.
_validateUnique Whether to validate uniqueness of _objInstance . Note : hidden fields are ignored for this validation.
Returns Whether or not _objInstance was added due to a duplicate being found.

bool esp::metadata::attributes::SceneInstanceAttributes::addArticulatedObjectInstanceAttrs(SceneAOInstanceAttributes::ptr _artObjInstance, bool _validateUnique)

Add an articulated object instance's attributes to this scene instance. Returns false if not added due to a duplicate to _artObjInstance found in artObjInstConfig_ .

Parameters
_artObjInstance The object instance to add to the owning subconfiguration.
_validateUnique Whether to validate uniqueness of _objInstance . Note : hidden fields are ignored for this validation.
Returns Whether or not _objInstance was added due to a duplicate being found.

void esp::metadata::attributes::SceneInstanceAttributes::setDefaultPbrShaderAttributesHandle(const std::string& handle)

Set the handle of the PbrShaderAttributes that would serve as the default or is otherwise intended to be used across all semantic regions in the scene not otherwise covered.

Parameters
handle The handle of the PbrShaderAttributes to use for this scene instance, as specified in the PbrShaderAttributesManager.

std::string esp::metadata::attributes::SceneInstanceAttributes::getDefaultPbrShaderAttributesHandle() const

Get the handle of the PbrShaderAttributes that would serve as the default or is otherwise intended to be used across all semantic regions in the scene not otherwise covered.

Returns The handle of the PbrShaderAttributes to use for this scene instance, as specified in the PbrShaderAttributesManager.

void esp::metadata::attributes::SceneInstanceAttributes::addRegionPbrShaderAttributesHandle(const std::string& region, const std::string& handle)

Add the handle of a PbrShaderAttributes, keyed by semantic region in scene where the config should be applied.

Parameters
region The region/identifier in the scene to apply the specified PbrShaderAttributes to the Pbr and Ibl shader calculations.
handle The handle of the PbrShaderAttributes to use for the given region , as specified in the PbrShaderAttributesManager.