class
AOAttributesManager
Base classes
-
template<class T, ManagedObjectAccess Access>class AbstractAttributesManager<attributes::ArticulatedObjectAttributes, ManagedObjectAccess::Copy>
- Class template defining responsibilities and functionality for managing esp::
metadata:: attributes:: AbstractAttributes constructs.
Constructors, destructors, conversion operators
Public functions
-
auto createObject(const std::
string& aoConfigFilename, bool registerTemplate = true) -> attributes::ArticulatedObjectAttributes::ptr override - Creates an instance of an articulated object template described by the passed string. For esp::
metadata:: attributes:: ArticulatedObjectAttributes templates, this is a config file name. Parses global and Habitat-specific articulated object parameters (such as render asset and semantic id) from the specified configuration file. - void setValsFromJSONDoc(attributes::ArticulatedObjectAttributes::ptr attribs, const io::JsonGenericValue& jsonConfig) override
- Method to take an existing attributes and set its values from passed json config file.
-
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.
- void finalizeAttrPathsBeforeRegister(const attributes::ArticulatedObjectAttributes::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 parseMarkerSets(const attributes::ArticulatedObjectAttributes::ptr& attribs, const io::JsonGenericValue& jsonConfig) const -> bool
- Parse Marker_sets object in json, if present.
-
auto initNewObjectInternal(const std::
string& handleName, bool builtFromConfig) -> attributes::ArticulatedObjectAttributes::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::ArticulatedObjectAttributes::ptr AOAttributesTemplate,
const std::
string& AOAttributesHandle, bool) -> 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 articulated-object-attributes-specific resetting that needs to happen on reset.
Function documentation
attributes::ArticulatedObjectAttributes::ptr esp:: metadata:: managers:: AOAttributesManager:: createObject(const std:: string& aoConfigFilename,
bool registerTemplate = true) override
Creates an instance of an articulated object template described by the passed string. For esp::
Parameters | |
---|---|
aoConfigFilename | The configuration file to parse. |
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 articulated object attributes 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:: AOAttributesManager:: setValsFromJSONDoc(attributes::ArticulatedObjectAttributes::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:: AOAttributesManager:: finalizeAttrPathsBeforeRegister(const attributes::ArticulatedObjectAttributes::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. |
bool esp:: metadata:: managers:: AOAttributesManager:: parseMarkerSets(const attributes::ArticulatedObjectAttributes::ptr& attribs,
const io::JsonGenericValue& jsonConfig) const protected
Parse Marker_sets object in json, if present.
Parameters | |
---|---|
attribs | (out) an existing attributes to be modified. |
jsonConfig | json document to parse |
Returns | true if tag is found, of appropriate configuration, and holds actual values. |
attributes::ArticulatedObjectAttributes::ptr esp:: metadata:: managers:: AOAttributesManager:: 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 ArticulatedObjectAttributes is being built from a config file (i.e. handleName is the name of a configuration file) or from some other source (such as a default being built for an existing URDF that otherwise had no specified JSON config). |
Returns | Newly created but unregistered ArticulatedObjectAttributes pointer, with only default values set. |
void esp:: metadata:: managers:: AOAttributesManager:: 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:: AOAttributesManager:: preRegisterObjectFinalize(attributes::ArticulatedObjectAttributes::ptr AOAttributesTemplate,
const std:: string& AOAttributesHandle,
bool) 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 | |
---|---|
AOAttributesTemplate | The attributes template. |
AOAttributesHandle | The key for referencing the template in the objectLibrary_. |
Returns | Whether the preregistration has succeeded and what handle to use to register the object if it has. |
void esp:: metadata:: managers:: AOAttributesManager:: 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.