HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
legacyPrimSceneIndex.h
Go to the documentation of this file.
1 //
2 // Copyright 2021 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_HD_LEGACY_PRIM_SCENE_INDEX_H
8 #define PXR_IMAGING_HD_LEGACY_PRIM_SCENE_INDEX_H
9 
11 
13 
14 class HdSceneDelegate;
15 using HdLegacyTaskFactorySharedPtr = std::shared_ptr<class HdLegacyTaskFactory>;
16 
18 
19 /// \class HdLegacyPrimSceneIndex
20 ///
21 /// Extends HdRetainedSceneIndex to instantiate and dirty HdDataSourceLegacyPrim
22 /// data sources.
23 ///
24 /// During emulation of legacy HdSceneDelegates, HdRenderIndex forwards
25 /// prim insertion calls here to produce a comparable HdSceneIndex
26 /// representation
28 {
29 public:
30 
31  static HdLegacyPrimSceneIndexRefPtr New() {
33  }
34 
35  /// Custom insertion wrapper called by HdRenderIndex during population
36  /// of legacy HdSceneDelegate's.
37  void AddLegacyPrim(SdfPath const &id, TfToken const &type,
38  HdSceneDelegate *sceneDelegate);
39 
40  /// Custom insertion wrapper called by HdRenderIndex::InsertTask<T>
41  /// during population of legacy HdSceneDelegate's
42  void AddLegacyTask(
43  SdfPath const &id,
44  HdSceneDelegate *sceneDelegate,
46 
47  /// Remove only the prim at \p id without affecting children.
48  ///
49  /// If \p id has children, it is replaced by an entry with no type
50  /// and no data source. If \p id does not have children, it is
51  /// removed from the retained scene index.
52  ///
53  /// This is called by HdRenderIndex on behalf of legacy
54  /// HdSceneDelegates to emulate the original behavior of
55  /// Remove{B,R,S}Prim, which did not remove children.
56  ///
57  void RemovePrim(SdfPath const &id);
58 
59  /// extends to also call DirtyPrim on HdDataSourceLegacyPrim
60  void DirtyPrims(
61  const HdSceneIndexObserver::DirtiedPrimEntries &entries) override;
62 };
63 
65 
66 #endif
void DirtyPrims(const HdSceneIndexObserver::DirtiedPrimEntries &entries) override
extends to also call DirtyPrim on HdDataSourceLegacyPrim
TfRefPtr< T > TfCreateRefPtr(T *ptr)
Definition: refPtr.h:1190
void RemovePrim(SdfPath const &id)
TF_DECLARE_REF_PTRS(HdLegacyPrimSceneIndex)
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:108
Definition: token.h:70
Definition: path.h:273
static HdLegacyPrimSceneIndexRefPtr New()
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
void AddLegacyPrim(SdfPath const &id, TfToken const &type, HdSceneDelegate *sceneDelegate)
void AddLegacyTask(SdfPath const &id, HdSceneDelegate *sceneDelegate, HdLegacyTaskFactorySharedPtr factory)
std::shared_ptr< class HdLegacyTaskFactory > HdLegacyTaskFactorySharedPtr