Loading...
Searching...
No Matches
selectionSceneIndexObserver.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_IMAGING_HDX_SELECTION_SCENE_INDEX_OBSERVER_H
8#define PXR_IMAGING_HDX_SELECTION_SCENE_INDEX_OBSERVER_H
9
10#include "pxr/pxr.h"
11#include "pxr/imaging/hdx/api.h"
12#include "pxr/imaging/hd/selection.h"
13#include "pxr/imaging/hd/sceneIndexObserver.h"
14
15PXR_NAMESPACE_OPEN_SCOPE
16
23{
24public:
25 HDX_API
27
29 HDX_API
30 void SetSceneIndex(HdSceneIndexBaseRefPtr const &sceneIndex);
31
34 HDX_API
35 int GetVersion() const;
36
39 HDX_API
40 HdSelectionSharedPtr GetSelection();
41
42 HDX_API
44 const HdSceneIndexBase &sender,
45 const AddedPrimEntries &entries) override;
46 HDX_API
48 const HdSceneIndexBase &sender,
49 const DirtiedPrimEntries &entries) override;
50 HDX_API
52 const HdSceneIndexBase &sender,
53 const RemovedPrimEntries &entries) override;
54
55 HDX_API
57 const HdSceneIndexBase &sender,
58 const RenamedPrimEntries &entries) override;
59
60private:
61 HdSelectionSharedPtr _ComputeSelection();
62
63 HdSceneIndexBaseRefPtr _sceneIndex;
64
65 int _version;
66 HdSelectionSharedPtr _selection;
67 SdfPathSet _dirtiedPrims;
68};
69
70PXR_NAMESPACE_CLOSE_SCOPE
71
72#endif
Abstract interface to scene data.
Definition: sceneIndex.h:54
Observer of scene data.
Queries each prim of the given scene index for the HdSelectionsSchema to compute a HdSelection.
HDX_API void PrimsAdded(const HdSceneIndexBase &sender, const AddedPrimEntries &entries) override
A notification indicating prims have been added to the scene.
HDX_API int GetVersion() const
Increased every time the selection in the scene index gets dirtied (or a difference scene index is se...
HDX_API void SetSceneIndex(HdSceneIndexBaseRefPtr const &sceneIndex)
Set which scene index to query for selection.
HDX_API void PrimsDirtied(const HdSceneIndexBase &sender, const DirtiedPrimEntries &entries) override
A notification indicating prim datasources have been invalidated.
HDX_API HdSelectionSharedPtr GetSelection()
Get the result of querying the scene index for the selection as HdSelection.
HDX_API void PrimsRemoved(const HdSceneIndexBase &sender, const RemovedPrimEntries &entries) override
A notification indicating prims have been removed from the scene.
HDX_API void PrimsRenamed(const HdSceneIndexBase &sender, const RenamedPrimEntries &entries) override
A notification indicating prims (and their descendants) have been renamed or reparented.