Loading...
Searching...
No Matches
noticeBatchingSceneIndex.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#ifndef PXR_IMAGING_HD_NOTICE_BATCHING_SCENE_INDEX_H
8#define PXR_IMAGING_HD_NOTICE_BATCHING_SCENE_INDEX_H
9
10#include "pxr/pxr.h"
11#include "pxr/imaging/hd/api.h"
12#include "pxr/imaging/hd/filteringSceneIndex.h"
13
14PXR_NAMESPACE_OPEN_SCOPE
15
16class HdNoticeBatchingSceneIndex;
17TF_DECLARE_REF_PTRS(HdNoticeBatchingSceneIndex);
18
19class HdNoticeBatchingSceneIndex : public HdSingleInputFilteringSceneIndexBase
20{
21public:
24 static HdNoticeBatchingSceneIndexRefPtr New(
25 const HdSceneIndexBaseRefPtr &inputScene) {
26 return TfCreateRefPtr(new HdNoticeBatchingSceneIndex(inputScene));
27 }
28
29 HD_API
30 ~HdNoticeBatchingSceneIndex() override;
31
32 // satisfying HdSceneIndexBase
33 HD_API
34 HdSceneIndexPrim GetPrim(const SdfPath &primPath) const override;
35
36 HD_API
37 SdfPathVector GetChildPrimPaths(const SdfPath &primPath) const override;
38
39 HD_API
40 bool IsBatchingEnabled() const;
41
46 HD_API
47 void SetBatchingEnabled(bool enabled);
48
51 HD_API
52 void Flush();
53
54protected:
55
56 HD_API
57 HdNoticeBatchingSceneIndex(const HdSceneIndexBaseRefPtr &inputScene);
58
59 // satisfying HdSingleInputFilteringSceneIndexBase
60 HD_API
61 void _PrimsAdded(
62 const HdSceneIndexBase &sender,
63 const HdSceneIndexObserver::AddedPrimEntries &entries) override;
64
65 HD_API
66 void _PrimsRemoved(
67 const HdSceneIndexBase &sender,
68 const HdSceneIndexObserver::RemovedPrimEntries &entries) override;
69
70 HD_API
71 void _PrimsDirtied(
72 const HdSceneIndexBase &sender,
73 const HdSceneIndexObserver::DirtiedPrimEntries &entries) override;
74
75 struct _BatchEntry
76 {
77 HD_API
78 virtual ~_BatchEntry();
79 };
80
81 struct _PrimsAddedBatchEntry : public _BatchEntry
82 {
84 };
85
86 struct _PrimsRemovedBatchEntry : public _BatchEntry
87 {
89 };
90
91 struct _PrimsDirtiedBatchEntry : public _BatchEntry
92 {
94 };
95
96 bool _batchingEnabled;
97 std::vector<std::unique_ptr<_BatchEntry>> _batches;
98
99};
100
101
102PXR_NAMESPACE_CLOSE_SCOPE
103
104
105#endif
Abstract interface to scene data.
Definition: sceneIndex.h:54
virtual SdfPathVector GetChildPrimPaths(const SdfPath &primPath) const =0
Returns the paths of all scene index prims located immediately below primPath.
virtual HdSceneIndexPrim GetPrim(const SdfPath &primPath) const =0
Returns a pair of (prim type, datasource).
An abstract base class for a filtering scene index that observes a single input scene index.
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:274
#define TF_DECLARE_REF_PTRS(type)
Define standard ref pointer types.
Definition: declarePtrs.h:58
Small struct representing a 'prim' in the Hydra scene index.
Definition: sceneIndex.h:35