24 #ifndef PXR_USD_SDF_DATA_H
25 #define PXR_USD_SDF_DATA_H
28 #include "pxr/usd/sdf/api.h"
29 #include "pxr/usd/sdf/abstractData.h"
30 #include "pxr/usd/sdf/path.h"
32 #include "pxr/base/tf/hashmap.h"
34 #include "pxr/base/vt/value.h"
38 PXR_NAMESPACE_OPEN_SCOPE
92 const TfToken& fieldName)
const;
103 virtual std::vector<TfToken>
List(
const SdfPath& path)
const;
106 virtual std::set<double>
107 ListAllTimeSamples()
const;
110 virtual std::set<double>
111 ListTimeSamplesForPath(
const SdfPath& path)
const;
115 GetBracketingTimeSamples(
double time,
double* tLower,
double* tUpper)
const;
119 GetNumTimeSamplesForPath(
const SdfPath& path)
const;
123 GetBracketingTimeSamplesForPath(
const SdfPath& path,
125 double* tLower,
double* tUpper)
const;
129 QueryTimeSample(
const SdfPath& path,
double time,
133 QueryTimeSample(
const SdfPath& path,
double time,
138 SetTimeSample(
const SdfPath& path,
double time,
143 EraseTimeSample(
const SdfPath& path,
double time);
166 typedef std::pair<TfToken, VtValue> _FieldValuePair;
168 _SpecData() : specType(SdfSpecTypeUnknown) {}
171 std::vector<_FieldValuePair> fields;
176 typedef SdfPath::Hash _KeyHash;
177 typedef TfHashMap<_Key, _SpecData, _KeyHash> _HashTable;
182 PXR_NAMESPACE_CLOSE_SCOPE
184 #endif // PXR_USD_SDF_DATA_H
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 void EraseSpec(const SdfPath &path)
Erase the spec at path and any fields that are on it.
Standard pointer typedefs.
virtual SDF_API void _VisitSpecs(SdfAbstractDataSpecVisitor *visitor) const
Visits every spec in this SdfAbstractData object with the given visitor.
virtual SDF_API void Erase(const SdfPath &path, const TfToken &fieldName)
Remove the field at path and fieldName, if one exists.
Base class for objects used to visit specs in an SdfAbstractData object.
A type-erased container for a const field value in an SdfAbstractData.
A type-erased container for a field value in an SdfAbstractData.
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 SdfSpecType GetSpecType(const SdfPath &path) const
Return the spec type for the spec at path.
#define TF_DECLARE_WEAK_AND_REF_PTRS(type)
Define standard weak, ref, and vector pointer types.
virtual SDF_API VtValue Get(const SdfPath &path, const TfToken &fieldName) const
Return the value for the given path and fieldName.
Token for efficient comparison, assignment, and hashing of known strings.
virtual SDF_API void CreateSpec(const SdfPath &path, SdfSpecType specType)
Create a new spec at path with the given specType.
SdfData provides concrete scene description data storage.
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).
A path value used to locate objects in layers or scenegraphs.
virtual SDF_API bool HasSpec(const SdfPath &path) const
Return true if this data has a spec for path.
SdfSpecType
An enum that specifies the type of an object.
virtual SDF_API bool StreamsData() const
SdfAbstractData overrides.
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 std::vector< TfToken > List(const SdfPath &path) const
Return the names of all the fields that are set at path.
Provides a container which may hold any type, and provides introspection and iteration over array typ...
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...
Interface for scene description data storage.