Loading...
Searching...
No Matches
unitTestHelper.h
1//
2// Copyright 2016 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_HD_UNIT_TEST_HELPER_H
8#define PXR_IMAGING_HD_UNIT_TEST_HELPER_H
9
10#include "pxr/pxr.h"
11#include "pxr/imaging/hd/api.h"
12#include "pxr/imaging/hd/engine.h"
13#include "pxr/imaging/hd/renderPass.h"
14#include "pxr/imaging/hd/renderPassState.h"
15#include "pxr/imaging/hd/unitTestDelegate.h"
16#include "pxr/imaging/hd/unitTestNullRenderDelegate.h"
17
18#include "pxr/base/gf/vec4d.h"
20
21#include <vector>
22
23PXR_NAMESPACE_OPEN_SCOPE
24
25
34class Hd_TestDriver final
35{
36public:
37 HD_API
38 Hd_TestDriver();
39 HD_API
40 Hd_TestDriver(HdReprSelector const &reprToken);
41 HD_API
42 ~Hd_TestDriver();
43
45 HD_API
46 void Draw(bool withGuides=false);
47
49 HD_API
50 void Draw(HdRenderPassSharedPtr const &renderPass, bool withGuides);
51
53 HD_API
54 void SetCamera(GfMatrix4d const &viewMatrix,
55 GfMatrix4d const &projectionMatrix,
56 CameraUtilFraming const &framing);
57
59 HD_API
60 void SetCullStyle(HdCullStyle cullStyle);
61
63 HD_API
64 HdRenderPassSharedPtr const &GetRenderPass();
65
67 HdRenderPassStateSharedPtr const &GetRenderPassState() const {
68 return _renderPassState;
69 }
70
72 HdUnitTestDelegate& GetDelegate() { return *_sceneDelegate; }
73
75 HD_API
76 void SetRepr(HdReprSelector const &reprSelector);
77
78private:
79
80 void _Init(HdReprSelector const &reprSelector);
81
82 HdEngine _engine;
83 Hd_UnitTestNullRenderDelegate _renderDelegate;
84 HdRenderIndex *_renderIndex;
85 HdUnitTestDelegate *_sceneDelegate;
86 SdfPath _cameraId;
87 HdRenderPassSharedPtr _renderPass;
88 HdRenderPassStateSharedPtr _renderPassState;
89 HdRprimCollection _collection;
90};
91
92PXR_NAMESPACE_CLOSE_SCOPE
93
94#endif // PXR_IMAGING_HD_UNIT_TEST_HELPER_H
Framing information.
Definition: framing.h:63
Stores a 4x4 matrix of double elements.
Definition: matrix4d.h:71
The application-facing entry point top-level entry point for accessing Hydra.
Definition: engine.h:31
The Hydra render index is a flattened representation of the client scene graph, which may be composed...
Definition: renderIndex.h:105
Describes one or more authored display representations for an rprim.
Definition: repr.h:32
A named, semantic collection of objects.
A simple delegate class for unit test driver.
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:274