HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
renderProductAdapter.h
Go to the documentation of this file.
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_USD_IMAGING_USD_IMAGING_RENDER_PRODUCT_ADAPTER_H
8 #define PXR_USD_IMAGING_USD_IMAGING_RENDER_PRODUCT_ADAPTER_H
9 
10 /// \file usdImaging/renderProductAdapter.h
11 
12 #include "pxr/pxr.h"
15 
17 
18 
19 /// \class UsdImagingRenderProductAdapter
20 ///
21 /// Adapter support for UsdRenderProduct for *only* the scene index (2.0) API.
22 ///
23 /// \note For the legacy (UsdImagingDelegate and associated prim adapter API)
24 /// scenario, UsdImagingRenderSettingsAdapter handles the flattening of
25 /// products and vars.
26 ///
28 {
29 public:
31 
34  {}
35 
38 
39  // ---------------------------------------------------------------------- //
40  /// \name Scene Index Support
41  // ---------------------------------------------------------------------- //
42 
44  TfTokenVector GetImagingSubprims(UsdPrim const& prim) override;
45 
48  UsdPrim const& prim,
49  TfToken const& subprim) override;
50 
52  HdContainerDataSourceHandle GetImagingSubprimData(
53  UsdPrim const& prim,
54  TfToken const& subprim,
55  const UsdImagingDataSourceStageGlobals &stageGlobals) override;
56 
59  UsdPrim const& prim,
60  TfToken const& subprim,
61  TfTokenVector const& properties,
62  UsdImagingPropertyInvalidationType invalidationType) override;
63 
64  // ---------------------------------------------------------------------- //
65  /// \name Initialization
66  // ---------------------------------------------------------------------- //
67 
69  SdfPath Populate(UsdPrim const& prim,
72  instancerContext = nullptr) override;
73 
75  bool IsSupported(UsdImagingIndexProxy const* index) const override;
76 
77  // ---------------------------------------------------------------------- //
78  /// \name Parallel Setup and Resolve
79  // ---------------------------------------------------------------------- //
80 
81  /// Thread Safe.
83  void TrackVariability(UsdPrim const& prim,
84  SdfPath const& cachePath,
85  HdDirtyBits* timeVaryingBits,
87  instancerContext = nullptr) const override;
88 
89 
90  /// Thread Safe.
92  void UpdateForTime(UsdPrim const& prim,
93  SdfPath const& cachePath,
95  HdDirtyBits requestedBits,
97  instancerContext = nullptr) const override;
98 
99  // ---------------------------------------------------------------------- //
100  /// \name Change Processing
101  // ---------------------------------------------------------------------- //
102 
103  /// Returns a bit mask of attributes to be udpated, or
104  /// HdChangeTracker::AllDirty if the entire prim must be resynchronized.
107  SdfPath const& cachePath,
108  TfToken const& propertyName) override;
109 
111  void MarkDirty(UsdPrim const& prim,
112  SdfPath const& cachePath,
113  HdDirtyBits dirty,
114  UsdImagingIndexProxy* index) override;
115 
116  // ---------------------------------------------------------------------- //
117  /// \name Data access
118  // ---------------------------------------------------------------------- //
119 
121  VtValue Get(UsdPrim const& prim,
122  SdfPath const& cachePath,
123  TfToken const& key,
125  VtIntArray *outIndices) const override;
126 
127 protected:
129  void _RemovePrim(SdfPath const& cachePath,
130  UsdImagingIndexProxy* index) override;
131 
132 };
133 
134 
136 
137 #endif // PXR_USD_IMAGING_USD_IMAGING_RENDER_PRODUCT_ADAPTER_H
USDIMAGING_API void UpdateForTime(UsdPrim const &prim, SdfPath const &cachePath, UsdTimeCode time, HdDirtyBits requestedBits, UsdImagingInstancerContext const *instancerContext=nullptr) const override
Thread Safe.
USDIMAGING_API HdDirtyBits ProcessPropertyChange(UsdPrim const &prim, SdfPath const &cachePath, TfToken const &propertyName) override
#define USDIMAGING_API
Definition: api.h:23
USDIMAGING_API SdfPath Populate(UsdPrim const &prim, UsdImagingIndexProxy *index, UsdImagingInstancerContext const *instancerContext=nullptr) override
GT_API const UT_StringHolder time
uint32_t HdDirtyBits
Definition: types.h:143
USDIMAGING_API HdDataSourceLocatorSet InvalidateImagingSubprim(UsdPrim const &prim, TfToken const &subprim, TfTokenVector const &properties, UsdImagingPropertyInvalidationType invalidationType) override
Definition: token.h:70
USDIMAGING_API ~UsdImagingRenderProductAdapter() override
USDIMAGING_API TfToken GetImagingSubprimType(UsdPrim const &prim, TfToken const &subprim) override
USDIMAGING_API HdContainerDataSourceHandle GetImagingSubprimData(UsdPrim const &prim, TfToken const &subprim, const UsdImagingDataSourceStageGlobals &stageGlobals) override
Definition: prim.h:116
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:440
Definition: path.h:273
USDIMAGING_API void TrackVariability(UsdPrim const &prim, SdfPath const &cachePath, HdDirtyBits *timeVaryingBits, UsdImagingInstancerContext const *instancerContext=nullptr) const override
Thread Safe.
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
USDIMAGING_API bool IsSupported(UsdImagingIndexProxy const *index) const override
Returns true if the adapter can be populated into the target index.
GLuint index
Definition: glcorearb.h:786
USDIMAGING_API void _RemovePrim(SdfPath const &cachePath, UsdImagingIndexProxy *index) override
Returns whether custom shading of prims is enabled.
USDIMAGING_API TfTokenVector GetImagingSubprims(UsdPrim const &prim) override
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
USDIMAGING_API void MarkDirty(UsdPrim const &prim, SdfPath const &cachePath, HdDirtyBits dirty, UsdImagingIndexProxy *index) override
Definition: value.h:146
USDIMAGING_API VtValue Get(UsdPrim const &prim, SdfPath const &cachePath, TfToken const &key, UsdTimeCode time, VtIntArray *outIndices) const override
UsdImagingPropertyInvalidationType
Definition: types.h:17