Loading...
Searching...
No Matches
instanceProxyViewSceneIndex.h
1//
2// Copyright 2026 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_INSTANCE_PROXY_VIEW_SCENE_INDEX_H
8#define PXR_IMAGING_HD_INSTANCE_PROXY_VIEW_SCENE_INDEX_H
9
10#include "pxr/pxr.h"
11#include "pxr/imaging/hd/api.h"
12
13#include "pxr/imaging/hd/filteringSceneIndex.h"
14#include "pxr/usd/sdf/path.h"
16#include "pxr/base/tf/token.h"
17
18#include <memory>
19
20PXR_NAMESPACE_OPEN_SCOPE
21
23
49{
50public:
51 HD_API
52 static HdInstanceProxyViewSceneIndexRefPtr
53 New(const HdSceneIndexBaseRefPtr &inputSceneIndex);
54
55 // ------------------------------------------------------------------------
56 // Non-virtual API.
57 //
61 HD_API
62 bool IsInstanceProxy(const SdfPath &primPath) const;
63
68 HD_API
69 bool IsOutermostInstance(const SdfPath &primPath) const;
70
72 HD_API
73 const SdfPathSet &GetAllOutermostInstancePrimPaths() const;
74
79 HD_API
80 std::optional<SdfPath>
81 GetInstancerPrimPath(const SdfPath &outermostInstancePath) const;
82
83 // ------------------------------------------------------------------------
84 // HdSceneIndex overrides.
85 //
88 HD_API
89 HdSceneIndexPrim GetPrim(const SdfPath &primPath) const override;
90
94 HD_API
95 SdfPathVector GetChildPrimPaths(const SdfPath &primPath) const override;
96
97protected:
98
99 HD_API
101 const HdSceneIndexBaseRefPtr &inputSceneIndex);
102
103 // ------------------------------------------------------------------------
104 // HdSingleInputFilteringSceneIndexBase overrides.
105 //
106 HD_API
107 void _PrimsAdded(
108 const HdSceneIndexBase &sender,
109 const HdSceneIndexObserver::AddedPrimEntries &entries) override;
110
111 HD_API
112 void _PrimsRemoved(
113 const HdSceneIndexBase &sender,
114 const HdSceneIndexObserver::RemovedPrimEntries &entries) override;
115
116 HD_API
117 void _PrimsDirtied(
118 const HdSceneIndexBase &sender,
119 const HdSceneIndexObserver::DirtiedPrimEntries &entries) override;
120
121private:
122 struct _Impl;
123 std::unique_ptr<_Impl> _impl;
124};
125
126PXR_NAMESPACE_CLOSE_SCOPE
127
128#endif
A scene index that provides a topological view of the scene as though instancing were not being used.
HD_API const SdfPathSet & GetAllOutermostInstancePrimPaths() const
Returns the set of all tracked outermost instance prim paths.
HD_API bool IsInstanceProxy(const SdfPath &primPath) const
Returns true if the given prim path is an instance proxy prim path matching the USD definition of an ...
HD_API HdSceneIndexPrim GetPrim(const SdfPath &primPath) const override
Adds support for instance proxy prim paths.
HD_API bool IsOutermostInstance(const SdfPath &primPath) const
Returns true if the given prim path is a leaf instance prim path that isn't under an instancer prim.
HD_API std::optional< SdfPath > GetInstancerPrimPath(const SdfPath &outermostInstancePath) const
Given an outermost instance prim path, returns the instancer prim path that is associated (responsibl...
HD_API SdfPathVector GetChildPrimPaths(const SdfPath &primPath) const override
Adds support for queries on outer (leaf) instance prim paths and instance proxy prim paths.
Abstract interface to scene data.
Definition sceneIndex.h:55
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:281
#define TF_DECLARE_REF_PTRS(type)
Define standard ref pointer types.
Definition declarePtrs.h:58
This file defines some macros that are useful for declaring and using static TfTokens.
Small struct representing a 'prim' in the Hydra scene index.
Definition sceneIndex.h:36
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...