All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
types.h File Reference

Basic Sdf data types. More...

Go to the source code of this file.

Classes

class  SdfUnregisteredValue
 Stores a representation of the value for an unregistered metadata field encountered during text layer parsing. More...
 
class  SdfValueBlock
 A special value type that can be used to explicitly author an opinion for an attribute's default value or time sample value that represents having no value. More...
 

Macros

#define _SDF_LENGTH_UNITS
 
#define _SDF_ANGULAR_UNITS
 
#define _SDF_DIMENSIONLESS_UNITS
 
#define _SDF_UNITS
 
#define _SDF_UNIT_TAG(tup)   BOOST_PP_TUPLE_ELEM(3, 0, tup)
 
#define _SDF_UNIT_NAME(tup)   BOOST_PP_TUPLE_ELEM(3, 1, tup)
 
#define _SDF_UNIT_SCALE(tup)   BOOST_PP_TUPLE_ELEM(3, 2, tup)
 
#define _SDF_UNITSLIST_CATEGORY(tup)   BOOST_PP_TUPLE_ELEM(2, 0, tup)
 
#define _SDF_UNITSLIST_TUPLES(tup)   BOOST_PP_TUPLE_ELEM(2, 1, tup)
 
#define _SDF_UNITSLIST_ENUM(elem)
 
#define _SDF_DECLARE_UNIT_ENUMERANT(r, tag, elem)   BOOST_PP_CAT(Sdf ## tag ## Unit, _SDF_UNIT_TAG(elem)),
 
#define _SDF_DECLARE_UNIT_ENUM(r, unused, elem)
 
#define _SDF_MAX_UNITS_OP(d, state, list)   BOOST_PP_MAX_D(d, state, BOOST_PP_SEQ_SIZE(_SDF_UNITSLIST_TUPLES(list)))
 
#define _SDF_UNIT_MAX_UNITS   BOOST_PP_LIST_FOLD_LEFT(_SDF_MAX_UNITS_OP, 0, _SDF_UNITS)
 
#define _SDF_UNIT_NUM_TYPES   BOOST_PP_LIST_SIZE(_SDF_UNITS)
 
#define _SDF_UNIT_MAX_UNITS_BITS   TF_BITS_FOR_VALUES(_SDF_UNIT_MAX_UNITS)
 
#define _SDF_UNIT_TYPES_BITS   TF_BITS_FOR_VALUES(_SDF_UNIT_NUM_TYPES)
 
#define _SDF_SCALAR_VALUE_TYPES
 
#define _SDF_DIMENSIONED_VALUE_TYPES
 
#define SDF_VALUE_TYPES   _SDF_SCALAR_VALUE_TYPES _SDF_DIMENSIONED_VALUE_TYPES
 
#define SDF_VALUE_CPP_TYPE(tup)   BOOST_PP_TUPLE_ELEM(4, 2, tup)
 
#define SDF_VALUE_CPP_ARRAY_TYPE(tup)   VtArray<BOOST_PP_TUPLE_ELEM(4, 2, tup)>
 
#define SDF_DECLARE_VALUE_TYPE_TRAITS(r, unused, elem)
 
#define SDF_VALUE_ROLE_NAME_TOKENS
 

Typedefs

typedef std::map< std::string,
VtValue
SdfMapperParametersMap
 A map of mapper parameter names to parameter values. More...
 
typedef std::map< std::string,
std::string > 
SdfVariantSelectionMap
 A map of reference variant set names to variants in those sets. More...
 
typedef std::map< std::string,
std::vector< std::string > > 
SdfVariantsMap
 A map of variant set names to list of variants in those sets. More...
 
typedef std::map< SdfPath,
SdfPath
SdfRelocatesMap
 A map of source SdfPaths to target SdfPaths for relocation. More...
 
typedef std::map< double, VtValueSdfTimeSampleMap
 A map from sample times to sample values. More...
 
typedef std::map< std::string,
SdfVariantSetSpecHandle > 
SdfVariantSetSpecHandleMap
 

Enumerations

