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
95 const TfToken& fieldName)
const;
106 virtual std::vector<TfToken>
List(
const SdfPath& path)
const;
109 virtual std::set<double>
110 ListAllTimeSamples()
const;
113 virtual std::set<double>
114 ListTimeSamplesForPath(
const SdfPath& path)
const;
118 GetBracketingTimeSamples(
double time,
double* tLower,
double* tUpper)
const;
122 GetNumTimeSamplesForPath(
const SdfPath& path)
const;
126 GetBracketingTimeSamplesForPath(
const SdfPath& path,
128 double* tLower,
double* tUpper)
const;
132 QueryTimeSample(
const SdfPath& path,
double time,
136 QueryTimeSample(
const SdfPath& path,
double time,
141 SetTimeSample(
const SdfPath& path,
double time,
146 EraseTimeSample(
const SdfPath& path,
double time);
169 typedef std::pair<TfToken, VtValue> _FieldValuePair;
171 _SpecData() : specType(SdfSpecTypeUnknown) {}
174 std::vector<_FieldValuePair> fields;
179 typedef SdfPath::Hash _KeyHash;
180 typedef TfHashMap<_Key, _SpecData, _KeyHash> _HashTable;
185 PXR_NAMESPACE_CLOSE_SCOPE
187 #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 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.
#define TF_DECLARE_WEAK_AND_REF_PTRS(type)
Define standard weak, ref, and vector pointer types.
virtual SDF_API SdfSpecType GetSpecType(const SdfPath &path) const
Return the spec type for the spec at path.
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.
virtual SDF_API VtValue Get(const SdfPath &path, const TfToken &fieldName) const
Return the value for the given path and fieldName.
SdfData provides concrete scene description data storage.
A path value used to locate objects in layers or scenegraphs.
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 bool StreamsData() const
SdfAbstractData overrides.
virtual SDF_API bool IsDetached() const
Returns true if this data object is detached from its serialized data store, false otherwise.
SdfSpecType
An enum that specifies the type of an object.
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.
Provides a container which may hold any type, and provides introspection and iteration over array typ...
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 HasSpec(const SdfPath &path) const
Return true if this data has a spec for path.
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...
Interface for scene description data storage.
virtual SDF_API void _VisitSpecs(SdfAbstractDataSpecVisitor *visitor) const
Visits every spec in this SdfAbstractData object with the given visitor.