Loading...
Searching...
No Matches
prefixingSceneIndex.h
1//
2// Copyright 2021 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_PREFIXING_SCENE_INDEX_H
8#define PXR_IMAGING_HD_PREFIXING_SCENE_INDEX_H
9
10#include "pxr/imaging/hd/api.h"
11#include "pxr/imaging/hd/filteringSceneIndex.h"
12
13PXR_NAMESPACE_OPEN_SCOPE
14
17
25{
26public:
27
30 static HdPrefixingSceneIndexRefPtr New(
31 const HdSceneIndexBaseRefPtr &inputScene, const SdfPath &prefix)
32 {
33 return TfCreateRefPtr(new HdPrefixingSceneIndex(inputScene, prefix));
34 }
35
36 // satisfying HdSceneIndexBase
37 HD_API
38 HdSceneIndexPrim GetPrim(const SdfPath &primPath) const override;
39
40 HD_API
41 SdfPathVector GetChildPrimPaths(const SdfPath &primPath) const override;
42
43protected:
44
45 HD_API
46 HdPrefixingSceneIndex(const HdSceneIndexBaseRefPtr &inputScene,
47 const SdfPath &prefix);
48
49 // satisfying HdSingleInputFilteringSceneIndexBase
50 void _PrimsAdded(
51 const HdSceneIndexBase &sender,
52 const HdSceneIndexObserver::AddedPrimEntries &entries) override;
53
54 void _PrimsRemoved(
55 const HdSceneIndexBase &sender,
56 const HdSceneIndexObserver::RemovedPrimEntries &entries) override;
57
58 void _PrimsDirtied(
59 const HdSceneIndexBase &sender,
60 const HdSceneIndexObserver::DirtiedPrimEntries &entries) override;
61
62private:
63
64 SdfPath _AddPathPrefix(const SdfPath &primPath) const;
65
66 SdfPath _RemovePathPrefix(const SdfPath &primPath) const;
67
68 const SdfPath _prefix;
69};
70
71PXR_NAMESPACE_CLOSE_SCOPE
72
73#endif
74
A prefixing scene index is one in which the input scene contains data sources whose paths are all pre...
HD_API HdSceneIndexPrim GetPrim(const SdfPath &primPath) const override
Returns a pair of (prim type, datasource).
static HdPrefixingSceneIndexRefPtr New(const HdSceneIndexBaseRefPtr &inputScene, const SdfPath &prefix)
Creates a new prefixing scene index.
HD_API SdfPathVector GetChildPrimPaths(const SdfPath &primPath) const override
Returns the paths of all scene index prims located immediately below primPath.
Abstract interface to scene data.
Definition: sceneIndex.h:54
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