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 
53 {
54 public:
55  /// \name Schema retrieval
56  /// @{
57 
58  HdSplitDiopterSchema(HdContainerDataSourceHandle container)
59  : HdSchema(container) {}
60 
61  /// Retrieves a container data source with the schema's default name token
62  /// "splitDiopter" from the parent container and constructs a
63  /// HdSplitDiopterSchema instance.
64  /// Because the requested container data source may not exist, the result
65  /// should be checked with IsDefined() or a bool comparison before use.
66  HD_API
68  const HdContainerDataSourceHandle &fromParentContainer);
69 
70  /// @}
71 
72 // --(BEGIN CUSTOM CODE: Schema Methods)--
73 // --(END CUSTOM CODE: Schema Methods)--
74 
75  /// \name Member accessor
76  /// @{
77 
78  HD_API
80 
81  HD_API
83 
84  HD_API
86 
87  HD_API
89 
90  HD_API
92 
93  HD_API
95 
96  HD_API
98 
99  HD_API
101 
102  /// @}
103 
104  /// \name Schema location
105  /// @{
106 
107  /// Returns a token where the container representing this schema is found in
108  /// a container by default.
109  HD_API
110  static const TfToken &GetSchemaToken();
111 
112  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
113  /// where the container representing this schema is found by default.
114  HD_API
115  static const HdDataSourceLocator &GetDefaultLocator();
116 
117  /// @}
118 
119  /// \name Schema construction
120  /// @{
121 
122  /// \deprecated Use Builder instead.
123  ///
124  /// Builds a container data source which includes the provided child data
125  /// sources. Parameters with nullptr values are excluded. This is a
126  /// low-level interface. For cases in which it's desired to define
127  /// the container with a sparse set of child fields, the Builder class
128  /// is often more convenient and readable.
129  HD_API
130  static HdContainerDataSourceHandle
134  const HdFloatDataSourceHandle &offset1,
135  const HdFloatDataSourceHandle &width1,
136  const HdFloatDataSourceHandle &focusDistance1,
137  const HdFloatDataSourceHandle &offset2,
138  const HdFloatDataSourceHandle &width2,
139  const HdFloatDataSourceHandle &focusDistance2
140  );
141 
142  /// \class HdSplitDiopterSchema::Builder
143  ///
144  /// Utility class for setting sparse sets of child data source fields to be
145  /// filled as arguments into BuildRetained. Because all setter methods
146  /// return a reference to the instance, this can be used in the "builder
147  /// pattern" form.
148  class Builder
149  {
150  public:
151  HD_API
152  Builder &SetCount(
154  HD_API
155  Builder &SetAngle(
157  HD_API
159  const HdFloatDataSourceHandle &offset1);
160  HD_API
162  const HdFloatDataSourceHandle &width1);
163  HD_API
165  const HdFloatDataSourceHandle &focusDistance1);
166  HD_API
168  const HdFloatDataSourceHandle &offset2);
169  HD_API
171  const HdFloatDataSourceHandle &width2);
172  HD_API
174  const HdFloatDataSourceHandle &focusDistance2);
175 
176  /// Returns a container data source containing the members set thus far.
177  HD_API
178  HdContainerDataSourceHandle Build();
179 
180  private:
181  HdIntDataSourceHandle _count;
183  HdFloatDataSourceHandle _offset1;
184  HdFloatDataSourceHandle _width1;
185  HdFloatDataSourceHandle _focusDistance1;
186  HdFloatDataSourceHandle _offset2;
187  HdFloatDataSourceHandle _width2;
188  HdFloatDataSourceHandle _focusDistance2;
189 
190  };
191 
192  /// @}
193 };
194 
196 
197 #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
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)
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
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)