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"
34 #include "pxr/usd/usdGeom/tokens.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"
42 #include "pxr/base/gf/matrix4d.h"
43 
44 #include "pxr/base/tf/token.h"
45 #include "pxr/base/tf/type.h"
46 
47 PXR_NAMESPACE_OPEN_SCOPE
48 
49 class SdfAssetPath;
50 
51 // -------------------------------------------------------------------------- //
52 // CAMERA //
53 // -------------------------------------------------------------------------- //
54 
91 {
92 public:
97 
102  explicit UsdGeomCamera(const UsdPrim& prim=UsdPrim())
103  : UsdGeomXformable(prim)
104  {
105  }
106 
110  explicit UsdGeomCamera(const UsdSchemaBase& schemaObj)
111  : UsdGeomXformable(schemaObj)
112  {
113  }
114 
116  USDGEOM_API
117  virtual ~UsdGeomCamera();
118 
122  USDGEOM_API
123  static const TfTokenVector &
124  GetSchemaAttributeNames(bool includeInherited=true);
125 
135  USDGEOM_API
136  static UsdGeomCamera
137  Get(const UsdStagePtr &stage, const SdfPath &path);
138 
161  USDGEOM_API
162  static UsdGeomCamera
163  Define(const UsdStagePtr &stage, const SdfPath &path);
164 
165 protected:
169  USDGEOM_API
170  UsdSchemaKind _GetSchemaKind() const override;
171 
172 private:
173  // needs to invoke _GetStaticTfType.
174  friend class UsdSchemaRegistry;
175  USDGEOM_API
176  static const TfType &_GetStaticTfType();
177 
178  static bool _IsTypedSchema();
179 
180  // override SchemaBase virtuals.
181  USDGEOM_API
182  const TfType &_GetTfType() const override;
183 
184 public:
185  // --------------------------------------------------------------------- //
186  // PROJECTION
187  // --------------------------------------------------------------------- //
196  USDGEOM_API
198 
204  USDGEOM_API
205  UsdAttribute CreateProjectionAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
206 
207 public:
208  // --------------------------------------------------------------------- //
209  // HORIZONTALAPERTURE
210  // --------------------------------------------------------------------- //
220  USDGEOM_API
222 
228  USDGEOM_API
229  UsdAttribute CreateHorizontalApertureAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
230 
231 public:
232  // --------------------------------------------------------------------- //
233  // VERTICALAPERTURE
234  // --------------------------------------------------------------------- //
244  USDGEOM_API
246 
252  USDGEOM_API
253  UsdAttribute CreateVerticalApertureAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
254 
255 public:
256  // --------------------------------------------------------------------- //
257  // HORIZONTALAPERTUREOFFSET
258  // --------------------------------------------------------------------- //
267  USDGEOM_API
269 
275  USDGEOM_API
276  UsdAttribute CreateHorizontalApertureOffsetAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
277 
278 public:
279  // --------------------------------------------------------------------- //
280  // VERTICALAPERTUREOFFSET
281  // --------------------------------------------------------------------- //
290  USDGEOM_API
292 
298  USDGEOM_API
299  UsdAttribute CreateVerticalApertureOffsetAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
300 
301 public:
302  // --------------------------------------------------------------------- //
303  // FOCALLENGTH
304  // --------------------------------------------------------------------- //
313  USDGEOM_API
315 
321  USDGEOM_API
322  UsdAttribute CreateFocalLengthAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
323 
324 public:
325  // --------------------------------------------------------------------- //
326  // CLIPPINGRANGE
327  // --------------------------------------------------------------------- //
336  USDGEOM_API
338 
344  USDGEOM_API
345  UsdAttribute CreateClippingRangeAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
346 
347 public:
348  // --------------------------------------------------------------------- //
349  // CLIPPINGPLANES
350  // --------------------------------------------------------------------- //
361  USDGEOM_API
363 
369  USDGEOM_API
370  UsdAttribute CreateClippingPlanesAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
371 
372 public:
373  // --------------------------------------------------------------------- //
374  // FSTOP
375  // --------------------------------------------------------------------- //
383  USDGEOM_API
384  UsdAttribute GetFStopAttr() const;
385 
391  USDGEOM_API
392  UsdAttribute CreateFStopAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
393 
394 public:
395  // --------------------------------------------------------------------- //
396  // FOCUSDISTANCE
397  // --------------------------------------------------------------------- //
406  USDGEOM_API
408 
414  USDGEOM_API
415  UsdAttribute CreateFocusDistanceAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
416 
417 public:
418  // --------------------------------------------------------------------- //
419  // STEREOROLE
420  // --------------------------------------------------------------------- //
431  USDGEOM_API
433 
439  USDGEOM_API
440  UsdAttribute CreateStereoRoleAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
441 
442 public:
443  // --------------------------------------------------------------------- //
444  // SHUTTEROPEN
445  // --------------------------------------------------------------------- //
455  USDGEOM_API
457 
463  USDGEOM_API
464  UsdAttribute CreateShutterOpenAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
465 
466 public:
467  // --------------------------------------------------------------------- //
468  // SHUTTERCLOSE
469  // --------------------------------------------------------------------- //
480  USDGEOM_API
482 
488  USDGEOM_API
489  UsdAttribute CreateShutterCloseAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
490 
491 public:
492  // --------------------------------------------------------------------- //
493  // EXPOSURE
494  // --------------------------------------------------------------------- //
505  USDGEOM_API
507 
513  USDGEOM_API
514  UsdAttribute CreateExposureAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
515 
516 public:
517  // ===================================================================== //
518  // Feel free to add custom code below this line, it will be preserved by
519  // the code generator.
520  //
521  // Just remember to:
522  // - Close the class declaration with };
523  // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
524  // - Close the include guard with #endif
525  // ===================================================================== //
526  // --(BEGIN CUSTOM CODE)--
527 
530  USDGEOM_API
531  GfCamera GetCamera(const UsdTimeCode &time) const;
532 
535  USDGEOM_API
536  void SetFromCamera(const GfCamera &camera, const UsdTimeCode &time);
537 };
538 
539 PXR_NAMESPACE_CLOSE_SCOPE
540 
541 #endif
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...
Object-based representation of a camera.
Definition: camera.h:49
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 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 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 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.
UsdGeomCamera(const UsdSchemaBase &schemaObj)
Construct a UsdGeomCamera on the prim held by schemaObj .
Definition: camera.h:110
USDGEOM_API GfCamera GetCamera(const UsdTimeCode &time) const
Creates a GfCamera object from the attribute values at time.
USDGEOM_API UsdAttribute GetShutterOpenAttr() const
Frame relative shutter open time in UsdTimeCode units (negative value indicates that the shutter open...
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 CreateHorizontalApertureOffsetAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetHorizontalApertureOffsetAttr(), and also Create vs Get Property Methods for when to use Get vs...
Scenegraph object for authoring and retrieving numeric, string, and array valued data,...
Definition: attribute.h:176
static const UsdSchemaKind schemaKind
Compile time constant representing what kind of schema this class is.
Definition: camera.h:96
UsdGeomCamera(const UsdPrim &prim=UsdPrim())
Construct a UsdGeomCamera on UsdPrim prim .
Definition: camera.h:102
USDGEOM_API UsdAttribute GetHorizontalApertureAttr() const
Horizontal aperture in millimeters (or, more general, tenths of a world unit).
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.
UsdSchemaKind
An enum representing which kind of schema a given schema class belongs to.
Definition: common.h:127
USDGEOM_API UsdAttribute GetFStopAttr() const
Lens aperture.
USDGEOM_API UsdAttribute GetFocalLengthAttr() const
Perspective focal length in millimeters (or, more general, tenths of a world unit).
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...
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 GetVerticalApertureOffsetAttr() const
Vertical aperture offset in the same units as verticalAperture.
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 GetClippingPlanesAttr() const
Additional, arbitrarily oriented clipping planes.
Represent a time value, which may be either numeric, holding a double value, or a sentinel value UsdT...
Definition: timeCode.h:85
USDGEOM_API UsdAttribute GetProjectionAttr() const
USDGEOM_API UsdSchemaKind _GetSchemaKind() const override
Returns the kind of schema this class belongs to.
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...
Represents a concrete typed schema.
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
Definition: prim.h:132
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:442
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:288
USDGEOM_API UsdAttribute GetFocusDistanceAttr() const
Distance from the camera to the focus plane in centimeters (or more general, world units).
USDGEOM_API UsdAttribute GetShutterCloseAttr() const
Frame relative shutter close time, analogous comments from shutter:open apply.
virtual USDGEOM_API ~UsdGeomCamera()
Destructor.
USDGEOM_API UsdAttribute GetVerticalApertureAttr() const
Vertical aperture in millimeters (or, more general, tenths of a world unit).
Contains an asset path and an optional resolved path.
Definition: assetPath.h:47
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 GetExposureAttr() const
Exposure adjustment, as a log base-2 value.
USDGEOM_API void SetFromCamera(const GfCamera &camera, const UsdTimeCode &time)
Write attribute values from camera for time.
TfType represents a dynamic runtime type.
Definition: type.h:64
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.
Singleton registry that provides access to schema type information and the prim definitions for regis...
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 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.
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.
The base class for all schema types in Usd.
Definition: schemaBase.h:56
USDGEOM_API UsdAttribute GetHorizontalApertureOffsetAttr() const
Horizontal aperture offset in the same units as horizontalAperture.
Base class for all transformable prims, which allows arbitrary sequences of component affine transfor...
Definition: xformable.h:252
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition: value.h:168
USDGEOM_API UsdAttribute GetStereoRoleAttr() const
If different from mono, the camera is intended to be the left or right camera of a stereo setup.
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...
USDGEOM_API UsdAttribute GetClippingRangeAttr() const
Near and far clipping distances in centimeters (or, more general, world units).
Transformable camera.
Definition: camera.h:90