HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
lensDistortionSchema.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_LENS_DISTORTION_SCHEMA_H
19 #define PXR_IMAGING_HD_LENS_DISTORTION_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_LENS_DISTORTION_SCHEMA_TOKENS \
36  (lensDistortion) \
37  (type) \
38  (k1) \
39  (k2) \
40  (center) \
41  (anaSq) \
42  (asym) \
43  (scale) \
44  (ior) \
45  (standard) \
46  (fisheye) \
47 
48 TF_DECLARE_PUBLIC_TOKENS(HdLensDistortionSchemaTokens, HD_API,
50 
51 //-----------------------------------------------------------------------------
52 
53 
55 {
56 public:
57  /// \name Schema retrieval
58  /// @{
59 
60  HdLensDistortionSchema(HdContainerDataSourceHandle container)
61  : HdSchema(container) {}
62 
63  /// Retrieves a container data source with the schema's default name token
64  /// "lensDistortion" from the parent container and constructs a
65  /// HdLensDistortionSchema 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
135  const HdFloatDataSourceHandle &k1,
136  const HdFloatDataSourceHandle &k2,
137  const HdVec2fDataSourceHandle &center,
138  const HdFloatDataSourceHandle &anaSq,
139  const HdVec2fDataSourceHandle &asym,
141  const HdFloatDataSourceHandle &ior
142  );
143 
144  /// \class HdLensDistortionSchema::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 &SetType(
156  HD_API
157  Builder &SetK1(
158  const HdFloatDataSourceHandle &k1);
159  HD_API
160  Builder &SetK2(
161  const HdFloatDataSourceHandle &k2);
162  HD_API
164  const HdVec2fDataSourceHandle &center);
165  HD_API
166  Builder &SetAnaSq(
167  const HdFloatDataSourceHandle &anaSq);
168  HD_API
169  Builder &SetAsym(
170  const HdVec2fDataSourceHandle &asym);
171  HD_API
172  Builder &SetScale(
174  HD_API
175  Builder &SetIor(
176  const HdFloatDataSourceHandle &ior);
177 
178  /// Returns a container data source containing the members set thus far.
179  HD_API
180  HdContainerDataSourceHandle Build();
181 
182  private:
186  HdVec2fDataSourceHandle _center;
191 
192  };
193 
194  /// Returns token data source for use as type value.
195  ///
196  /// The following values will be stored statically and reused for future
197  /// calls:
198  /// - HdLensDistortionSchemaTokens->standard
199  /// - HdLensDistortionSchemaTokens->fisheye
200  HD_API
202  const TfToken &type);
203 
204  /// @}
205 };
206 
208 
209 #endif
HD_API HdFloatDataSourceHandle GetK1() const
HD_API Builder & SetK2(const HdFloatDataSourceHandle &k2)
HdFloatDataSource::Handle HdFloatDataSourceHandle
TF_DECLARE_PUBLIC_TOKENS(HdLensDistortionSchemaTokens, HD_API, HD_LENS_DISTORTION_SCHEMA_TOKENS)
HD_API Builder & SetAnaSq(const HdFloatDataSourceHandle &anaSq)
HD_API Builder & SetK1(const HdFloatDataSourceHandle &k1)
#define HD_API
Definition: api.h:23
HD_API HdFloatDataSourceHandle GetScale() const
GA_API const UT_StringHolder scale
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:108
Definition: token.h:70
HD_API Builder & SetIor(const HdFloatDataSourceHandle &ior)
HD_API Builder & SetType(const HdTokenDataSourceHandle &type)
static HD_API const TfToken & GetSchemaToken()
HD_API HdTokenDataSourceHandle GetType() const
#define HD_LENS_DISTORTION_SCHEMA_TOKENS
HdVec2fDataSource::Handle HdVec2fDataSourceHandle
HD_API Builder & SetAsym(const HdVec2fDataSourceHandle &asym)
HD_API HdVec2fDataSourceHandle GetAsym() const
static HD_API HdLensDistortionSchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
HdLensDistortionSchema(HdContainerDataSourceHandle container)
HD_API Builder & SetScale(const HdFloatDataSourceHandle &scale)
static HD_API HdContainerDataSourceHandle BuildRetained(const HdTokenDataSourceHandle &type, const HdFloatDataSourceHandle &k1, const HdFloatDataSourceHandle &k2, const HdVec2fDataSourceHandle &center, const HdFloatDataSourceHandle &anaSq, const HdVec2fDataSourceHandle &asym, const HdFloatDataSourceHandle &scale, const HdFloatDataSourceHandle &ior)
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
static HD_API HdTokenDataSourceHandle BuildTypeDataSource(const TfToken &type)
HD_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
HD_API HdFloatDataSourceHandle GetK2() const
HD_API Builder & SetCenter(const HdVec2fDataSourceHandle &center)
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
static HD_API const HdDataSourceLocator & GetDefaultLocator()
HD_API HdVec2fDataSourceHandle GetCenter() const
HD_API HdFloatDataSourceHandle GetIor() const
HD_API HdFloatDataSourceHandle GetAnaSq() const
HdTokenDataSource::Handle HdTokenDataSourceHandle