HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
materialPrimvarTransferSceneIndex.h
Go to the documentation of this file.
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 #ifndef PXR_IMAGING_HDSI_MATERIAL_PRIMVAR_TRANSFER_SCENE_INDEX_H
7 #define PXR_IMAGING_HDSI_MATERIAL_PRIMVAR_TRANSFER_SCENE_INDEX_H
8 
9 #include "pxr/imaging/hdsi/api.h"
11 
12 #include "pxr/pxr.h"
13 
15 
17 
18 /// Transfers primvars present on the locally bound material. Any matching
19 /// primvar already present will have a stronger opinion.
20 ///
21 /// As it's expected that primvars inherited by the destination location
22 /// should have a stronger opinion than those transfered here, inherited
23 /// primvars must be flattened in advance of this scene index.
24 ///
25 /// This is in support of shading workflows.
26 ///
27 /// This also declares dependencies to ensure invalidation if a
28 /// HdDependencyForwardingSceneIndex is present downstream. (Because those
29 /// dependencies are computed on demand, no meaningful additional work is done
30 /// otherwise.)
31 ///
34 {
35 public:
36  HDSI_API
37  static HdsiMaterialPrimvarTransferSceneIndexRefPtr
38  New(const HdSceneIndexBaseRefPtr& inputSceneIndex);
39 
40 public: // HdSceneIndex overrides
41  HDSI_API
42  HdSceneIndexPrim GetPrim(const SdfPath& primPath) const override;
43 
44  HDSI_API
45  SdfPathVector GetChildPrimPaths(const SdfPath& primPath) const override;
46 
47 protected: // HdSingleInputFilteringSceneIndexBase overrides
48  void _PrimsAdded(
49  const HdSceneIndexBase& sender,
50  const HdSceneIndexObserver::AddedPrimEntries& entries) override;
51  void _PrimsRemoved(
52  const HdSceneIndexBase& sender,
53  const HdSceneIndexObserver::RemovedPrimEntries& entries) override;
54  void _PrimsDirtied(
55  const HdSceneIndexBase& sender,
56  const HdSceneIndexObserver::DirtiedPrimEntries& entries) override;
57 
58 private:
60  const HdSceneIndexBaseRefPtr& inputSceneIndex);
62 };
63 
65 
66 #endif
void _PrimsAdded(const HdSceneIndexBase &sender, const HdSceneIndexObserver::AddedPrimEntries &entries) override
void _PrimsRemoved(const HdSceneIndexBase &sender, const HdSceneIndexObserver::RemovedPrimEntries &entries) override
HDSI_API SdfPathVector GetChildPrimPaths(const SdfPath &primPath) const override
static HDSI_API HdsiMaterialPrimvarTransferSceneIndexRefPtr New(const HdSceneIndexBaseRefPtr &inputSceneIndex)
HDSI_API HdSceneIndexPrim GetPrim(const SdfPath &primPath) const override
std::vector< class SdfPath > SdfPathVector
void _PrimsDirtied(const HdSceneIndexBase &sender, const HdSceneIndexObserver::DirtiedPrimEntries &entries) override
Definition: path.h:273
#define HDSI_API
Definition: api.h:23
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
PXR_NAMESPACE_OPEN_SCOPE TF_DECLARE_REF_PTRS(HdsiMaterialPrimvarTransferSceneIndex)