HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
renderBufferSchema.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_BUFFER_SCHEMA_H
19 #define PXR_IMAGING_HD_RENDER_BUFFER_SCHEMA_H
20 
21 /// \file
22 
23 #include "pxr/imaging/hd/api.h"
24 
25 #include "pxr/imaging/hd/schema.h"
26 
27 // --(BEGIN CUSTOM CODE: Includes)--
28 // --(END CUSTOM CODE: Includes)--
29 
31 
32 // --(BEGIN CUSTOM CODE: Declares)--
33 // --(END CUSTOM CODE: Declares)--
34 
35 #define HD_RENDER_BUFFER_SCHEMA_TOKENS \
36  (renderBuffer) \
37  (dimensions) \
38  (format) \
39  (multiSampled) \
40 
41 TF_DECLARE_PUBLIC_TOKENS(HdRenderBufferSchemaTokens, HD_API,
43 
44 //-----------------------------------------------------------------------------
45 
46 
48 {
49 public:
50  /// \name Schema retrieval
51  /// @{
52 
53  HdRenderBufferSchema(HdContainerDataSourceHandle container)
54  : HdSchema(container) {}
55 
56  /// Retrieves a container data source with the schema's default name token
57  /// "renderBuffer" from the parent container and constructs a
58  /// HdRenderBufferSchema 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  HD_API
81 
82  /// @}
83 
84  /// \name Schema location
85  /// @{
86 
87  /// Returns a token where the container representing this schema is found in
88  /// a container by default.
89  HD_API
90  static const TfToken &GetSchemaToken();
91 
92  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
93  /// where the container representing this schema is found by default.
94  HD_API
95  static const HdDataSourceLocator &GetDefaultLocator();
96 
97  /// @}
98 
99  /// \name Data source locators for members
100  ///
101  /// The following methods return an HdDataSourceLocator (relative to the
102  /// prim-level data source) where the data source for a member can be found.
103  ///
104  /// This is often useful for checking intersection against the
105  /// HdDataSourceLocatorSet sent with HdDataSourceObserver::PrimsDirtied.
106  /// @{
107 
108  /// Prim-level relative data source locator to locate dimensions.
109  HD_API
111 
112  /// Prim-level relative data source locator to locate format.
113  HD_API
114  static const HdDataSourceLocator &GetFormatLocator();
115 
116  /// Prim-level relative data source locator to locate multiSampled.
117  HD_API
119  /// @}
120 
121  /// \name Schema construction
122  /// @{
123 
124  /// \deprecated Use Builder instead.
125  ///
126  /// Builds a container data source which includes the provided child data
127  /// sources. Parameters with nullptr values are excluded. This is a
128  /// low-level interface. For cases in which it's desired to define
129  /// the container with a sparse set of child fields, the Builder class
130  /// is often more convenient and readable.
131  HD_API
132  static HdContainerDataSourceHandle
134  const HdVec3iDataSourceHandle &dimensions,
136  const HdBoolDataSourceHandle &multiSampled
137  );
138 
139  /// \class HdRenderBufferSchema::Builder
140  ///
141  /// Utility class for setting sparse sets of child data source fields to be
142  /// filled as arguments into BuildRetained. Because all setter methods
143  /// return a reference to the instance, this can be used in the "builder
144  /// pattern" form.
145  class Builder
146  {
147  public:
148  HD_API
150  const HdVec3iDataSourceHandle &dimensions);
151  HD_API
154  HD_API
156  const HdBoolDataSourceHandle &multiSampled);
157 
158  /// Returns a container data source containing the members set thus far.
159  HD_API
160  HdContainerDataSourceHandle Build();
161 
162  private:
163  HdVec3iDataSourceHandle _dimensions;
164  HdFormatDataSourceHandle _format;
165  HdBoolDataSourceHandle _multiSampled;
166 
167  };
168 
169  /// @}
170 };
171 
173 
174 #endif
HD_API HdFormatDataSourceHandle GetFormat() const
HD_API Builder & SetMultiSampled(const HdBoolDataSourceHandle &multiSampled)
static HD_API const TfToken & GetSchemaToken()
#define HD_API
Definition: api.h:23
static HD_API HdRenderBufferSchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
#define HD_RENDER_BUFFER_SCHEMA_TOKENS
Definition: token.h:70
GLint GLint GLsizei GLint GLenum format
Definition: glcorearb.h:108
HdBoolDataSource::Handle HdBoolDataSourceHandle
HD_API HdVec3iDataSourceHandle GetDimensions() const
HdVec3iDataSource::Handle HdVec3iDataSourceHandle
static HD_API const HdDataSourceLocator & GetDimensionsLocator()
Prim-level relative data source locator to locate dimensions.
HD_API HdBoolDataSourceHandle GetMultiSampled() const
static HD_API const HdDataSourceLocator & GetMultiSampledLocator()
Prim-level relative data source locator to locate multiSampled.
HdRenderBufferSchema(HdContainerDataSourceHandle container)
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
static HD_API HdContainerDataSourceHandle BuildRetained(const HdVec3iDataSourceHandle &dimensions, const HdFormatDataSourceHandle &format, const HdBoolDataSourceHandle &multiSampled)
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
static HD_API const HdDataSourceLocator & GetFormatLocator()
Prim-level relative data source locator to locate format.
static HD_API const HdDataSourceLocator & GetDefaultLocator()
TF_DECLARE_PUBLIC_TOKENS(HdRenderBufferSchemaTokens, HD_API, HD_RENDER_BUFFER_SCHEMA_TOKENS)
HD_API Builder & SetFormat(const HdFormatDataSourceHandle &format)
HdFormatDataSource::Handle HdFormatDataSourceHandle
HD_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
HD_API Builder & SetDimensions(const HdVec3iDataSourceHandle &dimensions)