24 #ifndef PXR_USD_USD_SCHEMA_REGISTRY_H
25 #define PXR_USD_USD_SCHEMA_REGISTRY_H
28 #include "pxr/usd/usd/api.h"
36 #include "pxr/base/tf/hashmap.h"
38 PXR_NAMESPACE_OPEN_SCOPE
78 template <
class SchemaType>
269 std::map<TfToken, TfTokenVector> *autoApplyAPISchemas);
275 const TfToken &multiApplyAPISchemaName)
const;
281 const TfToken &typeName)
const {
282 auto it = _concreteTypedPrimDefinitions.find(typeName);
283 return it != _concreteTypedPrimDefinitions.end() ? it->second :
nullptr;
290 const TfToken &typeName)
const {
291 auto it = _appliedAPIPrimDefinitions.find(typeName);
292 return it != _appliedAPIPrimDefinitions.end() ? it->second :
nullptr;
297 return _emptyPrimDefinition;
305 std::unique_ptr<UsdPrimDefinition>
321 return _fallbackPrimTypes;
329 void _FindAndAddPluginSchema();
331 void _ApplyAPISchemasToPrimDefinition(
338 _TypeNameToPrimDefinitionMap _concreteTypedPrimDefinitions;
339 _TypeNameToPrimDefinitionMap _appliedAPIPrimDefinitions;
342 TfHashMap<TfToken, TfToken, TfToken::HashFunctor>
343 _multipleApplyAPISchemaNamespaces;
356 void Usd_GetAPISchemaPluginApplyToInfoForType(
357 const TfType &apiSchemaType,
359 std::map<TfToken, TfTokenVector> *autoApplyAPISchemasMap,
360 TfHashMap<TfToken, TfTokenVector, TfHash> *canOnlyApplyAPISchemasMap,
361 TfHashMap<TfToken, TfToken::Set, TfHash> *allowedInstanceNamesMap);
363 PXR_NAMESPACE_CLOSE_SCOPE
365 #endif //PXR_USD_USD_SCHEMA_REGISTRY_H
static USD_API bool IsMultipleApplyAPISchema(const TfType &apiSchemaType)
Returns true if apiSchemaType is a multiple-apply API schema type.
Manage a single instance of an object.
static USD_API const TfTokenVector & GetAPISchemaCanOnlyApplyToTypeNames(const TfToken &apiSchemaName, const TfToken &instanceName=TfToken())
Returns a list of prim type names that the given apiSchemaName can only be applied to...
Manage a single instance of an object (see.
static USD_API TfToken GetAPISchemaTypeName(const TfType &schemaType)
Return the type name in the USD schema for API schema types only from the given registered schemaType...
A map with string keys and VtValue values.
Functor to use for hash maps from tokens to other things.
const VtDictionary & GetFallbackPrimTypes() const
Returns a dictionary mapping concrete schema prim type names to a VtTokenArray of fallback prim type ...
UsdSchemaKind
An enum representing which kind of schema a given schema class belongs to.
static USD_API bool IsAppliedAPISchema(const TfType &apiSchemaType)
Returns true if apiSchemaType is an applied API schema type.
static USD_API bool IsAllowedAPISchemaInstanceName(const TfToken &apiSchemaName, const TfToken &instanceName)
Returns true if the given instanceName is an allowed instance name for the multiple apply API schema ...
Token for efficient comparison, assignment, and hashing of known strings.
A subclass of SdfPropertySpec that holds typed data.
static USD_API std::pair< TfToken, TfToken > GetTypeNameAndInstance(const TfToken &apiSchemaName)
Returns the schema type name and the instance name parsed from the given apiSchemaName.
USD_API TfToken GetPropertyNamespacePrefix(const TfToken &multiApplyAPISchemaName) const
Returns the namespace prefix that is prepended to all properties of the given multiApplyAPISchemaName...
static USD_API UsdSchemaKind GetSchemaKind(const TfType &schemaType)
Returns the kind of the schema the given schemaType represents.
USD_API std::unique_ptr< UsdPrimDefinition > BuildComposedPrimDefinition(const TfToken &primType, const TfTokenVector &appliedAPISchemas) const
Composes and returns a new UsdPrimDefinition from the given primType and list of appliedSchemas.
static USD_API void CollectAddtionalAutoApplyAPISchemasFromPlugins(std::map< TfToken, TfTokenVector > *autoApplyAPISchemas)
Collects all the additional auto apply schemas that can be defined in a plugin through "AutoApplyAPIS...
std::vector< TfToken > TfTokenVector
Convenience types.
static T & GetInstance()
Return a reference to an object of type T, creating it if necessary.
static USD_API TfType GetTypeFromSchemaTypeName(const TfToken &typeName)
Return the TfType of the schema corresponding to the given prim or API schema name typeName...
static USD_API bool IsDisallowedField(const TfToken &fieldName)
Returns true if the field fieldName cannot have fallback values specified in schemas.
A property that contains a reference to one or more SdfPrimSpec instances.
static USD_API bool IsConcrete(const TfType &primType)
Returns true if the prim type primType is instantiable in scene description.
static USD_API TfType GetConcreteTypeFromSchemaTypeName(const TfToken &typeName)
Return the TfType of the schema corresponding to the given concrete prim type name typeName...
Class representing the builtin definition of a prim given the schemas registered in the schema regist...
static USD_API TfType GetAPITypeFromSchemaTypeName(const TfToken &typeName)
Return the TfType of the schema corresponding to the given API schema type name typeName.
static TfToken GetSchemaTypeName()
Return the type name in the USD schema for prims or API schemas of the given registered SchemaType...
static USD_API bool IsTyped(const TfType &primType)
Returns true if the prim type primType inherits from UsdTyped.
static USD_API TfType GetTypeFromName(const TfToken &typeName)
Finds the TfType of a schema with typeName.
TfType represents a dynamic runtime type.
static USD_API const std::map< TfToken, TfTokenVector > & GetAutoApplyAPISchemas()
Returns a map of the names of all registered auto apply API schemas to the list of type names each is...
Singleton registry that provides access to schema type information and the prim definitions for regis...
const UsdPrimDefinition * FindAppliedAPIPrimDefinition(const TfToken &typeName) const
Finds the prim definition for the given typeName token if typeName is a registered applied API schema...
static USD_API TfToken GetConcreteSchemaTypeName(const TfType &schemaType)
Return the type name in the USD schema for concrete prim types only from the given registered schemaT...
const UsdPrimDefinition * GetEmptyPrimDefinition() const
Returns the empty prim definition.
Enable a concrete base class for use with TfWeakPtr.
const UsdPrimDefinition * FindConcretePrimDefinition(const TfToken &typeName) const
Finds the prim definition for the given typeName token if typeName is a registered concrete typed sch...