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
66 HDSI_API
67 void SetCullStyleFallback(const TfToken &cullStyleFallback);
68
69protected:
71 const HdSceneIndexBaseRefPtr &inputSceneIndex);
72
73 void _PrimsAdded(
74 const HdSceneIndexBase &sender,
75 const HdSceneIndexObserver::AddedPrimEntries &entries) override;
76
77 void _PrimsRemoved(
78 const HdSceneIndexBase &sender,
79 const HdSceneIndexObserver::RemovedPrimEntries &entries) override;
80
81 void _PrimsDirtied(
82 const HdSceneIndexBase &sender,
83 const HdSceneIndexObserver::DirtiedPrimEntries &entries) override;
84
85private:
86 void _DirtyAllPrims(const HdDataSourceLocatorSet &locators);
87
88 HdsiLegacyDisplayStyleSceneIndex_Impl::
89 _StyleInfoSharedPtr const _styleInfo;
90
92 HdContainerDataSourceHandle const _overlayDs;
93 HdContainerDataSourceHandle const _underlayDs;
94};
95
96HDSI_API
97bool operator==(
100
101HDSI_API
102bool operator!=(
105
106PXR_NAMESPACE_CLOSE_SCOPE
107
108#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:54
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).
HDSI_API void SetCullStyleFallback(const TfToken &cullStyleFallback)
Sets the cullStyleFallback (at data source locator displayStyle:cullStyleFallback) for every prim in ...
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
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:71
#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.