All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
registry.h
Go to the documentation of this file.
1//
2// Copyright 2018 Pixar
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://openusd.org/license.
6//
7
8#ifndef PXR_USD_SDR_REGISTRY_H
9#define PXR_USD_SDR_REGISTRY_H
10
12
13#include "pxr/pxr.h"
15#include "pxr/usd/sdr/api.h"
17#include "pxr/usd/sdr/declare.h"
19
20PXR_NAMESPACE_OPEN_SCOPE
21
27{
28public:
30 SDR_API
32
35 SDR_API
36 SdrShaderNodeConstPtr GetShaderNodeByIdentifier(
37 const NdrIdentifier& identifier,
38 const NdrTokenVec& typePriority = NdrTokenVec());
39
42 SDR_API
43 SdrShaderNodeConstPtr GetShaderNodeByIdentifierAndType(
44 const NdrIdentifier& identifier,
45 const TfToken& nodeType);
46
49 SDR_API
50 SdrShaderNodeConstPtr GetShaderNodeByName(
51 const std::string& name,
52 const NdrTokenVec& typePriority = NdrTokenVec(),
53 NdrVersionFilter filter = NdrVersionFilterDefaultOnly);
54
57 SDR_API
58 SdrShaderNodeConstPtr GetShaderNodeByNameAndType(
59 const std::string& name,
60 const TfToken& nodeType,
61 NdrVersionFilter filter = NdrVersionFilterDefaultOnly);
62
65 SDR_API
66 SdrShaderNodeConstPtr GetShaderNodeFromAsset(
67 const SdfAssetPath &shaderAsset,
68 const NdrTokenMap &metadata=NdrTokenMap(),
69 const TfToken &subIdentifier=TfToken(),
70 const TfToken &sourceType=TfToken());
71
74 SDR_API
75 SdrShaderNodeConstPtr GetShaderNodeFromSourceCode(
76 const std::string &sourceCode,
77 const TfToken &sourceType,
78 const NdrTokenMap &metadata=NdrTokenMap());
79
82 SDR_API
83 SdrShaderNodePtrVec GetShaderNodesByIdentifier(const NdrIdentifier& identifier);
84
87 SDR_API
88 SdrShaderNodePtrVec GetShaderNodesByName(
89 const std::string& name,
90 NdrVersionFilter filter = NdrVersionFilterDefaultOnly);
91
94 SDR_API
95 SdrShaderNodePtrVec GetShaderNodesByFamily(
96 const TfToken& family = TfToken(),
97 NdrVersionFilter filter = NdrVersionFilterDefaultOnly);
98
99protected:
100 // Allow TF to construct the class
101 friend class TfSingleton<SdrRegistry>;
102
103 SdrRegistry();
104 ~SdrRegistry();
105};
106
107PXR_NAMESPACE_CLOSE_SCOPE
108
109#endif // PXR_USD_SDR_REGISTRY_H
The registry provides access to node information.
Definition: registry.h:48
Contains an asset path and an optional resolved path.
Definition: assetPath.h:30
The shading-specialized version of NdrRegistry.
Definition: registry.h:27
SDR_API SdrShaderNodePtrVec GetShaderNodesByIdentifier(const NdrIdentifier &identifier)
Exactly like NdrRegistry::GetNodesByIdentifier(), but returns a vector of SdrShaderNode pointers inst...
SDR_API SdrShaderNodePtrVec GetShaderNodesByName(const std::string &name, NdrVersionFilter filter=NdrVersionFilterDefaultOnly)
Exactly like NdrRegistry::GetNodesByName(), but returns a vector of SdrShaderNode pointers instead of...
SDR_API SdrShaderNodeConstPtr GetShaderNodeByIdentifier(const NdrIdentifier &identifier, const NdrTokenVec &typePriority=NdrTokenVec())
Exactly like NdrRegistry::GetNodeByIdentifier(), but returns a SdrShaderNode pointer instead of a Ndr...
SDR_API SdrShaderNodeConstPtr GetShaderNodeFromSourceCode(const std::string &sourceCode, const TfToken &sourceType, const NdrTokenMap &metadata=NdrTokenMap())
Wrapper method for NdrRegistry::GetNodeFromSourceCode().
static SDR_API SdrRegistry & GetInstance()
Get the single SdrRegistry instance.
SDR_API SdrShaderNodePtrVec GetShaderNodesByFamily(const TfToken &family=TfToken(), NdrVersionFilter filter=NdrVersionFilterDefaultOnly)
Exactly like NdrRegistry::GetNodesByFamily(), but returns a vector of SdrShaderNode pointers instead ...
SDR_API SdrShaderNodeConstPtr GetShaderNodeByIdentifierAndType(const NdrIdentifier &identifier, const TfToken &nodeType)
Exactly like NdrRegistry::GetNodeByIdentifierAndType(), but returns a SdrShaderNode pointer instead o...
SDR_API SdrShaderNodeConstPtr GetShaderNodeByName(const std::string &name, const NdrTokenVec &typePriority=NdrTokenVec(), NdrVersionFilter filter=NdrVersionFilterDefaultOnly)
Exactly like NdrRegistry::GetNodeByName(), but returns a SdrShaderNode pointer instead of a NdrNode p...
SDR_API SdrShaderNodeConstPtr GetShaderNodeByNameAndType(const std::string &name, const TfToken &nodeType, NdrVersionFilter filter=NdrVersionFilterDefaultOnly)
Exactly like NdrRegistry::GetNodeByNameAndType(), but returns a SdrShaderNode pointer instead of a Nd...
SDR_API SdrShaderNodeConstPtr GetShaderNodeFromAsset(const SdfAssetPath &shaderAsset, const NdrTokenMap &metadata=NdrTokenMap(), const TfToken &subIdentifier=TfToken(), const TfToken &sourceType=TfToken())
Wrapper method for NdrRegistry::GetNodeFromAsset().
Manage a single instance of an object (see.
Definition: singleton.h:105
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:71
Manage a single instance of an object.
NdrVersionFilter
Enumeration used to select nodes by version.
Definition: declare.h:185