Loading...
Searching...
No Matches
types.h
Go to the documentation of this file.
1//
2// Copyright 2016 Pixar
3//
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
5// with the following modification; you may not use this file except in
6// compliance with the Apache License and the following modification to it:
7// Section 6. Trademarks. is deleted and replaced with:
8//
9// 6. Trademarks. This License does not grant permission to use the trade
10// names, trademarks, service marks, or product names of the Licensor
11// and its affiliates, except as required to comply with Section 4(c) of
12// the License and to reproduce the content of the NOTICE file.
13//
14// You may obtain a copy of the Apache License at
15//
16// http://www.apache.org/licenses/LICENSE-2.0
17//
18// Unless required by applicable law or agreed to in writing, software
19// distributed under the Apache License with the above modification is
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21// KIND, either express or implied. See the Apache License for the specific
22// language governing permissions and limitations under the Apache License.
23//
24#ifndef PXR_USD_SDF_TYPES_H
25#define PXR_USD_SDF_TYPES_H
26
29
30#include "pxr/pxr.h"
31#include "pxr/usd/sdf/api.h"
34#include "pxr/usd/sdf/listOp.h"
35#include "pxr/usd/sdf/opaqueValue.h"
36#include "pxr/usd/sdf/pathExpression.h"
38#include "pxr/usd/sdf/valueTypeName.h"
39
42#include "pxr/base/gf/half.h"
46#include "pxr/base/gf/quatd.h"
47#include "pxr/base/gf/quatf.h"
48#include "pxr/base/gf/quath.h"
49#include "pxr/base/gf/vec2d.h"
50#include "pxr/base/gf/vec2f.h"
51#include "pxr/base/gf/vec2h.h"
52#include "pxr/base/gf/vec2i.h"
53#include "pxr/base/gf/vec3d.h"
54#include "pxr/base/gf/vec3f.h"
55#include "pxr/base/gf/vec3h.h"
56#include "pxr/base/gf/vec3i.h"
57#include "pxr/base/gf/vec4d.h"
58#include "pxr/base/gf/vec4f.h"
59#include "pxr/base/gf/vec4h.h"
60#include "pxr/base/gf/vec4i.h"
61#include "pxr/base/tf/enum.h"
62#include "pxr/base/tf/preprocessorUtilsLite.h"
64#include "pxr/base/tf/token.h"
65#include "pxr/base/tf/type.h"
66#include "pxr/base/vt/array.h"
68#include "pxr/base/vt/value.h"
69
70#include <boost/preprocessor/list/for_each.hpp>
71#include <boost/preprocessor/list/size.hpp>
72#include <boost/preprocessor/selection/max.hpp>
73#include <boost/preprocessor/seq/for_each.hpp>
74#include <boost/preprocessor/seq/seq.hpp>
75#include <boost/preprocessor/tuple/elem.hpp>
76#include <iosfwd>
77#include <list>
78#include <map>
79#include <stdint.h>
80#include <string>
81#include <typeinfo>
82#include <vector>
83
84PXR_NAMESPACE_OPEN_SCOPE
85
86class SdfPath;
87
91 // The unknown type has a value of 0 so that SdfSpecType() is unknown.
92 SdfSpecTypeUnknown = 0,
93
94 // Real concrete types
95 SdfSpecTypeAttribute,
96 SdfSpecTypeConnection,
97 SdfSpecTypeExpression,
98 SdfSpecTypeMapper,
99 SdfSpecTypeMapperArg,
100 SdfSpecTypePrim,
101 SdfSpecTypePseudoRoot,
102 SdfSpecTypeRelationship,
103 SdfSpecTypeRelationshipTarget,
104 SdfSpecTypeVariant,
105 SdfSpecTypeVariantSet,
106
107 SdfNumSpecTypes
108};
109
123 SdfSpecifierDef,
124 SdfSpecifierOver,
125 SdfSpecifierClass,
126 SdfNumSpecifiers
127};
128
130inline
131bool
133{
134 return (spec != SdfSpecifierOver);
135}
136
155 SdfPermissionPublic,
156 SdfPermissionPrivate,
157
158 SdfNumPermissions
159};
160
179 SdfVariabilityVarying,
180 SdfVariabilityUniform,
181
182 SdfNumVariabilities
183};
184
185
200{
201 SdfAuthoringErrorUnrecognizedFields,
202 SdfAuthoringErrorUnrecognizedSpecType
203};
204
205// Each category of compatible units of measurement is defined by a
206// preprocessor sequence of tuples. Each such sequence gives rise to an enum
207// representing the corresponding unit category. All the unit categories are
208// listed in _SDF_UNITS where each entry is a two-tuple with the unit category
209// name as the first element, and the second element is the units in that
210// category. Each tuple in a unit category sequence corresponds to a unit of
211// measurement represented by an enumerant whose name is given by concatenating
212// 'Sdf', the unit category name, the word 'Unit' and the first entry in the
213// tuple. (E.g. units of category 'Length' are represented by an enum named
214// SdfLengthUnit with enumerants SdfLengthUnitInch, SdfLengthUnitMeter and so
215// forth.) The second element in the tuple is the display name for the unit,
216// and the third element is the relative size of the unit compared to the menv
217// default unit for the unit category (which has a relative size of 1.0).
218// Dimensionless quantities use a special 'Dimensionless' unit category
219// represented by the enum SdfDimensionlessUnit.
220#define _SDF_LENGTH_UNITS \
221((Millimeter, "mm", 0.001)) \
222((Centimeter, "cm", 0.01)) \
223((Decimeter, "dm", 0.1)) \
224((Meter, "m", 1.0)) \
225((Kilometer, "km", 1000.0)) \
226((Inch, "in", 0.0254)) \
227((Foot, "ft", 0.3048)) \
228((Yard, "yd", 0.9144)) \
229((Mile, "mi", 1609.344))
230
231#define _SDF_ANGULAR_UNITS \
232((Degrees, "deg", 1.0)) \
233((Radians, "rad", 57.2957795130823208768))
234
235#define _SDF_DIMENSIONLESS_UNITS \
236((Percent, "%", 0.01)) \
237((Default, "default", 1.0))
238
239#define _SDF_UNITS \
240((Length, _SDF_LENGTH_UNITS), \
241((Angular, _SDF_ANGULAR_UNITS), \
242((Dimensionless, _SDF_DIMENSIONLESS_UNITS), \
243 BOOST_PP_NIL)))
244
245#define _SDF_UNIT_TAG(tup) BOOST_PP_TUPLE_ELEM(3, 0, tup)
246#define _SDF_UNIT_NAME(tup) BOOST_PP_TUPLE_ELEM(3, 1, tup)
247#define _SDF_UNIT_SCALE(tup) BOOST_PP_TUPLE_ELEM(3, 2, tup)
248
249#define _SDF_UNITSLIST_CATEGORY(tup) BOOST_PP_TUPLE_ELEM(2, 0, tup)
250#define _SDF_UNITSLIST_TUPLES(tup) BOOST_PP_TUPLE_ELEM(2, 1, tup)
251#define _SDF_UNITSLIST_ENUM(elem) TF_PP_CAT(TF_PP_CAT(Sdf, \
252 _SDF_UNITSLIST_CATEGORY(elem)), Unit)
253
254#define _SDF_DECLARE_UNIT_ENUMERANT(r, tag, elem) \
255 TF_PP_CAT(Sdf ## tag ## Unit, _SDF_UNIT_TAG(elem)),
256
257#define _SDF_DECLARE_UNIT_ENUM(r, unused, elem) \
258enum _SDF_UNITSLIST_ENUM(elem) { \
259 BOOST_PP_SEQ_FOR_EACH(_SDF_DECLARE_UNIT_ENUMERANT, \
260 _SDF_UNITSLIST_CATEGORY(elem), \
261 _SDF_UNITSLIST_TUPLES(elem)) \
262};
263BOOST_PP_LIST_FOR_EACH(_SDF_DECLARE_UNIT_ENUM, ~, _SDF_UNITS)
264
265// Compute the max number of enumerants over all unit enums
266#define _SDF_MAX_UNITS_OP(d, state, list) \
267 BOOST_PP_MAX_D(d, state, BOOST_PP_SEQ_SIZE(_SDF_UNITSLIST_TUPLES(list)))
268#define _SDF_UNIT_MAX_UNITS \
269 BOOST_PP_LIST_FOLD_LEFT(_SDF_MAX_UNITS_OP, 0, _SDF_UNITS)
270
271// Compute the number of unit enums
272#define _SDF_UNIT_NUM_TYPES BOOST_PP_LIST_SIZE(_SDF_UNITS)
273
274// Compute the number of bits needed to hold _SDF_UNIT_MAX_UNITS and
275// _SDF_UNIT_NUM_TYPES.
276#define _SDF_UNIT_MAX_UNITS_BITS TF_BITS_FOR_VALUES(_SDF_UNIT_MAX_UNITS)
277#define _SDF_UNIT_TYPES_BITS TF_BITS_FOR_VALUES(_SDF_UNIT_NUM_TYPES)
278
280typedef std::map<std::string, VtValue> SdfMapperParametersMap;
281
283typedef std::map<std::string, std::string> SdfVariantSelectionMap;
284
286typedef std::map<std::string, std::vector<std::string> > SdfVariantsMap;
287
289// Note: This map needs to be lexicographically sorted for some downstream
290// clients, so SdfPath::FastLessThan is explicitly omitted as
291// the Compare template parameter.
292typedef std::map<SdfPath, SdfPath> SdfRelocatesMap;
293
295typedef std::map<double, VtValue> SdfTimeSampleMap;
296
298SDF_API TfEnum SdfDefaultUnit( TfToken const &typeName );
299
301SDF_API const TfEnum &SdfDefaultUnit( const TfEnum &unit );
302
304SDF_API const std::string &SdfUnitCategory( const TfEnum &unit );
305
308SDF_API double SdfConvertUnit( const TfEnum &fromUnit, const TfEnum &toUnit );
309
311SDF_API const std::string &SdfGetNameForUnit( const TfEnum &unit );
312
314SDF_API const TfEnum &SdfGetUnitFromName( const std::string &name );
315
317SDF_API bool SdfValueHasValidType(VtValue const& value);
318
322
327
331
332// Sdf allows a specific set of types for attribute and metadata values.
333// These types and some additional metadata are listed in the preprocessor
334// sequence of tuples below. First element is a tag name that is appended to
335// 'SdfValueType' to produce the C++ traits type for the value type.
336// Second element is the value type name, third element is the corresponding
337// C++ type, and the fourth element is the tuple of tuple dimensions.
338//
339// Libraries may extend this list and define additional value types.
340// When doing so, the type must be declared using the SDF_DECLARE_VALUE_TYPE
341// macro below. The type must also be registered in the associated schema using
342// SdfSchema::_RegisterValueType(s).
343#define _SDF_SCALAR_VALUE_TYPES \
344 ((Bool, bool, bool, () )) \
345 ((UChar, uchar, unsigned char, () )) \
346 ((Int, int, int, () )) \
347 ((UInt, uint, unsigned int, () )) \
348 ((Int64, int64, int64_t, () )) \
349 ((UInt64, uint64, uint64_t, () )) \
350 ((Half, half, GfHalf, () )) \
351 ((Float, float, float, () )) \
352 ((Double, double, double, () )) \
353 ((TimeCode, timecode, SdfTimeCode, () )) \
354 ((String, string, std::string, () )) \
355 ((Token, token, TfToken, () )) \
356 ((Asset, asset, SdfAssetPath, () )) \
357 ((Opaque, opaque, SdfOpaqueValue, () )) \
358 ((PathExpression, pathExpression, SdfPathExpression, () ))
359
360#define _SDF_DIMENSIONED_VALUE_TYPES \
361 ((Matrix2d, matrix2d, GfMatrix2d, (2,2) )) \
362 ((Matrix3d, matrix3d, GfMatrix3d, (3,3) )) \
363 ((Matrix4d, matrix4d, GfMatrix4d, (4,4) )) \
364 ((Quath, quath, GfQuath, (4) )) \
365 ((Quatf, quatf, GfQuatf, (4) )) \
366 ((Quatd, quatd, GfQuatd, (4) )) \
367 ((Int2, int2, GfVec2i, (2) )) \
368 ((Half2, half2, GfVec2h, (2) )) \
369 ((Float2, float2, GfVec2f, (2) )) \
370 ((Double2, double2, GfVec2d, (2) )) \
371 ((Int3, int3, GfVec3i, (3) )) \
372 ((Half3, half3, GfVec3h, (3) )) \
373 ((Float3, float3, GfVec3f, (3) )) \
374 ((Double3, double3, GfVec3d, (3) )) \
375 ((Int4, int4, GfVec4i, (4) )) \
376 ((Half4, half4, GfVec4h, (4) )) \
377 ((Float4, float4, GfVec4f, (4) )) \
378 ((Double4, double4, GfVec4d, (4) ))
379
380#define SDF_VALUE_TYPES _SDF_SCALAR_VALUE_TYPES _SDF_DIMENSIONED_VALUE_TYPES
381
382// Accessors for individual elements in the value types tuples.
383#define SDF_VALUE_CPP_TYPE(tup) BOOST_PP_TUPLE_ELEM(4, 2, tup)
384#define SDF_VALUE_CPP_ARRAY_TYPE(tup) VtArray<BOOST_PP_TUPLE_ELEM(4, 2, tup)>
385
386template <class T>
387struct SdfValueTypeTraits {
388 static const bool IsValueType = false;
389};
390
391// Allow character arrays to be treated as Sdf value types.
392// Sdf converts character arrays to strings for scene description.
393template <int N>
394struct SdfValueTypeTraits<char[N]> {
395 static const bool IsValueType = true;
396};
397
398#define SDF_DECLARE_VALUE_TYPE_TRAITS(r, unused, elem) \
399template <> \
400struct SdfValueTypeTraits<SDF_VALUE_CPP_TYPE(elem)> { \
401 static const bool IsValueType = true; \
402}; \
403template <> \
404struct SdfValueTypeTraits<SDF_VALUE_CPP_ARRAY_TYPE(elem)> { \
405 static const bool IsValueType = true; \
406};
407
408BOOST_PP_SEQ_FOR_EACH(SDF_DECLARE_VALUE_TYPE_TRAITS, ~, SDF_VALUE_TYPES);
409
431SDF_API
432bool
434
435#define SDF_VALUE_ROLE_NAME_TOKENS \
436 (Point) \
437 (Normal) \
438 (Vector) \
439 (Color) \
440 (Frame) \
441 (Transform) \
442 (PointIndex) \
443 (EdgeIndex) \
444 (FaceIndex) \
445 (Group) \
446 (TextureCoordinate)
447
448TF_DECLARE_PUBLIC_TOKENS(SdfValueRoleNames, SDF_API, SDF_VALUE_ROLE_NAME_TOKENS);
449
450SDF_DECLARE_HANDLES(SdfLayer);
451
452SDF_DECLARE_HANDLES(SdfAttributeSpec);
453SDF_DECLARE_HANDLES(SdfPrimSpec);
454SDF_DECLARE_HANDLES(SdfPropertySpec);
455SDF_DECLARE_HANDLES(SdfSpec);
456SDF_DECLARE_HANDLES(SdfRelationshipSpec);
457SDF_DECLARE_HANDLES(SdfVariantSetSpec);
458SDF_DECLARE_HANDLES(SdfVariantSpec);
459
460typedef std::map<std::string, SdfVariantSetSpecHandle>
461 SdfVariantSetSpecHandleMap;
462
464SDF_API
465std::ostream & operator<<( std::ostream &out, const SdfSpecifier &spec );
466
468SDF_API
469std::ostream & operator<<( std::ostream &out,
470 const SdfRelocatesMap &reloMap );
471
473SDF_API
474std::ostream & operator<<( std::ostream &out,
475 const SdfTimeSampleMap &sampleMap );
476
477SDF_API
478std::ostream &VtStreamOut(const SdfVariantSelectionMap &, std::ostream &);
479
489{
490public:
493
495 SDF_API explicit SdfUnregisteredValue(const std::string &value);
496
498 SDF_API explicit SdfUnregisteredValue(const VtDictionary &value);
499
501 SDF_API explicit SdfUnregisteredValue(const SdfUnregisteredValueListOp &value);
502
504 const VtValue& GetValue() const {
505 return _value;
506 }
507
509 friend size_t hash_value(const SdfUnregisteredValue &uv) {
510 return uv._value.GetHash();
511 }
512
514 SDF_API bool operator==(const SdfUnregisteredValue &other) const;
515
517 SDF_API bool operator!=(const SdfUnregisteredValue &other) const;
518
519private:
520 VtValue _value;
521};
522
524SDF_API std::ostream &operator << (std::ostream &out, const SdfUnregisteredValue &value);
525
526class Sdf_ValueTypeNamesType {
527 Sdf_ValueTypeNamesType(const Sdf_ValueTypeNamesType&) = delete;
528 Sdf_ValueTypeNamesType& operator=(const Sdf_ValueTypeNamesType&) = delete;
529public:
530 SdfValueTypeName Bool;
531 SdfValueTypeName UChar, Int, UInt, Int64, UInt64;
532 SdfValueTypeName Half, Float, Double, TimeCode;
533 SdfValueTypeName String, Token, Asset;
534 SdfValueTypeName Int2, Int3, Int4;
535 SdfValueTypeName Half2, Half3, Half4;
536 SdfValueTypeName Float2, Float3, Float4;
537 SdfValueTypeName Double2, Double3, Double4;
538 SdfValueTypeName Point3h, Point3f, Point3d;
539 SdfValueTypeName Vector3h, Vector3f, Vector3d;
540 SdfValueTypeName Normal3h, Normal3f, Normal3d;
541 SdfValueTypeName Color3h, Color3f, Color3d;
542 SdfValueTypeName Color4h, Color4f, Color4d;
543 SdfValueTypeName Quath, Quatf, Quatd;
544 SdfValueTypeName Matrix2d, Matrix3d, Matrix4d;
545 SdfValueTypeName Frame4d;
546 SdfValueTypeName TexCoord2h, TexCoord2f, TexCoord2d;
547 SdfValueTypeName TexCoord3h, TexCoord3f, TexCoord3d;
548 SdfValueTypeName Opaque;
549 SdfValueTypeName Group;
550 SdfValueTypeName PathExpression;
551
552 SdfValueTypeName BoolArray;
553 SdfValueTypeName UCharArray, IntArray, UIntArray, Int64Array, UInt64Array;
554 SdfValueTypeName HalfArray, FloatArray, DoubleArray, TimeCodeArray;
555 SdfValueTypeName StringArray, TokenArray, AssetArray;
556 SdfValueTypeName Int2Array, Int3Array, Int4Array;
557 SdfValueTypeName Half2Array, Half3Array, Half4Array;
558 SdfValueTypeName Float2Array, Float3Array, Float4Array;
559 SdfValueTypeName Double2Array, Double3Array, Double4Array;
560 SdfValueTypeName Point3hArray, Point3fArray, Point3dArray;
561 SdfValueTypeName Vector3hArray, Vector3fArray, Vector3dArray;
562 SdfValueTypeName Normal3hArray, Normal3fArray, Normal3dArray;
563 SdfValueTypeName Color3hArray, Color3fArray, Color3dArray;
564 SdfValueTypeName Color4hArray, Color4fArray, Color4dArray;
565 SdfValueTypeName QuathArray, QuatfArray, QuatdArray;
566 SdfValueTypeName Matrix2dArray, Matrix3dArray, Matrix4dArray;
567 SdfValueTypeName Frame4dArray;
568 SdfValueTypeName TexCoord2hArray, TexCoord2fArray, TexCoord2dArray;
569 SdfValueTypeName TexCoord3hArray, TexCoord3fArray, TexCoord3dArray;
570 SdfValueTypeName PathExpressionArray;
571
572 SDF_API ~Sdf_ValueTypeNamesType();
573 struct _Init {
574 SDF_API static const Sdf_ValueTypeNamesType* New();
575 };
576
577 // For Pixar internal backwards compatibility.
578 TfToken GetSerializationName(const SdfValueTypeName&) const;
579 TfToken GetSerializationName(const VtValue&) const;
580 TfToken GetSerializationName(const TfToken&) const;
581
582private:
583 friend const Sdf_ValueTypeNamesType* Sdf_InitializeValueTypeNames();
584 Sdf_ValueTypeNamesType();
585};
586
587extern SDF_API TfStaticData<const Sdf_ValueTypeNamesType,
588 Sdf_ValueTypeNamesType::_Init> SdfValueTypeNames;
589
605 bool operator==(const SdfValueBlock& block) const { return true; }
606 bool operator!=(const SdfValueBlock& block) const { return false; }
607
608private:
609 friend inline size_t hash_value(const SdfValueBlock &block) { return 0; }
610};
611
612// Write out the string representation of a block.
613SDF_API std::ostream& operator<<(std::ostream&, SdfValueBlock const&);
614
615// A class that represents a human-readable value. This is used for the special
616// purpose of producing layers that serialize field values in alternate ways; to
617// produce more human-readable output, for example.
618struct SdfHumanReadableValue {
619 SdfHumanReadableValue() = default;
620 explicit SdfHumanReadableValue(std::string const &text) : _text(text) {}
621
622 bool operator==(SdfHumanReadableValue const &other) const {
623 return GetText() == other.GetText();
624 }
625 bool operator!=(SdfHumanReadableValue const &other) const {
626 return !(*this == other);
627 }
628
629 std::string const &GetText() const { return _text; }
630private:
631 std::string _text;
632};
633
634SDF_API
635std::ostream &operator<<(std::ostream &out, const SdfHumanReadableValue &hrval);
636
637SDF_API
638size_t hash_value(const SdfHumanReadableValue &hrval);
639
640PXR_NAMESPACE_CLOSE_SCOPE
641
642#endif // PXR_USD_SDF_TYPES_H
A subclass of SdfPropertySpec that holds typed data.
Definition: attributeSpec.h:57
A scene description container that can combine with other such containers to form simple component as...
Definition: layer.h:97
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:291
Represents a prim description in an SdfLayer object.
Definition: primSpec.h:75
Base class for SdfAttributeSpec and SdfRelationshipSpec.
Definition: propertySpec.h:60
A property that contains a reference to one or more SdfPrimSpec instances.
Base class for all Sdf spec classes.
Definition: spec.h:50
Stores a representation of the value for an unregistered metadata field encountered during text layer...
Definition: types.h:489
const VtValue & GetValue() const
Returns the wrapped VtValue specified in the constructor.
Definition: types.h:504
SDF_API bool operator==(const SdfUnregisteredValue &other) const
Returns true if the wrapped VtValues are equal.
SDF_API SdfUnregisteredValue()
Wraps an empty VtValue.
SDF_API SdfUnregisteredValue(const SdfUnregisteredValueListOp &value)
Wraps a SdfUnregisteredValueListOp.
SDF_API bool operator!=(const SdfUnregisteredValue &other) const
Returns true if the wrapped VtValues are not equal.
friend size_t hash_value(const SdfUnregisteredValue &uv)
Hash.
Definition: types.h:509
SDF_API SdfUnregisteredValue(const VtDictionary &value)
Wraps a VtDictionary.
SDF_API SdfUnregisteredValue(const std::string &value)
Wraps a std::string.
Represents a value type name, i.e.
Definition: valueTypeName.h:88
Represents a coherent set of alternate representations for part of a scene.
Represents a single variant in a variant set.
Definition: variantSpec.h:56
An enum class that records both enum type and enum value.
Definition: enum.h:137
Create or return a previously created object instance of global data.
Definition: staticData.h:113
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:88
TfType represents a dynamic runtime type.
Definition: type.h:65
A map with string keys and VtValue values.
Definition: dictionary.h:60
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition: value.h:164
VT_API size_t GetHash() const
Return a hash code for the held object by calling VtHashValue() on it.
Demangle C++ typenames generated by the typeid() facility.
GF_API std::ostream & operator<<(std::ostream &, const GfBBox3d &)
Output a GfBBox3d using the format [(range) matrix zeroArea].
This header serves to simply bring in the half float datatype and provide a hash_value function.
size_t hash_value(const half h)
Overload hash_value for half.
Definition: half.h:45
Define integral types.
This file defines some macros that are useful for declaring and using static TfTokens.
#define TF_DECLARE_PUBLIC_TOKENS(...)
Macro to define public tokens.
Definition: staticTokens.h:115
A special value type that can be used to explicitly author an opinion for an attribute's default valu...
Definition: types.h:604
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...
SDF_API TfType SdfGetTypeForValueTypeName(TfToken const &name)
Given an sdf valueType name, produce TfType if the type name specifies a valid sdf value type.
SdfAuthoringError
An enum for TfError codes related to authoring operations.
Definition: types.h:200
SdfSpecType
An enum that specifies the type of an object.
Definition: types.h:90
SDF_API bool SdfValueHasValidType(VtValue const &value)
Given a value, returns if there is a valid corresponding valueType.
SdfSpecifier
An enum that identifies the possible specifiers for an SdfPrimSpec.
Definition: types.h:122
std::map< std::string, VtValue > SdfMapperParametersMap
A map of mapper parameter names to parameter values.
Definition: types.h:280
SDF_API const std::string & SdfUnitCategory(const TfEnum &unit)
Gets the unit category for a given /a unit.
SDF_API TfToken SdfGetRoleNameForValueTypeName(TfToken const &typeName)
Return role name for typeName.
std::map< std::string, std::vector< std::string > > SdfVariantsMap
A map of variant set names to list of variants in those sets.
Definition: types.h:286
SDF_API double SdfConvertUnit(const TfEnum &fromUnit, const TfEnum &toUnit)
Converts from one unit of measure to another.
SdfVariability
An enum that identifies variability types for attributes.
Definition: types.h:178
SDF_API TfEnum SdfDefaultUnit(TfToken const &typeName)
Gets the show default unit for the given /a typeName.
std::map< std::string, std::string > SdfVariantSelectionMap
A map of reference variant set names to variants in those sets.
Definition: types.h:283
SDF_API SdfValueTypeName SdfGetValueTypeNameForValue(VtValue const &value)
Given a value, produce the sdf valueType name.
SDF_API const std::string & SdfGetNameForUnit(const TfEnum &unit)
Gets the name for a given /a unit.
SdfPermission
An enum that defines permission levels.
Definition: types.h:154
bool SdfIsDefiningSpecifier(SdfSpecifier spec)
Returns true if the specifier defines a prim.
Definition: types.h:132
SDF_API bool SdfConvertToValidMetadataDictionary(VtDictionary *dict, std::string *errMsg)
Convert dict to a valid metadata dictionary for scene description.
SDF_API const TfEnum & SdfGetUnitFromName(const std::string &name)
Gets a unit for the given /a name.
std::map< SdfPath, SdfPath > SdfRelocatesMap
A map of source SdfPaths to target SdfPaths for relocation.
Definition: types.h:292
std::map< double, VtValue > SdfTimeSampleMap
A map from sample times to sample values.
Definition: types.h:295