esp::metadata::managers::SemanticAttributesManager class

Base classes

template<class T, ManagedObjectAccess Access>
class AbstractAttributesManager<attributes::SemanticAttributes, ManagedObjectAccess::Copy>
Class template defining responsibilities and functionality for managing esp::metadata::attributes::AbstractAttributes constructs.

Constructors, destructors, conversion operators

SemanticAttributesManager()

Public functions

auto createObject(const std::string& semanticConfigFilename, bool registerTemplate = true) -> attributes::SemanticAttributes::ptr override
Creates an instance of a semantic attributes used to govern which calculations are performed by the PBR shader (such as Image-based Lighting and/or specific PBR layer calculations), as well as to provide some user-configurable shader-wide control values.
void setValsFromJSONDoc(attributes::SemanticAttributes::ptr attribs, const io::JsonGenericValue& jsonConfig) override
Method to take an existing attributes and set its values from passed json config file.
auto createEmptyRegionAttributes(const std::string& handle) -> attributes::SemanticVolumeAttributes::ptr
This will return a attributes::SemanticVolumeAttributes object with passed handle.
void finalizeAttrPathsBeforeRegister(const attributes::SemanticAttributes::ptr& attributes) const override
This function will be called to finalize attributes' paths before registration, moving fully qualified paths to the appropriate hidden attribute fields. This can also be called without registration to make sure the paths specified in an attributes are properly configured.

Protected functions

auto createRegionAttributesFromJSON(const io::JsonGenericValue& jCell) -> attributes::SemanticVolumeAttributes::ptr
Used Internally. Create a esp::metadata::attributes::SemanticVolumeAttributes object from the passed JSON doc.
void setSemanticVolumeAttributesFromJson(const attributes::SemanticVolumeAttributes::ptr& attributes, const io::JsonGenericValue& jCell)
Populate an existing metadata::attributes::SemanticVolumeAttributes from a JSON config.
auto initNewObjectInternal(const std::string& handleName, bool builtFromConfig) -> attributes::SemanticAttributes::ptr override
Used Internally. Create and configure newly-created attributes with any default values, before any specific values are set.
void deleteObjectInternalFinalize(int templateID, const std::string& templateHandle) override
This method will perform any necessary updating that is AbstractAttributesManager-specific upon template removal, such as removing a specific template handle from the list of file-based template handles in ObjectAttributesManager. This should only be called esp::core::ManagedContainerBase.
auto preRegisterObjectFinalize(attributes::SemanticAttributes::ptr object, const std::string& objectHandle, bool forceRegistration) -> core::managedContainers::ManagedObjectPreregistration override
This method will perform any essential updating to the managed object before registration is performed. If this updating fails, registration will also fail.
void postRegisterObjectHandling(int objectID, const std::string& objectHandle) override
Not required for this manager.
void resetFinalize() override
Any physics-attributes-specific resetting that needs to happen on reset.

Function documentation

attributes::SemanticAttributes::ptr esp::metadata::managers::SemanticAttributesManager::createObject(const std::string& semanticConfigFilename, bool registerTemplate = true) override

Creates an instance of a semantic attributes used to govern which calculations are performed by the PBR shader (such as Image-based Lighting and/or specific PBR layer calculations), as well as to provide some user-configurable shader-wide control values.

Parameters
semanticConfigFilename The location of the Semantic Configuratioo.
registerTemplate whether to add this template to the library. If the user is going to edit this template, this should be false - any subsequent editing will require re-registration. Defaults to true. If specified as true, then this function returns a copy of the registered template.
Returns a reference to the physics simulation meta data object parsed from the specified configuration file.

If a template exists with this handle, this existing template will be overwritten with the newly created one if registerTemplate is true.

void esp::metadata::managers::SemanticAttributesManager::setValsFromJSONDoc(attributes::SemanticAttributes::ptr attribs, const io::JsonGenericValue& jsonConfig) override

Method to take an existing attributes and set its values from passed json config file.

Parameters
attribs (out) an existing attributes to be modified.
jsonConfig json document to parse

void esp::metadata::managers::SemanticAttributesManager::finalizeAttrPathsBeforeRegister(const attributes::SemanticAttributes::ptr& attributes) const override

This function will be called to finalize attributes' paths before registration, moving fully qualified paths to the appropriate hidden attribute fields. This can also be called without registration to make sure the paths specified in an attributes are properly configured.

Parameters
attributes The attributes to be filtered.

attributes::SemanticVolumeAttributes::ptr esp::metadata::managers::SemanticAttributesManager::createRegionAttributesFromJSON(const io::JsonGenericValue& jCell) protected

Used Internally. Create a esp::metadata::attributes::SemanticVolumeAttributes object from the passed JSON doc.

Parameters
jCell JSON object containing the description of the semantic retion
Returns the constructed esp::metadata::attributes::SemanticVolumeAttributes object

void esp::metadata::managers::SemanticAttributesManager::setSemanticVolumeAttributesFromJson(const attributes::SemanticVolumeAttributes::ptr& attributes, const io::JsonGenericValue& jCell) protected

Populate an existing metadata::attributes::SemanticVolumeAttributes from a JSON config.

Parameters
attributes (out) the attributes to populate with JSON values
jCell JSON document to parse to populate the metadata::attributes::SemanticVolumeAttributes

attributes::SemanticAttributes::ptr esp::metadata::managers::SemanticAttributesManager::initNewObjectInternal(const std::string& handleName, bool builtFromConfig) override protected

Used Internally. Create and configure newly-created attributes with any default values, before any specific values are set.

Parameters
handleName handle name to be assigned to attributes
builtFromConfig Whether this SemanticAttributes is being built from a config file (i.e. handleName is the name of a configuration file) or from some other source.
Returns Newly created but unregistered SemanticAttributes pointer, with only default values set.

void esp::metadata::managers::SemanticAttributesManager::deleteObjectInternalFinalize(int templateID, const std::string& templateHandle) override protected

This method will perform any necessary updating that is AbstractAttributesManager-specific upon template removal, such as removing a specific template handle from the list of file-based template handles in ObjectAttributesManager. This should only be called esp::core::ManagedContainerBase.

Parameters
templateID the ID of the template to remove
templateHandle the string key of the attributes desired.

core::managedContainers::ManagedObjectPreregistration esp::metadata::managers::SemanticAttributesManager::preRegisterObjectFinalize(attributes::SemanticAttributes::ptr object, const std::string& objectHandle, bool forceRegistration) override protected

This method will perform any essential updating to the managed object before registration is performed. If this updating fails, registration will also fail.

Parameters
object the managed object to be registered
objectHandle the name to register the managed object with. Expected to be valid.
forceRegistration Should register object even if conditional registration checks fail.
Returns Whether the preregistration has succeeded and what handle to use to register the object if it has.

void esp::metadata::managers::SemanticAttributesManager::postRegisterObjectHandling(int objectID, const std::string& objectHandle) override protected

Not required for this manager.

Parameters
objectID the ID of the successfully registered managed object
objectHandle The name of the managed object

This method will perform any final manager-related handling after successfully registering an object.

See esp::attributes::managers::ObjectAttributesManager for an example.