Loading...
Searching...
No Matches
legacyDisplayStyleOverrideSceneIndex.h
1//
2// Copyright 2023 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_HDSI_LEGACY_DISPLAY_STYLE_OVERRIDE_SCENE_INDEX_H
8#define PXR_IMAGING_HDSI_LEGACY_DISPLAY_STYLE_OVERRIDE_SCENE_INDEX_H
9
10#include "pxr/pxr.h"
11#include "pxr/imaging/hdsi/api.h"
12#include "pxr/imaging/hd/filteringSceneIndex.h"
13
14PXR_NAMESPACE_OPEN_SCOPE
15
16namespace HdsiLegacyDisplayStyleSceneIndex_Impl
17{
18struct _StyleInfo;
19using _StyleInfoSharedPtr = std::shared_ptr<_StyleInfo>;
20}
21
23
32{
33public:
34 HDSI_API
35 static HdsiLegacyDisplayStyleOverrideSceneIndexRefPtr
36 New(const HdSceneIndexBaseRefPtr &inputSceneIndex);
37
38 HDSI_API
39 HdSceneIndexPrim GetPrim(const SdfPath &primPath) const override;
40
41 HDSI_API
42 SdfPathVector GetChildPrimPaths(const SdfPath &primPath) const override;
43
46 {
47 bool hasValue = false;
48 int value = 0;
49
50 operator bool() const { return hasValue; }
51 int operator*() const { return value; }
52 };
53
60 HDSI_API
61 void SetRefineLevel(const OptionalInt &refineLevel);
62
63protected:
65 const HdSceneIndexBaseRefPtr &inputSceneIndex);
66
67 void _PrimsAdded(
68 const HdSceneIndexBase &sender,
69 const HdSceneIndexObserver::AddedPrimEntries &entries) override;
70
71 void _PrimsRemoved(
72 const HdSceneIndexBase &sender,
73 const HdSceneIndexObserver::RemovedPrimEntries &entries) override;
74
75 void _PrimsDirtied(
76 const HdSceneIndexBase &sender,
77 const HdSceneIndexObserver::DirtiedPrimEntries &entries) override;
78
79private:
80 void _DirtyAllPrims(const HdDataSourceLocatorSet &locators);
81
82 HdsiLegacyDisplayStyleSceneIndex_Impl::
83 _StyleInfoSharedPtr const _styleInfo;
84
86 HdContainerDataSourceHandle const _overlayDs;
87};
88
89HDSI_API
90bool operator==(
93
94HDSI_API
95bool operator!=(
98
99PXR_NAMESPACE_CLOSE_SCOPE
100
101#endif //PXR_IMAGING_HDSI_LEGACY_DISPLAY_STYLE_OVERRIDE_SCENE_INDEX_H
Represents a set of data source locators closed under descendancy.
Abstract interface to scene data.
Definition: sceneIndex.h:48
An abstract base class for a filtering scene index that observes a single input scene index.
A scene index overriding the legacy display style for each prim.
HDSI_API HdSceneIndexPrim GetPrim(const SdfPath &primPath) const override
Returns a pair of (prim type, datasource) for the object at primPath.
HDSI_API void SetRefineLevel(const OptionalInt &refineLevel)
Sets the refine level (at data source locator displayStyle:refineLevel) for every prim in the input s...
HDSI_API SdfPathVector GetChildPrimPaths(const SdfPath &primPath) const override
Returns the paths of all scene index prims located immediately below primPath.
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
A replacement for std::optional<int> that is not available until C++17.