HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
renderPassSchema.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 //
7 ////////////////////////////////////////////////////////////////////////
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_IMAGING_HD_RENDER_PASS_SCHEMA_H
19 #define PXR_IMAGING_HD_RENDER_PASS_SCHEMA_H
20 
21 /// \file
22 
23 #include "pxr/imaging/hd/api.h"
25 
26 #include "pxr/imaging/hd/schema.h"
27 
28 // --(BEGIN CUSTOM CODE: Includes)--
29 // --(END CUSTOM CODE: Includes)--
30 
32 
33 // --(BEGIN CUSTOM CODE: Declares)--
34 // --(END CUSTOM CODE: Declares)--
35 
36 #define HD_RENDER_PASS_SCHEMA_TOKENS \
37  (renderPass) \
38  (passType) \
39  (renderSource) \
40 
41 TF_DECLARE_PUBLIC_TOKENS(HdRenderPassSchemaTokens, HD_API,
43 
44 //-----------------------------------------------------------------------------
45 
46 
48 {
49 public:
50  /// \name Schema retrieval
51  /// @{
52 
53  HdRenderPassSchema(HdContainerDataSourceHandle container)
54  : HdSchema(container) {}
55 
56  /// Retrieves a container data source with the schema's default name token
57  /// "renderPass" from the parent container and constructs a
58  /// HdRenderPassSchema instance.
59  /// Because the requested container data source may not exist, the result
60  /// should be checked with IsDefined() or a bool comparison before use.
61  HD_API
63  const HdContainerDataSourceHandle &fromParentContainer);
64 
65  /// @}
66 
67 // --(BEGIN CUSTOM CODE: Schema Methods)--
68 // --(END CUSTOM CODE: Schema Methods)--
69 
70  /// \name Member accessor
71  /// @{
72 
73  HD_API
75 
76  HD_API
78 
79  /// @}
80 
81  /// \name Schema location
82  /// @{
83 
84  /// Returns a token where the container representing this schema is found in
85  /// a container by default.
86  HD_API
87  static const TfToken &GetSchemaToken();
88 
89  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
90  /// where the container representing this schema is found by default.
91  HD_API
92  static const HdDataSourceLocator &GetDefaultLocator();
93 
94  /// @}
95 
96  /// \name Data source locators for members
97  ///
98  /// The following methods return an HdDataSourceLocator (relative to the
99  /// prim-level data source) where the data source for a member can be found.
100  ///
101  /// This is often useful for checking intersection against the
102  /// HdDataSourceLocatorSet sent with HdDataSourceObserver::PrimsDirtied.
103  /// @{
104 
105  /// Prim-level relative data source locator to locate passType.
106  HD_API
107  static const HdDataSourceLocator &GetPassTypeLocator();
108 
109  /// Prim-level relative data source locator to locate renderSource.
110  HD_API
112  /// @}
113 
114  /// \name Schema construction
115  /// @{
116 
117  /// \deprecated Use Builder instead.
118  ///
119  /// Builds a container data source which includes the provided child data
120  /// sources. Parameters with nullptr values are excluded. This is a
121  /// low-level interface. For cases in which it's desired to define
122  /// the container with a sparse set of child fields, the Builder class
123  /// is often more convenient and readable.
124  HD_API
125  static HdContainerDataSourceHandle
127  const HdTokenDataSourceHandle &passType,
128  const HdPathDataSourceHandle &renderSource
129  );
130 
131  /// \class HdRenderPassSchema::Builder
132  ///
133  /// Utility class for setting sparse sets of child data source fields to be
134  /// filled as arguments into BuildRetained. Because all setter methods
135  /// return a reference to the instance, this can be used in the "builder
136  /// pattern" form.
137  class Builder
138  {
139  public:
140  HD_API
142  const HdTokenDataSourceHandle &passType);
143  HD_API
145  const HdPathDataSourceHandle &renderSource);
146 
147  /// Returns a container data source containing the members set thus far.
148  HD_API
149  HdContainerDataSourceHandle Build();
150 
151  private:
152  HdTokenDataSourceHandle _passType;
153  HdPathDataSourceHandle _renderSource;
154 
155  };
156 
157  /// @}
158 };
159 
161 
162 #endif
#define HD_RENDER_PASS_SCHEMA_TOKENS
static HD_API const HdDataSourceLocator & GetPassTypeLocator()
Prim-level relative data source locator to locate passType.
HD_API HdTokenDataSourceHandle GetPassType() const
TF_DECLARE_PUBLIC_TOKENS(HdRenderPassSchemaTokens, HD_API, HD_RENDER_PASS_SCHEMA_TOKENS)
static HD_API const HdDataSourceLocator & GetDefaultLocator()
#define HD_API
Definition: api.h:23
HdRenderPassSchema(HdContainerDataSourceHandle container)
static HD_API HdContainerDataSourceHandle BuildRetained(const HdTokenDataSourceHandle &passType, const HdPathDataSourceHandle &renderSource)
Definition: token.h:70
HD_API HdPathDataSourceHandle GetRenderSource() const
HD_API Builder & SetPassType(const HdTokenDataSourceHandle &passType)
static HD_API const HdDataSourceLocator & GetRenderSourceLocator()
Prim-level relative data source locator to locate renderSource.
HD_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
static HD_API HdRenderPassSchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
HD_API Builder & SetRenderSource(const HdPathDataSourceHandle &renderSource)
HdPathDataSource::Handle HdPathDataSourceHandle
static HD_API const TfToken & GetSchemaToken()
HdTokenDataSource::Handle HdTokenDataSourceHandle