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 
14 PXR_NAMESPACE_OPEN_SCOPE
15 
16 namespace UsdImagingSelectionSceneIndex_Impl
17 {
18 using _SelectionInfoSharedPtr = std::shared_ptr<struct _SelectionInfo>;
19 }
20 
22 
30 {
31 public:
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
53  void ClearSelection();
54 
55 protected:
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 
69 private:
71  const HdSceneIndexBaseRefPtr &inputSceneIndex);
72 
73  UsdImagingSelectionSceneIndex_Impl::
74  _SelectionInfoSharedPtr _selectionInfo;
75 };
76 
77 PXR_NAMESPACE_CLOSE_SCOPE
78 
79 #endif
An abstract base class for a filtering scene index that observes a single input scene index.
USDIMAGING_API SdfPathVector GetChildPrimPaths(const SdfPath &primPath) const override
Returns the paths of all scene index prims located immediately below primPath.
USDIMAGING_API void ClearSelection()
Reset the scene index selection state.
Small struct representing a 'prim' in the Hydra scene index.
Definition: sceneIndex.h:35
USDIMAGING_API HdSceneIndexPrim GetPrim(const SdfPath &primPath) const override
Returns a pair of (prim type, datasource).
Abstract interface to scene data.
Definition: sceneIndex.h:54
A simple scene index adding HdSelectionsSchema to all prims selected with AddSelection.
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:280
#define TF_DECLARE_REF_PTRS(type)
Define standard ref pointer types.
Definition: declarePtrs.h:58
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...