HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
renderVarAdapter.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_VAR_ADAPTER_H
8 #define PXR_USD_IMAGING_USD_IMAGING_RENDER_VAR_ADAPTER_H
9 
10 /// \file usdImaging/renderVarAdapter.h
11 
12 #include "pxr/pxr.h"
15 
17 
18 
19 /// \class UsdImagingRenderVarAdapter
20 ///
21 /// Adapter support for UsdRenderVar 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 public:
30 
33  {}
34 
36  ~UsdImagingRenderVarAdapter() override;
37 
38  // ---------------------------------------------------------------------- //
39  /// \name Scene Index Support
40  // ---------------------------------------------------------------------- //
41 
43  TfTokenVector GetImagingSubprims(UsdPrim const& prim) override;
44 
47  UsdPrim const& prim,
48  TfToken const& subprim) override;
49 
51  HdContainerDataSourceHandle GetImagingSubprimData(
52  UsdPrim const& prim,
53  TfToken const& subprim,
54  const UsdImagingDataSourceStageGlobals &stageGlobals) override;
55 
58  UsdPrim const& prim,
59  TfToken const& subprim,
60  TfTokenVector const& properties,
61  UsdImagingPropertyInvalidationType invalidationType) override;
62 
63  // ---------------------------------------------------------------------- //
64  /// \name Initialization
65  // ---------------------------------------------------------------------- //
66 
68  SdfPath Populate(UsdPrim const& prim,
71  instancerContext = nullptr) override;
72 
74  bool IsSupported(UsdImagingIndexProxy const* index) const override;
75 
76  // ---------------------------------------------------------------------- //
77  /// \name Parallel Setup and Resolve
78  // ---------------------------------------------------------------------- //
79 
80  /// Thread Safe.
82  void TrackVariability(UsdPrim const& prim,
83  SdfPath const& cachePath,
84  HdDirtyBits* timeVaryingBits,
86  instancerContext = nullptr) const override;
87 
88 
89  /// Thread Safe.
91  void UpdateForTime(UsdPrim const& prim,
92  SdfPath const& cachePath,
94  HdDirtyBits requestedBits,
96  instancerContext = nullptr) const override;
97 
98  // ---------------------------------------------------------------------- //
99  /// \name Change Processing
100  // ---------------------------------------------------------------------- //
101 
102  /// Returns a bit mask of attributes to be udpated, or
103  /// HdChangeTracker::AllDirty if the entire prim must be resynchronized.
106  SdfPath const& cachePath,
107  TfToken const& propertyName) override;
108 
110  void MarkDirty(UsdPrim const& prim,
111  SdfPath const& cachePath,
112  HdDirtyBits dirty,
113  UsdImagingIndexProxy* index) override;
114 
115  // ---------------------------------------------------------------------- //
116  /// \name Data access
117  // ---------------------------------------------------------------------- //
118 
120  VtValue Get(UsdPrim const& prim,
121  SdfPath const& cachePath,
122  TfToken const& key,
124  VtIntArray *outIndices) const override;
125 
126 protected:
128  void _RemovePrim(SdfPath const& cachePath,
129  UsdImagingIndexProxy* index) override;
130 
131 };
132 
133 
135 
136 #endif // PXR_USD_IMAGING_USD_IMAGING_RENDER_VAR_ADAPTER_H
#define USDIMAGING_API
Definition: api.h:23
USDIMAGING_API TfToken GetImagingSubprimType(UsdPrim const &prim, TfToken const &subprim) override
GT_API const UT_StringHolder time
uint32_t HdDirtyBits
Definition: types.h:143
USDIMAGING_API SdfPath Populate(UsdPrim const &prim, UsdImagingIndexProxy *index, UsdImagingInstancerContext const *instancerContext=nullptr) override
USDIMAGING_API void _RemovePrim(SdfPath const &cachePath, UsdImagingIndexProxy *index) override
Returns whether custom shading of prims is enabled.
USDIMAGING_API bool IsSupported(UsdImagingIndexProxy const *index) const override
Returns true if the adapter can be populated into the target index.
Definition: token.h:70
USDIMAGING_API ~UsdImagingRenderVarAdapter() override
USDIMAGING_API HdDirtyBits ProcessPropertyChange(UsdPrim const &prim, SdfPath const &cachePath, TfToken const &propertyName) override
USDIMAGING_API TfTokenVector GetImagingSubprims(UsdPrim const &prim) override
USDIMAGING_API HdDataSourceLocatorSet InvalidateImagingSubprim(UsdPrim const &prim, TfToken const &subprim, TfTokenVector const &properties, UsdImagingPropertyInvalidationType invalidationType) override
USDIMAGING_API void MarkDirty(UsdPrim const &prim, SdfPath const &cachePath, HdDirtyBits dirty, UsdImagingIndexProxy *index) override
USDIMAGING_API void TrackVariability(UsdPrim const &prim, SdfPath const &cachePath, HdDirtyBits *timeVaryingBits, UsdImagingInstancerContext const *instancerContext=nullptr) const override
Thread Safe.
Definition: prim.h:116
USDIMAGING_API HdContainerDataSourceHandle GetImagingSubprimData(UsdPrim const &prim, TfToken const &subprim, const UsdImagingDataSourceStageGlobals &stageGlobals) override
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:440
Definition: path.h:273
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
GLuint index
Definition: glcorearb.h:786
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
USDIMAGING_API void UpdateForTime(UsdPrim const &prim, SdfPath const &cachePath, UsdTimeCode time, HdDirtyBits requestedBits, UsdImagingInstancerContext const *instancerContext=nullptr) const override
Thread Safe.
USDIMAGING_API VtValue Get(UsdPrim const &prim, SdfPath const &cachePath, TfToken const &key, UsdTimeCode time, VtIntArray *outIndices) const override
Definition: value.h:146
UsdImagingPropertyInvalidationType
Definition: types.h:17