cameraSchema.h
1 //
2 // Copyright 2021 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 //
25 // This file is generated by a script. Do not edit directly. Edit the
26 // schema.template.h file to make changes.
27 
28 #ifndef PXR_IMAGING_HD_CAMERA_SCHEMA_H
29 #define PXR_IMAGING_HD_CAMERA_SCHEMA_H
30 
31 #include "pxr/imaging/hd/api.h"
32 
33 #include "pxr/imaging/hd/schema.h"
34 
35 PXR_NAMESPACE_OPEN_SCOPE
36 
37 //-----------------------------------------------------------------------------
38 
39 #define HDCAMERA_SCHEMA_TOKENS \
40  (camera) \
41  (projection) \
42  (horizontalAperture) \
43  (verticalAperture) \
44  (horizontalApertureOffset) \
45  (verticalApertureOffset) \
46  (focalLength) \
47  (clippingRange) \
48  (clippingPlanes) \
49  (perspective) \
50  (orthographic) \
51 
52 TF_DECLARE_PUBLIC_TOKENS(HdCameraSchemaTokens, HD_API,
53  HDCAMERA_SCHEMA_TOKENS);
54 
55 //-----------------------------------------------------------------------------
56 
57 class HdCameraSchema : public HdSchema
58 {
59 public:
60  HdCameraSchema(HdContainerDataSourceHandle container)
61  : HdSchema(container) {}
62 
63  //ACCESSORS
64 
65  HD_API
66  HdTokenDataSourceHandle GetProjection();
67  HD_API
68  HdFloatDataSourceHandle GetHorizontalAperture();
69  HD_API
70  HdFloatDataSourceHandle GetVerticalAperture();
71  HD_API
72  HdFloatDataSourceHandle GetHorizontalApertureOffset();
73  HD_API
74  HdFloatDataSourceHandle GetVerticalApertureOffset();
75  HD_API
76  HdFloatDataSourceHandle GetFocalLength();
77  HD_API
78  HdVec2fDataSourceHandle GetClippingRange();
79  HD_API
80  HdVec4dArrayDataSourceHandle GetClippingPlanes();
81 
82  // RETRIEVING AND CONSTRUCTING
83 
89  HD_API
90  static HdContainerDataSourceHandle
91  BuildRetained(
92  const HdTokenDataSourceHandle &projection,
93  const HdFloatDataSourceHandle &horizontalAperture,
94  const HdFloatDataSourceHandle &verticalAperture,
95  const HdFloatDataSourceHandle &horizontalApertureOffset,
96  const HdFloatDataSourceHandle &verticalApertureOffset,
97  const HdFloatDataSourceHandle &focalLength,
98  const HdVec2fDataSourceHandle &clippingRange,
99  const HdVec4dArrayDataSourceHandle &clippingPlanes
100  );
101 
108  class Builder
109  {
110  public:
111  HD_API
112  Builder &SetProjection(
113  const HdTokenDataSourceHandle &projection);
114  HD_API
115  Builder &SetHorizontalAperture(
116  const HdFloatDataSourceHandle &horizontalAperture);
117  HD_API
118  Builder &SetVerticalAperture(
119  const HdFloatDataSourceHandle &verticalAperture);
120  HD_API
121  Builder &SetHorizontalApertureOffset(
122  const HdFloatDataSourceHandle &horizontalApertureOffset);
123  HD_API
124  Builder &SetVerticalApertureOffset(
125  const HdFloatDataSourceHandle &verticalApertureOffset);
126  HD_API
127  Builder &SetFocalLength(
128  const HdFloatDataSourceHandle &focalLength);
129  HD_API
130  Builder &SetClippingRange(
131  const HdVec2fDataSourceHandle &clippingRange);
132  HD_API
133  Builder &SetClippingPlanes(
134  const HdVec4dArrayDataSourceHandle &clippingPlanes);
135 
137  HD_API
138  HdContainerDataSourceHandle Build();
139 
140  private:
141  HdTokenDataSourceHandle _projection;
142  HdFloatDataSourceHandle _horizontalAperture;
143  HdFloatDataSourceHandle _verticalAperture;
144  HdFloatDataSourceHandle _horizontalApertureOffset;
145  HdFloatDataSourceHandle _verticalApertureOffset;
146  HdFloatDataSourceHandle _focalLength;
147  HdVec2fDataSourceHandle _clippingRange;
148  HdVec4dArrayDataSourceHandle _clippingPlanes;
149  };
150 
156  HD_API
157  static HdCameraSchema GetFromParent(
158  const HdContainerDataSourceHandle &fromParentContainer);
159 
162  HD_API
163  static const HdDataSourceLocator &GetDefaultLocator();
164 
170  HD_API
171  static HdTokenDataSourceHandle BuildProjectionDataSource(
172  const TfToken &projection);
173 
174 };
175 
176 PXR_NAMESPACE_CLOSE_SCOPE
177 
178 #endif
HD_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:87
Represents an object that can identify the location of a data source.
#define TF_DECLARE_PUBLIC_TOKENS(...)
Macro to define public tokens.
Definition: staticTokens.h:118
Schema classes represent a structured view of the inherently unstructured container data source passe...
Definition: schema.h:43
Utility class for setting sparse sets of child data source fields to be filled as arguments into Buil...
Definition: cameraSchema.h:108