This document is for a version of USD that is under development. See this page for the current release.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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/imaging/hd/filteringSceneIndex.h"
11
12PXR_NAMESPACE_OPEN_SCOPE
13
14class HdNoticeBatchingSceneIndex;
15TF_DECLARE_REF_PTRS(HdNoticeBatchingSceneIndex);
16
17class HdNoticeBatchingSceneIndex : public HdSingleInputFilteringSceneIndexBase
18{
19public:
22 static HdNoticeBatchingSceneIndexRefPtr New(
23 const HdSceneIndexBaseRefPtr &inputScene) {
24 return TfCreateRefPtr(new HdNoticeBatchingSceneIndex(inputScene));
25 }
26
27 HD_API
28 ~HdNoticeBatchingSceneIndex() override;
29
30 // satisfying HdSceneIndexBase
31 HD_API
32 HdSceneIndexPrim GetPrim(const SdfPath &primPath) const override;
33
34 HD_API
35 SdfPathVector GetChildPrimPaths(const SdfPath &primPath) const override;
36
37 bool IsBatchingEnabled() const;
38
43 void SetBatchingEnabled(bool enabled);
44
47 void Flush();
48
49protected:
50
51 HD_API
52 HdNoticeBatchingSceneIndex(const HdSceneIndexBaseRefPtr &inputScene);
53
54 // satisfying HdSingleInputFilteringSceneIndexBase
55 void _PrimsAdded(
56 const HdSceneIndexBase &sender,
57 const HdSceneIndexObserver::AddedPrimEntries &entries) override;
58
59 void _PrimsRemoved(
60 const HdSceneIndexBase &sender,
61 const HdSceneIndexObserver::RemovedPrimEntries &entries) override;
62
63 void _PrimsDirtied(
64 const HdSceneIndexBase &sender,
65 const HdSceneIndexObserver::DirtiedPrimEntries &entries) override;
66
67 struct _BatchEntry
68 {
69 virtual ~_BatchEntry();
70 };
71
72 struct _PrimsAddedBatchEntry : public _BatchEntry
73 {
75 };
76
77 struct _PrimsRemovedBatchEntry : public _BatchEntry
78 {
80 };
81
82 struct _PrimsDirtiedBatchEntry : public _BatchEntry
83 {
85 };
86
87 bool _batchingEnabled;
88 std::vector<std::unique_ptr<_BatchEntry>> _batches;
89
90};
91
92
93PXR_NAMESPACE_CLOSE_SCOPE
94
95
96#endif
Abstract interface to scene data.
Definition: sceneIndex.h:48
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) for the object at primPath.
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