Loading...
Searching...
No Matches
camera.h
Go to the documentation of this file.
1//
2// Copyright 2016 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#ifndef USDGEOM_GENERATED_CAMERA_H
25#define USDGEOM_GENERATED_CAMERA_H
26
28
29#include "pxr/pxr.h"
30#include "pxr/usd/usdGeom/api.h"
32#include "pxr/usd/usd/prim.h"
33#include "pxr/usd/usd/stage.h"
35
36#include "pxr/base/gf/camera.h"
37
38#include "pxr/base/vt/value.h"
39
40#include "pxr/base/gf/vec3d.h"
41#include "pxr/base/gf/vec3f.h"
43
44#include "pxr/base/tf/token.h"
45#include "pxr/base/tf/type.h"
46
47PXR_NAMESPACE_OPEN_SCOPE
48
49class SdfAssetPath;
50
51// -------------------------------------------------------------------------- //
52// CAMERA //
53// -------------------------------------------------------------------------- //
54
112{
113public:
117 static const UsdSchemaKind schemaKind = UsdSchemaKind::ConcreteTyped;
118
123 explicit UsdGeomCamera(const UsdPrim& prim=UsdPrim())
124 : UsdGeomXformable(prim)
125 {
126 }
127
131 explicit UsdGeomCamera(const UsdSchemaBase& schemaObj)
132 : UsdGeomXformable(schemaObj)
133 {
134 }
135
137 USDGEOM_API
138 virtual ~UsdGeomCamera();
139
143 USDGEOM_API
144 static const TfTokenVector &
145 GetSchemaAttributeNames(bool includeInherited=true);
146
156 USDGEOM_API
157 static UsdGeomCamera
158 Get(const UsdStagePtr &stage, const SdfPath &path);
159
182 USDGEOM_API
183 static UsdGeomCamera
184 Define(const UsdStagePtr &stage, const SdfPath &path);
185
186protected:
190 USDGEOM_API
192
193private:
194 // needs to invoke _GetStaticTfType.
195 friend class UsdSchemaRegistry;
196 USDGEOM_API
197 static const TfType &_GetStaticTfType();
198
199 static bool _IsTypedSchema();
200
201 // override SchemaBase virtuals.
202 USDGEOM_API
203 const TfType &_GetTfType() const override;
204
205public:
206 // --------------------------------------------------------------------- //
207 // PROJECTION
208 // --------------------------------------------------------------------- //
217 USDGEOM_API
219
225 USDGEOM_API
226 UsdAttribute CreateProjectionAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
227
228public:
229 // --------------------------------------------------------------------- //
230 // HORIZONTALAPERTURE
231 // --------------------------------------------------------------------- //
241 USDGEOM_API
243
249 USDGEOM_API
250 UsdAttribute CreateHorizontalApertureAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
251
252public:
253 // --------------------------------------------------------------------- //
254 // VERTICALAPERTURE
255 // --------------------------------------------------------------------- //
265 USDGEOM_API
267
273 USDGEOM_API
274 UsdAttribute CreateVerticalApertureAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
275
276public:
277 // --------------------------------------------------------------------- //
278 // HORIZONTALAPERTUREOFFSET
279 // --------------------------------------------------------------------- //
288 USDGEOM_API
290
296 USDGEOM_API
297 UsdAttribute CreateHorizontalApertureOffsetAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
298
299public:
300 // --------------------------------------------------------------------- //
301 // VERTICALAPERTUREOFFSET
302 // --------------------------------------------------------------------- //
311 USDGEOM_API
313
319 USDGEOM_API
320 UsdAttribute CreateVerticalApertureOffsetAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
321
322public:
323 // --------------------------------------------------------------------- //
324 // FOCALLENGTH
325 // --------------------------------------------------------------------- //
334 USDGEOM_API
336
342 USDGEOM_API
343 UsdAttribute CreateFocalLengthAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
344
345public:
346 // --------------------------------------------------------------------- //
347 // CLIPPINGRANGE
348 // --------------------------------------------------------------------- //
357 USDGEOM_API
359
365 USDGEOM_API
366 UsdAttribute CreateClippingRangeAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
367
368public:
369 // --------------------------------------------------------------------- //
370 // CLIPPINGPLANES
371 // --------------------------------------------------------------------- //
382 USDGEOM_API
384
390 USDGEOM_API
391 UsdAttribute CreateClippingPlanesAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
392
393public:
394 // --------------------------------------------------------------------- //
395 // FSTOP
396 // --------------------------------------------------------------------- //
404 USDGEOM_API
406
412 USDGEOM_API
413 UsdAttribute CreateFStopAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
414
415public:
416 // --------------------------------------------------------------------- //
417 // FOCUSDISTANCE
418 // --------------------------------------------------------------------- //
427 USDGEOM_API
429
435 USDGEOM_API
436 UsdAttribute CreateFocusDistanceAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
437
438public:
439 // --------------------------------------------------------------------- //
440 // STEREOROLE
441 // --------------------------------------------------------------------- //
452 USDGEOM_API
454
460 USDGEOM_API
461 UsdAttribute CreateStereoRoleAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
462
463public:
464 // --------------------------------------------------------------------- //
465 // SHUTTEROPEN
466 // --------------------------------------------------------------------- //
476 USDGEOM_API
478
484 USDGEOM_API
485 UsdAttribute CreateShutterOpenAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
486
487public:
488 // --------------------------------------------------------------------- //
489 // SHUTTERCLOSE
490 // --------------------------------------------------------------------- //
501 USDGEOM_API
503
509 USDGEOM_API
510 UsdAttribute CreateShutterCloseAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
511
512public:
513 // --------------------------------------------------------------------- //
514 // EXPOSURE
515 // --------------------------------------------------------------------- //
526 USDGEOM_API
528
534 USDGEOM_API
535 UsdAttribute CreateExposureAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
536
537public:
538 // ===================================================================== //
539 // Feel free to add custom code below this line, it will be preserved by
540 // the code generator.
541 //
542 // Just remember to:
543 // - Close the class declaration with };
544 // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
545 // - Close the include guard with #endif
546 // ===================================================================== //
547 // --(BEGIN CUSTOM CODE)--
548
551 USDGEOM_API
552 GfCamera GetCamera(const UsdTimeCode &time) const;
553
575 USDGEOM_API
576 void SetFromCamera(const GfCamera &camera, const UsdTimeCode &time);
577};
578
579PXR_NAMESPACE_CLOSE_SCOPE
580
581#endif
Object-based representation of a camera.
Definition: camera.h:50
Contains an asset path and an optional resolved path.
Definition: assetPath.h:47
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:290
TfType represents a dynamic runtime type.
Definition: type.h:65
Scenegraph object for authoring and retrieving numeric, string, and array valued data,...
Definition: attribute.h:176
Transformable camera.
Definition: camera.h:112
USDGEOM_API UsdAttribute GetShutterOpenAttr() const
Frame relative shutter open time in UsdTimeCode units (negative value indicates that the shutter open...
USDGEOM_API UsdAttribute CreateExposureAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetExposureAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
USDGEOM_API UsdAttribute CreateFStopAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetFStopAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
USDGEOM_API UsdAttribute CreateVerticalApertureOffsetAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetVerticalApertureOffsetAttr(), and also Create vs Get Property Methods for when to use Get vs C...
USDGEOM_API UsdAttribute GetFocalLengthAttr() const
Perspective focal length in tenths of a scene unit; see Units of Measure for Camera Properties .
USDGEOM_API void SetFromCamera(const GfCamera &camera, const UsdTimeCode &time)
Write attribute values from camera for time.
USDGEOM_API UsdAttribute CreateFocusDistanceAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetFocusDistanceAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
USDGEOM_API UsdAttribute CreateFocalLengthAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetFocalLengthAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
USDGEOM_API UsdAttribute CreateShutterCloseAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetShutterCloseAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
USDGEOM_API UsdAttribute GetStereoRoleAttr() const
If different from mono, the camera is intended to be the left or right camera of a stereo setup.
static USDGEOM_API UsdGeomCamera Get(const UsdStagePtr &stage, const SdfPath &path)
Return a UsdGeomCamera holding the prim adhering to this schema at path on stage.
static USDGEOM_API UsdGeomCamera Define(const UsdStagePtr &stage, const SdfPath &path)
Attempt to ensure a UsdPrim adhering to this schema at path is defined (according to UsdPrim::IsDefin...
USDGEOM_API UsdAttribute GetFStopAttr() const
Lens aperture.
static const UsdSchemaKind schemaKind
Compile time constant representing what kind of schema this class is.
Definition: camera.h:117
USDGEOM_API UsdAttribute GetHorizontalApertureOffsetAttr() const
Horizontal aperture offset in the same units as horizontalAperture.
USDGEOM_API UsdSchemaKind _GetSchemaKind() const override
Returns the kind of schema this class belongs to.
virtual USDGEOM_API ~UsdGeomCamera()
Destructor.
USDGEOM_API UsdAttribute CreateStereoRoleAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetStereoRoleAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
static USDGEOM_API const TfTokenVector & GetSchemaAttributeNames(bool includeInherited=true)
Return a vector of names of all pre-declared attributes for this schema class and all its ancestor cl...
USDGEOM_API UsdAttribute CreateHorizontalApertureOffsetAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetHorizontalApertureOffsetAttr(), and also Create vs Get Property Methods for when to use Get vs...
USDGEOM_API UsdAttribute CreateVerticalApertureAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetVerticalApertureAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
USDGEOM_API UsdAttribute GetExposureAttr() const
Exposure adjustment, as a log base-2 value.
UsdGeomCamera(const UsdSchemaBase &schemaObj)
Construct a UsdGeomCamera on the prim held by schemaObj .
Definition: camera.h:131
USDGEOM_API UsdAttribute GetClippingPlanesAttr() const
Additional, arbitrarily oriented clipping planes.
USDGEOM_API GfCamera GetCamera(const UsdTimeCode &time) const
Creates a GfCamera object from the attribute values at time.
USDGEOM_API UsdAttribute CreateShutterOpenAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetShutterOpenAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
USDGEOM_API UsdAttribute GetFocusDistanceAttr() const
Distance from the camera to the focus plane in scene units; see Units of Measure for Camera Propertie...
USDGEOM_API UsdAttribute GetClippingRangeAttr() const
Near and far clipping distances in scene units; see Units of Measure for Camera Properties .
USDGEOM_API UsdAttribute CreateClippingPlanesAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetClippingPlanesAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
USDGEOM_API UsdAttribute GetProjectionAttr() const
USDGEOM_API UsdAttribute CreateClippingRangeAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetClippingRangeAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
USDGEOM_API UsdAttribute GetVerticalApertureOffsetAttr() const
Vertical aperture offset in the same units as verticalAperture.
USDGEOM_API UsdAttribute CreateProjectionAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetProjectionAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
USDGEOM_API UsdAttribute GetHorizontalApertureAttr() const
Horizontal aperture in tenths of a scene unit; see Units of Measure for Camera Properties .
UsdGeomCamera(const UsdPrim &prim=UsdPrim())
Construct a UsdGeomCamera on UsdPrim prim .
Definition: camera.h:123
USDGEOM_API UsdAttribute GetShutterCloseAttr() const
Frame relative shutter close time, analogous comments from shutter:open apply.
USDGEOM_API UsdAttribute GetVerticalApertureAttr() const
Vertical aperture in tenths of a scene unit; see Units of Measure for Camera Properties .
USDGEOM_API UsdAttribute CreateHorizontalApertureAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetHorizontalApertureAttr(), and also Create vs Get Property Methods for when to use Get vs Creat...
Base class for all transformable prims, which allows arbitrary sequences of component affine transfor...
Definition: xformable.h:253
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
Definition: prim.h:134
The base class for all schema types in Usd.
Definition: schemaBase.h:56
Singleton registry that provides access to schema type information and the prim definitions for regis...
Represent a time value, which may be either numeric, holding a double value, or a sentinel value UsdT...
Definition: timeCode.h:84
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition: value.h:164
UsdSchemaKind
An enum representing which kind of schema a given schema class belongs to.
Definition: common.h:129
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:457