dataSourceCamera.h
1 //
2 // Copyright 2022 Pixar
3 //
4 // Licensed under the terms set forth in the LICENSE.txt file available at
5 // https://openusd.org/license.
6 //
7 
8 #ifndef PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_CAMERA_H
9 #define PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_CAMERA_H
10 
11 #include "pxr/usdImaging/usdImaging/dataSourcePrim.h"
12 #include "pxr/usdImaging/usdImaging/dataSourceStageGlobals.h"
13 
14 #include "pxr/usd/usdGeom/camera.h"
15 
16 #include "pxr/imaging/hd/dataSource.h"
17 
18 PXR_NAMESPACE_OPEN_SCOPE
19 
20 
26 {
27 public:
28  HD_DECLARE_DATASOURCE(UsdImagingDataSourceCamera);
29 
30  TfTokenVector GetNames() override;
31  HdDataSourceBaseHandle Get(const TfToken &name) override;
32 
33 private:
34 
35  // Private constructor, use static New() instead.
37  const SdfPath &sceneIndexPath,
38  UsdGeomCamera usdCamera,
39  const UsdImagingDataSourceStageGlobals &stageGlobals);
40 
41 private:
42  const SdfPath _sceneIndexPath;
43  UsdGeomCamera _usdCamera;
44  const UsdImagingDataSourceStageGlobals & _stageGlobals;
45 };
46 
47 HD_DECLARE_DATASOURCE_HANDLES(UsdImagingDataSourceCamera);
48 
54 {
55 public:
56  HD_DECLARE_DATASOURCE(UsdImagingDataSourceCameraPrim);
57 
58  TfTokenVector GetNames() override;
59  HdDataSourceBaseHandle Get(const TfToken &name) override;
60 
61  static
63  Invalidate(
64  UsdPrim const& prim,
65  const TfToken &subprim,
66  const TfTokenVector &properties,
67  UsdImagingPropertyInvalidationType invalidationType);
68 
69 private:
70 
71  // Private constructor, use static New() instead.
73  const SdfPath &sceneIndexPath,
74  UsdPrim usdPrim,
75  const UsdImagingDataSourceStageGlobals &stageGlobals);
76 };
77 
78 HD_DECLARE_DATASOURCE_HANDLES(UsdImagingDataSourceCameraPrim);
79 
80 PXR_NAMESPACE_CLOSE_SCOPE
81 
82 #endif // PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_CAMERA_H
A container data source representing camera info.
TfTokenVector GetNames() override
Returns the list of names for which Get(...) is expected to return a non-null value.
A datasource representing structured (named, hierarchical) data, for example a geometric primitive or...
Definition: dataSource.h:147
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:80
Data source representing a basic USD prim.
This class is used as a context object with global stage information, that gets passed down to dataso...
Represents a set of data source locators closed under descendancy.
HdDataSourceBaseHandle Get(const TfToken &name) override
Returns the child datasource of the given name.
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
Definition: prim.h:116
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:489
TfTokenVector GetNames() override
Returns the list of names for which Get(...) is expected to return a non-null value.
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:280
HdDataSourceBaseHandle Get(const TfToken &name) override
Returns the child datasource of the given name.
A prim data source representing UsdCamera.
Transformable camera.
Definition: camera.h:129