enum  SdfSpecType {
  SdfSpecTypeUnknown = 0, SdfSpecTypeAttribute, SdfSpecTypeConnection, SdfSpecTypeExpression,
  SdfSpecTypeMapper, SdfSpecTypeMapperArg, SdfSpecTypePrim, SdfSpecTypePseudoRoot,
  SdfSpecTypeRelationship, SdfSpecTypeRelationshipTarget, SdfSpecTypeVariant, SdfSpecTypeVariantSet,
  SdfNumSpecTypes
}
 An enum that specifies the type of an object. More...
 
enum  SdfSpecifier { SdfSpecifierDef, SdfSpecifierOver, SdfSpecifierClass, SdfNumSpecifiers }
 An enum that identifies the possible specifiers for an SdfPrimSpec. More...
 
enum  SdfPermission { SdfPermissionPublic, SdfPermissionPrivate, SdfNumPermissions }
 An enum that defines permission levels. More...
 
enum  SdfVariability { SdfVariabilityVarying, SdfVariabilityUniform, SdfVariabilityConfig, SdfNumVariabilities }
 An enum that identifies variability types for attributes. More...
 

Functions

bool SdfIsDefiningSpecifier (SdfSpecifier spec)
 Returns true if the specifier defines a prim. More...
 
SDF_API TfEnum SdfDefaultUnit (TfToken const &typeName)
 Gets the show default unit for the given /a typeName. More...
 
SDF_API const TfEnumSdfDefaultUnit (const TfEnum &unit)
 Gets the show default unit for the given /a unit. More...
 
SDF_API const std::string & SdfUnitCategory (const TfEnum &unit)
 Gets the unit category for a given /a unit. More...
 
SDF_API double SdfConvertUnit (const TfEnum &fromUnit, const TfEnum &toUnit)
 Converts from one unit of measure to another. More...
 
SDF_API const std::string & SdfGetNameForUnit (const TfEnum &unit)
 Gets the name for a given /a unit. More...
 
SDF_API const TfEnumSdfGetUnitFromName (const std::string &name)
 Gets a unit for the given /a name. More...
 
SDF_API bool SdfBoolFromString (const std::string &, bool *parseOk=NULL)
 Converts a string to a bool. More...
 
SDF_API bool SdfValueHasValidType (VtValue const &value)
 Given a value, returns if there is a valid corresponding valueType. More...
 
SDF_API TfType SdfGetTypeForValueTypeName (TfToken const &name)
 Given an sdf valueType name, produce TfType if the type name specifies a valid sdf value type. More...
 
SDF_API SdfValueTypeName SdfGetValueTypeNameForValue (VtValue const &value)
 Given a value, produce the sdf valueType name. More...
 
SDF_API TfToken SdfGetRoleNameForValueTypeName (TfToken const &typeName)
 Return role name for typeName. More...
 
 BOOST_PP_SEQ_FOR_EACH (SDF_DECLARE_VALUE_TYPE_TRAITS,~, SDF_VALUE_TYPES)
 
 TF_DECLARE_PUBLIC_TOKENS (SdfValueRoleNames, SDF_API, SDF_VALUE_ROLE_NAME_TOKENS)
 
 SDF_DECLARE_HANDLES (SdfLayer)
 
 SDF_DECLARE_HANDLES (SdfAttributeSpec)
 
 SDF_DECLARE_HANDLES (SdfPrimSpec)
 
 SDF_DECLARE_HANDLES (SdfPropertySpec)
 
 SDF_DECLARE_HANDLES (SdfSpec)
 
 SDF_DECLARE_HANDLES (SdfRelationshipSpec)
 
 SDF_DECLARE_HANDLES (SdfVariantSetSpec)
 
 SDF_DECLARE_HANDLES (SdfVariantSpec)
 
SDF_API std::ostream & operator<< (std::ostream &out, const SdfSpecifier &spec)
 Writes the string representation of SdfSpecifier to out. More...
 
SDF_API std::ostream & operator<< (std::ostream &out, const SdfRelocatesMap &reloMap)
 Writes the string representation of SdfRelocatesMap to out. More...
 
SDF_API std::ostream & operator<< (std::ostream &out, const SdfTimeSampleMap &sampleMap)
 Writes the string representation of SdfTimeSampleMap to out. More...
 
