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 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 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 setSemanticAssetHandle(const std::string& semanticAssetHandle)
Set the Filename to the semantic texture mesh, if one exists.
auto getSemanticAssetHandle() const -> std::string
Get the Filename to the semantic texture mesh, if one exists.
void setSemanticAssetType(int semanticAssetType)
auto getSemanticAssetType() const -> int
void setHasSemanticTextures(bool hasSemanticTextures)
Set whether or not the semantic asset for this stage supports texture semantics.
auto getHasSemanticTextures() const -> bool
Get whether or not the semantic asset for this stage supports texture semantics.
void addRegionInstanceAttrs(SemanticVolumeAttributes::ptr _regionInstance)
Add an object instance attributes to this scene instance.
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.