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 
47 /// \class HdRenderBufferSchema
48 ///
50 {
51 public:
52  /// \name Schema retrieval
53  /// @{
54 
55  HdRenderBufferSchema(HdContainerDataSourceHandle container)
56  : HdSchema(container) {}
57 
58  /// Retrieves a container data source with the schema's default name token
59  /// "renderBuffer" from the parent container and constructs a
60  /// HdRenderBufferSchema instance.
61  /// Because the requested container data source may not exist, the result
62  /// should be checked with IsDefined() or a bool comparison before use.
63  HD_API
65  const HdContainerDataSourceHandle &fromParentContainer);
66 
67  /// @}
68 
69 // --(BEGIN CUSTOM CODE: Schema Methods)--
70 // --(END CUSTOM CODE: Schema Methods)--
71 
72  /// \name Member accessor
73  /// @{
74 
75  HD_API
77 
78  HD_API
80 
81  HD_API
83 
84  /// @}
85 
86  /// \name Schema location
87  /// @{
88 
89  /// Returns a token where the container representing this schema is found in
90  /// a container by default.
91  HD_API
92  static const TfToken &GetSchemaToken();
93 
94  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
95  /// where the container representing this schema is found by default.
96  HD_API
97  static const HdDataSourceLocator &GetDefaultLocator();
98 
99  /// @}
100 
101  /// \name Data source locators for members
102  ///
103  /// The following methods return an HdDataSourceLocator (relative to the
104  /// prim-level data source) where the data source for a member can be found.
105  ///
106  /// This is often useful for checking intersection against the
107  /// HdDataSourceLocatorSet sent with HdDataSourceObserver::PrimsDirtied.
108  /// @{
109 
110  /// Prim-level relative data source locator to locate dimensions.
111  HD_API
113 
114  /// Prim-level relative data source locator to locate format.
115  HD_API
116  static const HdDataSourceLocator &GetFormatLocator();
117 
118  /// Prim-level relative data source locator to locate multiSampled.
119  HD_API
121  /// @}
122 
123  /// \name Schema construction
124  /// @{
125 
126  /// \deprecated Use Builder instead.
127  ///
128  /// Builds a container data source which includes the provided child data
129  /// sources. Parameters with nullptr values are excluded. This is a
130  /// low-level interface. For cases in which it's desired to define
131  /// the container with a sparse set of child fields, the Builder class
132  /// is often more convenient and readable.
133  HD_API
134  static HdContainerDataSourceHandle
136  const HdVec3iDataSourceHandle &dimensions,
138  const HdBoolDataSourceHandle &multiSampled
139  );
140 
141  /// \class HdRenderBufferSchema::Builder
142  ///
143  /// Utility class for setting sparse sets of child data source fields to be
144  /// filled as arguments into BuildRetained. Because all setter methods
145  /// return a reference to the instance, this can be used in the "builder
146  /// pattern" form.
147  class Builder
148  {
149  public:
150  HD_API
152  const HdVec3iDataSourceHandle &dimensions);
153  HD_API
156  HD_API
158  const HdBoolDataSourceHandle &multiSampled);
159 
160  /// Returns a container data source containing the members set thus far.
161  HD_API
162  HdContainerDataSourceHandle Build();
163 
164  private:
165  HdVec3iDataSourceHandle _dimensions;
166  HdFormatDataSourceHandle _format;
167  HdBoolDataSourceHandle _multiSampled;
168 
169  };
170 
171  /// @}
172 };
173 
175 
176 #endif
HD_API HdFormatDataSourceHandle GetFormat() const
HD_API Builder & SetMultiSampled(const HdBoolDataSourceHandle &multiSampled)
#define PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
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)
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)