HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
10 /// \file sdf/types.h
11 /// Basic Sdf data types
12 
13 #include "pxr/pxr.h"
14 #include "pxr/usd/sdf/api.h"
15 #include "pxr/usd/sdf/assetPath.h"
17 #include "pxr/usd/sdf/listOp.h"
20 #include "pxr/usd/sdf/timeCode.h"
22 
23 #include "pxr/base/arch/demangle.h"
24 #include "pxr/base/arch/inttypes.h"
25 #include "pxr/base/arch/pragmas.h"
26 #include "pxr/base/gf/half.h"
27 #include "pxr/base/gf/matrix2d.h"
28 #include "pxr/base/gf/matrix3d.h"
29 #include "pxr/base/gf/matrix4d.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"
48 #include "pxr/base/tf/token.h"
49 #include "pxr/base/tf/type.h"
50 #include "pxr/base/vt/array.h"
51 #include "pxr/base/vt/arrayEdit.h"
52 #include "pxr/base/vt/dictionary.h"
53 #include "pxr/base/vt/traits.h"
54 #include "pxr/base/vt/value.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 
66 
67 class SdfPath;
68 
69 /// An enum that specifies the type of an object. Objects
70 /// are entities that have fields and are addressable by path.
72  // The unknown type has a value of 0 so that SdfSpecType() is unknown.
74 
75  // Real concrete types
87 
89 };
90 
91 /// An enum that identifies the possible specifiers for an
92 /// SdfPrimSpec. The SdfSpecifier enum is registered as a TfEnum
93 /// for converting to and from <c>std::string</c>.
94 ///
95 /// <b>SdfSpecifier:</b>
96 /// <ul>
97 /// <li><b>SdfSpecifierDef.</b> Defines a concrete prim.
98 /// <li><b>SdfSpecifierOver.</b> Overrides an existing prim.
99 /// <li><b>SdfSpecifierClass.</b> Defines an abstract prim.
100 /// <li><b>SdfNumSpecifiers.</b> The number of specifiers.
101 /// </ul>
102 ///
108 };
109 
110 /// Returns true if the specifier defines a prim.
111 inline
112 bool
114 {
115  return (spec != SdfSpecifierOver);
116 }
117 
118 /// An enum that defines permission levels.
119 ///
120 /// Permissions control which layers may refer to or express
121 /// opinions about a prim. Opinions expressed about a prim, or
122 /// relationships to that prim, by layers that are not allowed
123 /// permission to access the prim will be ignored.
124 ///
125 /// <b>SdfPermission:</b>
126 /// <ul>
127 /// <li><b>SdfPermissionPublic.</b> Public prims can be referred to by
128 /// anything. (Available to any client.)
129 /// <li><b>SdfPermissionPrivate.</b> Private prims can be referred to
130 /// only within the local layer stack, and not across references
131 /// or inherits. (Not available to clients.)
132 /// <li><b>SdfNumPermission.</b> Internal sentinel value.
133 /// </ul>
134 ///
138 
140 };
141 
142 /// An enum that identifies variability types for attributes.
143 /// Variability indicates whether the attribute may vary over time and
144 /// value coordinates, and if its value comes through authoring or
145 /// or from its owner.
146 ///
147 /// <b>SdfVariability:</b>
148 /// <ul>
149 /// <li><b>SdfVariabilityVarying.</b> Varying attributes may be directly
150 /// authored, animated and affected on by Actions. They are the
151 /// most flexible.
152 /// <li><b>SdfVariabilityUniform.</b> Uniform attributes may be authored
153 /// only with non-animated values (default values). They cannot
154 /// be affected by Actions, but they can be connected to other
155 /// Uniform attributes.
156 /// <li><b>SdNumVariabilities.</b> Internal sentinel value.
157 /// </ul>
158 ///
162 
164 };
165 
166 
167 /// An enum for TfError codes related to authoring operations.
168 ///
169 /// <b>SdfAuthoringError:</b>
170 /// <ul>
171 /// <li><b>SdfAuthoringErrorUnrecognizedFields.</b> This error is raised if
172 /// SdfLayer::TransferContent, or SdfLayer::SetField API is called
173 /// for layers of differing schema, and fields from the source layer
174 /// are not recognized by the target layer's schema.
175 /// <li><b>SdfAuthoringErrorUnrecognizedSpecType.</b> This error is raised
176 /// in attempts to create specs on layers with spec types that are
177 /// not recognized by the layer's schema.
178 /// </ul>
179 ///
181 {
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) \
238 enum _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.
256 
257 /// A map of mapper parameter names to parameter values.
258 typedef std::map<std::string, VtValue> SdfMapperParametersMap;
259 
260 /// A map of reference variant set names to variants in those sets.
261 typedef std::map<std::string, std::string> SdfVariantSelectionMap;
262 
263 /// A map of variant set names to list of variants in those sets.
264 typedef std::map<std::string, std::vector<std::string> > SdfVariantsMap;
265 
266 /// A map of source SdfPaths to target SdfPaths for relocation.
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.
270 typedef std::map<SdfPath, SdfPath> SdfRelocatesMap;
271 
272 /// A single relocate specifying a source SdfPath and a target SdfPath for a
273 /// relocation.
274 typedef std::pair<SdfPath, SdfPath> SdfRelocate;
275 
276 /// A vector of relocation source path to target path pairs.
277 typedef std::vector<SdfRelocate> SdfRelocates;
278 
279 /// A map from sample times to sample values.
280 typedef std::map<double, VtValue> SdfTimeSampleMap;
281 VT_VALUE_TYPE_CAN_TRANSFORM(SdfTimeSampleMap);
282 VT_VALUE_TYPE_CAN_COMPOSE(SdfTimeSampleMap);
283 
284 /// Compose a stronger SdfTimeSampleMap over a weaker one. This produces a
285 /// result different from `strong` when it contains values that
286 /// VtValueCanComposeOver() values in weaker. See SdfComposeTimeSampleSeries()
287 /// for details.
288 SDF_API
289 SdfTimeSampleMap
290 SdfComposeTimeSampleMaps(SdfTimeSampleMap const &strong,
291  SdfTimeSampleMap const &weak);
292 
293 /// Gets the show default unit for the given /a typeName.
294 SDF_API TfEnum SdfDefaultUnit( TfToken const &typeName );
295 
296 /// Gets the show default unit for the given /a unit.
297 SDF_API const TfEnum &SdfDefaultUnit( const TfEnum &unit );
298 
299 /// Gets the unit category for a given /a unit.
300 SDF_API const std::string &SdfUnitCategory( const TfEnum &unit );
301 
302 /// Converts from one unit of measure to another. The \a fromUnit and \a toUnit
303 /// units must be of the same type (for example, both of type SdfLengthUnit).
304 SDF_API double SdfConvertUnit( const TfEnum &fromUnit, const TfEnum &toUnit );
305 
306 /// Gets the name for a given /a unit.
307 SDF_API const std::string &SdfGetNameForUnit( const TfEnum &unit );
308 
309 /// Gets a unit for the given /a name
310 SDF_API const TfEnum &SdfGetUnitFromName( const std::string &name );
311 
312 /// Given a value, returns if there is a valid corresponding valueType.
314 
315 /// Given an sdf valueType name, produce TfType if the type name specifies a
316 /// valid sdf value type.
318 
319 /// Given a value, produce the sdf valueType name. If you provide a value that
320 /// does not return true for SdfValueHasValidType, the return value is
321 /// unspecified.
323 
324 /// Return role name for \p typeName. Return empty token if \p typeName has no
325 /// associated role name.
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 
383 template <class T>
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.
390 template <int N>
391 struct SdfValueTypeTraits<char[N]> {
392  static const bool IsValueType = true;
393 };
394 
395 #define SDF_DECLARE_VALUE_TYPE_TRAITS(unused, elem) \
396 template <> \
397 struct SdfValueTypeTraits<SDF_VALUE_CPP_TYPE(elem)> { \
398  static const bool IsValueType = true; \
399 }; \
400 template <> \
401 struct SdfValueTypeTraits<SDF_VALUE_CPP_ARRAY_TYPE(elem)> { \
402  static const bool IsValueType = true; \
403 }; \
404 template <> \
405 struct SdfValueTypeTraits<SDF_VALUE_CPP_ARRAY_EDIT_TYPE(elem)> { \
406  static const bool IsValueType = true; \
407 };
408 
410 
411 /// Convert \p dict to a valid metadata dictionary for scene description. Valid
412 /// metadata dictionaries have values that are any of SDF_VALUE_TYPES (or
413 /// VtArrays of those), plus VtDictionary with values of those types (or
414 /// similarly nested VtDictionaries).
415 ///
416 /// Certain conversions are performed in an attempt to produce a valid metadata
417 /// dictionary. For example:
418 ///
419 /// Convert std::vector<VtValue> to VtArray<T> where T is the type of the first
420 /// element in the vector. Fail conversion for empty vectors where a concrete
421 /// type cannot be inferred.
422 ///
423 /// Convert python sequences to VtArray<T> where T is the type of the first
424 /// element in the python sequence, when converted to VtValue, if that T is an
425 /// SDF_VALUE_TYPE). Fail conversion for empty sequences where a concrete type
426 /// cannot be inferred.
427 ///
428 /// If any values cannot be converted to valid SDF_VALUE_TYPES, omit those
429 /// elements and add a message to \p errMsg indicating which values were
430 /// omitted.
431 ///
432 SDF_API
433 bool
434 SdfConvertToValidMetadataDictionary(VtDictionary *dict, std::string *errMsg);
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 
450 
452 
460 
461 typedef std::map<std::string, SdfVariantSetSpecHandle>
463 
464 /// Writes the string representation of \c SdfSpecifier to \a out.
465 SDF_API
466 std::ostream & operator<<( std::ostream &out, const SdfSpecifier &spec );
467 
468 /// Writes the string representation of \c SdfRelocatesMap to \a out.
469 SDF_API
470 std::ostream & operator<<( std::ostream &out,
471  const SdfRelocatesMap &reloMap );
472 
473 /// Writes the string representation of \c SdfRelocates to \a out.
474 SDF_API
475 std::ostream & operator<<( std::ostream &out,
476  const SdfRelocates &relocates );
477 
478 /// Writes the string representation of \c SdfTimeSampleMap to \a out.
479 SDF_API
480 std::ostream & operator<<( std::ostream &out,
481  const SdfTimeSampleMap &sampleMap );
482 
483 SDF_API
484 std::ostream &VtStreamOut(const SdfVariantSelectionMap &, std::ostream &);
485 
486 /// \class SdfUnregisteredValue
487 /// Stores a representation of the value for an unregistered metadata
488 /// field encountered during text layer parsing.
489 ///
490 /// This provides the ability to serialize this data to a layer, as
491 /// well as limited inspection and editing capabilities (e.g., moving
492 /// this data to a different spec or field) even when the data type
493 /// of the value isn't known.
495 {
496 public:
497  /// Wraps an empty VtValue
499 
500  /// Wraps a std::string
501  SDF_API explicit SdfUnregisteredValue(const std::string &value);
502 
503  /// Wraps a VtDictionary
504  SDF_API explicit SdfUnregisteredValue(const VtDictionary &value);
505 
506  /// Wraps a SdfUnregisteredValueListOp
508 
509  /// Returns the wrapped VtValue specified in the constructor
510  const VtValue& GetValue() const {
511  return _value;
512  }
513 
514  /// Hash.
515  friend size_t hash_value(const SdfUnregisteredValue &uv) {
516  return uv._value.GetHash();
517  }
518 
519  /// Returns true if the wrapped VtValues are equal
520  SDF_API bool operator==(const SdfUnregisteredValue &other) const;
521 
522  /// Returns true if the wrapped VtValues are not equal
523  SDF_API bool operator!=(const SdfUnregisteredValue &other) const;
524 
525 private:
526  VtValue _value;
527 };
528 
529 /// Writes the string representation of \c SdfUnregisteredValue to \a out.
530 SDF_API std::ostream &operator << (std::ostream &out, const SdfUnregisteredValue &value);
531 
534  Sdf_ValueTypeNamesType& operator=(const Sdf_ValueTypeNamesType&) = delete;
535 public:
557 
577 
579  struct _Init {
580  SDF_API static const Sdf_ValueTypeNamesType* New();
581  };
582 
583  // For Pixar internal backwards compatibility.
585  TfToken GetSerializationName(const VtValue&) const;
586  TfToken GetSerializationName(const TfToken&) const;
587 
588 private:
591 };
592 
595 
596 /// \class SdfValueBlock
597 /// A special value type that can be used to explicitly author an
598 /// opinion for an attribute's default value or time sample value
599 /// that represents having no value. Note that this is different
600 /// from not having a value authored.
601 ///
602 /// One could author such a value in two ways.
603 ///
604 /// \code
605 /// attribute->SetDefaultValue(VtValue(SdfValueBlock());
606 /// ...
607 /// layer->SetTimeSample(attribute->GetPath(), 101, VtValue(SdfValueBlock()));
608 /// \endcode
609 ///
610 struct SdfValueBlock {
611  bool operator==(const SdfValueBlock& block) const { return true; }
612  bool operator!=(const SdfValueBlock& block) const { return false; }
613 
614 private:
615  friend inline size_t hash_value(const SdfValueBlock &block) { return 0; }
616 };
617 
618 // Write out the string representation of a block.
619 SDF_API std::ostream& operator<<(std::ostream&, SdfValueBlock const&);
620 
621 /// \class SdfAnimationBlock
622 /// A special value type that can be used to explicitly author an
623 /// opinion for an attribute's default value that represents having no animation
624 /// value and is used to block spline or time samples value on a weaker layer.
626  bool operator==(const SdfAnimationBlock& block) const { return true; }
627  bool operator!=(const SdfAnimationBlock& block) const { return false; }
628 
629 private:
630  friend inline size_t hash_value(const SdfAnimationBlock &block) { return 0; }
631 };
632 
633 // Write out the string representation of an animation block.
634 SDF_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.
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; }
651 private:
652  std::string _text;
653 };
654 
655 SDF_API
656 std::ostream &operator<<(std::ostream &out, const SdfHumanReadableValue &hrval);
657 
658 SDF_API
659 size_t hash_value(const SdfHumanReadableValue &hrval);
660 
662 
663 #endif // PXR_USD_SDF_TYPES_H
SdfValueTypeName Normal3d
Definition: types.h:546
SDF_API TfType SdfGetTypeForValueTypeName(TfToken const &name)
SdfValueTypeName Float2Array
Definition: types.h:564
Definition: layer.h:81
SdfValueTypeName Color4dArray
Definition: types.h:570
SdfValueTypeName IntArray
Definition: types.h:559
SdfValueTypeName Color3fArray
Definition: types.h:569
SdfValueTypeName Double4
Definition: types.h:543
SdfValueTypeName Token
Definition: types.h:539
SdfValueTypeName QuatdArray
Definition: types.h:571
SdfValueTypeName UCharArray
Definition: types.h:559
friend size_t hash_value(const SdfValueBlock &block)
Definition: types.h:615
SdfValueTypeName TexCoord2fArray
Definition: types.h:574
SdfValueTypeName Half
Definition: types.h:538
SdfValueTypeName Asset
Definition: types.h:539
SdfValueTypeName HalfArray
Definition: types.h:560
SdfValueTypeName QuatfArray
Definition: types.h:571
SdfValueTypeName Matrix2dArray
Definition: types.h:572
SdfValueTypeName Color4f
Definition: types.h:548
SDF_API TfToken SdfGetRoleNameForValueTypeName(TfToken const &typeName)
friend size_t hash_value(const SdfAnimationBlock &block)
Definition: types.h:630
SdfValueTypeName Int4
Definition: types.h:540
std::map< SdfPath, SdfPath > SdfRelocatesMap
A map of source SdfPaths to target SdfPaths for relocation.
Definition: types.h:270
SdfValueTypeName Point3h
Definition: types.h:544
SdfValueTypeName DoubleArray
Definition: types.h:560
GA_API const UT_StringHolder uv
SdfValueTypeName Int4Array
Definition: types.h:562
SdfValueTypeName Frame4dArray
Definition: types.h:573
#define PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
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
GLsizei const GLfloat * value
Definition: glcorearb.h:824
SdfValueTypeName TokenArray
Definition: types.h:561
SdfValueTypeName Normal3hArray
Definition: types.h:568
SdfValueTypeName TexCoord3fArray
Definition: types.h:575
#define ARCH_PRAGMA_POP
Definition: pragmas.h:170
SdfValueTypeName Vector3hArray
Definition: types.h:567
SdfValueTypeName Vector3fArray
Definition: types.h:567
std::map< std::string, std::string > SdfVariantSelectionMap
A map of reference variant set names to variants in those sets.
Definition: types.h:261
Definition: spec.h:32
SdfValueTypeName Color4fArray
Definition: types.h:570
SdfValueTypeName UInt64
Definition: types.h:537
friend const Sdf_ValueTypeNamesType * Sdf_InitializeValueTypeNames()
SdfValueTypeName UChar
Definition: types.h:537
SdfValueTypeName Half2
Definition: types.h:541
bool operator!=(const SdfAnimationBlock &block) const
Definition: types.h:627
Definition: enum.h:119
SdfValueTypeName Normal3f
Definition: types.h:546
SdfValueTypeName Int3
Definition: types.h:540
#define SDF_VALUE_ROLE_NAME_TOKENS
Definition: types.h:436
SDF_API const TfEnum & SdfGetUnitFromName(const std::string &name)
Gets a unit for the given /a name.
SdfValueTypeName TexCoord3d
Definition: types.h:553
TF_PP_SEQ_FOR_EACH(_TS_SUPPORT_DATA_TYPE,~, TS_SPLINE_SUPPORTED_VALUE_TYPES) template< class T > inline const expr bool TsSplineIsValidSampleType
True if template parameter T is a supported spline sampling vertex type.
SdfValueTypeName TexCoord2hArray
Definition: types.h:574
SdfHumanReadableValue()=default
SdfValueTypeName Point3hArray
Definition: types.h:566
SdfValueTypeName Half2Array
Definition: types.h:563
SdfValueTypeName TimeCode
Definition: types.h:538
TF_DECLARE_PUBLIC_TOKENS(SdfValueRoleNames, SDF_API, SDF_VALUE_ROLE_NAME_TOKENS)
SdfValueTypeName TexCoord2h
Definition: types.h:552
HDX_API std::ostream & operator<<(std::ostream &out, const HdxShaderInputs &pv)
SdfValueTypeName Vector3h
Definition: types.h:545
class SdfListOp< class SdfUnregisteredValue > SdfUnregisteredValueListOp
Definition: listOp.h:380
SdfValueTypeName Normal3fArray
Definition: types.h:568
SdfValueTypeName Matrix4dArray
Definition: types.h:572
SdfValueTypeName Vector3dArray
Definition: types.h:567
SdfValueTypeName Point3fArray
Definition: types.h:566
SdfValueTypeName Int3Array
Definition: types.h:562
SdfValueTypeName FloatArray
Definition: types.h:560
SdfValueTypeName Double
Definition: types.h:538
SdfValueTypeName Half3
Definition: types.h:541
SdfValueTypeName Frame4d
Definition: types.h:551
SdfValueTypeName Normal3h
Definition: types.h:546
SdfValueTypeName StringArray
Definition: types.h:561
SdfValueTypeName TexCoord2f
Definition: types.h:552
SdfValueTypeName Quath
Definition: types.h:549
SdfValueTypeName Color4d
Definition: types.h:548
SDF_API bool SdfConvertToValidMetadataDictionary(VtDictionary *dict, std::string *errMsg)
SdfValueTypeName Opaque
Definition: types.h:554
SDF_API SdfValueTypeName SdfGetValueTypeNameForValue(VtValue const &value)
Definition: token.h:70
SdfValueTypeName Double2Array
Definition: types.h:565
#define ARCH_PRAGMA_PUSH
Definition: pragmas.h:166
SdfValueTypeName Color3h
Definition: types.h:547
SdfValueTypeName Int2Array
Definition: types.h:562
SdfValueTypeName Matrix3d
Definition: types.h:550
SdfValueTypeName Float
Definition: types.h:538
bool SdfIsDefiningSpecifier(SdfSpecifier spec)
Returns true if the specifier defines a prim.
Definition: types.h:113
SDF_API TfEnum SdfDefaultUnit(TfToken const &typeName)
Gets the show default unit for the given /a typeName.
SdfValueTypeName UIntArray
Definition: types.h:559
SdfValueTypeName PathExpression
Definition: types.h:556
SdfValueTypeName Float4Array
Definition: types.h:564
SDF_API SdfTimeSampleMap SdfComposeTimeSampleMaps(SdfTimeSampleMap const &strong, SdfTimeSampleMap const &weak)
SdfValueTypeName TexCoord2dArray
Definition: types.h:574
SdfValueTypeName Color3f
Definition: types.h:547
SdfValueTypeName Color3d
Definition: types.h:547
SdfValueTypeName Float2
Definition: types.h:542
SDF_API std::ostream & VtStreamOut(const SdfVariantSelectionMap &, std::ostream &)
std::map< std::string, SdfVariantSetSpecHandle > SdfVariantSetSpecHandleMap
Definition: types.h:462
SdfValueTypeName Matrix2d
Definition: types.h:550
SdfSpecifier
Definition: types.h:103
png_const_structrp png_const_inforp int * unit
Definition: png.h:2161
SdfValueTypeName Float3
Definition: types.h:542
SDF_DECLARE_HANDLES(SdfLayer)
SdfValueTypeName Color4h
Definition: types.h:548
GLuint const GLchar * name
Definition: glcorearb.h:786
const VtValue & GetValue() const
Returns the wrapped VtValue specified in the constructor.
Definition: types.h:510
SdfValueTypeName PathExpressionArray
Definition: types.h:576
std::string const & GetText() const
Definition: types.h:650
SDF_API bool operator==(const SdfUnregisteredValue &other) const
Returns true if the wrapped VtValues are equal.
Definition: path.h:280
SdfValueTypeName Quatf
Definition: types.h:549
SdfAuthoringError
Definition: types.h:180
SdfValueTypeName TimeCodeArray
Definition: types.h:560
SdfValueTypeName Point3f
Definition: types.h:544
SdfValueTypeName Double3
Definition: types.h:543
SdfValueTypeName UInt
Definition: types.h:537
SdfValueTypeName Double3Array
Definition: types.h:565
SdfValueTypeName String
Definition: types.h:539
SdfValueTypeName Float4
Definition: types.h:542
SdfValueTypeName UInt64Array
Definition: types.h:559
bool operator==(SdfHumanReadableValue const &other) const
Definition: types.h:643
SdfValueTypeName Matrix4d
Definition: types.h:550
SdfVariability
Definition: types.h:159
SdfValueTypeName Matrix3dArray
Definition: types.h:572
#define SDF_API
Definition: api.h:23
SdfValueTypeName Color3dArray
Definition: types.h:569
SdfValueTypeName Point3d
Definition: types.h:544
SDF_API TfStaticData< const Sdf_ValueTypeNamesType, Sdf_ValueTypeNamesType::_Init > SdfValueTypeNames
SdfValueTypeName Color3hArray
Definition: types.h:569
SdfValueTypeName Bool
Definition: types.h:536
SdfValueTypeName Normal3dArray
Definition: types.h:568
VT_API size_t GetHash() const
Return a hash code for the held object by calling VtHashValue() on it.
SDF_API ~Sdf_ValueTypeNamesType()
SdfValueTypeName Int64Array
Definition: types.h:559
SdfValueTypeName Color4hArray
Definition: types.h:570
SdfValueTypeName Vector3d
Definition: types.h:545
SdfValueTypeName Half4Array
Definition: types.h:563
SdfSpecType
Definition: types.h:71
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
TfToken GetSerializationName(const SdfValueTypeName &) const
SDF_API double SdfConvertUnit(const TfEnum &fromUnit, const TfEnum &toUnit)
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
bool operator!=(SdfHumanReadableValue const &other) const
Definition: types.h:646
GA_API const UT_StringHolder N
SdfValueTypeName Int2
Definition: types.h:540
bool operator!=(const SdfValueBlock &block) const
Definition: types.h:612
Definition: type.h:47
#define ARCH_PRAGMA_MACRO_TOO_FEW_ARGUMENTS
Definition: pragmas.h:210
SDF_API size_t hash_value(const SdfHumanReadableValue &hrval)
SdfHumanReadableValue(std::string const &text)
Definition: types.h:641
SdfValueTypeName TexCoord3hArray
Definition: types.h:575
SdfValueTypeName TexCoord3dArray
Definition: types.h:575
SdfValueTypeName Int
Definition: types.h:537
SdfValueTypeName TexCoord3f
Definition: types.h:553
#define _SDF_UNITS
Definition: types.h:220
SdfValueTypeName Point3dArray
Definition: types.h:566
SDF_API bool SdfValueHasValidType(VtValue const &value)
Given a value, returns if there is a valid corresponding valueType.
SdfValueTypeName Half3Array
Definition: types.h:563
#define SDF_DECLARE_VALUE_TYPE_TRAITS(unused, elem)
Definition: types.h:395
SdfValueTypeName Half4
Definition: types.h:541
SdfValueTypeName QuathArray
Definition: types.h:571
std::map< double, VtValue > SdfTimeSampleMap
A map from sample times to sample values.
Definition: types.h:280
VT_VALUE_TYPE_CAN_COMPOSE(SdfTimeSampleMap)
SdfValueTypeName Double2
Definition: types.h:543
#define _SDF_FOR_EACH_UNITS(macro, args)
Definition: types.h:246
SdfValueTypeName Group
Definition: types.h:555
std::vector< SdfRelocate > SdfRelocates
A vector of relocation source path to target path pairs.
Definition: types.h:277
SdfValueTypeName Int64
Definition: types.h:537
static const bool IsValueType
Definition: types.h:385
SdfValueTypeName AssetArray
Definition: types.h:561
SDF_API const std::string & SdfUnitCategory(const TfEnum &unit)
Gets the unit category for a given /a unit.
VT_VALUE_TYPE_CAN_TRANSFORM(SdfTimeSampleMap)
static SDF_API const Sdf_ValueTypeNamesType * New()
Definition: value.h:89
SdfValueTypeName Vector3f
Definition: types.h:545
SdfValueTypeName BoolArray
Definition: types.h:558
SdfValueTypeName Float3Array
Definition: types.h:564
#define SDF_VALUE_TYPES
Definition: types.h:376
SdfValueTypeName Double4Array
Definition: types.h:565
SDF_API const std::string & SdfGetNameForUnit(const TfEnum &unit)
Gets the name for a given /a unit.
#define _SDF_DECLARE_UNIT_ENUM(elem)
Definition: types.h:237
SdfValueTypeName TexCoord3h
Definition: types.h:553
SdfValueTypeName Quatd
Definition: types.h:549
std::pair< SdfPath, SdfPath > SdfRelocate
Definition: types.h:274
bool operator==(const SdfValueBlock &block) const
Definition: types.h:611
SDF_API bool operator!=(const SdfUnregisteredValue &other) const
Returns true if the wrapped VtValues are not equal.
SdfValueTypeName TexCoord2d
Definition: types.h:552
SdfPermission
Definition: types.h:135
friend size_t hash_value(const SdfUnregisteredValue &uv)
Hash.
Definition: types.h:515
bool operator==(const SdfAnimationBlock &block) const
Definition: types.h:626
SDF_API SdfUnregisteredValue()
Wraps an empty VtValue.