HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
cameraSchema.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 /* ** ** */
28 /* ** This file is generated by a script. ** */
29 /* ** ** */
30 /* ** Do not edit it directly (unless it is within a CUSTOM CODE section)! ** */
31 /* ** Edit hdGen/schema.py instead to make changes. ** */
32 /* ** ** */
33 /* ************************************************************************** */
34 
35 #ifndef PXR_IMAGING_HD_CAMERA_SCHEMA_H
36 #define PXR_IMAGING_HD_CAMERA_SCHEMA_H
37 
38 /// \file
39 
40 #include "pxr/imaging/hd/api.h"
43 
44 #include "pxr/imaging/hd/schema.h"
45 
46 // --(BEGIN CUSTOM CODE: Includes)--
47 // --(END CUSTOM CODE: Includes)--
48 
50 
51 // --(BEGIN CUSTOM CODE: Declares)--
52 // --(END CUSTOM CODE: Declares)--
53 
54 #define HD_CAMERA_SCHEMA_TOKENS \
55  (camera) \
56  (projection) \
57  (horizontalAperture) \
58  (verticalAperture) \
59  (horizontalApertureOffset) \
60  (verticalApertureOffset) \
61  (focalLength) \
62  (clippingRange) \
63  (clippingPlanes) \
64  (fStop) \
65  (focusDistance) \
66  (shutterOpen) \
67  (shutterClose) \
68  (exposure) \
69  (focusOn) \
70  (dofAspect) \
71  (splitDiopter) \
72  (lensDistortion) \
73  (perspective) \
74  (orthographic) \
75 
76 TF_DECLARE_PUBLIC_TOKENS(HdCameraSchemaTokens, HD_API,
78 
79 //-----------------------------------------------------------------------------
80 
81 
82 class HdCameraSchema : public HdSchema
83 {
84 public:
85  /// \name Schema retrieval
86  /// @{
87 
88  HdCameraSchema(HdContainerDataSourceHandle container)
89  : HdSchema(container) {}
90 
91  /// Retrieves a container data source with the schema's default name token
92  /// "camera" from the parent container and constructs a
93  /// HdCameraSchema instance.
94  /// Because the requested container data source may not exist, the result
95  /// should be checked with IsDefined() or a bool comparison before use.
96  HD_API
98  const HdContainerDataSourceHandle &fromParentContainer);
99 
100  /// @}
101 
102 // --(BEGIN CUSTOM CODE: Schema Methods)--
103 // --(END CUSTOM CODE: Schema Methods)--
104 
105  /// \name Member accessor
106  /// @{
107 
108  HD_API
110 
111  HD_API
113 
114  HD_API
116 
117  HD_API
119 
120  HD_API
122 
123  HD_API
125 
126  HD_API
128 
129  HD_API
131 
132  HD_API
134 
135  HD_API
137 
138  HD_API
140 
141  HD_API
143 
144  HD_API
146 
147  HD_API
149 
150  HD_API
152 
153  HD_API
155 
156  HD_API
158 
159  /// @}
160 
161  /// \name Schema location
162  /// @{
163 
164  /// Returns a token where the container representing this schema is found in
165  /// a container by default.
166  HD_API
167  static const TfToken &GetSchemaToken();
168 
169  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
170  /// where the container representing this schema is found by default.
171  HD_API
172  static const HdDataSourceLocator &GetDefaultLocator();
173 
174  /// @}
175 
176  /// \name Data source locators for members
177  ///
178  /// The following methods return an HdDataSourceLocator (relative to the
179  /// prim-level data source) where the data source for a member can be found.
180  ///
181  /// This is often useful for checking intersection against the
182  /// HdDataSourceLocatorSet sent with HdDataSourceObserver::PrimsDirtied.
183  /// @{
184 
185  /// Prim-level relative data source locator to locate shutterOpen.
186  HD_API
188 
189  /// Prim-level relative data source locator to locate shutterClose.
190  HD_API
192  /// @}
193 
194  /// \name Schema construction
195  /// @{
196 
197  /// \deprecated Use Builder instead.
198  ///
199  /// Builds a container data source which includes the provided child data
200  /// sources. Parameters with nullptr values are excluded. This is a
201  /// low-level interface. For cases in which it's desired to define
202  /// the container with a sparse set of child fields, the Builder class
203  /// is often more convenient and readable.
204  HD_API
205  static HdContainerDataSourceHandle
207  const HdTokenDataSourceHandle &projection,
208  const HdFloatDataSourceHandle &horizontalAperture,
209  const HdFloatDataSourceHandle &verticalAperture,
210  const HdFloatDataSourceHandle &horizontalApertureOffset,
211  const HdFloatDataSourceHandle &verticalApertureOffset,
212  const HdFloatDataSourceHandle &focalLength,
213  const HdVec2fDataSourceHandle &clippingRange,
214  const HdVec4dArrayDataSourceHandle &clippingPlanes,
215  const HdFloatDataSourceHandle &fStop,
216  const HdFloatDataSourceHandle &focusDistance,
217  const HdDoubleDataSourceHandle &shutterOpen,
218  const HdDoubleDataSourceHandle &shutterClose,
219  const HdFloatDataSourceHandle &exposure,
220  const HdBoolDataSourceHandle &focusOn,
221  const HdFloatDataSourceHandle &dofAspect,
222  const HdContainerDataSourceHandle &splitDiopter,
223  const HdContainerDataSourceHandle &lensDistortion
224  );
225 
226  /// \class HdCameraSchema::Builder
227  ///
228  /// Utility class for setting sparse sets of child data source fields to be
229  /// filled as arguments into BuildRetained. Because all setter methods
230  /// return a reference to the instance, this can be used in the "builder
231  /// pattern" form.
232  class Builder
233  {
234  public:
235  HD_API
237  const HdTokenDataSourceHandle &projection);
238  HD_API
240  const HdFloatDataSourceHandle &horizontalAperture);
241  HD_API
243  const HdFloatDataSourceHandle &verticalAperture);
244  HD_API
246  const HdFloatDataSourceHandle &horizontalApertureOffset);
247  HD_API
249  const HdFloatDataSourceHandle &verticalApertureOffset);
250  HD_API
252  const HdFloatDataSourceHandle &focalLength);
253  HD_API
255  const HdVec2fDataSourceHandle &clippingRange);
256  HD_API
258  const HdVec4dArrayDataSourceHandle &clippingPlanes);
259  HD_API
260  Builder &SetFStop(
261  const HdFloatDataSourceHandle &fStop);
262  HD_API
264  const HdFloatDataSourceHandle &focusDistance);
265  HD_API
267  const HdDoubleDataSourceHandle &shutterOpen);
268  HD_API
270  const HdDoubleDataSourceHandle &shutterClose);
271  HD_API
273  const HdFloatDataSourceHandle &exposure);
274  HD_API
276  const HdBoolDataSourceHandle &focusOn);
277  HD_API
279  const HdFloatDataSourceHandle &dofAspect);
280  HD_API
282  const HdContainerDataSourceHandle &splitDiopter);
283  HD_API
285  const HdContainerDataSourceHandle &lensDistortion);
286 
287  /// Returns a container data source containing the members set thus far.
288  HD_API
289  HdContainerDataSourceHandle Build();
290 
291  private:
292  HdTokenDataSourceHandle _projection;
293  HdFloatDataSourceHandle _horizontalAperture;
294  HdFloatDataSourceHandle _verticalAperture;
295  HdFloatDataSourceHandle _horizontalApertureOffset;
296  HdFloatDataSourceHandle _verticalApertureOffset;
297  HdFloatDataSourceHandle _focalLength;
298  HdVec2fDataSourceHandle _clippingRange;
299  HdVec4dArrayDataSourceHandle _clippingPlanes;
301  HdFloatDataSourceHandle _focusDistance;
302  HdDoubleDataSourceHandle _shutterOpen;
303  HdDoubleDataSourceHandle _shutterClose;
304  HdFloatDataSourceHandle _exposure;
305  HdBoolDataSourceHandle _focusOn;
306  HdFloatDataSourceHandle _dofAspect;
307  HdContainerDataSourceHandle _splitDiopter;
308  HdContainerDataSourceHandle _lensDistortion;
309 
310  };
311 
312  /// Returns token data source for use as projection value.
313  ///
314  /// The following values will be stored statically and reused for future
315  /// calls:
316  /// - HdCameraSchemaTokens->perspective
317  /// - HdCameraSchemaTokens->orthographic
318  HD_API
320  const TfToken &projection);
321 
322  /// @}
323 };
324 
326 
327 #endif
HD_API HdFloatDataSourceHandle GetHorizontalAperture()
HD_API Builder & SetFocusOn(const HdBoolDataSourceHandle &focusOn)
HdDoubleDataSource::Handle HdDoubleDataSourceHandle
HD_API HdDoubleDataSourceHandle GetShutterClose()
HD_API HdFloatDataSourceHandle GetFocusDistance()
HdFloatDataSource::Handle HdFloatDataSourceHandle
HD_API HdBoolDataSourceHandle GetFocusOn()
HD_API HdLensDistortionSchema GetLensDistortion()
static HD_API HdTokenDataSourceHandle BuildProjectionDataSource(const TfToken &projection)
HD_API HdVec4dArrayDataSourceHandle GetClippingPlanes()
HD_API Builder & SetExposure(const HdFloatDataSourceHandle &exposure)
static HD_API const HdDataSourceLocator & GetShutterCloseLocator()
Prim-level relative data source locator to locate shutterClose.
HD_API Builder & SetShutterOpen(const HdDoubleDataSourceHandle &shutterOpen)
#define HD_API
Definition: api.h:40
HD_API HdFloatDataSourceHandle GetExposure()
HD_API HdVec2fDataSourceHandle GetClippingRange()
HD_API HdFloatDataSourceHandle GetVerticalApertureOffset()
#define HD_CAMERA_SCHEMA_TOKENS
Definition: cameraSchema.h:54
HD_API Builder & SetLensDistortion(const HdContainerDataSourceHandle &lensDistortion)
HD_API Builder & SetSplitDiopter(const HdContainerDataSourceHandle &splitDiopter)
static HD_API const HdDataSourceLocator & GetDefaultLocator()
Definition: token.h:87
HD_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
HD_API Builder & SetProjection(const HdTokenDataSourceHandle &projection)
HD_API Builder & SetFStop(const HdFloatDataSourceHandle &fStop)
HD_API Builder & SetShutterClose(const HdDoubleDataSourceHandle &shutterClose)
HD_API HdFloatDataSourceHandle GetDofAspect()
HdBoolDataSource::Handle HdBoolDataSourceHandle
HD_API Builder & SetFocalLength(const HdFloatDataSourceHandle &focalLength)
HdVec2fDataSource::Handle HdVec2fDataSourceHandle
static HD_API const TfToken & GetSchemaToken()
HdCameraSchema(HdContainerDataSourceHandle container)
Definition: cameraSchema.h:88
HD_API HdDoubleDataSourceHandle GetShutterOpen()
static HD_API const HdDataSourceLocator & GetShutterOpenLocator()
Prim-level relative data source locator to locate shutterOpen.
HD_API Builder & SetDofAspect(const HdFloatDataSourceHandle &dofAspect)
TF_DECLARE_PUBLIC_TOKENS(HdCameraSchemaTokens, HD_API, HD_CAMERA_SCHEMA_TOKENS)
static HD_API HdCameraSchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
HD_API Builder & SetClippingRange(const HdVec2fDataSourceHandle &clippingRange)
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1432
HD_API Builder & SetVerticalApertureOffset(const HdFloatDataSourceHandle &verticalApertureOffset)
HD_API Builder & SetFocusDistance(const HdFloatDataSourceHandle &focusDistance)
HD_API HdSplitDiopterSchema GetSplitDiopter()
HD_API HdTokenDataSourceHandle GetProjection()
HD_API HdFloatDataSourceHandle GetVerticalAperture()
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
HdVec4dArrayDataSource::Handle HdVec4dArrayDataSourceHandle
static HD_API HdContainerDataSourceHandle BuildRetained(const HdTokenDataSourceHandle &projection, const HdFloatDataSourceHandle &horizontalAperture, const HdFloatDataSourceHandle &verticalAperture, const HdFloatDataSourceHandle &horizontalApertureOffset, const HdFloatDataSourceHandle &verticalApertureOffset, const HdFloatDataSourceHandle &focalLength, const HdVec2fDataSourceHandle &clippingRange, const HdVec4dArrayDataSourceHandle &clippingPlanes, const HdFloatDataSourceHandle &fStop, const HdFloatDataSourceHandle &focusDistance, const HdDoubleDataSourceHandle &shutterOpen, const HdDoubleDataSourceHandle &shutterClose, const HdFloatDataSourceHandle &exposure, const HdBoolDataSourceHandle &focusOn, const HdFloatDataSourceHandle &dofAspect, const HdContainerDataSourceHandle &splitDiopter, const HdContainerDataSourceHandle &lensDistortion)
HD_API HdFloatDataSourceHandle GetFocalLength()
HD_API Builder & SetVerticalAperture(const HdFloatDataSourceHandle &verticalAperture)
HdTokenDataSource::Handle HdTokenDataSourceHandle
HD_API Builder & SetHorizontalApertureOffset(const HdFloatDataSourceHandle &horizontalApertureOffset)
HD_API Builder & SetClippingPlanes(const HdVec4dArrayDataSourceHandle &clippingPlanes)
HD_API Builder & SetHorizontalAperture(const HdFloatDataSourceHandle &horizontalAperture)
HD_API HdFloatDataSourceHandle GetFStop()
HD_API HdFloatDataSourceHandle GetHorizontalApertureOffset()