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 
90 {
91 public:
96 
101  explicit UsdGeomCamera(const UsdPrim& prim=UsdPrim())
102  : UsdGeomXformable(prim)
103  {
104  }
105 
109  explicit UsdGeomCamera(const UsdSchemaBase& schemaObj)
110  : UsdGeomXformable(schemaObj)
111  {
112  }
113 
115  USDGEOM_API
116  virtual ~UsdGeomCamera();
117 
121  USDGEOM_API
122  static const TfTokenVector &
123  GetSchemaAttributeNames(bool includeInherited=true);
124 
134  USDGEOM_API
135  static UsdGeomCamera
136  Get(const UsdStagePtr &stage, const SdfPath &path);
137 
160  USDGEOM_API
161  static UsdGeomCamera
162  Define(const UsdStagePtr &stage, const SdfPath &path);
163 
164 protected:
168  USDGEOM_API
169  UsdSchemaType _GetSchemaType() const override;
170 
171 private:
172  // needs to invoke _GetStaticTfType.
173  friend class UsdSchemaRegistry;
174  USDGEOM_API
175  static const TfType &_GetStaticTfType();
176 
177  static bool _IsTypedSchema();
178 
179  // override SchemaBase virtuals.
180  USDGEOM_API
181  const TfType &_GetTfType() const override;
182 
183 public:
184  // --------------------------------------------------------------------- //
185  // PROJECTION
186  // --------------------------------------------------------------------- //
194  USDGEOM_API
196 
202  USDGEOM_API
203  UsdAttribute CreateProjectionAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
204 
205 public:
206  // --------------------------------------------------------------------- //
207  // HORIZONTALAPERTURE
208  // --------------------------------------------------------------------- //
217  USDGEOM_API
219 
225  USDGEOM_API
226  UsdAttribute CreateHorizontalApertureAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
227 
228 public:
229  // --------------------------------------------------------------------- //
230  // VERTICALAPERTURE
231  // --------------------------------------------------------------------- //
240  USDGEOM_API
242 
248  USDGEOM_API
249  UsdAttribute CreateVerticalApertureAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
250 
251 public:
252  // --------------------------------------------------------------------- //
253  // HORIZONTALAPERTUREOFFSET
254  // --------------------------------------------------------------------- //
262  USDGEOM_API
264 
270  USDGEOM_API
271  UsdAttribute CreateHorizontalApertureOffsetAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
272 
273 public:
274  // --------------------------------------------------------------------- //
275  // VERTICALAPERTUREOFFSET
276  // --------------------------------------------------------------------- //
284  USDGEOM_API
286 
292  USDGEOM_API
293  UsdAttribute CreateVerticalApertureOffsetAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
294 
295 public:
296  // --------------------------------------------------------------------- //
297  // FOCALLENGTH
298  // --------------------------------------------------------------------- //
306  USDGEOM_API
308 
314  USDGEOM_API
315  UsdAttribute CreateFocalLengthAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
316 
317 public:
318  // --------------------------------------------------------------------- //
319  // CLIPPINGRANGE
320  // --------------------------------------------------------------------- //
328  USDGEOM_API
330 
336  USDGEOM_API
337  UsdAttribute CreateClippingRangeAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
338 
339 public:
340  // --------------------------------------------------------------------- //
341  // CLIPPINGPLANES
342  // --------------------------------------------------------------------- //
352  USDGEOM_API
354 
360  USDGEOM_API
361  UsdAttribute CreateClippingPlanesAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
362 
363 public:
364  // --------------------------------------------------------------------- //
365  // FSTOP
366  // --------------------------------------------------------------------- //
373  USDGEOM_API
374  UsdAttribute GetFStopAttr() const;
375 
381  USDGEOM_API
382  UsdAttribute CreateFStopAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
383 
384 public:
385  // --------------------------------------------------------------------- //
386  // FOCUSDISTANCE
387  // --------------------------------------------------------------------- //
395  USDGEOM_API
397 
403  USDGEOM_API
404  UsdAttribute CreateFocusDistanceAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
405 
406 public:
407  // --------------------------------------------------------------------- //
408  // STEREOROLE
409  // --------------------------------------------------------------------- //
418  USDGEOM_API
420 
426  USDGEOM_API
427  UsdAttribute CreateStereoRoleAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
428 
429 public:
430  // --------------------------------------------------------------------- //
431  // SHUTTEROPEN
432  // --------------------------------------------------------------------- //
441  USDGEOM_API
443 
449  USDGEOM_API
450  UsdAttribute CreateShutterOpenAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
451 
452 public:
453  // --------------------------------------------------------------------- //
454  // SHUTTERCLOSE
455  // --------------------------------------------------------------------- //
465  USDGEOM_API
467 
473  USDGEOM_API
474  UsdAttribute CreateShutterCloseAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
475 
476 public:
477  // ===================================================================== //
478  // Feel free to add custom code below this line, it will be preserved by
479  // the code generator.
480  //
481  // Just remember to:
482  // - Close the class declaration with };
483  // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
484  // - Close the include guard with #endif
485  // ===================================================================== //
486  // --(BEGIN CUSTOM CODE)--
487 
490  USDGEOM_API
491  GfCamera GetCamera(const UsdTimeCode &time) const;
492 
495  USDGEOM_API
496  void SetFromCamera(const GfCamera &camera, const UsdTimeCode &time);
497 };
498 
499 PXR_NAMESPACE_CLOSE_SCOPE
500 
501 #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:109
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:101
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:149
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:438
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
C++ Type: TfToken Usd Type: SdfValueTypeNames-&gt;Token Variability: SdfVariabilityVarying Fallb...
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:95
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:89