24 #ifndef PXR_USD_USD_PRIM_DEFINITION_H 25 #define PXR_USD_USD_PRIM_DEFINITION_H 28 #include "pxr/usd/usd/api.h" 29 #include "pxr/usd/usd/schemaRegistry.h" 37 #include <unordered_map> 39 PXR_NAMESPACE_OPEN_SCOPE
59 return _appliedAPISchemas;
68 return _GetSchematics()->GetSpecType(*path);
70 return SdfSpecTypeUnknown;
79 return _GetSchematics()->GetPropertyAtPath(*path);
90 return _GetSchematics()->GetAttributeAtPath(*path);
101 return _GetSchematics()->GetRelationshipAtPath(*path);
114 return _HasField(attrName, SdfFieldKeys->Default, value);
121 return _ListMetadataFields(
TfToken());
136 return _HasField(
TfToken(), key, value);
149 const TfToken &keyPath, T* value)
const 154 return _HasFieldDictKey(
TfToken(), key, keyPath, value);
184 return _HasField(propName, key, value);
198 const TfToken &keyPath, T* value)
const 203 return _HasFieldDictKey(propName, key, keyPath, value);
235 bool FlattenTo(
const SdfLayerHandle &layer,
237 SdfSpecifier newSpecSpecifier = SdfSpecifierOver)
const;
246 SdfSpecifier newSpecSpecifier = SdfSpecifierOver)
const;
253 SdfSpecifier newSpecSpecifier = SdfSpecifierOver)
const;
274 primDef._HasField(propName, fieldName, value) :
275 primDef._HasFieldDictKey(propName, fieldName, keyPath, value);
282 bool _HasField(
const TfToken& propName,
287 return _GetSchematics()->HasField(*path, fieldName, value);
293 bool _HasFieldDictKey(
const TfToken& propName,
299 return _GetSchematics()->HasFieldDictKey(
300 *path, fieldName, keyPath, value);
314 return UsdSchemaRegistry::GetInstance()._schematics;
322 void _ComposePropertiesFromPrimSpec(
324 const SdfPath &weakerPrimSpecPath,
325 const std::string &instanceName =
"");
328 void _ComposePropertiesFromPrimDef(
330 bool useWeakerPropertyForTypeConflict,
331 const std::string &instanceName =
"");
338 using _PrimTypePropNameToPathMap =
339 std::unordered_map<TfToken, SdfPath, TfToken::HashFunctor>;
340 _PrimTypePropNameToPathMap _propPathMap;
347 PXR_NAMESPACE_CLOSE_SCOPE
349 #endif //PXR_USD_USD_PRIM_DEFINITION_H bool IsEmpty() const
Returns true iff this token contains the empty string "".
const TfTokenVector & GetPropertyNames() const
Return the list of names of builtin properties for this prim definition.
SdfSpecType GetSpecType(const TfToken &propName) const
Return the SdfSpecType for propName if it is a builtin property of the prim type represented by this ...
TfTokenVector ListPropertyMetadataFields(const TfToken &propName) const
Returns the list of names of metadata fields that are defined by this prim definition for property pr...
SdfPropertySpecHandle GetSchemaPropertySpec(const TfToken &propName) const
Return the property spec that defines the fallback for the property named propName on prims of this p...
bool GetPropertyMetadataByDictKey(const TfToken &propName, const TfToken &key, const TfToken &keyPath, T *value) const
Retrieves the value at keyPath from the fallback dictionary value for the dictionary metadata field n...
SdfRelationshipSpecHandle GetSchemaRelationshipSpec(const TfToken &relName) const
This is a convenience method.
USD_API std::string GetPropertyDocumentation(const TfToken &propName) const
Returns the documentation metadata defined by the prim definition for the property named propName if ...
Token for efficient comparison, assignment, and hashing of known strings.
const TfTokenVector & GetAppliedAPISchemas() const
Return the list of names of the API schemas that have been applied to this prim definition in order.
USD_API std::string GetDocumentation() const
Returns the documentation metadata defined by the prim definition for the prim itself.
USD_API bool FlattenTo(const SdfLayerHandle &layer, const SdfPath &path, SdfSpecifier newSpecSpecifier=SdfSpecifierOver) const
Copies the contents of this prim definition to a prim spec on the given layer at the given path.
bool GetPropertyMetadata(const TfToken &propName, const TfToken &key, T *value) const
Retrieves the fallback value for the metadata field named key, that is defined by this prim definitio...
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
SdfSpecifier
An enum that identifies the possible specifiers for an SdfPrimSpec.
std::vector< TfToken > TfTokenVector
Convenience types.
A path value used to locate objects in layers or scenegraphs.
bool GetMetadataByDictKey(const TfToken &key, const TfToken &keyPath, T *value) const
Retrieves the value at keyPath from the fallback dictionary value for the dictionary metadata field n...
bool GetMetadata(const TfToken &key, T *value) const
Retrieves the fallback value for the metadata field named key, that is defined by this prim definitio...
static USD_API bool IsDisallowedField(const TfToken &fieldName)
Returns true if the field fieldName cannot have fallback values specified in schemas.
SdfSpecType
An enum that specifies the type of an object.
SdfAttributeSpecHandle GetSchemaAttributeSpec(const TfToken &attrName) const
This is a convenience method.
Class representing the builtin definition of a prim given the schemas registered in the schema regist...
Container::mapped_type * TfMapLookupPtr(Container &map, Key const &key)
Checks if an item exists in a map or TfHashMap, without copying it.
TfTokenVector ListMetadataFields() const
Returns the list of names of metadata fields that are defined by this prim definition for the prim it...
Singleton registry that provides access to schema type information and the prim definitions for regis...
bool GetAttributeFallbackValue(const TfToken &attrName, T *value) const
Retrieves the fallback value for the attribute named attrName and stores it in value if possible.