Loading...
Searching...
No Matches
freeCameraPrimDataSource.h
1//
2// Copyright 2024 Pixar
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://openusd.org/license.
6//
7#ifndef PXR_IMAGING_HDX_FREE_CAMERA_DATA_SOURCE_H
8#define PXR_IMAGING_HDX_FREE_CAMERA_DATA_SOURCE_H
9
10#include "pxr/pxr.h"
11#include "pxr/imaging/hdx/api.h"
12
13#include "pxr/imaging/cameraUtil/conformWindow.h"
14#include "pxr/imaging/hd/dataSource.h"
15
16#include "pxr/base/gf/camera.h"
17
18PXR_NAMESPACE_OPEN_SCOPE
19
20namespace HdxFreeCameraPrimDataSource_Impl {
21struct _Info;
22}
23
32{
33public:
34 HD_DECLARE_DATASOURCE(HdxFreeCameraPrimDataSource);
35
36 HDX_API
38
39 HDX_API
40 void SetCamera(
41 const GfCamera &camera,
42 HdDataSourceLocatorSet * dirtyLocators = nullptr);
43
44 HDX_API
45 void SetWindowPolicy(
46 CameraUtilConformWindowPolicy policy,
47 HdDataSourceLocatorSet * dirtyLocators = nullptr);
48
49 HDX_API
50 void SetViewAndProjectionMatrix(
51 const GfMatrix4d& viewMatrix,
52 const GfMatrix4d& projectionMatrix,
53 HdDataSourceLocatorSet * dirtyLocators = nullptr);
54
55 HDX_API
56 void SetClippingPlanes(
57 const std::vector<GfVec4f> &clippingPlanes,
58 HdDataSourceLocatorSet * dirtyLocators = nullptr);
59
60 HDX_API
61 HdDataSourceBaseHandle Get(const TfToken &name) override;
62
63 HDX_API
65
66private:
67 HDX_API
69 const GfCamera &camera = GfCamera(),
70 CameraUtilConformWindowPolicy policy = CameraUtilFit);
71
72 HDX_API
74 const GfMatrix4d& viewMatrix,
75 const GfMatrix4d& projectionMatrix,
76 CameraUtilConformWindowPolicy policy = CameraUtilFit);
77
78 std::shared_ptr<HdxFreeCameraPrimDataSource_Impl::_Info> const _info;
79};
80
81PXR_NAMESPACE_CLOSE_SCOPE
82
83#endif // PXR_IMAGING_HDX_FREE_CAMERA_DATA_SOURCE_H
Object-based representation of a camera.
Definition: camera.h:33
Stores a 4x4 matrix of double elements.
Definition: matrix4d.h:71
A datasource representing structured (named, hierarchical) data, for example a geometric primitive or...
Definition: dataSource.h:99
Represents a set of data source locators closed under descendancy.
A data source conforming to the HdCameraSchema and HdXformSchema populated from a GfCamera or camera ...
HDX_API TfTokenVector GetNames() override
Returns the list of names for which Get(...) is expected to return a non-null value.
HDX_API HdDataSourceBaseHandle Get(const TfToken &name) override
Returns the child datasource of the given name.
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:71
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:440