24#ifndef PXR_IMAGING_HDSI_PRIMTYPE_NOTICE_BATCHING_SCENE_INDEX_H
25#define PXR_IMAGING_HDSI_PRIMTYPE_NOTICE_BATCHING_SCENE_INDEX_H
29#include "pxr/imaging/hdsi/api.h"
31#include "pxr/imaging/hd/filteringSceneIndex.h"
35PXR_NAMESPACE_OPEN_SCOPE
37#define HDSI_PRIM_TYPE_NOTICE_BATCHING_SCENE_INDEX_TOKENS \
38 (primTypePriorityFunctor)
41 HDSI_PRIM_TYPE_NOTICE_BATCHING_SCENE_INDEX_TOKENS);
84 const TfToken &primType)
const = 0;
94 using PrimTypePriorityFunctorHandle =
95 std::shared_ptr<PrimTypePriorityFunctor>;
102 static HdsiPrimTypeNoticeBatchingSceneIndexRefPtr
New(
103 HdSceneIndexBaseRefPtr
const &inputScene,
104 HdContainerDataSourceHandle
const &inputArgs) {
105 return TfCreateRefPtr(
136 HdSceneIndexBaseRefPtr
const &inputScene,
137 HdContainerDataSourceHandle
const &inputArgs);
153 void _RemovePathFromAddedOrDirtiedPrims(
const SdfPath &path);
155 void _AddPathToRemovedPrims(
const SdfPath &path);
157 size_t _GetPriority(
const TfToken &primType)
const;
159 PrimTypePriorityFunctorHandle
const _primTypePriorityFunctor;
160 const size_t _numPriorities;
162 struct _PrimAddedEntry
167 struct _PrimDirtiedEntry
177 using _PrimAddedOrDirtiedEntry =
178 std::variant<_PrimDirtiedEntry, _PrimAddedEntry>;
180 std::map<SdfPath, _PrimAddedOrDirtiedEntry> _addedOrDirtiedPrims;
184 std::set<SdfPath> _removedPrims;
188PXR_NAMESPACE_CLOSE_SCOPE
Represents a set of data source locators closed under descendancy.
Abstract interface to scene data.
Base class for functor mapping prim types to priorities.
virtual size_t GetNumPriorities() const =0
Number of priorities - that is 1 + the highest number ever returned by GetPriorityForPrimType().
virtual size_t GetPriorityForPrimType(const TfToken &primType) const =0
Priority for given prim type.
A filtering scene index batching prim notices by type using a given priority functor.
HDSI_API void Flush()
Sends out all notices queued and commulated since the last call to Flush.
static HdsiPrimTypeNoticeBatchingSceneIndexRefPtr New(HdSceneIndexBaseRefPtr const &inputScene, HdContainerDataSourceHandle const &inputArgs)
Creates a new notice batching scene index.
HDSI_API HdSceneIndexPrim GetPrim(const SdfPath &primPath) const override
Forwards to input scene after first call to Flush.
HDSI_API SdfPathVector GetChildPrimPaths(const SdfPath &primPath) const override
Forwards to input scene after first call to Flush.
A path value used to locate objects in layers or scenegraphs.
Token for efficient comparison, assignment, and hashing of known strings.
#define TF_DECLARE_REF_PTRS(type)
Define standard ref pointer types.
#define TF_DECLARE_PUBLIC_TOKENS(...)
Macro to define public tokens.
Small struct representing a 'prim' in the Hydra scene index.