Loading...
Searching...
No Matches
sceneIndexPrimAdapter.h
1//
2// Copyright 2025 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_SCENE_INDEX_PRIM_ADAPTER_H
8#define PXR_USD_IMAGING_USD_IMAGING_SCENE_INDEX_PRIM_ADAPTER_H
9
10#include "pxr/pxr.h"
11#include "pxr/usdImaging/usdImaging/api.h"
13
14PXR_NAMESPACE_OPEN_SCOPE
15
28{
29public:
31
32 USDIMAGING_API
34
35 USDIMAGING_API
37
38 // ---------------------------------------------------------------------- //
40 // ---------------------------------------------------------------------- //
41
42 TfTokenVector GetImagingSubprims(UsdPrim const &prim) override = 0;
43
44 TfToken GetImagingSubprimType(
45 UsdPrim const &prim, TfToken const& subprim) override = 0;
46
47 HdContainerDataSourceHandle GetImagingSubprimData(
48 UsdPrim const& prim,
49 TfToken const& subprim,
50 const UsdImagingDataSourceStageGlobals &stageGlobals) override = 0;
51
52 HdDataSourceLocatorSet InvalidateImagingSubprim(
53 UsdPrim const& prim,
54 TfToken const& subprim,
55 TfTokenVector const& properties,
56 UsdImagingPropertyInvalidationType invalidationType) override = 0;
57
58 /*
59 * A simple prim could implement this as:
60 * GetImagingSubprims() = { "" }
61 * GetImagingSubprimType("") = "Sphere"
62 * GetImagingSubprimData("") = SphereDataSource(prim, globals)
63 * ... while a more complicated prim could implement this as:
64 * GetImagingSubprims() = { "", "guide" }
65 * GetImagingSubprimType("") = "Light"
66 * GetImagingSubprimType("guide") = "Mesh"
67 * ... etc. Typically the main prim is named "" (empty token).
68 */
69
70 // ---------------------------------------------------------------------- //
75 // ---------------------------------------------------------------------- //
76
77 USDIMAGING_API
81 instancerContext = nullptr) override final;
82
83 USDIMAGING_API
84 void TrackVariability(UsdPrim const& prim,
85 SdfPath const& cachePath,
86 HdDirtyBits* timeVaryingBits,
88 instancerContext = nullptr) const override final;
89
90 USDIMAGING_API
91 void UpdateForTime(UsdPrim const& prim,
92 SdfPath const& cachePath,
93 UsdTimeCode time,
94 HdDirtyBits requestedBits,
96 instancerContext = nullptr) const override final;
97
98 USDIMAGING_API
100 UsdPrim const& prim,
101 SdfPath const& cachePath,
102 TfToken const& propertyName) override final;
103
104 USDIMAGING_API
105 void MarkDirty(UsdPrim const& prim,
106 SdfPath const& cachePath,
107 HdDirtyBits dirty,
108 UsdImagingIndexProxy* index) override final;
109
110 USDIMAGING_API
111 void _RemovePrim(SdfPath const& cachePath,
112 UsdImagingIndexProxy* index) override final;
113};
114
115PXR_NAMESPACE_CLOSE_SCOPE
116
117#endif // PXR_USD_IMAGING_USD_IMAGING_PRIM_DATASOURCE_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
The base class prim adapter for scene index support.
USDIMAGING_API void UpdateForTime(UsdPrim const &prim, SdfPath const &cachePath, UsdTimeCode time, HdDirtyBits requestedBits, UsdImagingInstancerContext const *instancerContext=nullptr) const override final
Populates the cache for the given prim, time and requestedBits.
USDIMAGING_API HdDirtyBits ProcessPropertyChange(UsdPrim const &prim, SdfPath const &cachePath, TfToken const &propertyName) override final
Returns a bit mask of attributes to be updated, or HdChangeTracker::AllDirty if the entire prim must ...
USDIMAGING_API void TrackVariability(UsdPrim const &prim, SdfPath const &cachePath, HdDirtyBits *timeVaryingBits, UsdImagingInstancerContext const *instancerContext=nullptr) const override final
For the given prim, variability is detected and stored in timeVaryingBits.
USDIMAGING_API SdfPath Populate(UsdPrim const &prim, UsdImagingIndexProxy *index, UsdImagingInstancerContext const *instancerContext=nullptr) override final
Called to populate the RenderIndex for this UsdPrim.
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...
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:440