Loading...
Searching...
No Matches
selectionSceneIndex.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_USD_IMAGING_USD_IMAGING_SELECTION_SCENE_INDEX_H
8#define PXR_USD_IMAGING_USD_IMAGING_SELECTION_SCENE_INDEX_H
9
10#include "pxr/usdImaging/usdImaging/api.h"
11
12#include "pxr/imaging/hd/filteringSceneIndex.h"
13
14PXR_NAMESPACE_OPEN_SCOPE
15
16namespace UsdImagingSelectionSceneIndex_Impl
17{
18using _SelectionInfoSharedPtr = std::shared_ptr<struct _SelectionInfo>;
19}
20
22
30{
31public:
32 USDIMAGING_API
33 static UsdImagingSelectionSceneIndexRefPtr New(
34 HdSceneIndexBaseRefPtr const &inputSceneIndex);
35
37
38 USDIMAGING_API
39 HdSceneIndexPrim GetPrim(const SdfPath &primPath) const override;
40
41 USDIMAGING_API
42 SdfPathVector GetChildPrimPaths(const SdfPath &primPath) const override;
43
48 USDIMAGING_API
49 void AddSelection(const SdfPath &usdPath);
50
52 USDIMAGING_API
54
55protected:
56 void _PrimsAdded(
57 const HdSceneIndexBase &sender,
58 const HdSceneIndexObserver::AddedPrimEntries &entries) override;
59
60 void _PrimsRemoved(
61 const HdSceneIndexBase &sender,
62 const HdSceneIndexObserver::RemovedPrimEntries &entries) override;
63
64 void _PrimsDirtied(
65 const HdSceneIndexBase &sender,
66 const HdSceneIndexObserver::DirtiedPrimEntries &entries) override;
67
68
69private:
71 const HdSceneIndexBaseRefPtr &inputSceneIndex);
72
73 UsdImagingSelectionSceneIndex_Impl::
74 _SelectionInfoSharedPtr _selectionInfo;
75};
76
77PXR_NAMESPACE_CLOSE_SCOPE
78
79#endif
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
A simple scene index adding HdSelectionsSchema to all prims selected with AddSelection.
USDIMAGING_API void AddSelection(const SdfPath &usdPath)
Given a path (including usd proxy path inside a native instance) of a USD prim, determine the corresp...
USDIMAGING_API SdfPathVector GetChildPrimPaths(const SdfPath &primPath) const override
Returns the paths of all scene index prims located immediately below primPath.
USDIMAGING_API HdSceneIndexPrim GetPrim(const SdfPath &primPath) const override
Returns a pair of (prim type, datasource).
USDIMAGING_API void ClearSelection()
Reset the scene index selection state.
#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