Loading...
Searching...
No Matches
types.h
Go to the documentation of this file.
1//
2// Copyright 2016 Pixar
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://openusd.org/license.
6//
7#ifndef PXR_USD_SDF_TYPES_H
8#define PXR_USD_SDF_TYPES_H
9
12
13#include "pxr/pxr.h"
14#include "pxr/usd/sdf/api.h"
17#include "pxr/usd/sdf/listOp.h"
18#include "pxr/usd/sdf/opaqueValue.h"
19#include "pxr/usd/sdf/pathExpression.h"
21#include "pxr/usd/sdf/valueTypeName.h"
22
26#include "pxr/base/gf/half.h"
30#include "pxr/base/gf/quatd.h"
31#include "pxr/base/gf/quatf.h"
32#include "pxr/base/gf/quath.h"
33#include "pxr/base/gf/vec2d.h"
34#include "pxr/base/gf/vec2f.h"
35#include "pxr/base/gf/vec2h.h"
36#include "pxr/base/gf/vec2i.h"
37#include "pxr/base/gf/vec3d.h"
38#include "pxr/base/gf/vec3f.h"
39#include "pxr/base/gf/vec3h.h"
40#include "pxr/base/gf/vec3i.h"
41#include "pxr/base/gf/vec4d.h"
42#include "pxr/base/gf/vec4f.h"
43#include "pxr/base/gf/vec4h.h"
44#include "pxr/base/gf/vec4i.h"
45#include "pxr/base/tf/enum.h"
46#include "pxr/base/tf/preprocessorUtilsLite.h"
48#include "pxr/base/tf/token.h"
49#include "pxr/base/tf/type.h"
50#include "pxr/base/vt/array.h"
53#include "pxr/base/vt/traits.h"
54#include "pxr/base/vt/value.h"
55#include "pxr/base/vt/valueTransform.h"
56
57#include <iosfwd>
58#include <list>
59#include <map>
60#include <stdint.h>
61#include <string>
62#include <typeinfo>
63#include <vector>
64
65PXR_NAMESPACE_OPEN_SCOPE
66
67class SdfPath;
68
72 // The unknown type has a value of 0 so that SdfSpecType() is unknown.
73 SdfSpecTypeUnknown = 0,
74
75 // Real concrete types
76 SdfSpecTypeAttribute,
77 SdfSpecTypeConnection,
78 SdfSpecTypeExpression,
79 SdfSpecTypeMapper,
80 SdfSpecTypeMapperArg,
81 SdfSpecTypePrim,
82 SdfSpecTypePseudoRoot,
83 SdfSpecTypeRelationship,
84 SdfSpecTypeRelationshipTarget,
85 SdfSpecTypeVariant,
86 SdfSpecTypeVariantSet,
87
88 SdfNumSpecTypes
89};
90
104 SdfSpecifierDef,
105 SdfSpecifierOver,
106 SdfSpecifierClass,
107 SdfNumSpecifiers
108};
109
111inline
112bool
114{
115 return (spec != SdfSpecifierOver);
116}
117
136 SdfPermissionPublic,
137 SdfPermissionPrivate,
138
139 SdfNumPermissions
140};
141
160 SdfVariabilityVarying,
161 SdfVariabilityUniform,
162
163 SdfNumVariabilities
164};
165
166
181{
182 SdfAuthoringErrorUnrecognizedFields,
183 SdfAuthoringErrorUnrecognizedSpecType
184};
185
186// Each category of compatible units of measurement is defined by a
187// preprocessor sequence of tuples. Each such sequence gives rise to an enum
188// representing the corresponding unit category. All the unit categories are
189// listed in _SDF_UNITS where each entry is a two-tuple with the unit category
190// name as the first element, and the second element is the units in that
191// category. Each tuple in a unit category sequence corresponds to a unit of
192// measurement represented by an enumerant whose name is given by concatenating
193// 'Sdf', the unit category name, the word 'Unit' and the first entry in the
194// tuple. (E.g. units of category 'Length' are represented by an enum named
195// SdfLengthUnit with enumerants SdfLengthUnitInch, SdfLengthUnitMeter and so
196// forth.) The second element in the tuple is the display name for the unit,
197// and the third element is the relative size of the unit compared to the menv
198// default unit for the unit category (which has a relative size of 1.0).
199// Dimensionless quantities use a special 'Dimensionless' unit category
200// represented by the enum SdfDimensionlessUnit.
201#define _SDF_LENGTH_UNITS \
202((Millimeter, "mm", 0.001)) \
203((Centimeter, "cm", 0.01)) \
204((Decimeter, "dm", 0.1)) \
205((Meter, "m", 1.0)) \
206((Kilometer, "km", 1000.0)) \
207((Inch, "in", 0.0254)) \
208((Foot, "ft", 0.3048)) \
209((Yard, "yd", 0.9144)) \
210((Mile, "mi", 1609.344))
211
212#define _SDF_ANGULAR_UNITS \
213((Degrees, "deg", 1.0)) \
214((Radians, "rad", 57.2957795130823208768))
215
216#define _SDF_DIMENSIONLESS_UNITS \
217((Percent, "%", 0.01)) \
218((Default, "default", 1.0))
219
220#define _SDF_UNITS \
221((Length, _SDF_LENGTH_UNITS), \
222(Angular, _SDF_ANGULAR_UNITS), \
223(Dimensionless, _SDF_DIMENSIONLESS_UNITS))
224
225#define _SDF_UNIT_TAG(tup) TF_PP_TUPLE_ELEM(0, tup)
226#define _SDF_UNIT_NAME(tup) TF_PP_TUPLE_ELEM(1, tup)
227#define _SDF_UNIT_SCALE(tup) TF_PP_TUPLE_ELEM(2, tup)
228
229#define _SDF_UNITSLIST_CATEGORY(tup) TF_PP_TUPLE_ELEM(0, tup)
230#define _SDF_UNITSLIST_TUPLES(tup) TF_PP_TUPLE_ELEM(1, tup)
231#define _SDF_UNITSLIST_ENUM(elem) TF_PP_CAT(TF_PP_CAT(Sdf, \
232 _SDF_UNITSLIST_CATEGORY(elem)), Unit)
233
234#define _SDF_DECLARE_UNIT_ENUMERANT(tag, elem) \
235 TF_PP_CAT(Sdf ## tag ## Unit, _SDF_UNIT_TAG(elem)),
236
237#define _SDF_DECLARE_UNIT_ENUM(elem) \
238enum _SDF_UNITSLIST_ENUM(elem) { \
239 TF_PP_SEQ_FOR_EACH(_SDF_DECLARE_UNIT_ENUMERANT, \
240 _SDF_UNITSLIST_CATEGORY(elem), \
241 _SDF_UNITSLIST_TUPLES(elem)) \
242};
243
244#define _SDF_FOR_EACH_UNITS_IMPL(macro, ...) \
245 TF_PP_FOR_EACH(macro, __VA_ARGS__)
246#define _SDF_FOR_EACH_UNITS(macro, args) \
247 _SDF_FOR_EACH_UNITS_IMPL(macro, TF_PP_EAT_PARENS(args))
248
249// On Windows this call to _SDF_FOR_EACH_UNITS generates a C4003 warning.
250// This is harmless, but we disable the warning here so that external
251// projects that include this header don't run into it as well.
252ARCH_PRAGMA_PUSH
253ARCH_PRAGMA_MACRO_TOO_FEW_ARGUMENTS
254_SDF_FOR_EACH_UNITS(_SDF_DECLARE_UNIT_ENUM, _SDF_UNITS)
255ARCH_PRAGMA_POP
256
258typedef std::map<std::string, VtValue> SdfMapperParametersMap;
259
261typedef std::map<std::string, std::string> SdfVariantSelectionMap;
262
264typedef std::map<std::string, std::vector<std::string> > SdfVariantsMap;
265
267// Note: This map needs to be lexicographically sorted for some downstream
268// clients, so SdfPath::FastLessThan is explicitly omitted as
269// the Compare template parameter.
270typedef std::map<SdfPath, SdfPath> SdfRelocatesMap;
271
274typedef std::pair<SdfPath, SdfPath> SdfRelocate;
275
277typedef std::vector<SdfRelocate> SdfRelocates;
278
280typedef std::map<double, VtValue> SdfTimeSampleMap;
283
288SDF_API
291 SdfTimeSampleMap const &weak);
292
294SDF_API TfEnum SdfDefaultUnit( TfToken const &typeName );
295
297SDF_API const TfEnum &SdfDefaultUnit( const TfEnum &unit );
298
300SDF_API const std::string &SdfUnitCategory( const TfEnum &unit );
301
304SDF_API double SdfConvertUnit( const TfEnum &fromUnit, const TfEnum &toUnit );
305
307SDF_API const std::string &SdfGetNameForUnit( const TfEnum &unit );
308
310SDF_API const TfEnum &SdfGetUnitFromName( const std::string &name );
311
313SDF_API bool SdfValueHasValidType(VtValue const& value);
314
318
323
327
328// Sdf allows a specific set of types for attribute and metadata values.
329// These types and some additional metadata are listed in the preprocessor
330// sequence of tuples below. First element is a tag name that is appended to
331// 'SdfValueType' to produce the C++ traits type for the value type.
332// Second element is the value type name, third element is the corresponding
333// C++ type, and the fourth element is the tuple of tuple dimensions.
334//
335// Libraries may extend this list and define additional value types.
336// When doing so, the type must be declared using the SDF_DECLARE_VALUE_TYPE
337// macro below. The type must also be registered in the associated schema using
338// SdfSchema::_RegisterValueType(s).
339#define _SDF_SCALAR_VALUE_TYPES \
340 ((Bool, bool, bool, () )) \
341 ((UChar, uchar, unsigned char, () )) \
342 ((Int, int, int, () )) \
343 ((UInt, uint, unsigned int, () )) \
344 ((Int64, int64, int64_t, () )) \
345 ((UInt64, uint64, uint64_t, () )) \
346 ((Half, half, GfHalf, () )) \
347 ((Float, float, float, () )) \
348 ((Double, double, double, () )) \
349 ((TimeCode, timecode, SdfTimeCode, () )) \
350 ((String, string, std::string, () )) \
351 ((Token, token, TfToken, () )) \
352 ((Asset, asset, SdfAssetPath, () )) \
353 ((Opaque, opaque, SdfOpaqueValue, () )) \
354 ((PathExpression, pathExpression, SdfPathExpression, () ))
355
356#define _SDF_DIMENSIONED_VALUE_TYPES \
357 ((Matrix2d, matrix2d, GfMatrix2d, (2,2) )) \
358 ((Matrix3d, matrix3d, GfMatrix3d, (3,3) )) \
359 ((Matrix4d, matrix4d, GfMatrix4d, (4,4) )) \
360 ((Quath, quath, GfQuath, (4) )) \
361 ((Quatf, quatf, GfQuatf, (4) )) \
362 ((Quatd, quatd, GfQuatd, (4) )) \
363 ((Int2, int2, GfVec2i, (2) )) \
364 ((Half2, half2, GfVec2h, (2) )) \
365 ((Float2, float2, GfVec2f, (2) )) \
366 ((Double2, double2, GfVec2d, (2) )) \
367 ((Int3, int3, GfVec3i, (3) )) \
368 ((Half3, half3, GfVec3h, (3) )) \
369 ((Float3, float3, GfVec3f, (3) )) \
370 ((Double3, double3, GfVec3d, (3) )) \
371 ((Int4, int4, GfVec4i, (4) )) \
372 ((Half4, half4, GfVec4h, (4) )) \
373 ((Float4, float4, GfVec4f, (4) )) \
374 ((Double4, double4, GfVec4d, (4) ))
375
376#define SDF_VALUE_TYPES _SDF_SCALAR_VALUE_TYPES _SDF_DIMENSIONED_VALUE_TYPES
377
378// Accessors for individual elements in the value types tuples.
379#define SDF_VALUE_CPP_TYPE(tup) TF_PP_TUPLE_ELEM(2, tup)
380#define SDF_VALUE_CPP_ARRAY_TYPE(tup) VtArray<TF_PP_TUPLE_ELEM(2, tup)>
381#define SDF_VALUE_CPP_ARRAY_EDIT_TYPE(tup) VtArrayEdit<TF_PP_TUPLE_ELEM(2, tup)>
382
383template <class T>
384struct SdfValueTypeTraits {
385 static const bool IsValueType = false;
386};
387
388// Allow character arrays to be treated as Sdf value types.
389// Sdf converts character arrays to strings for scene description.
390template <int N>
391struct SdfValueTypeTraits<char[N]> {
392 static const bool IsValueType = true;
393};
394
395#define SDF_DECLARE_VALUE_TYPE_TRAITS(unused, elem) \
396template <> \
397struct SdfValueTypeTraits<SDF_VALUE_CPP_TYPE(elem)> { \
398 static const bool IsValueType = true; \
399}; \
400template <> \
401struct SdfValueTypeTraits<SDF_VALUE_CPP_ARRAY_TYPE(elem)> { \
402 static const bool IsValueType = true; \
403}; \
404template <> \
405struct SdfValueTypeTraits<SDF_VALUE_CPP_ARRAY_EDIT_TYPE(elem)> { \
406 static const bool IsValueType = true; \
407};
408
409TF_PP_SEQ_FOR_EACH(SDF_DECLARE_VALUE_TYPE_TRAITS, ~, SDF_VALUE_TYPES);
410
432SDF_API
433bool
435
436#define SDF_VALUE_ROLE_NAME_TOKENS \
437 (Point) \
438 (Normal) \
439 (Vector) \
440 (Color) \
441 (Frame) \
442 (Transform) \
443 (PointIndex) \
444 (EdgeIndex) \
445 (FaceIndex) \
446 (Group) \
447 (TextureCoordinate)
448
449TF_DECLARE_PUBLIC_TOKENS(SdfValueRoleNames, SDF_API, SDF_VALUE_ROLE_NAME_TOKENS);
450
451SDF_DECLARE_HANDLES(SdfLayer);
452
453SDF_DECLARE_HANDLES(SdfAttributeSpec);
454SDF_DECLARE_HANDLES(SdfPrimSpec);
455SDF_DECLARE_HANDLES(SdfPropertySpec);
456SDF_DECLARE_HANDLES(SdfSpec);
457SDF_DECLARE_HANDLES(SdfRelationshipSpec);
458SDF_DECLARE_HANDLES(SdfVariantSetSpec);
459SDF_DECLARE_HANDLES(SdfVariantSpec);
460
461typedef std::map<std::string, SdfVariantSetSpecHandle>
462 SdfVariantSetSpecHandleMap;
463
465SDF_API
466std::ostream & operator<<( std::ostream &out, const SdfSpecifier &spec );
467
469SDF_API
470std::ostream & operator<<( std::ostream &out,
471 const SdfRelocatesMap &reloMap );
472
474SDF_API
475std::ostream & operator<<( std::ostream &out,
476 const SdfRelocates &relocates );
477
479SDF_API
480std::ostream & operator<<( std::ostream &out,
481 const SdfTimeSampleMap &sampleMap );
482
483SDF_API
484std::ostream &VtStreamOut(const SdfVariantSelectionMap &, std::ostream &);
485
495{
496public:
499
501 SDF_API explicit SdfUnregisteredValue(const std::string &value);
502
504 SDF_API explicit SdfUnregisteredValue(const VtDictionary &value);
505
507 SDF_API explicit SdfUnregisteredValue(const SdfUnregisteredValueListOp &value);
508
510 const VtValue& GetValue() const {
511 return _value;
512 }
513
515 friend size_t hash_value(const SdfUnregisteredValue &uv) {
516 return uv._value.GetHash();
517 }
518
520 SDF_API bool operator==(const SdfUnregisteredValue &other) const;
521
523 SDF_API bool operator!=(const SdfUnregisteredValue &other) const;
524
525private:
526 VtValue _value;
527};
528
530SDF_API std::ostream &operator << (std::ostream &out, const SdfUnregisteredValue &value);
531
532class Sdf_ValueTypeNamesType {
533 Sdf_ValueTypeNamesType(const Sdf_ValueTypeNamesType&) = delete;
534 Sdf_ValueTypeNamesType& operator=(const Sdf_ValueTypeNamesType&) = delete;
535public:
536 SdfValueTypeName Bool;
537 SdfValueTypeName UChar, Int, UInt, Int64, UInt64;
538 SdfValueTypeName Half, Float, Double, TimeCode;
539 SdfValueTypeName String, Token, Asset;
540 SdfValueTypeName Int2, Int3, Int4;
541 SdfValueTypeName Half2, Half3, Half4;
542 SdfValueTypeName Float2, Float3, Float4;
543 SdfValueTypeName Double2, Double3, Double4;
544 SdfValueTypeName Point3h, Point3f, Point3d;
545 SdfValueTypeName Vector3h, Vector3f, Vector3d;
546 SdfValueTypeName Normal3h, Normal3f, Normal3d;
547 SdfValueTypeName Color3h, Color3f, Color3d;
548 SdfValueTypeName Color4h, Color4f, Color4d;
549 SdfValueTypeName Quath, Quatf, Quatd;
550 SdfValueTypeName Matrix2d, Matrix3d, Matrix4d;
551 SdfValueTypeName Frame4d;
552 SdfValueTypeName TexCoord2h, TexCoord2f, TexCoord2d;
553 SdfValueTypeName TexCoord3h, TexCoord3f, TexCoord3d;
554 SdfValueTypeName Opaque;
555 SdfValueTypeName Group;
556 SdfValueTypeName PathExpression;
557
558 SdfValueTypeName BoolArray;
559 SdfValueTypeName UCharArray, IntArray, UIntArray, Int64Array, UInt64Array;
560 SdfValueTypeName HalfArray, FloatArray, DoubleArray, TimeCodeArray;
561 SdfValueTypeName StringArray, TokenArray, AssetArray;
562 SdfValueTypeName Int2Array, Int3Array, Int4Array;
563 SdfValueTypeName Half2Array, Half3Array, Half4Array;
564 SdfValueTypeName Float2Array, Float3Array, Float4Array;
565 SdfValueTypeName Double2Array, Double3Array, Double4Array;
566 SdfValueTypeName Point3hArray, Point3fArray, Point3dArray;
567 SdfValueTypeName Vector3hArray, Vector3fArray, Vector3dArray;
568 SdfValueTypeName Normal3hArray, Normal3fArray, Normal3dArray;
569 SdfValueTypeName Color3hArray, Color3fArray, Color3dArray;
570 SdfValueTypeName Color4hArray, Color4fArray, Color4dArray;
571 SdfValueTypeName QuathArray, QuatfArray, QuatdArray;
572 SdfValueTypeName Matrix2dArray, Matrix3dArray, Matrix4dArray;
573 SdfValueTypeName Frame4dArray;
574 SdfValueTypeName TexCoord2hArray, TexCoord2fArray, TexCoord2dArray;
575 SdfValueTypeName TexCoord3hArray, TexCoord3fArray, TexCoord3dArray;
576 SdfValueTypeName PathExpressionArray;
577
578 SDF_API ~Sdf_ValueTypeNamesType();
579 struct _Init {
580 SDF_API static const Sdf_ValueTypeNamesType* New();
581 };
582
583 // For Pixar internal backwards compatibility.
584 TfToken GetSerializationName(const SdfValueTypeName&) const;
585 TfToken GetSerializationName(const VtValue&) const;
586 TfToken GetSerializationName(const TfToken&) const;
587
588private:
589 friend const Sdf_ValueTypeNamesType* Sdf_InitializeValueTypeNames();
590 Sdf_ValueTypeNamesType();
591};
592
593extern SDF_API TfStaticData<const Sdf_ValueTypeNamesType,
594 Sdf_ValueTypeNamesType::_Init> SdfValueTypeNames;
595
611 bool operator==(const SdfValueBlock& block) const { return true; }
612 bool operator!=(const SdfValueBlock& block) const { return false; }
613
614private:
615 friend inline size_t hash_value(const SdfValueBlock &block) { return 0; }
616};
617
618// Write out the string representation of a block.
619SDF_API std::ostream& operator<<(std::ostream&, SdfValueBlock const&);
620
626 bool operator==(const SdfAnimationBlock& block) const { return true; }
627 bool operator!=(const SdfAnimationBlock& block) const { return false; }
628
629private:
630 friend inline size_t hash_value(const SdfAnimationBlock &block) { return 0; }
631};
632
633// Write out the string representation of an animation block.
634SDF_API std::ostream& operator<<(std::ostream&, SdfAnimationBlock const&);
635
636// A class that represents a human-readable value. This is used for the special
637// purpose of producing layers that serialize field values in alternate ways; to
638// produce more human-readable output, for example.
639struct SdfHumanReadableValue {
640 SdfHumanReadableValue() = default;
641 explicit SdfHumanReadableValue(std::string const &text) : _text(text) {}
642
643 bool operator==(SdfHumanReadableValue const &other) const {
644 return GetText() == other.GetText();
645 }
646 bool operator!=(SdfHumanReadableValue const &other) const {
647 return !(*this == other);
648 }
649
650 std::string const &GetText() const { return _text; }
651private:
652 std::string _text;
653};
654
655SDF_API
656std::ostream &operator<<(std::ostream &out, const SdfHumanReadableValue &hrval);
657
658SDF_API
659size_t hash_value(const SdfHumanReadableValue &hrval);
660
661PXR_NAMESPACE_CLOSE_SCOPE
662
663#endif // PXR_USD_SDF_TYPES_H
#define VT_VALUE_TYPE_CAN_TRANSFORM(T)
A helper for specializing the above trait.
Definition: traits.h:150
#define VT_VALUE_TYPE_CAN_COMPOSE(T)
A helper for specializing the above trait.
Definition: traits.h:140
A subclass of SdfPropertySpec that holds typed data.
Definition: attributeSpec.h:42
A scene description container that can combine with other such containers to form simple component as...
Definition: layer.h:84
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:281
Represents a prim description in an SdfLayer object.
Definition: primSpec.h:58
Base class for SdfAttributeSpec and SdfRelationshipSpec.
Definition: propertySpec.h:47
A property that contains a reference to one or more SdfPrimSpec instances.
Base class for all Sdf spec classes.
Definition: spec.h:33
Stores a representation of the value for an unregistered metadata field encountered during text layer...
Definition: types.h:495
const VtValue & GetValue() const
Returns the wrapped VtValue specified in the constructor.
Definition: types.h:510
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:515
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:72
Represents a coherent set of alternate representations for part of a scene.
Represents a single variant in a variant set.
Definition: variantSpec.h:39
An enum class that records both enum type and enum value.
Definition: enum.h:120
Create or return a previously created object instance of global data.
Definition: staticData.h:96
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:71
TfType represents a dynamic runtime type.
Definition: type.h:48
A map with string keys and VtValue values.
Definition: dictionary.h:52
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition: value.h:90
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.
std::size_t hash_value(const half h)
Overload hash_value for half.
Definition: half.h:30
Define integral types.
Pragmas for controlling compiler-specific behaviors.
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:181
SdfSpecType
An enum that specifies the type of an object.
Definition: types.h:71
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:103
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::pair< SdfPath, SdfPath > SdfRelocate
A single relocate specifying a source SdfPath and a target SdfPath for a relocation.
Definition: types.h:274
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:264
ARCH_PRAGMA_PUSH ARCH_PRAGMA_MACRO_TOO_FEW_ARGUMENTS ARCH_PRAGMA_POP typedef std::map< std::string, VtValue > SdfMapperParametersMap
A map of mapper parameter names to parameter values.
Definition: types.h:258
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:159
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:261
SDF_API SdfValueTypeName SdfGetValueTypeNameForValue(VtValue const &value)
Given a value, produce the sdf valueType name.
std::vector< SdfRelocate > SdfRelocates
A vector of relocation source path to target path pairs.
Definition: types.h:277
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:135
bool SdfIsDefiningSpecifier(SdfSpecifier spec)
Returns true if the specifier defines a prim.
Definition: types.h:113
SDF_API bool SdfConvertToValidMetadataDictionary(VtDictionary *dict, std::string *errMsg)
Convert dict to a valid metadata dictionary for scene description.
SDF_API SdfTimeSampleMap SdfComposeTimeSampleMaps(SdfTimeSampleMap const &strong, SdfTimeSampleMap const &weak)
Compose a stronger SdfTimeSampleMap over a weaker one.
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:270
std::map< double, VtValue > SdfTimeSampleMap
A map from sample times to sample values.
Definition: types.h:280
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:92
A special value type that can be used to explicitly author an opinion for an attribute's default valu...
Definition: types.h:625
A special value type that can be used to explicitly author an opinion for an attribute's default valu...
Definition: types.h:610
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...