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 /* ** 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_CAMERA_SCHEMA_H
32 #define PXR_IMAGING_HD_CAMERA_SCHEMA_H
33 
34 #include "pxr/imaging/hd/api.h"
35 
38 
39 
41 
42 //-----------------------------------------------------------------------------
43 
44 #define HDCAMERA_SCHEMA_TOKENS \
45  (camera) \
46  (projection) \
47  (horizontalAperture) \
48  (verticalAperture) \
49  (horizontalApertureOffset) \
50  (verticalApertureOffset) \
51  (focalLength) \
52  (clippingRange) \
53  (clippingPlanes) \
54  (fStop) \
55  (focusDistance) \
56  (shutterOpen) \
57  (shutterClose) \
58  (exposure) \
59  (focusOn) \
60  (dofAspect) \
61  (splitDiopter) \
62  (lensDistortion) \
63  (perspective) \
64  (orthographic) \
65 
66 TF_DECLARE_PUBLIC_TOKENS(HdCameraSchemaTokens, HD_API,
68 
69 //-----------------------------------------------------------------------------
70 
71 class HdCameraSchema : public HdSchema
72 {
73 public:
74  HdCameraSchema(HdContainerDataSourceHandle container)
75  : HdSchema(container) {}
76 
77  //ACCESSORS
78 
79  HD_API
81  HD_API
83  HD_API
85  HD_API
87  HD_API
89  HD_API
91  HD_API
93  HD_API
95  HD_API
97  HD_API
99  HD_API
101  HD_API
103  HD_API
105  HD_API
107  HD_API
109  HD_API
111  HD_API
113 
114  // RETRIEVING AND CONSTRUCTING
115 
116  /// Builds a container data source which includes the provided child data
117  /// sources. Parameters with nullptr values are excluded. This is a
118  /// low-level interface. For cases in which it's desired to define
119  /// the container with a sparse set of child fields, the Builder class
120  /// is often more convenient and readable.
121  HD_API
122  static HdContainerDataSourceHandle
124  const HdTokenDataSourceHandle &projection,
125  const HdFloatDataSourceHandle &horizontalAperture,
126  const HdFloatDataSourceHandle &verticalAperture,
127  const HdFloatDataSourceHandle &horizontalApertureOffset,
128  const HdFloatDataSourceHandle &verticalApertureOffset,
129  const HdFloatDataSourceHandle &focalLength,
130  const HdVec2fDataSourceHandle &clippingRange,
131  const HdVec4dArrayDataSourceHandle &clippingPlanes,
132  const HdFloatDataSourceHandle &fStop,
133  const HdFloatDataSourceHandle &focusDistance,
134  const HdDoubleDataSourceHandle &shutterOpen,
135  const HdDoubleDataSourceHandle &shutterClose,
136  const HdFloatDataSourceHandle &exposure,
137  const HdBoolDataSourceHandle &focusOn,
138  const HdFloatDataSourceHandle &dofAspect,
139  const HdContainerDataSourceHandle &splitDiopter,
140  const HdContainerDataSourceHandle &lensDistortion
141  );
142 
143  /// \class HdCameraSchema::Builder
144  ///
145  /// Utility class for setting sparse sets of child data source fields to be
146  /// filled as arguments into BuildRetained. Because all setter methods
147  /// return a reference to the instance, this can be used in the "builder
148  /// pattern" form.
149  class Builder
150  {
151  public:
152  HD_API
154  const HdTokenDataSourceHandle &projection);
155  HD_API
157  const HdFloatDataSourceHandle &horizontalAperture);
158  HD_API
160  const HdFloatDataSourceHandle &verticalAperture);
161  HD_API
163  const HdFloatDataSourceHandle &horizontalApertureOffset);
164  HD_API
166  const HdFloatDataSourceHandle &verticalApertureOffset);
167  HD_API
169  const HdFloatDataSourceHandle &focalLength);
170  HD_API
172  const HdVec2fDataSourceHandle &clippingRange);
173  HD_API
175  const HdVec4dArrayDataSourceHandle &clippingPlanes);
176  HD_API
177  Builder &SetFStop(
178  const HdFloatDataSourceHandle &fStop);
179  HD_API
181  const HdFloatDataSourceHandle &focusDistance);
182  HD_API
184  const HdDoubleDataSourceHandle &shutterOpen);
185  HD_API
187  const HdDoubleDataSourceHandle &shutterClose);
188  HD_API
190  const HdFloatDataSourceHandle &exposure);
191  HD_API
193  const HdBoolDataSourceHandle &focusOn);
194  HD_API
196  const HdFloatDataSourceHandle &dofAspect);
197  HD_API
199  const HdContainerDataSourceHandle &splitDiopter);
200  HD_API
202  const HdContainerDataSourceHandle &lensDistortion);
203 
204  /// Returns a container data source containing the members set thus far.
205  HD_API
206  HdContainerDataSourceHandle Build();
207 
208  private:
209  HdTokenDataSourceHandle _projection;
210  HdFloatDataSourceHandle _horizontalAperture;
211  HdFloatDataSourceHandle _verticalAperture;
212  HdFloatDataSourceHandle _horizontalApertureOffset;
213  HdFloatDataSourceHandle _verticalApertureOffset;
214  HdFloatDataSourceHandle _focalLength;
215  HdVec2fDataSourceHandle _clippingRange;
216  HdVec4dArrayDataSourceHandle _clippingPlanes;
218  HdFloatDataSourceHandle _focusDistance;
219  HdDoubleDataSourceHandle _shutterOpen;
220  HdDoubleDataSourceHandle _shutterClose;
221  HdFloatDataSourceHandle _exposure;
222  HdBoolDataSourceHandle _focusOn;
223  HdFloatDataSourceHandle _dofAspect;
224  HdContainerDataSourceHandle _splitDiopter;
225  HdContainerDataSourceHandle _lensDistortion;
226  };
227 
228  /// Retrieves a container data source with the schema's default name token
229  /// "camera" from the parent container and constructs a
230  /// HdCameraSchema instance.
231  /// Because the requested container data source may not exist, the result
232  /// should be checked with IsDefined() or a bool comparison before use.
233  HD_API
235  const HdContainerDataSourceHandle &fromParentContainer);
236 
237  /// Returns a token where the container representing this schema is found in
238  /// a container by default.
239  HD_API
240  static const TfToken &GetSchemaToken();
241 
242  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
243  /// where the container representing this schema is found by default.
244  HD_API
245  static const HdDataSourceLocator &GetDefaultLocator();
246 
247  /// Returns token data source for use as projection value.
248  /// Values of...
249  /// - HdCameraSchemaTokens->perspective
250  /// - HdCameraSchemaTokens->orthographic
251  /// ...will be stored statically and reused for future calls.
252  HD_API
254  const TfToken &projection);
255 
256 };
257 
259 
260 #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)
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()
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:74
HD_API HdDoubleDataSourceHandle GetShutterOpen()
HD_API Builder & SetDofAspect(const HdFloatDataSourceHandle &dofAspect)
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:1441
TF_DECLARE_PUBLIC_TOKENS(HdCameraSchemaTokens, HD_API, HDCAMERA_SCHEMA_TOKENS)
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()
#define HDCAMERA_SCHEMA_TOKENS
Definition: cameraSchema.h:44
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()