SDF_API std::ostream & VtStreamOut (const SdfVariantSelectionMap &, std::ostream &)
 
SDF_API std::ostream & operator<< (std::ostream &out, const SdfUnregisteredValue &value)
 Writes the string representation of SdfUnregisteredValue to out. More...
 
SDF_API std::ostream & operator<< (std::ostream &, SdfValueBlock const &)
 
SDF_API std::ostream & operator<< (std::ostream &out, const SdfHumanReadableValue &hrval)
 
SDF_API size_t hash_value (const SdfHumanReadableValue &hrval)
 

Variables

SDF_API TfStaticData< const
Sdf_ValueTypeNamesType,
Sdf_ValueTypeNamesType::_Init > 
SdfValueTypeNames
 

Detailed Description

Basic Sdf data types.

Definition in file types.h.

Macro Definition Documentation

#define _SDF_ANGULAR_UNITS
Value:
((Degrees, "deg", 1.0)) \
((Radians, "rad", 57.2957795130823208768))

Definition at line 216 of file types.h.

#define _SDF_DECLARE_UNIT_ENUM (   r,
  unused,
  elem 
)
Value:
enum _SDF_UNITSLIST_ENUM(elem) { \
BOOST_PP_SEQ_FOR_EACH(_SDF_DECLARE_UNIT_ENUMERANT, \
_SDF_UNITSLIST_CATEGORY(elem), \
_SDF_UNITSLIST_TUPLES(elem)) \
};

Definition at line 242 of file types.h.

#define _SDF_DIMENSIONED_VALUE_TYPES
Value:
((Matrix2d, matrix2d, GfMatrix2d, (2,2) )) \
((Matrix3d, matrix3d, GfMatrix3d, (3,3) )) \
((Matrix4d, matrix4d, GfMatrix4d, (4,4) )) \
((Quath, quath, GfQuath, (4) )) \
((Quatf, quatf, GfQuatf, (4) )) \
((Quatd, quatd, GfQuatd, (4) )) \
((Int2, int2, GfVec2i, (2) )) \
((Half2, half2, GfVec2h, (2) )) \
((Float2, float2, GfVec2f, (2) )) \
((Double2, double2, GfVec2d, (2) )) \
((Int3, int3, GfVec3i, (3) )) \
((Half3, half3, GfVec3h, (3) )) \
((Float3, float3, GfVec3f, (3) )) \
((Double3, double3, GfVec3d, (3) )) \
((Int4, int4, GfVec4i, (4) )) \
((Half4, half4, GfVec4h, (4) )) \
((Float4, float4, GfVec4f, (4) )) \
((Double4, double4, GfVec4d, (4) ))
Basic type: a quaternion, a complex number with a real coefficient and three imaginary coefficients...
Definition: quath.h:61
Basic type for a vector of 4 int components.
Definition: vec4i.h:61
Basic type for a vector of 2 int components.
Definition: vec2i.h:61
Basic type for a vector of 3 float components.
Definition: vec3f.h:63
Basic type for a vector of 4 double components.
Definition: vec4d.h:63
Basic type: a quaternion, a complex number with a real coefficient and three imaginary coefficients...
Definition: quatf.h:60
Basic type for a vector of 2 double components.
Definition: vec2d.h:63
Basic type for a vector of 4 GfHalf components.
Definition: vec4h.h:64
Stores a 2x2 matrix of double elements.
Definition: matrix2d.h:62
Basic type for a vector of 2 GfHalf components.
Definition: vec2h.h:64
Stores a 4x4 matrix of double elements.
Definition: matrix4d.h:88
Basic type for a vector of 3 int components.
Definition: vec3i.h:61
Basic type for a vector of 4 float components.
Definition: vec4f.h:63
Basic type for a vector of 2 float components.
Definition: vec2f.h:63
Basic type for a vector of 3 double components.
Definition: vec3d.h:63
Stores a 3x3 matrix of double elements.
Definition: matrix3d.h:82
Basic type: a quaternion, a complex number with a real coefficient and three imaginary coefficients...
Definition: quatd.h:60
Basic type for a vector of 3 GfHalf components.
Definition: vec3h.h:64

Definition at line 351 of file types.h.

