Loading...
Searching...
No Matches
geomSubsetAdapter.h
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_GEOM_SUBSET_ADAPTER_H
8#define PXR_USD_IMAGING_USD_IMAGING_GEOM_SUBSET_ADAPTER_H
9
10#include "pxr/usdImaging/usdImaging/api.h"
12#include "pxr/usdImaging/usdImaging/types.h"
13
14#include "pxr/imaging/hd/dataSource.h"
15#include "pxr/imaging/hd/dataSourceLocator.h"
16#include "pxr/imaging/hd/types.h"
17
18#include "pxr/usd/sdf/path.h"
19#include "pxr/usd/usd/timeCode.h"
20
21#include "pxr/base/tf/token.h"
22
23#include "pxr/pxr.h"
24
25PXR_NAMESPACE_OPEN_SCOPE
26
27class UsdImagingGeomSubsetAdapter
29{
30public:
31 using BaseAdapter = UsdImagingPrimAdapter;
32
33 UsdImagingGeomSubsetAdapter()
34 : BaseAdapter()
35 { }
36
37 USDIMAGING_API
38 ~UsdImagingGeomSubsetAdapter() override;
39
40 // ---------------------------------------------------------------------- //
42 // ---------------------------------------------------------------------- //
43
44 USDIMAGING_API
45 TfTokenVector GetImagingSubprims(const UsdPrim& prim) override;
46
47 USDIMAGING_API
48 TfToken GetImagingSubprimType(
49 const UsdPrim& prim,
50 const TfToken& subprim) override;
51
52 USDIMAGING_API
53 HdContainerDataSourceHandle GetImagingSubprimData(
54 const UsdPrim& prim,
55 const TfToken& subprim,
56 const UsdImagingDataSourceStageGlobals& stageGlobals) override;
57
58 USDIMAGING_API
59 HdDataSourceLocatorSet InvalidateImagingSubprim(
60 const UsdPrim& prim,
61 const TfToken& subprim,
62 const TfTokenVector& properties,
63 UsdImagingPropertyInvalidationType invalidationType) override;
64
65 // ---------------------------------------------------------------------- //
67 // ---------------------------------------------------------------------- //
68
69 USDIMAGING_API
71 const UsdPrim& prim,
73 const UsdImagingInstancerContext* instancerCtx = nullptr) override;
74
75 USDIMAGING_API
77 const UsdPrim& prim,
78 const SdfPath& cachePath,
79 HdDirtyBits* timeVaryingBits,
80 const UsdImagingInstancerContext* instancerCtx = nullptr) const override
81 { }
82
83 USDIMAGING_API
84 void UpdateForTime(
85 const UsdPrim& prim,
86 const SdfPath& cachePath,
87 UsdTimeCode time,
88 HdDirtyBits requestedBits,
89 const UsdImagingInstancerContext* instancerCtx = nullptr) const override
90 { }
91
92 USDIMAGING_API
93 HdDirtyBits ProcessPropertyChange(
94 const UsdPrim& prim,
95 const SdfPath& cachePath,
96 const TfToken& propertyName) override;
97
98 USDIMAGING_API
99 void MarkDirty(
100 const UsdPrim& prim,
101 const SdfPath& cachePath,
102 HdDirtyBits dirty,
103 UsdImagingIndexProxy* index) override
104 { }
105
106protected:
107 USDIMAGING_API
108 void _RemovePrim(
109 const SdfPath& cachePath,
110 UsdImagingIndexProxy* index) override
111 { }
112};
113
114PXR_NAMESPACE_CLOSE_SCOPE
115
116#endif // PXR_USD_IMAGING_USD_IMAGING_GEOM_SUBSET_ADAPTER_H
Represents a set of data source locators closed under descendancy.
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:274
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:71
This class is used as a context object with global stage information, that gets passed down to dataso...
This proxy class exposes a subset of the private Delegate API to PrimAdapters.
Definition: indexProxy.h:30
Base class for all PrimAdapters.
Definition: primAdapter.h:54
virtual HdDirtyBits ProcessPropertyChange(UsdPrim const &prim, SdfPath const &cachePath, TfToken const &propertyName)=0
Returns a bit mask of attributes to be updated, or HdChangeTracker::AllDirty if the entire prim must ...
virtual SdfPath Populate(UsdPrim const &prim, UsdImagingIndexProxy *index, UsdImagingInstancerContext const *instancerContext=nullptr)=0
Called to populate the RenderIndex for this UsdPrim.
virtual void TrackVariability(UsdPrim const &prim, SdfPath const &cachePath, HdDirtyBits *timeVaryingBits, UsdImagingInstancerContext const *instancerContext=nullptr) const =0
For the given prim, variability is detected and stored in timeVaryingBits.
virtual void UpdateForTime(UsdPrim const &prim, SdfPath const &cachePath, UsdTimeCode time, HdDirtyBits requestedBits, UsdImagingInstancerContext const *instancerContext=nullptr) const =0
Populates the cache for the given prim, time and requestedBits.
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
Definition: prim.h:117
Represent a time value, which may be either numeric, holding a double value, or a sentinel value UsdT...
Definition: timeCode.h:72
Object used by instancer prim adapters to pass along context about the instancer and instance prim to...
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:440