7 #ifndef PXR_USD_USD_PRIM_DEFINITION_H
8 #define PXR_USD_USD_PRIM_DEFINITION_H
20 #include <unordered_map>
42 return _appliedAPISchemas;
73 explicit operator bool()
const
181 explicit operator bool()
const {
247 explicit operator bool()
const{
285 const TfToken& propName)
const;
294 const TfToken& attrName)
const;
313 return _HasField(attrName, SdfFieldKeys->Default, value);
333 return _HasField(
TfToken(), key, value);
351 return _HasFieldDictKey(
TfToken(), key, keyPath, value);
376 return prop.GetMetadata(key, value);
395 return prop.GetMetadataByDictKey(key, keyPath, value);
467 primDef._HasField(propName, fieldName, value) :
468 primDef._HasFieldDictKey(propName, fieldName, keyPath, value);
473 struct _LayerAndPath {
485 return layer->HasField(
path, fieldName, value);
489 bool HasFieldDictKey(
491 return layer->HasFieldDictKey(
path, fieldName, keyPath, value);
494 explicit operator bool() const noexcept {
503 bool _HasField(
const TfToken& propName,
507 if (
const _LayerAndPath *layerAndPath =
508 _GetPropertyLayerAndPath(propName)) {
509 return layerAndPath->HasField(fieldName, value);
515 bool _HasFieldDictKey(
const TfToken& propName,
520 if (
const _LayerAndPath *layerAndPath =
521 _GetPropertyLayerAndPath(propName)) {
522 return layerAndPath->HasFieldDictKey(fieldName, keyPath, value);
531 void _IntializeForTypedSchema(
532 const SdfLayerHandle &schematicsLayer,
533 const SdfPath &schematicsPrimPath,
534 const VtTokenArray &propertiesToIgnore);
537 void _IntializeForAPISchema(
539 const SdfLayerHandle &schematicsLayer,
540 const SdfPath &schematicsPrimPath,
541 const VtTokenArray &propertiesToIgnore);
544 bool _MapSchematicsPropertyPaths(
545 const VtTokenArray &propertiesToIgnore);
548 const _LayerAndPath *_GetPropertyLayerAndPath(
const TfToken& propName)
const
553 _LayerAndPath *_GetPropertyLayerAndPath(
const TfToken& propName)
559 void _ComposePropertiesFromPrimDef(
562 void _ComposePropertiesFromPrimDefInstance(
564 const std::string &instanceName);
566 void _AddOrComposeProperty(
568 const _LayerAndPath &layerAndPath);
570 SdfSpecHandle _FindOrCreateSpecForComposition(
572 const _LayerAndPath &srcLayerAndPath);
574 SdfSpecHandle _CreateComposedPrimOrPropertyIfNeeded(
576 const _LayerAndPath &strongProp,
577 const _LayerAndPath &weakProp);
580 void _ComposeOverAndReplaceExistingProperty(
585 using _FamilyAndInstanceToVersionMap =
589 bool _ComposeWeakerAPIPrimDefinition(
592 _FamilyAndInstanceToVersionMap *alreadyAppliedSchemaFamilyVersions);
594 static bool _PropertyTypesMatch(
599 _LayerAndPath _primLayerAndPath;
603 using _PrimTypePropNameToPathMap =
604 std::unordered_map<TfToken, _LayerAndPath, TfToken::HashFunctor>;
605 _PrimTypePropNameToPathMap _propLayerAndPathMap;
635 return _layerAndPath->HasFieldDictKey(key, keyPath, value);
642 return _layerAndPath->HasField(SdfFieldKeys->Default, value);
648 #endif //PXR_USD_USD_PRIM_DEFINITION_H
USD_API Attribute GetAttributeDefinition(const TfToken &attrName) const
USD_API SdfAttributeSpecHandle GetSchemaAttributeSpec(const TfToken &attrName) const
USD_API TfTokenVector ListPropertyMetadataFields(const TfToken &propName) const
bool GetMetadataByDictKey(const TfToken &key, const TfToken &keyPath, T *value) const
USD_API Relationship GetRelationshipDefinition(const TfToken &relName) const
USD_API SdfValueTypeName GetTypeName() const
GLsizei const GLfloat * value
USD_API const TfToken & GetName() const
USD_API SdfSpecType GetSpecType(const TfToken &propName) const
GLsizei const GLchar *const * path
USD_API SdfVariability GetVariability() const
Returns the variability of this property in the prim definition.
bool GetFallbackValue(T *value) const
~UsdPrimDefinition()=default
const TfTokenVector & GetAppliedAPISchemas() const
USD_API std::string GetDocumentation() const
USD_API bool IsAttribute() const
friend bool Usd_GetFallbackValue(const UsdPrimDefinition &primDef, const TfToken &propName, const TfToken &fieldName, const TfToken &keyPath, T *value)
USD_API TfTokenVector ListMetadataFields() const
bool GetPropertyMetadataByDictKey(const TfToken &propName, const TfToken &key, const TfToken &keyPath, T *value) const
GLenum GLuint GLint GLint layer
unsigned int UsdSchemaVersion
Schema versions are specified as a single unsigned integer value.
Property()=default
Default constructor returns an invalid property.
USD_API Property GetPropertyDefinition(const TfToken &propName) const
bool GetPropertyMetadata(const TfToken &propName, const TfToken &key, T *value) const
Property(const _LayerAndPath *layerAndPath)
USD_API std::string GetPropertyDocumentation(const TfToken &propName) const
const _LayerAndPath * _layerAndPath
Container::mapped_type * TfMapLookupPtr(Container &map, Key const &key)
USD_API std::string GetDocumentation() const
bool GetAttributeFallbackValue(const TfToken &attrName, T *value) const
std::vector< TfToken > TfTokenVector
Convenience types.
USD_API TfToken GetTypeNameToken() const
GLuint const GLchar * name
USD_API SdfSpecType GetSpecType() const
Returns the spec type of this property in the prim definition.
USD_API TfTokenVector ListMetadataFields() const
Relationship()=default
Default constructor returns an invalid relationship.
bool GetMetadataByDictKey(const TfToken &key, const TfToken &keyPath, T *value) const
static USD_API bool IsDisallowedField(const TfToken &fieldName)
const TfTokenVector & GetPropertyNames() const
Return the list of names of builtin properties for this prim definition.
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Attribute()=default
Default constructor returns an invalid attribute.
USD_API SdfRelationshipSpecHandle GetSchemaRelationshipSpec(const TfToken &relName) const
#define PXR_NAMESPACE_CLOSE_SCOPE
bool GetMetadata(const TfToken &key, T *value) const
Property(const TfToken &name, const _LayerAndPath *layerAndPath)
bool GetMetadata(const TfToken &key, T *value) const
USD_API bool FlattenTo(const SdfLayerHandle &layer, const SdfPath &path, SdfSpecifier newSpecSpecifier=SdfSpecifierOver) const
USD_API SdfPropertySpecHandle GetSchemaPropertySpec(const TfToken &propName) const
USD_API bool IsRelationship() const
bool IsEmpty() const
Returns true iff this token contains the empty string "".