modelSchema.h
Go to the documentation of this file.
1 //
2 // Copyright 2023 Pixar
3 //
4 // Licensed under the terms set forth in the LICENSE.txt file available at
5 // https://openusd.org/license.
6 //
8 
9 /* ************************************************************************** */
10 /* ** ** */
11 /* ** This file is generated by a script. ** */
12 /* ** ** */
13 /* ** Do not edit it directly (unless it is within a CUSTOM CODE section)! ** */
14 /* ** Edit hdSchemaDefs.py instead to make changes. ** */
15 /* ** ** */
16 /* ************************************************************************** */
17 
18 #ifndef PXR_USD_IMAGING_USD_IMAGING_MODEL_SCHEMA_H
19 #define PXR_USD_IMAGING_USD_IMAGING_MODEL_SCHEMA_H
20 
22 
23 #include "pxr/usdImaging/usdImaging/api.h"
24 
25 #include "pxr/imaging/hd/schema.h"
26 
27 // --(BEGIN CUSTOM CODE: Includes)--
28 // --(END CUSTOM CODE: Includes)--
29 
30 PXR_NAMESPACE_OPEN_SCOPE
31 
32 // --(BEGIN CUSTOM CODE: Declares)--
33 // --(END CUSTOM CODE: Declares)--
34 
35 #define USD_IMAGING_MODEL_SCHEMA_TOKENS \
36  (model) \
37  (modelPath) \
38  (assetIdentifier) \
39  (assetName) \
40  (assetVersion) \
41  ((modelPathPrimvarName, "model:modelPath")) \
42 
43 TF_DECLARE_PUBLIC_TOKENS(UsdImagingModelSchemaTokens, USDIMAGING_API,
44  USD_IMAGING_MODEL_SCHEMA_TOKENS);
45 
46 //-----------------------------------------------------------------------------
47 
48 
51 class UsdImagingModelSchema : public HdSchema
52 {
53 public:
56 
57  UsdImagingModelSchema(HdContainerDataSourceHandle container)
58  : HdSchema(container) {}
59 
65  USDIMAGING_API
66  static UsdImagingModelSchema GetFromParent(
67  const HdContainerDataSourceHandle &fromParentContainer);
68 
70 
71 // --(BEGIN CUSTOM CODE: Schema Methods)--
72 // --(END CUSTOM CODE: Schema Methods)--
73 
76 
77  USDIMAGING_API
78  HdPathDataSourceHandle GetModelPath() const;
79 
80  USDIMAGING_API
81  HdAssetPathDataSourceHandle GetAssetIdentifier() const;
82 
83  USDIMAGING_API
84  HdStringDataSourceHandle GetAssetName() const;
85 
86  USDIMAGING_API
87  HdStringDataSourceHandle GetAssetVersion() const;
88 
90 
93 
96  USDIMAGING_API
97  static const TfToken &GetSchemaToken();
98 
101  USDIMAGING_API
102  static const HdDataSourceLocator &GetDefaultLocator();
103 
105 
108 
116  USDIMAGING_API
117  static HdContainerDataSourceHandle
118  BuildRetained(
119  const HdPathDataSourceHandle &modelPath,
120  const HdAssetPathDataSourceHandle &assetIdentifier,
121  const HdStringDataSourceHandle &assetName,
122  const HdStringDataSourceHandle &assetVersion
123  );
124 
131  class Builder
132  {
133  public:
134  USDIMAGING_API
135  Builder &SetModelPath(
136  const HdPathDataSourceHandle &modelPath);
137  USDIMAGING_API
138  Builder &SetAssetIdentifier(
139  const HdAssetPathDataSourceHandle &assetIdentifier);
140  USDIMAGING_API
141  Builder &SetAssetName(
142  const HdStringDataSourceHandle &assetName);
143  USDIMAGING_API
144  Builder &SetAssetVersion(
145  const HdStringDataSourceHandle &assetVersion);
146 
148  USDIMAGING_API
149  HdContainerDataSourceHandle Build();
150 
151  private:
152  HdPathDataSourceHandle _modelPath;
153  HdAssetPathDataSourceHandle _assetIdentifier;
154  HdStringDataSourceHandle _assetName;
155  HdStringDataSourceHandle _assetVersion;
156 
157  };
158 
160 };
161 
162 PXR_NAMESPACE_CLOSE_SCOPE
163 
164 #endif
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:80
Represents an object that can identify the location of a data source.
#define TF_DECLARE_PUBLIC_TOKENS(...)
Macro to define public tokens.
Definition: staticTokens.h:92
Schema classes represent a structured view of the inherently unstructured container data source passe...
Definition: schema.h:25
Utility class for setting sparse sets of child data source fields to be filled as arguments into Buil...
Definition: modelSchema.h:131
USDIMAGING_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.