Loading...
Searching...
No Matches
generativeProceduralAdapter.h
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_PROC_IMAGING_GENERATIVE_PROCEDURAL_ADAPTER_H
8#define PXR_USD_IMAGING_USD_PROC_IMAGING_GENERATIVE_PROCEDURAL_ADAPTER_H
9
10#include "pxr/usdImaging/usdProcImaging/api.h"
11#include "pxr/usdImaging/usdImaging/instanceablePrimAdapter.h"
12
13PXR_NAMESPACE_OPEN_SCOPE
14
15class UsdProcImagingGenerativeProceduralAdapter
17{
18public:
19 using BaseAdapter = UsdImagingInstanceablePrimAdapter;
20
21 // ---------------------------------------------------------------------- //
23 // ---------------------------------------------------------------------- //
24
25 USDPROCIMAGING_API
26 TfTokenVector GetImagingSubprims(UsdPrim const& prim) override;
27
28 USDPROCIMAGING_API
29 TfToken GetImagingSubprimType(UsdPrim const& prim, TfToken const& subprim)
30 override;
31
32 USDPROCIMAGING_API
33 HdContainerDataSourceHandle GetImagingSubprimData(
34 UsdPrim const& prim,
35 TfToken const& subprim,
36 const UsdImagingDataSourceStageGlobals &stageGlobals) override;
37
38 USDPROCIMAGING_API
39 HdDataSourceLocatorSet InvalidateImagingSubprim(
40 UsdPrim const& prim,
41 TfToken const& subprim,
42 TfTokenVector const& properties,
43 UsdImagingPropertyInvalidationType invalidationType) override;
44
45 // ---------------------------------------------------------------------- //
47 // ---------------------------------------------------------------------- //
48
49
50 USDPROCIMAGING_API
52 UsdPrim const& prim,
55 instancerContext = nullptr) override;
56
57 USDPROCIMAGING_API
58 bool IsSupported(UsdImagingIndexProxy const* index) const override;
59
60 USDPROCIMAGING_API
61 void UpdateForTime(
62 UsdPrim const& prim,
63 SdfPath const& cachePath,
64 UsdTimeCode time,
65 HdDirtyBits requestedBits,
67 instancerContext = nullptr) const override;
68
69 USDPROCIMAGING_API
70 VtValue Get(UsdPrim const& prim,
71 SdfPath const& cachePath,
72 TfToken const& key,
73 UsdTimeCode time,
74 VtIntArray *outIndices) const override;
75
76 USDPROCIMAGING_API
77 HdDirtyBits ProcessPropertyChange(
78 UsdPrim const& prim,
79 SdfPath const& cachePath,
80 TfToken const& propertyName) override;
81
82
83 USDPROCIMAGING_API
84 void MarkDirty(UsdPrim const& prim,
85 SdfPath const& cachePath,
86 HdDirtyBits dirty,
87 UsdImagingIndexProxy* index) override;
88
89 USDPROCIMAGING_API
90 void MarkTransformDirty(UsdPrim const& prim,
91 SdfPath const& cachePath,
92 UsdImagingIndexProxy* index) override;
93
94 USDPROCIMAGING_API
95 void MarkVisibilityDirty(UsdPrim const& prim,
96 SdfPath const& cachePath,
97 UsdImagingIndexProxy* index) override;
98
99 USDPROCIMAGING_API
100 void TrackVariability(UsdPrim const& prim,
101 SdfPath const& cachePath,
102 HdDirtyBits* timeVaryingBits,
104 instancerContext = nullptr) const override;
105
106protected:
107 USDPROCIMAGING_API
108 void _RemovePrim(SdfPath const& cachePath,
109 UsdImagingIndexProxy* index) override;
110
111private:
112 TfToken _GetHydraPrimType(UsdPrim const& prim);
113
114};
115
116PXR_NAMESPACE_CLOSE_SCOPE
117
118#endif // PXR_USD_IMAGING_USD_PROC_IMAGING_GENERATIVE_PROCEDURAL_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
An abstract adapter class for prims that are instanceable.
virtual USDIMAGING_API VtValue Get(UsdPrim const &prim, SdfPath const &cachePath, TfToken const &key, UsdTimeCode time, VtIntArray *outIndices) const
Gets the value of the parameter named key for the given prim (which has the given cache path) and giv...
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 bool IsSupported(UsdImagingIndexProxy const *index) const
Returns true if the adapter can be populated into the target index.
Definition: primAdapter.h:668
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
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition: value.h:90
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