All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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"
31 #include "pxr/usd/usdGeom/xformable.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  UsdSchemaType _GetSchemaType() 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  // Feel free to add custom code below this line, it will be preserved by
494  // the code generator.
495  //
496  // Just remember to:
497  // - Close the class declaration with };
498  // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
499  // - Close the include guard with #endif
500  // ===================================================================== //
501  // --(BEGIN CUSTOM CODE)--
502 
505  USDGEOM_API
506  GfCamera GetCamera(const UsdTimeCode &time) const;
507 
510  USDGEOM_API
511  void SetFromCamera(const GfCamera &camera, const UsdTimeCode &time);
512 };
513 
514 PXR_NAMESPACE_CLOSE_SCOPE
515 
516 #endif
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...
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 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 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 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 GetFocusDistanceAttr() const
Distance from the camera to the focus plane in centimeters (or more general, world units)...
Object-based representation of a camera.
Definition: camera.h:49
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 GfCamera GetCamera(const UsdTimeCode &time) const
Creates a GfCamera object from the attribute values at time.
USDGEOM_API UsdAttribute GetVerticalApertureAttr() const
Vertical aperture in millimeters (or, more general, tenths of a world unit).
UsdGeomCamera(const UsdSchemaBase &schemaObj)
Construct a UsdGeomCamera on the prim held by schemaObj .
Definition: camera.h:110
USDGEOM_API UsdSchemaType _GetSchemaType() const override
Returns the type of schema this class belongs to.
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...
Scenegraph object for authoring and retrieving numeric, string, and array valued data, sampled over time.
Definition: attribute.h:176
Represents a concrete typed schema.
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...
UsdGeomCamera(const UsdPrim &prim=UsdPrim())
Construct a UsdGeomCamera on UsdPrim prim .
Definition: camera.h:102
USDGEOM_API UsdAttribute GetClippingRangeAttr() const
Near and far clipping distances in centimeters (or, more general, world units).
USDGEOM_API UsdAttribute GetVerticalApertureOffsetAttr() const
Vertical aperture offset in the same units as verticalAperture.
USDGEOM_API UsdAttribute GetShutterCloseAttr() const
Frame relative shutter close time, analogous comments from shutter:open apply.
USDGEOM_API UsdAttribute GetFStopAttr() const
Lens aperture.
Represent a time value, which may be either numeric, holding a double value, or a sentinel value UsdT...
Definition: timeCode.h:85
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...
UsdSchemaType
An enum representing which type of schema a given schema class belongs to.
Definition: common.h:127
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
Definition: prim.h:131
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:433
USDGEOM_API UsdAttribute GetClippingPlanesAttr() const
Additional, arbitrarily oriented clipping planes.
USDGEOM_API UsdAttribute GetFocalLengthAttr() const
Perspective focal length in millimeters (or, more general, tenths of a world unit).
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:287
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 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 GetHorizontalApertureOffsetAttr() const
Horizontal aperture offset in the same units as horizontalAperture.
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 GetProjectionAttr() const
Declaration token projection = &quot;perspective&quot; C++ Type TfToken Usd Type SdfValueTypeNames-&gt;Token Allow...
virtual USDGEOM_API ~UsdGeomCamera()
Destructor.
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...
Contains an asset path and an optional resolved path.
Definition: assetPath.h:43
static const UsdSchemaType schemaType
Compile time constant representing what kind of schema this class is.
Definition: camera.h:96
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:70
Singleton registry that provides access to prim and property definition information for registered Us...
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 GetShutterOpenAttr() const
Frame relative shutter open time in UsdTimeCode units (negative value indicates that the shutter open...
Base class for all transformable prims, which allows arbitrary sequences of component affine transfor...
Definition: xformable.h:252
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...
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition: value.h:182
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 GetStereoRoleAttr() const
If different from mono, the camera is intended to be the left or right camera of a stereo setup...
USDGEOM_API UsdAttribute GetHorizontalApertureAttr() const
Horizontal aperture in millimeters (or, more general, tenths of a world unit).
Transformable camera.
Definition: camera.h:90