7#ifndef PXR_USD_SDF_DATA_H
8#define PXR_USD_SDF_DATA_H
11#include "pxr/usd/sdf/api.h"
12#include "pxr/usd/sdf/abstractData.h"
13#include "pxr/usd/sdf/path.h"
15#include "pxr/base/tf/hashmap.h"
17#include "pxr/base/vt/value.h"
21PXR_NAMESPACE_OPEN_SCOPE
78 const TfToken& fieldName)
const;
92 virtual std::set<double>
93 ListAllTimeSamples()
const;
96 virtual std::set<double>
97 ListTimeSamplesForPath(
const SdfPath& path)
const;
101 GetBracketingTimeSamples(
double time,
double* tLower,
double* tUpper)
const;
105 GetNumTimeSamplesForPath(
const SdfPath& path)
const;
109 GetBracketingTimeSamplesForPath(
const SdfPath& path,
111 double* tLower,
double* tUpper)
const;
115 QueryTimeSample(
const SdfPath& path,
double time,
119 QueryTimeSample(
const SdfPath& path,
double time,
124 SetTimeSample(
const SdfPath& path,
double time,
129 EraseTimeSample(
const SdfPath& path,
double time);
152 typedef std::pair<TfToken, VtValue> _FieldValuePair;
154 _SpecData() : specType(SdfSpecTypeUnknown) {}
157 std::vector<_FieldValuePair> fields;
162 typedef SdfPath::Hash _KeyHash;
163 typedef TfHashMap<_Key, _SpecData, _KeyHash> _HashTable;
168PXR_NAMESPACE_CLOSE_SCOPE
A type-erased container for a const field value in an SdfAbstractData.
Interface for scene description data storage.
Base class for objects used to visit specs in an SdfAbstractData object.
A type-erased container for a field value in an SdfAbstractData.
SdfData provides concrete scene description data storage.
virtual SDF_API bool Has(const SdfPath &path, const TfToken &fieldName, SdfAbstractDataValue *value) const
Returns whether a value exists for the given path and fieldName.
virtual SDF_API bool HasSpec(const SdfPath &path) const
Return true if this data has a spec for path.
virtual SDF_API void EraseSpec(const SdfPath &path)
Erase the spec at path and any fields that are on it.
virtual SDF_API void Set(const SdfPath &path, const TfToken &fieldName, const VtValue &value)
Set the value of the given path and fieldName.
virtual SDF_API bool IsDetached() const
Returns true if this data object is detached from its serialized data store, false otherwise.
virtual SDF_API void Set(const SdfPath &path, const TfToken &fieldName, const SdfAbstractDataConstValue &value)
Set the value of the given path and fieldName.
virtual SDF_API void Erase(const SdfPath &path, const TfToken &fieldName)
Remove the field at path and fieldName, if one exists.
virtual SDF_API VtValue Get(const SdfPath &path, const TfToken &fieldName) const
Return the value for the given path and fieldName.
virtual SDF_API std::vector< TfToken > List(const SdfPath &path) const
Return the names of all the fields that are set at path.
virtual SDF_API bool StreamsData() const
SdfAbstractData overrides.
virtual SDF_API bool HasSpecAndField(const SdfPath &path, const TfToken &fieldName, VtValue *value, SdfSpecType *specType) const
Fill specType (which cannot be nullptr) as if by a call to GetSpecType(path).
virtual SDF_API bool HasSpecAndField(const SdfPath &path, const TfToken &fieldName, SdfAbstractDataValue *value, SdfSpecType *specType) const
Fill specType (which cannot be nullptr) as if by a call to GetSpecType(path).
virtual SDF_API void CreateSpec(const SdfPath &path, SdfSpecType specType)
Create a new spec at path with the given specType.
virtual SDF_API void MoveSpec(const SdfPath &oldPath, const SdfPath &newPath)
Move the spec at oldPath to newPath, including all the fields that are on it.
virtual SDF_API bool Has(const SdfPath &path, const TfToken &fieldName, VtValue *value=NULL) const
Return whether a value exists for the given path and fieldName.
virtual SDF_API SdfSpecType GetSpecType(const SdfPath &path) const
Return the spec type for the spec at path.
virtual SDF_API void _VisitSpecs(SdfAbstractDataSpecVisitor *visitor) const
Visits every spec in this SdfAbstractData object with the given visitor.
A path value used to locate objects in layers or scenegraphs.
Token for efficient comparison, assignment, and hashing of known strings.
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Standard pointer typedefs.
#define TF_DECLARE_WEAK_AND_REF_PTRS(type)
Define standard weak, ref, and vector pointer types.
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...
SdfSpecType
An enum that specifies the type of an object.