esp::metadata::attributes::SemanticAttributes class

This class describes the semantic attributes for a specific scene. This includes semantic region description and annotation.

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

SemanticAttributes(const std::string& handle = "") explicit
SemanticAttributes(const SemanticAttributes& otr)
SemanticAttributes(SemanticAttributes&& otr) noexcept

Public functions

auto operator=(const SemanticAttributes& otr) -> SemanticAttributes&
auto operator=(SemanticAttributes&& otr) -> SemanticAttributes& noexcept
void setSemanticOrientUp(const Magnum::Vector3& semanticOrientUp)
Set default up orientation for semantic mesh. This is to support aligning semantic meshes that have different orientations than the target stage's render mesh.
auto getSemanticOrientUp() const -> Magnum::Vector3
Get default up orientation for semantic mesh. This is to support aligning semantic meshes that have different orientations than the stage render mesh.
void setSemanticOrientFront(const Magnum::Vector3& semanticOrientFront)
Set default forward orientation for semantic mesh. This is to support aligning semantic meshes that have different orientations than the stage render mesh.
auto getSemanticOrientFront() const -> Magnum::Vector3
Get default forward orientation for semantic mesh. This is to support aligning semantic meshes that have different orientations than the stage render mesh.
void setSemanticDescriptorFilename(const std::string& semantic_descriptor_filename)
Set the relative filename to the text file that describes the hierharchy of semantic information embedded in the Semantic Asset mesh. May be overridden by value specified in Scene Instance Attributes.
auto getSemanticDescriptorFilename() const -> std::string
Get the relative filename to the text file that describes the hierharchy of semantic information embedded in the Semantic Asset mesh. May be overridden by value specified in Scene Instance Attributes.
void setSemanticDescriptorFullPath(const std::string& semanticDescriptorHandle)
Sets the fully-qualified filename to the text file that describes the hierharchy of semantic information embedded in the Semantic Asset mesh. May be overridden by value specified in Scene Instance Attributes. This is only used internally and should not be saved to disk.
auto getSemanticDescriptorFullPath() const -> std::string
Gets the fully-qualified filename to the text file that describes the hierharchy of semantic information embedded in the Semantic Asset mesh. May be overridden by value specified in Scene Instance Attributes. This is only used internally and should not be saved to disk.
void setSemanticAssetHandle(const std::string& semanticAssetHandle)
Set the relative Filename to the semantic texture mesh, if one exists.
auto getSemanticAssetHandle() const -> std::string
Get the relative Filename to the semantic texture mesh, if one exists.
void setSemanticAssetFullPath(const std::string& semanticAssetHandle)
Sets the fully-qualified filepath for the semantic asset to be used to render the semantics for the stage this attributes describes. This is only used internally and should not be saved to disk.
auto getSemanticAssetFullPath() const -> std::string
Gets the fully-qualified filepath for the semantic asset to be used to render the semantics for the stage this attributes describes. This is only used internally and should not be saved to disk.
void setSemanticAssetType(const std::string& semanticAssetType)
Sets the semantic asset type, as specified by AssetType. This specification was generally intended for specifying certain criteria such as orientation for the loaded asset based on file name, which was in turn queried for type. This is an artifact of a very early version of Habitat-Sim and effort should be spent to remove this entirely, as more accurate and thorough mechanisms have been implemented in its place.
void initSemanticAssetType(const std::string& semanticAssetType)
Initalize the semantic asset type, as specified by AssetType. This specification was generally intended for specifying certain criteria such as orientation for the loaded asset based on file name, which was in turn queried for type. This is an artifact of a very early version of Habitat-Sim and effort should be spent to remove this entirely, as more accurate and thorough mechanisms have been implemented in its place.
void setSemanticAssetTypeEnum(AssetType assetTypeEnum)
Sets the semantic asset type, as specified by AssetType, by first translating from provided enum. This specification was generally intended for specifying certain criteria such as orientation for the loaded asset based on file name, which was in turn queried for type. This is an artifact of a very early version of Habitat-Sim and effort should be spent to remove this entirely, as more accurate and thorough mechanisms have been implemented in its place.
void initSemanticAssetTypeEnum(AssetType assetTypeEnum)
Initialize the semantic asset type, as specified by AssetType, by first translating from provided enum. This specification was generally intended for specifying certain criteria such as orientation for the loaded asset based on file name, which was in turn queried for type. This is an artifact of a very early version of Habitat-Sim and effort should be spent to remove this entirely, as more accurate and thorough mechanisms have been implemented in its place.
auto getSemanticAssetType() const -> AssetType
Gets the semantic asset type, as specified by AssetType. This specification was generally intended for specifying certain criteria such as orientation for the loaded asset based on file name, which was in turn queried for type. This is an artifact of a very early version of Habitat-Sim and effort should be spent to remove this entirely, as more accurate and thorough mechanisms have been implemented in its place.
void setHasSemanticTextures(bool hasSemanticTextures)
Set whether or not the semantic asset described by this attributes supports texture semantics.
auto getHasSemanticTextures() const -> bool
Get whether or not the semantic asset described by this attributes supports texture semantics.
auto addRegionInstanceAttrs(SemanticVolumeAttributes::ptr _regionInstance, bool _validateUnique) -> bool
Add an object instance attributes to this scene instance. Returns false if not added due to a duplicate to _regionInstance found in regionAnnotationConfig_ .
auto getRegionInstances() const -> std::vector<SemanticVolumeAttributes::cptr>
Get the object instance descriptions for this scene.
auto getNumRegionInstances() const -> int
Return the number of defined SemanticVolumeAttributes subconfigs in this scene instance.
void clearRegionInstances()
Clears current regionAnnotationConfig_ values.
void writeValuesToJson(io::JsonGenericValue& jsonObj, io::JsonAllocator& allocator) const override
Populate a JSON object with all the first-level values held in this SemanticVolumeAttributes. Default is overridden to handle special cases for SemanticVolumeAttributes.
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.
auto getUseSpecifiedSemanticFrame() const -> bool
Whether to use the specified semantic orientation frame. This will only be set to true if the frame was explicitly set, either from src json or from a stage with a pre-existing config.

Protected functions

void setUseSpecifiedSemanticFrame(bool useSemanticFrame)
Whether to use the specified semantic orientation frame. This will only be set to true if.
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. Don't use this method, since we have both SemanticAttributes data to save and the individual SemanticVolumeAttributes data to save.
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> regionAnnotationConfig_
Smartpointer to created region instance collection configuration. The configuration is created on SemanticAttributes construction.
std::deque<int> availableRegionInstIDs_
Deque holding all released IDs to consume for region instances when one is deleted, before using size of regionAnnotationConfig_ container.

Function documentation

bool esp::metadata::attributes::SemanticAttributes::addRegionInstanceAttrs(SemanticVolumeAttributes::ptr _regionInstance, bool _validateUnique)

Add an object instance attributes to this scene instance. Returns false if not added due to a duplicate to _regionInstance found in regionAnnotationConfig_ .

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