#define _SDF_DIMENSIONLESS_UNITS
Value:
((Percent, "%", 0.01)) \
((Default, "default", 1.0))

Definition at line 220 of file types.h.

#define _SDF_LENGTH_UNITS
Value:
((Millimeter, "mm", 0.001)) \
((Centimeter, "cm", 0.01)) \
((Decimeter, "dm", 0.1)) \
((Meter, "m", 1.0)) \
((Kilometer, "km", 1000.0)) \
((Inch, "in", 0.0254)) \
((Foot, "ft", 0.3048)) \
((Yard, "yd", 0.9144)) \
((Mile, "mi", 1609.344))

Definition at line 205 of file types.h.

#define _SDF_SCALAR_VALUE_TYPES
Value:
((Bool, bool, bool, () )) \
((UChar, uchar, unsigned char, () )) \
((Int, int, int, () )) \
((UInt, uint, unsigned int, () )) \
((Int64, int64, int64_t, () )) \
((UInt64, uint64, uint64_t, () )) \
((Half, half, GfHalf, () )) \
((Float, float, float, () )) \
((Double, double, double, () )) \
((TimeCode, timecode, SdfTimeCode, () )) \
((String, string, std::string, () )) \
((Token, token, TfToken, () )) \
((Asset, asset, SdfAssetPath, () ))
pxr_half::half GfHalf
A 16-bit floating point data type.
Definition: half.h:42
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:89
Value type that represents a time code.
Definition: timeCode.h:44
Contains an asset path and an optional resolved path.
Definition: assetPath.h:43

Definition at line 336 of file types.h.

#define _SDF_UNITS
Value:
((Length, _SDF_LENGTH_UNITS), \
((Angular, _SDF_ANGULAR_UNITS), \
((Dimensionless, _SDF_DIMENSIONLESS_UNITS), \
BOOST_PP_NIL)))

Definition at line 224 of file types.h.

#define _SDF_UNITSLIST_ENUM (   elem)
Value:
BOOST_PP_CAT(BOOST_PP_CAT(Sdf, \
_SDF_UNITSLIST_CATEGORY(elem)), Unit)

Definition at line 236 of file types.h.

#define SDF_DECLARE_VALUE_TYPE_TRAITS (   r,
  unused,
  elem 
)
Value:
template <> \
struct SdfValueTypeTraits<SDF_VALUE_CPP_TYPE(elem)> { \
static const bool IsValueType = true; \
}; \
template <> \
struct SdfValueTypeTraits<SDF_VALUE_CPP_ARRAY_TYPE(elem)> { \
static const bool IsValueType = true; \
};

Definition at line 389 of file types.h.

#define SDF_VALUE_ROLE_NAME_TOKENS
Value:
(Point) \
(Normal) \
(Vector) \
(Color) \
(Frame) \
(Transform) \
(PointIndex) \
(EdgeIndex) \
(FaceIndex) \
(TextureCoordinate)

Definition at line 401 of file types.h.

Typedef Documentation

typedef std::map<std::string, VtValue> SdfMapperParametersMap

A map of mapper parameter names to parameter values.

Definition at line 265 of file types.h.

typedef std::map<SdfPath, SdfPath> SdfRelocatesMap

A map of source SdfPaths to target SdfPaths for relocation.

Definition at line 277 of file types.h.

typedef std::map<double, VtValue> SdfTimeSampleMap

A map from sample times to sample values.

Definition at line 280 of file types.h.

typedef std::map<std::string, std::string> SdfVariantSelectionMap

A map of reference variant set names to variants in those sets.

Definition at line 268 of file types.h.

typedef std::map<std::string, std::vector<std::string> > SdfVariantsMap

A map of variant set names to list of variants in those sets.

Definition at line 271 of file types.h.

Enumeration Type Documentation

An enum that defines permission levels.

Permissions control which layers may refer to or express opinions about a prim. Opinions expressed about a prim, or relationships to that prim, by layers that are not allowed permission to access the prim will be ignored.

SdfPermission:

  • SdfPermissionPublic. Public prims can be referred to by anything. (Available to any client.)
  • SdfPermissionPrivate. Private prims can be referred to only within the local layer stack, and not across references or inherits. (Not available to clients.)
  • SdfNumPermission. Internal sentinel value.

