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 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_LENS_DISTORTION_SCHEMA_H
32 #define PXR_IMAGING_HD_LENS_DISTORTION_SCHEMA_H
33 
34 #include "pxr/imaging/hd/api.h"
35 
36 #include "pxr/imaging/hd/schema.h"
37 
39 
40 //-----------------------------------------------------------------------------
41 
42 #define HDLENSDISTORTION_SCHEMA_TOKENS \
43  (lensDistortion) \
44  (type) \
45  (k1) \
46  (k2) \
47  (center) \
48  (anaSq) \
49  (asym) \
50  (scale) \
51  (ior) \
52  (standard) \
53  (fisheye) \
54 
55 TF_DECLARE_PUBLIC_TOKENS(HdLensDistortionSchemaTokens, HD_API,
57 
58 //-----------------------------------------------------------------------------
59 
61 {
62 public:
63  HdLensDistortionSchema(HdContainerDataSourceHandle container)
64  : HdSchema(container) {}
65 
66  //ACCESSORS
67 
68  HD_API
70  HD_API
72  HD_API
74  HD_API
76  HD_API
78  HD_API
80  HD_API
82  HD_API
84 
85  // RETRIEVING AND CONSTRUCTING
86 
87  /// Builds a container data source which includes the provided child data
88  /// sources. Parameters with nullptr values are excluded. This is a
89  /// low-level interface. For cases in which it's desired to define
90  /// the container with a sparse set of child fields, the Builder class
91  /// is often more convenient and readable.
92  HD_API
93  static HdContainerDataSourceHandle
96  const HdFloatDataSourceHandle &k1,
97  const HdFloatDataSourceHandle &k2,
99  const HdFloatDataSourceHandle &anaSq,
100  const HdVec2fDataSourceHandle &asym,
102  const HdFloatDataSourceHandle &ior
103  );
104 
105  /// \class HdLensDistortionSchema::Builder
106  ///
107  /// Utility class for setting sparse sets of child data source fields to be
108  /// filled as arguments into BuildRetained. Because all setter methods
109  /// return a reference to the instance, this can be used in the "builder
110  /// pattern" form.
111  class Builder
112  {
113  public:
114  HD_API
115  Builder &SetType(
117  HD_API
118  Builder &SetK1(
119  const HdFloatDataSourceHandle &k1);
120  HD_API
121  Builder &SetK2(
122  const HdFloatDataSourceHandle &k2);
123  HD_API
126  HD_API
127  Builder &SetAnaSq(
128  const HdFloatDataSourceHandle &anaSq);
129  HD_API
130  Builder &SetAsym(
131  const HdVec2fDataSourceHandle &asym);
132  HD_API
133  Builder &SetScale(
135  HD_API
136  Builder &SetIor(
137  const HdFloatDataSourceHandle &ior);
138 
139  /// Returns a container data source containing the members set thus far.
140  HD_API
141  HdContainerDataSourceHandle Build();
142 
143  private:
147  HdVec2fDataSourceHandle _center;
152  };
153 
154  /// Retrieves a container data source with the schema's default name token
155  /// "lensDistortion" from the parent container and constructs a
156  /// HdLensDistortionSchema instance.
157  /// Because the requested container data source may not exist, the result
158  /// should be checked with IsDefined() or a bool comparison before use.
159  HD_API
161  const HdContainerDataSourceHandle &fromParentContainer);
162 
163  /// Returns a token where the container representing this schema is found in
164  /// a container by default.
165  HD_API
166  static const TfToken &GetSchemaToken();
167 
168  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
169  /// where the container representing this schema is found by default.
170  HD_API
171  static const HdDataSourceLocator &GetDefaultLocator();
172 
173  /// Returns token data source for use as type value.
174  /// Values of...
175  /// - HdLensDistortionSchemaTokens->standard
176  /// - HdLensDistortionSchemaTokens->fisheye
177  /// ...will be stored statically and reused for future calls.
178  HD_API
180  const TfToken &type);
181 
182 };
183 
185 
186 #endif
HD_API Builder & SetK2(const HdFloatDataSourceHandle &k2)
HD_API HdFloatDataSourceHandle GetAnaSq()
HdFloatDataSource::Handle HdFloatDataSourceHandle
HD_API HdVec2fDataSourceHandle GetCenter()
HD_API Builder & SetAnaSq(const HdFloatDataSourceHandle &anaSq)
HD_API Builder & SetK1(const HdFloatDataSourceHandle &k1)
#define HDLENSDISTORTION_SCHEMA_TOKENS
#define HD_API
Definition: api.h:40
GA_API const UT_StringHolder scale
HD_API HdFloatDataSourceHandle GetScale()
Definition: token.h:87
HD_API Builder & SetIor(const HdFloatDataSourceHandle &ior)
HD_API Builder & SetType(const HdTokenDataSourceHandle &type)
static HD_API const TfToken & GetSchemaToken()
HD_API HdFloatDataSourceHandle GetIor()
HD_API HdFloatDataSourceHandle GetK1()
HdVec2fDataSource::Handle HdVec2fDataSourceHandle
HD_API Builder & SetAsym(const HdVec2fDataSourceHandle &asym)
static HD_API HdLensDistortionSchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
HD_API HdTokenDataSourceHandle GetType()
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)
TF_DECLARE_PUBLIC_TOKENS(HdLensDistortionSchemaTokens, HD_API, HDLENSDISTORTION_SCHEMA_TOKENS)
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1441
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 Builder & SetCenter(const HdVec2fDataSourceHandle &center)
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
static HD_API const HdDataSourceLocator & GetDefaultLocator()
type
Definition: core.h:1059
HD_API HdVec2fDataSourceHandle GetAsym()
HdTokenDataSource::Handle HdTokenDataSourceHandle
HD_API HdFloatDataSourceHandle GetK2()