HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
splitDiopterSchema.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_SPLIT_DIOPTER_SCHEMA_H
19 #define PXR_IMAGING_HD_SPLIT_DIOPTER_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_SPLIT_DIOPTER_SCHEMA_TOKENS \
36  (splitDiopter) \
37  (count) \
38  (angle) \
39  (offset1) \
40  (width1) \
41  (focusDistance1) \
42  (offset2) \
43  (width2) \
44  (focusDistance2) \
45 
46 TF_DECLARE_PUBLIC_TOKENS(HdSplitDiopterSchemaTokens, HD_API,
48 
49 //-----------------------------------------------------------------------------
50 
51 
52 /// \class HdSplitDiopterSchema
53 ///
55 {
56 public:
57  /// \name Schema retrieval
58  /// @{
59 
60  HdSplitDiopterSchema(HdContainerDataSourceHandle container)
61  : HdSchema(container) {}
62 
63  /// Retrieves a container data source with the schema's default name token
64  /// "splitDiopter" from the parent container and constructs a
65  /// HdSplitDiopterSchema instance.
66  /// Because the requested container data source may not exist, the result
67  /// should be checked with IsDefined() or a bool comparison before use.
68  HD_API
70  const HdContainerDataSourceHandle &fromParentContainer);
71 
72  /// @}
73 
74 // --(BEGIN CUSTOM CODE: Schema Methods)--
75 // --(END CUSTOM CODE: Schema Methods)--
76 
77  /// \name Member accessor
78  /// @{
79 
80  HD_API
82 
83  HD_API
85 
86  HD_API
88 
89  HD_API
91 
92  HD_API
94 
95  HD_API
97 
98  HD_API
100 
101  HD_API
103 
104  /// @}
105 
106  /// \name Schema location
107  /// @{
108 
109  /// Returns a token where the container representing this schema is found in
110  /// a container by default.
111  HD_API
112  static const TfToken &GetSchemaToken();
113 
114  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
115  /// where the container representing this schema is found by default.
116  HD_API
117  static const HdDataSourceLocator &GetDefaultLocator();
118 
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
136  const HdFloatDataSourceHandle &offset1,
137  const HdFloatDataSourceHandle &width1,
138  const HdFloatDataSourceHandle &focusDistance1,
139  const HdFloatDataSourceHandle &offset2,
140  const HdFloatDataSourceHandle &width2,
141  const HdFloatDataSourceHandle &focusDistance2
142  );
143 
144  /// \class HdSplitDiopterSchema::Builder
145  ///
146  /// Utility class for setting sparse sets of child data source fields to be
147  /// filled as arguments into BuildRetained. Because all setter methods
148  /// return a reference to the instance, this can be used in the "builder
149  /// pattern" form.
150  class Builder
151  {
152  public:
153  HD_API
154  Builder &SetCount(
156  HD_API
157  Builder &SetAngle(
159  HD_API
161  const HdFloatDataSourceHandle &offset1);
162  HD_API
164  const HdFloatDataSourceHandle &width1);
165  HD_API
167  const HdFloatDataSourceHandle &focusDistance1);
168  HD_API
170  const HdFloatDataSourceHandle &offset2);
171  HD_API
173  const HdFloatDataSourceHandle &width2);
174  HD_API
176  const HdFloatDataSourceHandle &focusDistance2);
177 
178  /// Returns a container data source containing the members set thus far.
179  HD_API
180  HdContainerDataSourceHandle Build();
181 
182  private:
183  HdIntDataSourceHandle _count;
185  HdFloatDataSourceHandle _offset1;
186  HdFloatDataSourceHandle _width1;
187  HdFloatDataSourceHandle _focusDistance1;
188  HdFloatDataSourceHandle _offset2;
189  HdFloatDataSourceHandle _width2;
190  HdFloatDataSourceHandle _focusDistance2;
191 
192  };
193 
194  /// @}
195 };
196 
198 
199 #endif
HD_API HdFloatDataSourceHandle GetWidth2() const
TF_DECLARE_PUBLIC_TOKENS(HdSplitDiopterSchemaTokens, HD_API, HD_SPLIT_DIOPTER_SCHEMA_TOKENS)
HdFloatDataSource::Handle HdFloatDataSourceHandle
HD_API Builder & SetWidth1(const HdFloatDataSourceHandle &width1)
SIM_API const UT_StringHolder angle
#define PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
HD_API HdFloatDataSourceHandle GetOffset2() const
HD_API Builder & SetOffset2(const HdFloatDataSourceHandle &offset2)
HD_API HdFloatDataSourceHandle GetFocusDistance2() const
#define HD_API
Definition: api.h:23
HD_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
static HD_API const HdDataSourceLocator & GetDefaultLocator()
HD_API HdFloatDataSourceHandle GetFocusDistance1() const
HD_API Builder & SetAngle(const HdFloatDataSourceHandle &angle)
Definition: token.h:70
static HD_API HdContainerDataSourceHandle BuildRetained(const HdIntDataSourceHandle &count, const HdFloatDataSourceHandle &angle, const HdFloatDataSourceHandle &offset1, const HdFloatDataSourceHandle &width1, const HdFloatDataSourceHandle &focusDistance1, const HdFloatDataSourceHandle &offset2, const HdFloatDataSourceHandle &width2, const HdFloatDataSourceHandle &focusDistance2)
HD_API HdIntDataSourceHandle GetCount() const
HD_API Builder & SetWidth2(const HdFloatDataSourceHandle &width2)
static HD_API HdSplitDiopterSchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
HD_API Builder & SetCount(const HdIntDataSourceHandle &count)
static HD_API const TfToken & GetSchemaToken()
HD_API Builder & SetOffset1(const HdFloatDataSourceHandle &offset1)
HD_API HdFloatDataSourceHandle GetOffset1() const
HD_API Builder & SetFocusDistance2(const HdFloatDataSourceHandle &focusDistance2)
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
HdIntDataSource::Handle HdIntDataSourceHandle
HD_API HdFloatDataSourceHandle GetWidth1() const
HD_API Builder & SetFocusDistance1(const HdFloatDataSourceHandle &focusDistance1)
HD_API HdFloatDataSourceHandle GetAngle() const
GLint GLsizei count
Definition: glcorearb.h:405
#define HD_SPLIT_DIOPTER_SCHEMA_TOKENS
HdSplitDiopterSchema(HdContainerDataSourceHandle container)