Loading...
Searching...
No Matches
camera.h
Go to the documentation of this file.
1//
2// Copyright 2016 Pixar
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://openusd.org/license.
6//
7#ifndef USDGEOM_GENERATED_CAMERA_H
8#define USDGEOM_GENERATED_CAMERA_H
9
11
12#include "pxr/pxr.h"
13#include "pxr/usd/usdGeom/api.h"
15#include "pxr/usd/usd/prim.h"
16#include "pxr/usd/usd/stage.h"
18
19#include "pxr/base/gf/camera.h"
20
21#include "pxr/base/vt/value.h"
22
23#include "pxr/base/gf/vec3d.h"
24#include "pxr/base/gf/vec3f.h"
26
27#include "pxr/base/tf/token.h"
28#include "pxr/base/tf/type.h"
29
30PXR_NAMESPACE_OPEN_SCOPE
31
32class SdfAssetPath;
33
34// -------------------------------------------------------------------------- //
35// CAMERA //
36// -------------------------------------------------------------------------- //
37
130{
131public:
135 static const UsdSchemaKind schemaKind = UsdSchemaKind::ConcreteTyped;
136
141 explicit UsdGeomCamera(const UsdPrim& prim=UsdPrim())
142 : UsdGeomXformable(prim)
143 {
144 }
145
149 explicit UsdGeomCamera(const UsdSchemaBase& schemaObj)
150 : UsdGeomXformable(schemaObj)
151 {
152 }
153
155 USDGEOM_API
156 virtual ~UsdGeomCamera();
157
161 USDGEOM_API
162 static const TfTokenVector &
163 GetSchemaAttributeNames(bool includeInherited=true);
164
174 USDGEOM_API
175 static UsdGeomCamera
176 Get(const UsdStagePtr &stage, const SdfPath &path);
177
200 USDGEOM_API
201 static UsdGeomCamera
202 Define(const UsdStagePtr &stage, const SdfPath &path);
203
204protected:
208 USDGEOM_API
210
211private:
212 // needs to invoke _GetStaticTfType.
213 friend class UsdSchemaRegistry;
214 USDGEOM_API
215 static const TfType &_GetStaticTfType();
216
217 static bool _IsTypedSchema();
218
219 // override SchemaBase virtuals.
220 USDGEOM_API
221 const TfType &_GetTfType() const override;
222
223public:
224 // --------------------------------------------------------------------- //
225 // PROJECTION
226 // --------------------------------------------------------------------- //
235 USDGEOM_API
237
243 USDGEOM_API
244 UsdAttribute CreateProjectionAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
245
246public:
247 // --------------------------------------------------------------------- //
248 // HORIZONTALAPERTURE
249 // --------------------------------------------------------------------- //
259 USDGEOM_API
261
267 USDGEOM_API
268 UsdAttribute CreateHorizontalApertureAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
269
270public:
271 // --------------------------------------------------------------------- //
272 // VERTICALAPERTURE
273 // --------------------------------------------------------------------- //
283 USDGEOM_API
285
291 USDGEOM_API
292 UsdAttribute CreateVerticalApertureAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
293
294public:
295 // --------------------------------------------------------------------- //
296 // HORIZONTALAPERTUREOFFSET
297 // --------------------------------------------------------------------- //
306 USDGEOM_API
308
314 USDGEOM_API
315 UsdAttribute CreateHorizontalApertureOffsetAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
316
317public:
318 // --------------------------------------------------------------------- //
319 // VERTICALAPERTUREOFFSET
320 // --------------------------------------------------------------------- //
329 USDGEOM_API
331
337 USDGEOM_API
338 UsdAttribute CreateVerticalApertureOffsetAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
339
340public:
341 // --------------------------------------------------------------------- //
342 // FOCALLENGTH
343 // --------------------------------------------------------------------- //
352 USDGEOM_API
354
360 USDGEOM_API
361 UsdAttribute CreateFocalLengthAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
362
363public:
364 // --------------------------------------------------------------------- //
365 // CLIPPINGRANGE
366 // --------------------------------------------------------------------- //
375 USDGEOM_API
377
383 USDGEOM_API
384 UsdAttribute CreateClippingRangeAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
385
386public:
387 // --------------------------------------------------------------------- //
388 // CLIPPINGPLANES
389 // --------------------------------------------------------------------- //
400 USDGEOM_API
402
408 USDGEOM_API
409 UsdAttribute CreateClippingPlanesAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
410
411public:
412 // --------------------------------------------------------------------- //
413 // FSTOP
414 // --------------------------------------------------------------------- //
422 USDGEOM_API
424
430 USDGEOM_API
431 UsdAttribute CreateFStopAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
432
433public:
434 // --------------------------------------------------------------------- //
435 // FOCUSDISTANCE
436 // --------------------------------------------------------------------- //
445 USDGEOM_API
447
453 USDGEOM_API
454 UsdAttribute CreateFocusDistanceAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
455
456public:
457 // --------------------------------------------------------------------- //
458 // STEREOROLE
459 // --------------------------------------------------------------------- //
470 USDGEOM_API
472
478 USDGEOM_API
479 UsdAttribute CreateStereoRoleAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
480
481public:
482 // --------------------------------------------------------------------- //
483 // SHUTTEROPEN
484 // --------------------------------------------------------------------- //
494 USDGEOM_API
496
502 USDGEOM_API
503 UsdAttribute CreateShutterOpenAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
504
505public:
506 // --------------------------------------------------------------------- //
507 // SHUTTERCLOSE
508 // --------------------------------------------------------------------- //
519 USDGEOM_API
521
527 USDGEOM_API
528 UsdAttribute CreateShutterCloseAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
529
530public:
531 // --------------------------------------------------------------------- //
532 // EXPOSURE
533 // --------------------------------------------------------------------- //
544 USDGEOM_API
546
552 USDGEOM_API
553 UsdAttribute CreateExposureAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
554
555public:
556 // --------------------------------------------------------------------- //
557 // EXPOSUREISO
558 // --------------------------------------------------------------------- //
567 USDGEOM_API
569
575 USDGEOM_API
576 UsdAttribute CreateExposureIsoAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
577
578public:
579 // --------------------------------------------------------------------- //
580 // EXPOSURETIME
581 // --------------------------------------------------------------------- //
594 USDGEOM_API
596
602 USDGEOM_API
603 UsdAttribute CreateExposureTimeAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
604
605public:
606 // --------------------------------------------------------------------- //
607 // EXPOSUREFSTOP
608 // --------------------------------------------------------------------- //
622 USDGEOM_API
624
630 USDGEOM_API
631 UsdAttribute CreateExposureFStopAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
632
633public:
634 // --------------------------------------------------------------------- //
635 // EXPOSURERESPONSIVITY
636 // --------------------------------------------------------------------- //
646 USDGEOM_API
648
654 USDGEOM_API
655 UsdAttribute CreateExposureResponsivityAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
656
657public:
658 // ===================================================================== //
659 // Feel free to add custom code below this line, it will be preserved by
660 // the code generator.
661 //
662 // Just remember to:
663 // - Close the class declaration with };
664 // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
665 // - Close the include guard with #endif
666 // ===================================================================== //
667 // --(BEGIN CUSTOM CODE)--
668
671 USDGEOM_API
672 GfCamera GetCamera(const UsdTimeCode &time) const;
673
695 USDGEOM_API
696 void SetFromCamera(const GfCamera &camera, const UsdTimeCode &time);
697
708 USDGEOM_API
710};
711
712PXR_NAMESPACE_CLOSE_SCOPE
713
714#endif
Object-based representation of a camera.
Definition: camera.h:33
Contains an asset path and optional evaluated and resolved paths.
Definition: assetPath.h:78
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:274
TfType represents a dynamic runtime type.
Definition: type.h:48
Scenegraph object for authoring and retrieving numeric, string, and array valued data,...
Definition: attribute.h:183
Transformable camera.
Definition: camera.h:130
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 CreateExposureFStopAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetExposureFStopAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
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:135
USDGEOM_API UsdAttribute CreateExposureIsoAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetExposureIsoAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
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.
USDGEOM_API UsdAttribute CreateExposureResponsivityAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetExposureResponsivityAttr(), and also Create vs Get Property Methods for when to use Get vs Cre...
USDGEOM_API UsdAttribute GetExposureFStopAttr() const
f-stop of the aperture when calculating exposure.
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 compensation, as a log base-2 value.
USDGEOM_API UsdAttribute GetExposureTimeAttr() const
Time in seconds that the sensor is exposed to light when calculating exposure.
UsdGeomCamera(const UsdSchemaBase &schemaObj)
Construct a UsdGeomCamera on the prim held by schemaObj .
Definition: camera.h:149
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 GetExposureResponsivityAttr() const
Scalar multiplier representing overall responsivity of the sensor system to light when calculating ex...
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 float ComputeLinearExposureScale(UsdTimeCode time=UsdTimeCode::Default()) const
Computes the ratio between incident luminance and photometric exposure (in lux-seconds),...
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:141
USDGEOM_API UsdAttribute GetShutterCloseAttr() const
Frame relative shutter close time, analogous comments from shutter:open apply.
USDGEOM_API UsdAttribute CreateExposureTimeAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetExposureTimeAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
USDGEOM_API UsdAttribute GetVerticalApertureAttr() const
Vertical aperture in tenths of a scene unit; see Units of Measure for Camera Properties .
USDGEOM_API UsdAttribute GetExposureIsoAttr() const
The speed rating of the sensor or film when calculating exposure.
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:242
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
Definition: prim.h:117
The base class for all schema types in Usd.
Definition: schemaBase.h:39
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:72
static constexpr UsdTimeCode Default()
Produce a UsdTimeCode representing the sentinel value for 'default'.
Definition: timeCode.h:113
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition: value.h:152
UsdSchemaKind
An enum representing which kind of schema a given schema class belongs to.
Definition: common.h:112
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:440