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 
11 
12 #include "pxr/pxr.h"
13 #include "pxr/usdImaging/usdImaging/api.h"
15 
16 PXR_NAMESPACE_OPEN_SCOPE
17 
18 
19 class UsdPrim;
20 
26 public:
28 
29 
32  {}
33 
34  USDIMAGING_API
35  ~UsdImagingFieldAdapter() override;
36 
37  USDIMAGING_API
38  SdfPath Populate(UsdPrim const& prim,
39  UsdImagingIndexProxy* index,
41  instancerContext = nullptr) override;
42 
43  USDIMAGING_API
44  bool IsSupported(UsdImagingIndexProxy const* index) const override;
45 
46  // ---------------------------------------------------------------------- //
48  // ---------------------------------------------------------------------- //
49 
51  USDIMAGING_API
52  void TrackVariability(UsdPrim const& prim,
53  SdfPath const& cachePath,
54  HdDirtyBits* timeVaryingBits,
56  instancerContext = nullptr) const override;
57 
58 
60  USDIMAGING_API
61  void UpdateForTime(UsdPrim const& prim,
62  SdfPath const& cachePath,
63  UsdTimeCode time,
64  HdDirtyBits requestedBits,
66  instancerContext = nullptr) const override;
67 
68  // ---------------------------------------------------------------------- //
70  // ---------------------------------------------------------------------- //
71 
74  USDIMAGING_API
75  HdDirtyBits ProcessPropertyChange(UsdPrim const& prim,
76  SdfPath const& cachePath,
77  TfToken const& propertyName) override;
78 
79  USDIMAGING_API
80  void MarkDirty(UsdPrim const& prim,
81  SdfPath const& cachePath,
82  HdDirtyBits dirty,
83  UsdImagingIndexProxy* index) override;
84 
85  USDIMAGING_API
86  void MarkTransformDirty(UsdPrim const& prim,
87  SdfPath const& cachePath,
88  UsdImagingIndexProxy* index) override;
89 
90  USDIMAGING_API
91  void MarkVisibilityDirty(UsdPrim const& prim,
92  SdfPath const& cachePath,
93  UsdImagingIndexProxy* index) override;
94 
95  // ---------------------------------------------------------------------- //
97  // ---------------------------------------------------------------------- //
98 
99  USDIMAGING_API
100  VtValue Get(UsdPrim const& prim,
101  SdfPath const& cachePath,
102  TfToken const& key,
103  UsdTimeCode time,
104  VtIntArray *outIndices) const override;
105 
106  // ---------------------------------------------------------------------- //
108  // ---------------------------------------------------------------------- //
111  USDIMAGING_API
112  virtual TfToken GetPrimTypeToken() const = 0;
113 
114 protected:
115  USDIMAGING_API
116  void _RemovePrim(SdfPath const& cachePath,
117  UsdImagingIndexProxy* index) override;
118 };
119 
120 
121 PXR_NAMESPACE_CLOSE_SCOPE
122 
123 #endif // PXR_USD_IMAGING_USD_IMAGING_FIELD_ADAPTER_H
Base class for all USD fields.
Definition: fieldAdapter.h:25
virtual USDIMAGING_API TfToken GetPrimTypeToken() const =0
Returns the token specifying the Hydra primitive type that is created by this adapter.
This proxy class exposes a subset of the private Delegate API to PrimAdapters.
Definition: indexProxy.h:30
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:80
Represent a time value, which may be either numeric, holding a double value, or a sentinel value UsdT...
Definition: timeCode.h:73
Base class for all PrimAdapters.
Definition: primAdapter.h:52
USDIMAGING_API VtValue Get(UsdPrim const &prim, SdfPath const &cachePath, TfToken const &key, UsdTimeCode time, VtIntArray *outIndices) const override
Gets the value of the parameter named key for the given prim (which has the given cache path) and giv...
USDIMAGING_API void TrackVariability(UsdPrim const &prim, SdfPath const &cachePath, HdDirtyBits *timeVaryingBits, UsdImagingInstancerContext const *instancerContext=nullptr) const override
Thread Safe.
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
Definition: prim.h:116
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:280
USDIMAGING_API void UpdateForTime(UsdPrim const &prim, SdfPath const &cachePath, UsdTimeCode time, HdDirtyBits requestedBits, UsdImagingInstancerContext const *instancerContext=nullptr) const override
Thread Safe.
USDIMAGING_API bool IsSupported(UsdImagingIndexProxy const *index) const override
Returns true if the adapter can be populated into the target index.
Object used by instancer prim adapters to pass along context about the instancer and instance prim to...
USDIMAGING_API SdfPath Populate(UsdPrim const &prim, UsdImagingIndexProxy *index, UsdImagingInstancerContext const *instancerContext=nullptr) override
Called to populate the RenderIndex for this UsdPrim.
USDIMAGING_API HdDirtyBits ProcessPropertyChange(UsdPrim const &prim, SdfPath const &cachePath, TfToken const &propertyName) override
Returns a bit mask of attributes to be udpated, or HdChangeTracker::AllDirty if the entire prim must ...
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition: value.h:89