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 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 
26 /* ************************************************************************** */
27 /* ** This file is generated by a script. Do not edit directly. Edit ** */
28 /* ** defs.py or the (*)Schema.template.h files to make changes. ** */
29 /* ************************************************************************** */
30 
31 #ifndef PXR_IMAGING_HD_RENDER_BUFFER_SCHEMA_H
32 #define PXR_IMAGING_HD_RENDER_BUFFER_SCHEMA_H
33 
34 #include "pxr/imaging/hd/api.h"
35 
36 #include "pxr/imaging/hd/schema.h"
37 
39 
40 //-----------------------------------------------------------------------------
41 
42 #define HDRENDERBUFFER_SCHEMA_TOKENS \
43  (renderBuffer) \
44  (dimensions) \
45  (format) \
46  (multiSampled) \
47 
48 TF_DECLARE_PUBLIC_TOKENS(HdRenderBufferSchemaTokens, HD_API,
50 
51 //-----------------------------------------------------------------------------
52 
54 {
55 public:
56  HdRenderBufferSchema(HdContainerDataSourceHandle container)
57  : HdSchema(container) {}
58 
59  //ACCESSORS
60 
61  HD_API
63  HD_API
65  HD_API
67 
68  // RETRIEVING AND CONSTRUCTING
69 
70  /// Builds a container data source which includes the provided child data
71  /// sources. Parameters with nullptr values are excluded. This is a
72  /// low-level interface. For cases in which it's desired to define
73  /// the container with a sparse set of child fields, the Builder class
74  /// is often more convenient and readable.
75  HD_API
76  static HdContainerDataSourceHandle
78  const HdVec3iDataSourceHandle &dimensions,
80  const HdBoolDataSourceHandle &multiSampled
81  );
82 
83  /// \class HdRenderBufferSchema::Builder
84  ///
85  /// Utility class for setting sparse sets of child data source fields to be
86  /// filled as arguments into BuildRetained. Because all setter methods
87  /// return a reference to the instance, this can be used in the "builder
88  /// pattern" form.
89  class Builder
90  {
91  public:
92  HD_API
94  const HdVec3iDataSourceHandle &dimensions);
95  HD_API
98  HD_API
100  const HdBoolDataSourceHandle &multiSampled);
101 
102  /// Returns a container data source containing the members set thus far.
103  HD_API
104  HdContainerDataSourceHandle Build();
105 
106  private:
107  HdVec3iDataSourceHandle _dimensions;
108  HdFormatDataSourceHandle _format;
109  HdBoolDataSourceHandle _multiSampled;
110  };
111 
112  /// Retrieves a container data source with the schema's default name token
113  /// "renderBuffer" from the parent container and constructs a
114  /// HdRenderBufferSchema instance.
115  /// Because the requested container data source may not exist, the result
116  /// should be checked with IsDefined() or a bool comparison before use.
117  HD_API
119  const HdContainerDataSourceHandle &fromParentContainer);
120 
121  /// Returns a token where the container representing this schema is found in
122  /// a container by default.
123  HD_API
124  static const TfToken &GetSchemaToken();
125 
126  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
127  /// where the container representing this schema is found by default.
128  HD_API
129  static const HdDataSourceLocator &GetDefaultLocator();
130 
131 };
132 
134 
135 #endif
TF_DECLARE_PUBLIC_TOKENS(HdRenderBufferSchemaTokens, HD_API, HDRENDERBUFFER_SCHEMA_TOKENS)
HD_API Builder & SetMultiSampled(const HdBoolDataSourceHandle &multiSampled)
HD_API HdBoolDataSourceHandle GetMultiSampled()
static HD_API const TfToken & GetSchemaToken()
HD_API HdVec3iDataSourceHandle GetDimensions()
#define HD_API
Definition: api.h:40
#define HDRENDERBUFFER_SCHEMA_TOKENS
static HD_API HdRenderBufferSchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
Definition: token.h:87
GLint GLint GLsizei GLint GLenum format
Definition: glcorearb.h:108
HdBoolDataSource::Handle HdBoolDataSourceHandle
HdVec3iDataSource::Handle HdVec3iDataSourceHandle
HdRenderBufferSchema(HdContainerDataSourceHandle container)
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1441
HD_API HdFormatDataSourceHandle GetFormat()
static HD_API HdContainerDataSourceHandle BuildRetained(const HdVec3iDataSourceHandle &dimensions, const HdFormatDataSourceHandle &format, const HdBoolDataSourceHandle &multiSampled)
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
static HD_API const HdDataSourceLocator & GetDefaultLocator()
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)