HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
nodeDiscoveryResult.h
Go to the documentation of this file.
1 //
2 // Copyright 2018 Pixar
3 //
4 // Licensed under the Apache License, Version 2.0 (the "Apache License")
5 // with the following modification; you may not use this file except in
6 // compliance with the Apache License and the following modification to it:
7 // Section 6. Trademarks. is deleted and replaced with:
8 //
9 // 6. Trademarks. This License does not grant permission to use the trade
10 // names, trademarks, service marks, or product names of the Licensor
11 // and its affiliates, except as required to comply with Section 4(c) of
12 // the License and to reproduce the content of the NOTICE file.
13 //
14 // You may obtain a copy of the Apache License at
15 //
16 // http://www.apache.org/licenses/LICENSE-2.0
17 //
18 // Unless required by applicable law or agreed to in writing, software
19 // distributed under the Apache License with the above modification is
20 // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21 // KIND, either express or implied. See the Apache License for the specific
22 // language governing permissions and limitations under the Apache License.
23 //
24 
25 #ifndef PXR_USD_NDR_NODE_DISCOVERY_RESULT_H
26 #define PXR_USD_NDR_NODE_DISCOVERY_RESULT_H
27 
28 #include "pxr/usd/ndr/declare.h"
29 
31 
32 /// Represents the raw data of a node, and some other bits of metadata, that
33 /// were determined via a `NdrDiscoveryPlugin`.
35  /// Constructor.
38  const NdrVersion& version,
39  const std::string& name,
40  const TfToken& family,
41  const TfToken& discoveryType,
42  const TfToken& sourceType,
43  const std::string& uri,
44  const std::string& resolvedUri,
49  ) : identifier(identifier),
50  version(version),
51  name(name),
52  family(family),
53  discoveryType(discoveryType),
54  sourceType(sourceType),
55  uri(uri),
56  resolvedUri(resolvedUri),
61  { }
62 
63  /// The node's identifier.
64  ///
65  /// How the node is identified. In many cases this will be the
66  /// name of the file or resource that this node originated from.
67  /// E.g. "mix_float_2_1". The identifier must be unique for a
68  /// given sourceType.
70 
71  /// The node's version. This may or may not be embedded in the
72  /// identifier, it's up to implementations. E.g a node with
73  /// identifier "mix_float_2_1" might have version 2.1.
75 
76  /// The node's name.
77  ///
78  /// A version independent identifier for the node type. This will
79  /// often embed type parameterization but should not embed the
80  /// version. E.g a node with identifier "mix_float_2_1" might have
81  /// name "mix_float".
83 
84  /// The node's family.
85  ///
86  /// A node's family is an optional piece of metadata that specifies a
87  /// generic grouping of nodes. E.g a node with identifier
88  /// "mix_float_2_1" might have family "mix".
90 
91  /// The node's discovery type.
92  ///
93  /// The type could be the file extension, or some other type of metadata
94  /// that can signify a type prior to parsing. See the documentation for
95  /// `NdrParserPlugin` and `NdrParserPlugin::DiscoveryTypes` for more
96  /// information on how this value is used.
98 
99  /// The node's source type.
100  ///
101  /// This type is unique to the parsing plugin
102  /// (`NdrParserPlugin::SourceType`), and determines the source of the node.
103  /// See `NdrNode::GetSourceType()` for more information.
105 
106  /// The node's origin.
107  ///
108  /// This may be a filesystem path, a URL pointing to a resource in the
109  /// cloud, or some other type of resource identifier.
111 
112  /// The node's fully-resolved URI.
113  ///
114  /// For example, this might be an absolute path when the original URI was
115  /// a relative path. In most cases, this is the path that `Ar`'s
116  /// `Resolve()` returns. In any case, this path should be locally
117  /// accessible.
119 
120  /// The node's entire source code.
121  ///
122  /// The source code is parsed (if non-empty) by parser plugins when the
123  /// resolvedUri value is empty.
125 
126  /// The node's metadata collected during the discovery process.
127  ///
128  /// Additional metadata may be present in the node's source, in the asset
129  /// pointed to by resolvedUri or in sourceCode (if resolvedUri is empty).
130  /// In general, parsers should override this data with metadata from the
131  /// shader source.
133 
134  /// An optional detail for the parser plugin. The parser plugin
135  /// defines the meaning of this data so the discovery plugin must
136  /// be written to match.
138 
139  /// The subIdentifier is associated with a particular asset and refers to a
140  /// specific definition within the asset. The asset is the one referred to
141  /// by `NdrRegistry::GetNodeFromAsset()`. The subIdentifier is not needed
142  /// for all cases where the node definition is not associated with an asset.
143  /// Even if the node definition is associated with an asset, the
144  /// subIdentifier is only needed if the asset specifies multiple definitions
145  /// rather than a single definition.
147 };
148 
149 typedef std::vector<NdrNodeDiscoveryResult> NdrNodeDiscoveryResultVec;
150 
152 
153 #endif // PXR_USD_NDR_NODE_DISCOVERY_RESULT_H
GLsizei const GLchar *const * string
Definition: glcorearb.h:814
std::vector< NdrNodeDiscoveryResult > NdrNodeDiscoveryResultVec
Definition: token.h:87
GLuint const GLchar * name
Definition: glcorearb.h:786
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1432
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
std::unordered_map< TfToken, std::string, TfToken::HashFunctor > NdrTokenMap
Definition: declare.h:61
NdrNodeDiscoveryResult(const NdrIdentifier &identifier, const NdrVersion &version, const std::string &name, const TfToken &family, const TfToken &discoveryType, const TfToken &sourceType, const std::string &uri, const std::string &resolvedUri, const std::string &sourceCode=std::string(), const NdrTokenMap &metadata=NdrTokenMap(), const std::string &blindData=std::string(), const TfToken &subIdentifier=TfToken())
Constructor.