HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
fieldAdapter.h
Go to the documentation of this file.
1 //
2 // Copyright 2018 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_FIELD_ADAPTER_H
8 #define PXR_USD_IMAGING_USD_IMAGING_FIELD_ADAPTER_H
9 
10 /// \file usdImaging/fieldAdapter.h
11 
12 #include "pxr/pxr.h"
15 
17 
18 
19 class UsdPrim;
20 
21 /// \class UsdImagingFieldAdapter
22 ///
23 /// Base class for all USD fields.
24 ///
26 public:
28 
29 
32  {}
33 
35  ~UsdImagingFieldAdapter() override;
36 
38  SdfPath Populate(UsdPrim const& prim,
41  instancerContext = nullptr) override;
42 
44  bool IsSupported(UsdImagingIndexProxy const* index) const override;
45 
46  // ---------------------------------------------------------------------- //
47  /// \name Parallel Setup and Resolve
48  // ---------------------------------------------------------------------- //
49 
50  /// Thread Safe.
52  void TrackVariability(UsdPrim const& prim,
53  SdfPath const& cachePath,
54  HdDirtyBits* timeVaryingBits,
56  instancerContext = nullptr) const override;
57 
58 
59  /// Thread Safe.
61  void UpdateForTime(UsdPrim const& prim,
62  SdfPath const& cachePath,
64  HdDirtyBits requestedBits,
66  instancerContext = nullptr) const override;
67 
68  // ---------------------------------------------------------------------- //
69  /// \name Change Processing
70  // ---------------------------------------------------------------------- //
71 
72  /// Returns a bit mask of attributes to be udpated, or
73  /// HdChangeTracker::AllDirty if the entire prim must be resynchronized.
76  SdfPath const& cachePath,
77  TfToken const& propertyName) override;
78 
80  void MarkDirty(UsdPrim const& prim,
81  SdfPath const& cachePath,
82  HdDirtyBits dirty,
83  UsdImagingIndexProxy* index) override;
84 
86  void MarkTransformDirty(UsdPrim const& prim,
87  SdfPath const& cachePath,
88  UsdImagingIndexProxy* index) override;
89 
91  void MarkVisibilityDirty(UsdPrim const& prim,
92  SdfPath const& cachePath,
93  UsdImagingIndexProxy* index) override;
94 
95  // ---------------------------------------------------------------------- //
96  /// \name Data access
97  // ---------------------------------------------------------------------- //
98 
100  VtValue Get(UsdPrim const& prim,
101  SdfPath const& cachePath,
102  TfToken const& key,
104  VtIntArray *outIndices) const override;
105 
106  // ---------------------------------------------------------------------- //
107  /// \name Field adapter requirements
108  // ---------------------------------------------------------------------- //
109  /// Returns the token specifying the Hydra primitive type that is created
110  /// by this adapter.
112  virtual TfToken GetPrimTypeToken() const = 0;
113 
114 protected:
116  void _RemovePrim(SdfPath const& cachePath,
117  UsdImagingIndexProxy* index) override;
118 };
119 
120 
122 
123 #endif // PXR_USD_IMAGING_USD_IMAGING_FIELD_ADAPTER_H
#define USDIMAGING_API
Definition: api.h:23
GT_API const UT_StringHolder time
uint32_t HdDirtyBits
Definition: types.h:143
USDIMAGING_API void MarkVisibilityDirty(UsdPrim const &prim, SdfPath const &cachePath, UsdImagingIndexProxy *index) override
USDIMAGING_API bool IsSupported(UsdImagingIndexProxy const *index) const override
Returns true if the adapter can be populated into the target index.
USDIMAGING_API void _RemovePrim(SdfPath const &cachePath, UsdImagingIndexProxy *index) override
Definition: token.h:70
virtual USDIMAGING_API TfToken GetPrimTypeToken() const =0
Definition: prim.h:116
USDIMAGING_API SdfPath Populate(UsdPrim const &prim, UsdImagingIndexProxy *index, UsdImagingInstancerContext const *instancerContext=nullptr) override
Definition: path.h:273
USDIMAGING_API HdDirtyBits ProcessPropertyChange(UsdPrim const &prim, SdfPath const &cachePath, TfToken const &propertyName) override
USDIMAGING_API ~UsdImagingFieldAdapter() override
USDIMAGING_API VtValue Get(UsdPrim const &prim, SdfPath const &cachePath, TfToken const &key, UsdTimeCode time, VtIntArray *outIndices) const 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 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 void MarkDirty(UsdPrim const &prim, SdfPath const &cachePath, HdDirtyBits dirty, UsdImagingIndexProxy *index) override
GLuint index
Definition: glcorearb.h:786
USDIMAGING_API void MarkTransformDirty(UsdPrim const &prim, SdfPath const &cachePath, UsdImagingIndexProxy *index) override
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
Definition: value.h:146