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 
54 /// \class HdLensDistortionSchema
55 ///
57 {
58 public:
59  /// \name Schema retrieval
60  /// @{
61 
62  HdLensDistortionSchema(HdContainerDataSourceHandle container)
63  : HdSchema(container) {}
64 
65  /// Retrieves a container data source with the schema's default name token
66  /// "lensDistortion" from the parent container and constructs a
67  /// HdLensDistortionSchema instance.
68  /// Because the requested container data source may not exist, the result
69  /// should be checked with IsDefined() or a bool comparison before use.
70  HD_API
72  const HdContainerDataSourceHandle &fromParentContainer);
73 
74  /// @}
75 
76 // --(BEGIN CUSTOM CODE: Schema Methods)--
77 // --(END CUSTOM CODE: Schema Methods)--
78 
79  /// \name Member accessor
80  /// @{
81 
82  HD_API
84 
85  HD_API
87 
88  HD_API
90 
91  HD_API
93 
94  HD_API
96 
97  HD_API
99 
100  HD_API
102 
103  HD_API
105 
106  /// @}
107 
108  /// \name Schema location
109  /// @{
110 
111  /// Returns a token where the container representing this schema is found in
112  /// a container by default.
113  HD_API
114  static const TfToken &GetSchemaToken();
115 
116  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
117  /// where the container representing this schema is found by default.
118  HD_API
119  static const HdDataSourceLocator &GetDefaultLocator();
120 
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
137  const HdFloatDataSourceHandle &k1,
138  const HdFloatDataSourceHandle &k2,
139  const HdVec2fDataSourceHandle &center,
140  const HdFloatDataSourceHandle &anaSq,
141  const HdVec2fDataSourceHandle &asym,
143  const HdFloatDataSourceHandle &ior
144  );
145 
146  /// \class HdLensDistortionSchema::Builder
147  ///
148  /// Utility class for setting sparse sets of child data source fields to be
149  /// filled as arguments into BuildRetained. Because all setter methods
150  /// return a reference to the instance, this can be used in the "builder
151  /// pattern" form.
152  class Builder
153  {
154  public:
155  HD_API
156  Builder &SetType(
158  HD_API
159  Builder &SetK1(
160  const HdFloatDataSourceHandle &k1);
161  HD_API
162  Builder &SetK2(
163  const HdFloatDataSourceHandle &k2);
164  HD_API
166  const HdVec2fDataSourceHandle &center);
167  HD_API
168  Builder &SetAnaSq(
169  const HdFloatDataSourceHandle &anaSq);
170  HD_API
171  Builder &SetAsym(
172  const HdVec2fDataSourceHandle &asym);
173  HD_API
174  Builder &SetScale(
176  HD_API
177  Builder &SetIor(
178  const HdFloatDataSourceHandle &ior);
179 
180  /// Returns a container data source containing the members set thus far.
181  HD_API
182  HdContainerDataSourceHandle Build();
183 
184  private:
188  HdVec2fDataSourceHandle _center;
193 
194  };
195 
196  /// Returns token data source for use as type value.
197  ///
198  /// The following values will be stored statically and reused for future
199  /// calls:
200  /// - HdLensDistortionSchemaTokens->standard
201  /// - HdLensDistortionSchemaTokens->fisheye
202  HD_API
204  const TfToken &type);
205 
206  /// @}
207 };
208 
210 
211 #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)
#define PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
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)
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