HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
debuggingSceneIndex.h
Go to the documentation of this file.
1 //
2 // Copyright 2025 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_DEBUGGING_SCENE_INDEX_H
8 #define PXR_IMAGING_HDSI_DEBUGGING_SCENE_INDEX_H
9 
11 #include "pxr/imaging/hdsi/api.h"
12 #include "pxr/pxr.h"
13 
14 #include <optional>
15 #include <map>
16 #include <mutex>
17 
19 
21 
22 namespace HdsiDebuggingSceneIndex_Impl
23 {
24 
25 struct _PrimInfo;
26 using _PrimInfoSharedPtr = std::shared_ptr<_PrimInfo>;
27 using _PrimMap = std::map<SdfPath, _PrimInfo>;
28 
29 }
30 
31 /// \class HdsiDebuggingSceneIndex
32 ///
33 /// A filtering scene index that checks for certain inconsistencies (without
34 /// transforming the scene) in its input scene.
35 /// For example, it will report if the input scene's GetPrim(/foo) returns a
36 /// prim type different from a previous call to GetPrim(/foo) even though the
37 /// input scene sent no related prims added or removed notice.
38 ///
39 /// The easiest way to invoke this scene index is by setting the env var
40 /// HDSI_DEBUGGING_SCENE_INDEX_INSERTION_PHASE. Also see
41 /// HdsiDebuggingSceneIndexPlugin.
42 ///
44 {
45 public:
46  HDSI_API
47  static HdsiDebuggingSceneIndexRefPtr
48  New(HdSceneIndexBaseRefPtr const &inputSceneIndex,
49  HdContainerDataSourceHandle const &inputArgs);
50 
51  HDSI_API
52  ~HdsiDebuggingSceneIndex() override;
53 
54  HDSI_API
55  HdSceneIndexPrim GetPrim(const SdfPath &primPath) const override;
56 
57  HDSI_API
58  SdfPathVector GetChildPrimPaths(const SdfPath &primPath) const override;
59 
60 protected:
61  HDSI_API
62  void _PrimsAdded(
63  const HdSceneIndexBase &sender,
64  const HdSceneIndexObserver::AddedPrimEntries &entries) override;
65 
66  HDSI_API
67  void _PrimsRemoved(
68  const HdSceneIndexBase &sender,
69  const HdSceneIndexObserver::RemovedPrimEntries &entries) override;
70 
71  HDSI_API
72  void _PrimsDirtied(
73  const HdSceneIndexBase &sender,
74  const HdSceneIndexObserver::DirtiedPrimEntries &entries) override;
75 
76  HDSI_API
77  void _PrimsRenamed(
78  const HdSceneIndexBase &sender,
79  const HdSceneIndexObserver::RenamedPrimEntries &entries) override;
80 
81 private:
82  HdsiDebuggingSceneIndex(HdSceneIndexBaseRefPtr const &inputSceneIndex,
83  HdContainerDataSourceHandle const &inputArgs);
84 
85  mutable std::mutex _primsMutex;
87 };
88 
90 
91 #endif // PXR_IMAGING_HD_DEBUGGING_SCENE_INDEX_H
HDSI_API void _PrimsRenamed(const HdSceneIndexBase &sender, const HdSceneIndexObserver::RenamedPrimEntries &entries) override
HDSI_API void _PrimsAdded(const HdSceneIndexBase &sender, const HdSceneIndexObserver::AddedPrimEntries &entries) override
std::vector< class SdfPath > SdfPathVector
std::map< SdfPath, _PrimInfo > _PrimMap
static HDSI_API HdsiDebuggingSceneIndexRefPtr New(HdSceneIndexBaseRefPtr const &inputSceneIndex, HdContainerDataSourceHandle const &inputArgs)
Definition: path.h:273
#define HDSI_API
Definition: api.h:23
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
HDSI_API void _PrimsRemoved(const HdSceneIndexBase &sender, const HdSceneIndexObserver::RemovedPrimEntries &entries) override
HDSI_API HdSceneIndexPrim GetPrim(const SdfPath &primPath) const override
std::shared_ptr< _PrimInfo > _PrimInfoSharedPtr
HDSI_API void _PrimsDirtied(const HdSceneIndexBase &sender, const HdSceneIndexObserver::DirtiedPrimEntries &entries) override
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
HDSI_API ~HdsiDebuggingSceneIndex() override
HDSI_API SdfPathVector GetChildPrimPaths(const SdfPath &primPath) const override
PXR_NAMESPACE_OPEN_SCOPE TF_DECLARE_WEAK_AND_REF_PTRS(HdsiDebuggingSceneIndex)