HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
renderSettingsAdapter.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 //
7 #ifndef PXR_USD_IMAGING_USD_IMAGING_RENDER_SETTINGS_ADAPTER_H
8 #define PXR_USD_IMAGING_USD_IMAGING_RENDER_SETTINGS_ADAPTER_H
9 
10 /// \file usdImaging/renderSettingsAdapter.h
11 
12 #include "pxr/pxr.h"
13 #include "pxr/base/tf/envSetting.h"
16 
18 
19 
20 /// \class UsdImagingRenderSettingsAdapter
21 ///
22 /// Delegate support for UsdRenderSettings.
23 ///
25 {
26 public:
28 
31  {}
32 
35 
36 
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 
134 // XXX: This should be moved to renderman in an upcoming change.
135 //
136 // For PxrRenderTerminalsAPI schemas applied on RenderSettings that
137 // allow specification of display filters, sample filters, and
138 // integrators: if the shema expects relationships, perform the
139 // following actions for each value of the environment variable.
140 // true : Produce a warning message if connections are used.
141 // false : Disallow the use of attribute connections for the purposes of
142 // connecting display filters, sample filters, and integrators.
144 extern TfEnvSetting<bool>
146 
148 
149 #endif // PXR_USD_IMAGING_USD_IMAGING_RENDER_SETTINGS_ADAPTER_H
#define USDIMAGING_API
Definition: api.h:23
USDIMAGING_API void MarkDirty(UsdPrim const &prim, SdfPath const &cachePath, HdDirtyBits dirty, UsdImagingIndexProxy *index) override
USDIMAGING_API VtValue Get(UsdPrim const &prim, SdfPath const &cachePath, TfToken const &key, UsdTimeCode time, VtIntArray *outIndices) const override
GT_API const UT_StringHolder time
uint32_t HdDirtyBits
Definition: types.h:143
USDIMAGING_API ~UsdImagingRenderSettingsAdapter() 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: token.h:70
USDIMAGING_API bool IsSupported(UsdImagingIndexProxy const *index) const override
Returns true if the adapter can be populated into the target index.
USDIMAGING_API HdDataSourceLocatorSet InvalidateImagingSubprim(UsdPrim const &prim, TfToken const &subprim, TfTokenVector const &properties, UsdImagingPropertyInvalidationType invalidationType) override
USDIMAGING_API void UpdateForTime(UsdPrim const &prim, SdfPath const &cachePath, UsdTimeCode time, HdDirtyBits requestedBits, UsdImagingInstancerContext const *instancerContext=nullptr) const override
Thread Safe.
USDIMAGING_API TfTokenVector GetImagingSubprims(UsdPrim const &prim) override
USDIMAGING_API SdfPath Populate(UsdPrim const &prim, UsdImagingIndexProxy *index, UsdImagingInstancerContext const *instancerContext=nullptr) override
Definition: prim.h:116
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:440
USDIMAGING_API HdDirtyBits ProcessPropertyChange(UsdPrim const &prim, SdfPath const &cachePath, TfToken const &propertyName) override
Definition: path.h:273
USDIMAGING_API void _RemovePrim(SdfPath const &cachePath, UsdImagingIndexProxy *index) override
Returns whether custom shading of prims is enabled.
USDIMAGING_API TfEnvSetting< bool > LEGACY_PXR_RENDER_TERMINALS_API_ALLOWED_AND_WARN
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
Definition: value.h:146
UsdImagingPropertyInvalidationType
Definition: types.h:17
USDIMAGING_API void TrackVariability(UsdPrim const &prim, SdfPath const &cachePath, HdDirtyBits *timeVaryingBits, UsdImagingInstancerContext const *instancerContext=nullptr) const override
Thread Safe.