Definition at line 155 of file types.h.

An enum that identifies the possible specifiers for an SdfPrimSpec.

The SdfSpecifier enum is registered as a TfEnum for converting to and from std::string.

SdfSpecifier:

  • SdfSpecifierDef. Defines a concrete prim.
  • SdfSpecifierOver. Overrides an existing prim.
  • SdfSpecifierClass. Defines an abstract prim.
  • SdfNumSpecifiers. The number of specifiers.

Definition at line 123 of file types.h.

An enum that specifies the type of an object.

Objects are entities that have fields and are addressable by path.

Definition at line 91 of file types.h.

An enum that identifies variability types for attributes.

Variability indicates whether the attribute may vary over time and value coordinates, and if its value comes through authoring or or from its owner.

SdfVariability:

  • SdfVariabilityVarying. Varying attributes may be directly authored, animated and affected on by Actions. They are the most flexible.
  • SdfVariabilityUniform. Uniform attributes may be authored only with non-animated values (default values). They cannot be affected by Actions, but they can be connected to other Uniform attributes.
  • SdfVariabilityConfig. Config attributes are the same as Uniform except that a Prim can choose to alter its collection of built-in properties based on the values of its Config attributes.
  • SdNumVariabilities. Internal sentinel value.

Definition at line 182 of file types.h.

Function Documentation

SDF_API std::ostream& operator<< ( std::ostream &  out,
const SdfSpecifier spec 
)

Writes the string representation of SdfSpecifier to out.

SDF_API std::ostream& operator<< ( std::ostream &  out,
const SdfRelocatesMap reloMap 
)

Writes the string representation of SdfRelocatesMap to out.

SDF_API std::ostream& operator<< ( std::ostream &  out,
const SdfTimeSampleMap sampleMap 
)

Writes the string representation of SdfTimeSampleMap to out.

SDF_API std::ostream& operator<< ( std::ostream &  out,
const SdfUnregisteredValue value 
)

Writes the string representation of SdfUnregisteredValue to out.

SDF_API bool SdfBoolFromString ( const std::string &  ,
bool *  parseOk = NULL 
)

Converts a string to a bool.

Accepts case insensitive "yes", "no", "false", true", "0", "1". Defaults to "true" if the string is not recognized.

If parseOK is supplied, the pointed-to bool will be set to indicate whether the parse was successful.

SDF_API double SdfConvertUnit ( const TfEnum fromUnit,
const TfEnum toUnit 
)

Converts from one unit of measure to another.

The fromUnit and toUnit units must be of the same type (for example, both of type SdfLengthUnit).

SDF_API TfEnum SdfDefaultUnit ( TfToken const &  typeName)

Gets the show default unit for the given /a typeName.

SDF_API const TfEnum& SdfDefaultUnit ( const TfEnum unit)

Gets the show default unit for the given /a unit.

SDF_API const std::string& SdfGetNameForUnit ( const TfEnum unit)

Gets the name for a given /a unit.

SDF_API TfToken SdfGetRoleNameForValueTypeName ( TfToken const &  typeName)

Return role name for typeName.

Return empty token if typeName has no associated role name.

SDF_API TfType SdfGetTypeForValueTypeName ( TfToken const &  name)

Given an sdf valueType name, produce TfType if the type name specifies a valid sdf value type.

SDF_API const TfEnum& SdfGetUnitFromName ( const std::string &  name)

Gets a unit for the given /a name.

SDF_API SdfValueTypeName SdfGetValueTypeNameForValue ( VtValue const &  value)

Given a value, produce the sdf valueType name.

If you provide a value that does not return true for SdfValueHasValidType, the return value is unspecified.

bool SdfIsDefiningSpecifier ( SdfSpecifier  spec)
inline

Returns true if the specifier defines a prim.

Definition at line 133 of file types.h.

SDF_API const std::string& SdfUnitCategory ( const TfEnum unit)

Gets the unit category for a given /a unit.

SDF_API bool SdfValueHasValidType ( VtValue const &  value)

Given a value, returns if there is a valid corresponding valueType.