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 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 SDF_TYPES_H
25 #define SDF_TYPES_H
26 
29 
30 #include "pxr/pxr.h"
31 #include "pxr/usd/sdf/api.h"
32 #include "pxr/usd/sdf/assetPath.h"
33 #include "pxr/usd/sdf/declareHandles.h"
34 #include "pxr/usd/sdf/listOp.h"
35 #include "pxr/usd/sdf/timeCode.h"
36 #include "pxr/usd/sdf/valueTypeName.h"
37 
38 #include "pxr/base/arch/demangle.h"
39 #include "pxr/base/arch/inttypes.h"
40 #include "pxr/base/gf/half.h"
41 #include "pxr/base/gf/matrix2d.h"
42 #include "pxr/base/gf/matrix3d.h"
43 #include "pxr/base/gf/matrix4d.h"
44 #include "pxr/base/gf/quatd.h"
45 #include "pxr/base/gf/quatf.h"
46 #include "pxr/base/gf/quath.h"
47 #include "pxr/base/gf/vec2d.h"
48 #include "pxr/base/gf/vec2f.h"
49 #include "pxr/base/gf/vec2h.h"
50 #include "pxr/base/gf/vec2i.h"
51 #include "pxr/base/gf/vec3d.h"
52 #include "pxr/base/gf/vec3f.h"
53 #include "pxr/base/gf/vec3h.h"
54 #include "pxr/base/gf/vec3i.h"
55 #include "pxr/base/gf/vec4d.h"
56 #include "pxr/base/gf/vec4f.h"
57 #include "pxr/base/gf/vec4h.h"
58 #include "pxr/base/gf/vec4i.h"
59 #include "pxr/base/tf/enum.h"
60 #include "pxr/base/tf/preprocessorUtils.h"
61 #include "pxr/base/tf/staticTokens.h"
62 #include "pxr/base/tf/token.h"
63 #include "pxr/base/tf/type.h"
64 #include "pxr/base/vt/array.h"
65 #include "pxr/base/vt/dictionary.h"
66 #include "pxr/base/vt/value.h"
67 
68 #include <boost/noncopyable.hpp>
69 #include <boost/preprocessor/list/for_each.hpp>
70 #include <boost/preprocessor/list/size.hpp>
71 #include <boost/preprocessor/punctuation/comma.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 <boost/shared_ptr.hpp>
77 #include <iosfwd>
78 #include <list>
79 #include <map>
80 #include <stdint.h>
81 #include <string>
82 #include <typeinfo>
83 #include <vector>
84 
85 PXR_NAMESPACE_OPEN_SCOPE
86 
87 class SdfPath;
88 
92  // The unknown type has a value of 0 so that SdfSpecType() is unknown.
93  SdfSpecTypeUnknown = 0,
94 
95  // Real concrete types
96  SdfSpecTypeAttribute,
97  SdfSpecTypeConnection,
98  SdfSpecTypeExpression,
99  SdfSpecTypeMapper,
100  SdfSpecTypeMapperArg,
101  SdfSpecTypePrim,
102  SdfSpecTypePseudoRoot,
103  SdfSpecTypeRelationship,
104  SdfSpecTypeRelationshipTarget,
105  SdfSpecTypeVariant,
106  SdfSpecTypeVariantSet,
107 
108  SdfNumSpecTypes
109 };
110 
124  SdfSpecifierDef,
125  SdfSpecifierOver,
126  SdfSpecifierClass,
127  SdfNumSpecifiers
128 };
129 
131 inline
132 bool
134 {
135  return (spec != SdfSpecifierOver);
136 }
137 
156  SdfPermissionPublic,
157  SdfPermissionPrivate,
158 
159  SdfNumPermissions
160 };
161 
183  SdfVariabilityVarying,
184  SdfVariabilityUniform,
185  SdfVariabilityConfig,
186 
187  SdfNumVariabilities
188 };
189 
190 // Each category of compatible units of measurement is defined by a
191 // preprocessor sequence of tuples. Each such sequence gives rise to an enum
192 // representing the corresponding unit category. All the unit categories are
193 // listed in _SDF_UNITS where each entry is a two-tuple with the unit category
194 // name as the first element, and the second element is the units in that
195 // category. Each tuple in a unit category sequence corresponds to a unit of
196 // measurement represented by an enumerant whose name is given by concatenating
197 // 'Sdf', the unit category name, the word 'Unit' and the first entry in the
198 // tuple. (E.g. units of category 'Length' are represented by an enum named
199 // SdfLengthUnit with enumerants SdfLengthUnitInch, SdfLengthUnitMeter and so
200 // forth.) The second element in the tuple is the display name for the unit,
201 // and the third element is the relative size of the unit compared to the menv
202 // default unit for the unit category (which has a relative size of 1.0).
203 // Dimensionless quantities use a special 'Dimensionless' unit category
204 // represented by the enum SdfDimensionlessUnit.
205 #define _SDF_LENGTH_UNITS \
206 ((Millimeter, "mm", 0.001)) \
207 ((Centimeter, "cm", 0.01)) \
208 ((Decimeter, "dm", 0.1)) \
209 ((Meter, "m", 1.0)) \
210 ((Kilometer, "km", 1000.0)) \
211 ((Inch, "in", 0.0254)) \
212 ((Foot, "ft", 0.3048)) \
213 ((Yard, "yd", 0.9144)) \
214 ((Mile, "mi", 1609.344))
215 
216 #define _SDF_ANGULAR_UNITS \
217 ((Degrees, "deg", 1.0)) \
218 ((Radians, "rad", 57.2957795130823208768))
219 
220 #define _SDF_DIMENSIONLESS_UNITS \
221 ((Percent, "%", 0.01)) \
222 ((Default, "default", 1.0))
223 
224 #define _SDF_UNITS \
225 ((Length, _SDF_LENGTH_UNITS), \
226 ((Angular, _SDF_ANGULAR_UNITS), \
227 ((Dimensionless, _SDF_DIMENSIONLESS_UNITS), \
228  BOOST_PP_NIL)))
229 
230 #define _SDF_UNIT_TAG(tup) BOOST_PP_TUPLE_ELEM(3, 0, tup)
231 #define _SDF_UNIT_NAME(tup) BOOST_PP_TUPLE_ELEM(3, 1, tup)
232 #define _SDF_UNIT_SCALE(tup) BOOST_PP_TUPLE_ELEM(3, 2, tup)
233 
234 #define _SDF_UNITSLIST_CATEGORY(tup) BOOST_PP_TUPLE_ELEM(2, 0, tup)
235 #define _SDF_UNITSLIST_TUPLES(tup) BOOST_PP_TUPLE_ELEM(2, 1, tup)
236 #define _SDF_UNITSLIST_ENUM(elem) BOOST_PP_CAT(BOOST_PP_CAT(Sdf, \
237  _SDF_UNITSLIST_CATEGORY(elem)), Unit)
238 
239 #define _SDF_DECLARE_UNIT_ENUMERANT(r, tag, elem) \
240  BOOST_PP_CAT(Sdf ## tag ## Unit, _SDF_UNIT_TAG(elem)),
241 
242 #define _SDF_DECLARE_UNIT_ENUM(r, unused, elem) \
243 enum _SDF_UNITSLIST_ENUM(elem) { \
244  BOOST_PP_SEQ_FOR_EACH(_SDF_DECLARE_UNIT_ENUMERANT, \
245  _SDF_UNITSLIST_CATEGORY(elem), \
246  _SDF_UNITSLIST_TUPLES(elem)) \
247 };
248 BOOST_PP_LIST_FOR_EACH(_SDF_DECLARE_UNIT_ENUM, ~, _SDF_UNITS)
249 
250 // Compute the max number of enumerants over all unit enums
251 #define _SDF_MAX_UNITS_OP(d, state, list) \
252  BOOST_PP_MAX_D(d, state, BOOST_PP_SEQ_SIZE(_SDF_UNITSLIST_TUPLES(list)))
253 #define _SDF_UNIT_MAX_UNITS \
254  BOOST_PP_LIST_FOLD_LEFT(_SDF_MAX_UNITS_OP, 0, _SDF_UNITS)
255 
256 // Compute the number of unit enums
257 #define _SDF_UNIT_NUM_TYPES BOOST_PP_LIST_SIZE(_SDF_UNITS)
258 
259 // Compute the number of bits needed to hold _SDF_UNIT_MAX_UNITS and
260 // _SDF_UNIT_NUM_TYPES.
261 #define _SDF_UNIT_MAX_UNITS_BITS TF_BITS_FOR_VALUES(_SDF_UNIT_MAX_UNITS)
262 #define _SDF_UNIT_TYPES_BITS TF_BITS_FOR_VALUES(_SDF_UNIT_NUM_TYPES)
263 
265 typedef std::map<std::string, VtValue> SdfMapperParametersMap;
266 
268 typedef std::map<std::string, std::string> SdfVariantSelectionMap;
269 
271 typedef std::map<std::string, std::vector<std::string> > SdfVariantsMap;
272 
274 // Note: This map needs to be lexicographically sorted for Csd composition
275 // implementation, so SdfPath::FastLessThan is explicitly omitted as
276 // the Compare template parameter.
277 typedef std::map<SdfPath, SdfPath> SdfRelocatesMap;
278 
280 typedef std::map<double, VtValue> SdfTimeSampleMap;
281 
283 SDF_API TfEnum SdfDefaultUnit( TfToken const &typeName );
284 
286 SDF_API const TfEnum &SdfDefaultUnit( const TfEnum &unit );
287 
289 SDF_API const std::string &SdfUnitCategory( const TfEnum &unit );
290 
293 SDF_API double SdfConvertUnit( const TfEnum &fromUnit, const TfEnum &toUnit );
294 
296 SDF_API const std::string &SdfGetNameForUnit( const TfEnum &unit );
297 
299 SDF_API const TfEnum &SdfGetUnitFromName( const std::string &name );
300 
307 SDF_API bool SdfBoolFromString( const std::string &, bool *parseOk = NULL );
308 
310 SDF_API bool SdfValueHasValidType(VtValue const& value);
311 
314 SDF_API TfType SdfGetTypeForValueTypeName(TfToken const &name);
315 
320 
323 SDF_API TfToken SdfGetRoleNameForValueTypeName(TfToken const &typeName);
324 
325 // Sdf allows a specific set of types for attribute and metadata values.
326 // These types and some additional metadata are listed in the preprocessor
327 // sequence of tuples below. First element is a tag name that is appended to
328 // 'SdfValueType' to produce the C++ traits type for the value type.
329 // Second element is the value type name, third element is the corresponding
330 // C++ type, and the fourth element is the tuple of tuple dimensions.
331 //
332 // Libraries may extend this list and define additional value types.
333 // When doing so, the type must be declared using the SDF_DECLARE_VALUE_TYPE
334 // macro below. The type must also be registered in the associated schema using
335 // SdfSchema::_RegisterValueType(s).
336 #define _SDF_SCALAR_VALUE_TYPES \
337  ((Bool, bool, bool, () )) \
338  ((UChar, uchar, unsigned char, () )) \
339  ((Int, int, int, () )) \
340  ((UInt, uint, unsigned int, () )) \
341  ((Int64, int64, int64_t, () )) \
342  ((UInt64, uint64, uint64_t, () )) \
343  ((Half, half, GfHalf, () )) \
344  ((Float, float, float, () )) \
345  ((Double, double, double, () )) \
346  ((TimeCode, timecode, SdfTimeCode, () )) \
347  ((String, string, std::string, () )) \
348  ((Token, token, TfToken, () )) \
349  ((Asset, asset, SdfAssetPath, () ))
350 
351 #define _SDF_DIMENSIONED_VALUE_TYPES \
352  ((Matrix2d, matrix2d, GfMatrix2d, (2,2) )) \
353  ((Matrix3d, matrix3d, GfMatrix3d, (3,3) )) \
354  ((Matrix4d, matrix4d, GfMatrix4d, (4,4) )) \
355  ((Quath, quath, GfQuath, (4) )) \
356  ((Quatf, quatf, GfQuatf, (4) )) \
357  ((Quatd, quatd, GfQuatd, (4) )) \
358  ((Int2, int2, GfVec2i, (2) )) \
359  ((Half2, half2, GfVec2h, (2) )) \
360  ((Float2, float2, GfVec2f, (2) )) \
361  ((Double2, double2, GfVec2d, (2) )) \
362  ((Int3, int3, GfVec3i, (3) )) \
363  ((Half3, half3, GfVec3h, (3) )) \
364  ((Float3, float3, GfVec3f, (3) )) \
365  ((Double3, double3, GfVec3d, (3) )) \
366  ((Int4, int4, GfVec4i, (4) )) \
367  ((Half4, half4, GfVec4h, (4) )) \
368  ((Float4, float4, GfVec4f, (4) )) \
369  ((Double4, double4, GfVec4d, (4) ))
370 
371 #define SDF_VALUE_TYPES _SDF_SCALAR_VALUE_TYPES _SDF_DIMENSIONED_VALUE_TYPES
372 
373 // Accessors for individual elements in the value types tuples.
374 #define SDF_VALUE_CPP_TYPE(tup) BOOST_PP_TUPLE_ELEM(4, 2, tup)
375 #define SDF_VALUE_CPP_ARRAY_TYPE(tup) VtArray<BOOST_PP_TUPLE_ELEM(4, 2, tup)>
376 
377 template <class T>
378 struct SdfValueTypeTraits {
379  static const bool IsValueType = false;
380 };
381 
382 // Allow character arrays to be treated as Sdf value types.
383 // Sdf converts character arrays to strings for scene description.
384 template <int N>
385 struct SdfValueTypeTraits<char[N]> {
386  static const bool IsValueType = true;
387 };
388 
389 #define SDF_DECLARE_VALUE_TYPE_TRAITS(r, unused, elem) \
390 template <> \
391 struct SdfValueTypeTraits<SDF_VALUE_CPP_TYPE(elem)> { \
392  static const bool IsValueType = true; \
393 }; \
394 template <> \
395 struct SdfValueTypeTraits<SDF_VALUE_CPP_ARRAY_TYPE(elem)> { \
396  static const bool IsValueType = true; \
397 };
398 
399 BOOST_PP_SEQ_FOR_EACH(SDF_DECLARE_VALUE_TYPE_TRAITS, ~, SDF_VALUE_TYPES);
400 
401 #define SDF_VALUE_ROLE_NAME_TOKENS \
402  (Point) \
403  (Normal) \
404  (Vector) \
405  (Color) \
406  (Frame) \
407  (Transform) \
408  (PointIndex) \
409  (EdgeIndex) \
410  (FaceIndex) \
411  (TextureCoordinate)
412 
413 TF_DECLARE_PUBLIC_TOKENS(SdfValueRoleNames, SDF_API, SDF_VALUE_ROLE_NAME_TOKENS);
414 
415 SDF_DECLARE_HANDLES(SdfLayer);
416 
417 SDF_DECLARE_HANDLES(SdfAttributeSpec);
418 SDF_DECLARE_HANDLES(SdfPrimSpec);
419 SDF_DECLARE_HANDLES(SdfPropertySpec);
420 SDF_DECLARE_HANDLES(SdfSpec);
421 SDF_DECLARE_HANDLES(SdfRelationshipSpec);
422 SDF_DECLARE_HANDLES(SdfVariantSetSpec);
423 SDF_DECLARE_HANDLES(SdfVariantSpec);
424 
425 typedef std::map<std::string, SdfVariantSetSpecHandle>
426  SdfVariantSetSpecHandleMap;
427 
429 SDF_API
430 std::ostream & operator<<( std::ostream &out, const SdfSpecifier &spec );
431 
433 SDF_API
434 std::ostream & operator<<( std::ostream &out,
435  const SdfRelocatesMap &reloMap );
436 
438 SDF_API
439 std::ostream & operator<<( std::ostream &out,
440  const SdfTimeSampleMap &sampleMap );
441 
442 SDF_API
443 std::ostream &VtStreamOut(const SdfVariantSelectionMap &, std::ostream &);
444 
454  public boost::equality_comparable<SdfUnregisteredValue>
455 {
456 public:
458  SDF_API SdfUnregisteredValue();
459 
461  SDF_API explicit SdfUnregisteredValue(const std::string &value);
462 
464  SDF_API explicit SdfUnregisteredValue(const VtDictionary &value);
465 
467  SDF_API explicit SdfUnregisteredValue(const SdfUnregisteredValueListOp &value);
468 
470  const VtValue& GetValue() const {
471  return _value;
472  }
473 
475  friend size_t hash_value(const SdfUnregisteredValue &uv) {
476  return uv._value.GetHash();
477  }
478 
480  SDF_API bool operator==(const SdfUnregisteredValue &other) const;
481 
482 private:
483  VtValue _value;
484 };
485 
487 SDF_API std::ostream &operator << (std::ostream &out, const SdfUnregisteredValue &value);
488 
489 class Sdf_ValueTypeNamesType : boost::noncopyable {
490 public:
491  SdfValueTypeName Bool;
492  SdfValueTypeName UChar, Int, UInt, Int64, UInt64;
493  SdfValueTypeName Half, Float, Double, TimeCode;
494  SdfValueTypeName String, Token, Asset;
495  SdfValueTypeName Int2, Int3, Int4;
496  SdfValueTypeName Half2, Half3, Half4;
497  SdfValueTypeName Float2, Float3, Float4;
498  SdfValueTypeName Double2, Double3, Double4;
499  SdfValueTypeName Point3h, Point3f, Point3d;
500  SdfValueTypeName Vector3h, Vector3f, Vector3d;
501  SdfValueTypeName Normal3h, Normal3f, Normal3d;
502  SdfValueTypeName Color3h, Color3f, Color3d;
503  SdfValueTypeName Color4h, Color4f, Color4d;
504  SdfValueTypeName Quath, Quatf, Quatd;
505  SdfValueTypeName Matrix2d, Matrix3d, Matrix4d;
506  SdfValueTypeName Frame4d;
507  SdfValueTypeName TexCoord2h, TexCoord2f, TexCoord2d;
508  SdfValueTypeName TexCoord3h, TexCoord3f, TexCoord3d;
509 
510  SdfValueTypeName BoolArray;
511  SdfValueTypeName UCharArray, IntArray, UIntArray, Int64Array, UInt64Array;
512  SdfValueTypeName HalfArray, FloatArray, DoubleArray, TimeCodeArray;
513  SdfValueTypeName StringArray, TokenArray, AssetArray;
514  SdfValueTypeName Int2Array, Int3Array, Int4Array;
515  SdfValueTypeName Half2Array, Half3Array, Half4Array;
516  SdfValueTypeName Float2Array, Float3Array, Float4Array;
517  SdfValueTypeName Double2Array, Double3Array, Double4Array;
518  SdfValueTypeName Point3hArray, Point3fArray, Point3dArray;
519  SdfValueTypeName Vector3hArray, Vector3fArray, Vector3dArray;
520  SdfValueTypeName Normal3hArray, Normal3fArray, Normal3dArray;
521  SdfValueTypeName Color3hArray, Color3fArray, Color3dArray;
522  SdfValueTypeName Color4hArray, Color4fArray, Color4dArray;
523  SdfValueTypeName QuathArray, QuatfArray, QuatdArray;
524  SdfValueTypeName Matrix2dArray, Matrix3dArray, Matrix4dArray;
525  SdfValueTypeName Frame4dArray;
526  SdfValueTypeName TexCoord2hArray, TexCoord2fArray, TexCoord2dArray;
527  SdfValueTypeName TexCoord3hArray, TexCoord3fArray, TexCoord3dArray;
528 
529  SDF_API ~Sdf_ValueTypeNamesType();
530  struct _Init {
531  SDF_API static const Sdf_ValueTypeNamesType* New();
532  };
533 
534  // For Pixar internal backwards compatibility.
535  TfToken GetSerializationName(const SdfValueTypeName&) const;
536  TfToken GetSerializationName(const VtValue&) const;
537  TfToken GetSerializationName(const TfToken&) const;
538 
539 private:
540  friend const Sdf_ValueTypeNamesType* Sdf_InitializeValueTypeNames();
541  Sdf_ValueTypeNamesType();
542 };
543 
544 extern SDF_API TfStaticData<const Sdf_ValueTypeNamesType,
545  Sdf_ValueTypeNamesType::_Init> SdfValueTypeNames;
546 
561 struct SdfValueBlock {
562  bool operator==(const SdfValueBlock& block) const { return true; }
563  bool operator!=(const SdfValueBlock& block) const { return false; }
564 
565 private:
566  friend inline size_t hash_value(const SdfValueBlock &block) { return 0; }
567 };
568 
569 // Write out the string representation of a block.
570 SDF_API std::ostream& operator<<(std::ostream&, SdfValueBlock const&);
571 
572 // A class that represents a human-readable value. This is used for the special
573 // purpose of producing layers that serialize field values in alternate ways; to
574 // produce more human-readable output, for example.
575 struct SdfHumanReadableValue {
576  SdfHumanReadableValue() = default;
577  explicit SdfHumanReadableValue(std::string const &text) : _text(text) {}
578 
579  bool operator==(SdfHumanReadableValue const &other) const {
580  return GetText() == other.GetText();
581  }
582  bool operator!=(SdfHumanReadableValue const &other) const {
583  return !(*this == other);
584  }
585 
586  std::string const &GetText() const { return _text; }
587 private:
588  std::string _text;
589 };
590 
591 SDF_API
592 std::ostream &operator<<(std::ostream &out, const SdfHumanReadableValue &hrval);
593 
594 SDF_API
595 size_t hash_value(const SdfHumanReadableValue &hrval);
596 
597 PXR_NAMESPACE_CLOSE_SCOPE
598 
599 #endif // SDF_TYPES_H
SDF_API TfEnum SdfDefaultUnit(TfToken const &typeName)
Gets the show default unit for the given /a typeName.
A unit of scene description that you combine with other units of scene description to form a shot...
Definition: layer.h:93
SDF_API bool operator==(const SdfUnregisteredValue &other) const
Returns true if the wrapped VtValues are equal.
SDF_API bool SdfBoolFromString(const std::string &, bool *parseOk=NULL)
Converts a string to a bool.
std::map< std::string, std::string > SdfVariantSelectionMap
A map of reference variant set names to variants in those sets.
Definition: types.h:268
Base class for SdfAttributeSpec and SdfRelationshipSpec.
Definition: propertySpec.h:59
bool SdfIsDefiningSpecifier(SdfSpecifier spec)
Returns true if the specifier defines a prim.
Definition: types.h:133
SDF_API TfType SdfGetTypeForValueTypeName(TfToken const &name)
Given an sdf valueType name, produce TfType if the type name specifies a valid sdf value type...
A map with string keys and VtValue values.
Definition: dictionary.h:61
Base class for all Sdf spec classes.
Definition: spec.h:51
An enum class that records both enum type and enum value.
Definition: enum.h:140
Represents a value type name, i.e.
Definition: valueTypeName.h:83
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:271
SdfSpecType
An enum that specifies the type of an object.
Definition: types.h:91
A special value type that can be used to explicitly author an opinion for an attribute&#39;s default valu...
Definition: types.h:561
SDF_API TfToken SdfGetRoleNameForValueTypeName(TfToken const &typeName)
Return role name for typeName.
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:89
Stores a representation of the value for an unregistered metadata field encountered during text layer...
Definition: types.h:453
SdfSpecifier
An enum that identifies the possible specifiers for an SdfPrimSpec.
Definition: types.h:123
A subclass of SdfPropertySpec that holds typed data.
Definition: attributeSpec.h:56
Create or return a previously created object instance of global data.
Definition: staticData.h:113
Represents a coherent set of alternate representations for part of a scene.
#define TF_DECLARE_PUBLIC_TOKENS(...)
Macro to define public tokens.
Definition: staticTokens.h:118
SdfVariability
An enum that identifies variability types for attributes.
Definition: types.h:182
SDF_API const std::string & SdfGetNameForUnit(const TfEnum &unit)
Gets the name for a given /a unit.
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:287
const VtValue & GetValue() const
Returns the wrapped VtValue specified in the constructor.
Definition: types.h:470
GF_API std::ostream & operator<<(std::ostream &, const GfBBox3d &)
Output a GfBBox3d using the format [(range) matrix zeroArea].
Represents a prim description in an SdfLayer object.
Definition: primSpec.h:74
A property that contains a reference to one or more SdfPrimSpec instances.
SDF_API double SdfConvertUnit(const TfEnum &fromUnit, const TfEnum &toUnit)
Converts from one unit of measure to another.
VT_API size_t GetHash() const
Return a hash code for the held object by calling VtHashValue() on it.
TfType represents a dynamic runtime type.
Definition: type.h:70
std::map< SdfPath, SdfPath > SdfRelocatesMap
A map of source SdfPaths to target SdfPaths for relocation.
Definition: types.h:277
VT_API bool operator==(VtDictionary const &, VtDictionary const &)
Equality comparison.
SDF_API SdfUnregisteredValue()
Wraps an empty VtValue.
SdfPermission
An enum that defines permission levels.
Definition: types.h:155
SDF_API bool SdfValueHasValidType(VtValue const &value)
Given a value, returns if there is a valid corresponding valueType.
Represents a single variant in a variant set.
Definition: variantSpec.h:55
SDF_API SdfValueTypeName SdfGetValueTypeNameForValue(VtValue const &value)
Given a value, produce the sdf valueType name.
SDF_API const TfEnum & SdfGetUnitFromName(const std::string &name)
Gets a unit for the given /a name.
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition: value.h:182
SDF_API const std::string & SdfUnitCategory(const TfEnum &unit)
Gets the unit category for a given /a unit.
friend size_t hash_value(const SdfUnregisteredValue &uv)
Hash.
Definition: types.h:475
std::map< double, VtValue > SdfTimeSampleMap
A map from sample times to sample values.
Definition: types.h:280
std::map< std::string, VtValue > SdfMapperParametersMap
A map of mapper parameter names to parameter values.
Definition: types.h:265