HDK
|
#include <spec.h>
Public Member Functions | |
SDF_API SdfSpec & | operator= (const SdfSpec &other) |
SDF_API | ~SdfSpec () |
SdSpec generic API | |
SDF_API const SdfSchemaBase & | GetSchema () const |
Returns the SdfSchemaBase for the layer that owns this spec. More... | |
SDF_API SdfSpecType | GetSpecType () const |
SDF_API bool | IsDormant () const |
Returns true if this object is invalid or expired. More... | |
SDF_API SdfLayerHandle | GetLayer () const |
Returns the layer that this object belongs to. More... | |
SDF_API SdfPath | GetPath () const |
Returns the scene path of this object. More... | |
SDF_API bool | PermissionToEdit () const |
Returns whether this object's layer can be edited. More... | |
SDF_API std::vector< TfToken > | ListInfoKeys () const |
SDF_API std::vector< TfToken > | GetMetaDataInfoKeys () const |
SDF_API TfToken | GetMetaDataDisplayGroup (TfToken const &key) const |
SDF_API VtValue | GetInfo (const TfToken &key) const |
SDF_API void | SetInfo (const TfToken &key, const VtValue &value) |
SDF_API void | SetInfoDictionaryValue (const TfToken &dictionaryKey, const TfToken &entryKey, const VtValue &value) |
SDF_API bool | HasInfo (const TfToken &key) const |
SDF_API void | ClearInfo (const TfToken &key) |
SDF_API TfType | GetTypeForInfo (const TfToken &key) const |
Returns the data type for the info with the given key. More... | |
SDF_API const VtValue & | GetFallbackForInfo (const TfToken &key) const |
Returns the fallback for the info with the given key. More... | |
SDF_API bool | WriteToStream (std::ostream &, size_t indent=0) const |
Writes this spec to the given stream. More... | |
SDF_API bool | IsInert (bool ignoreChildren=false) const |
Field-based Generic API | |
SDF_API std::vector< TfToken > | ListFields () const |
Returns all fields with values. More... | |
SDF_API bool | HasField (const TfToken &name) const |
template<class T > | |
bool | HasField (const TfToken &name, T *value) const |
SDF_API VtValue | GetField (const TfToken &name) const |
Returns a field value by name. More... | |
template<typename T > | |
T | GetFieldAs (const TfToken &name, const T &defaultValue=T()) const |
SDF_API bool | SetField (const TfToken &name, const VtValue &value) |
Sets a field value as a boxed VtValue. More... | |
template<typename T > | |
bool | SetField (const TfToken &name, const T &value) |
Sets a field value of type T. More... | |
SDF_API bool | ClearField (const TfToken &name) |
Clears a field. More... | |
Comparison operators | |
SDF_API bool | operator== (const SdfSpec &rhs) const |
SDF_API bool | operator< (const SdfSpec &rhs) const |
Protected Member Functions | |
bool | _MoveSpec (const SdfPath &oldPath, const SdfPath &newPath) const |
bool | _DeleteSpec (const SdfPath &path) |
Friends | |
template<class HashState > | |
void | TfHashAppend (HashState &h, const SdfSpec &x) |
Hash. More... | |
SDF_API SdfSpec::~SdfSpec | ( | ) |
|
protected |
Clears the value for scene spec info with the given key.
After calling this, HasInfo() will return false. To make HasInfo() return true just set a value for that scene spec info.
This is interim API which is likely to change. Only editors with an immediate specific need (like the Inspector) should use this API.
Returns the fallback for the info with the given key.
Gets the value for the given metadata key.
This is interim API which is likely to change. Only editors with an immediate specific need (like the Inspector) should use this API.
SDF_API SdfLayerHandle SdfSpec::GetLayer | ( | ) | const |
Returns the layer that this object belongs to.
Returns this metadata key's displayGroup.
Returns the list of metadata info keys for this object.
This is not the complete list of keys, it is only those that should be considered to be metadata by inspectors or other presentation UI.
This is interim API which is likely to change. Only editors with an immediate specific need (like the Inspector) should use this API.
SDF_API const SdfSchemaBase& SdfSpec::GetSchema | ( | ) | const |
Returns the SdfSchemaBase for the layer that owns this spec.
SDF_API SdfSpecType SdfSpec::GetSpecType | ( | ) | const |
Returns the SdfSpecType specifying the spec type this object represents.
Returns the data type for the info with the given key.
Returns true
if the spec has a non-empty value with field name name
.
Returns whether there is a setting for the scene spec info with the given key.
When asked for a value for one of its scene spec info, a valid value will always be returned. But if this API returns false for a scene spec info, the value of that info will be the defined default value.
When dealing with a composedLayer, it is not necessary to worry about whether a scene spec info "has a value" because the composed layer will always have a valid value, even if it is the default.
A spec may or may not have an expressed value for some of its scene spec info.
This is interim API which is likely to change. Only editors with an immediate specific need (like the Inspector) should use this API.
SDF_API bool SdfSpec::IsDormant | ( | ) | const |
Returns true if this object is invalid or expired.
SDF_API bool SdfSpec::IsInert | ( | bool | ignoreChildren = false | ) | const |
Returns whether this object has no significant data.
"Significant" here means that the object contributes opinions to a scene. If this spec has any child scenegraph objects (e.g., prim or property spec), it will be considered significant even if those child objects are not. However, if ignoreChildren
is true
, these child objects will be ignored.
Returns the full list of info keys currently set on this object.
SDF_API bool SdfSpec::PermissionToEdit | ( | ) | const |
Returns whether this object's layer can be edited.
Sets a field value as a boxed VtValue.
Sets the value for the given metadata key.
It is an error to pass a value that is not the correct type for that given key.
This is interim API which is likely to change. Only editors with an immediate specific need (like the Inspector) should use this API.
SDF_API void SdfSpec::SetInfoDictionaryValue | ( | const TfToken & | dictionaryKey, |
const TfToken & | entryKey, | ||
const VtValue & | value | ||
) |
Sets the value for entryKey
to value
within the dictionary with the given metadata key dictionaryKey
SDF_API bool SdfSpec::WriteToStream | ( | std::ostream & | , |
size_t | indent = 0 |
||
) | const |
Writes this spec to the given stream.