dataSourceFieldAsset.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 
8 #ifndef PXR_USD_IMAGING_USD_VOL_IMAGING_DATA_SOURCE_FIELD_ASSET_H
9 #define PXR_USD_IMAGING_USD_VOL_IMAGING_DATA_SOURCE_FIELD_ASSET_H
10 
12 
13 #include "pxr/pxr.h"
14 #include "pxr/usdImaging/usdVolImaging/api.h"
15 
16 #include "pxr/usdImaging/usdImaging/dataSourcePrim.h"
17 #include "pxr/usdImaging/usdImaging/dataSourceStageGlobals.h"
18 #include "pxr/imaging/hd/dataSource.h"
19 
20 PXR_NAMESPACE_OPEN_SCOPE
21 
22 
28 {
29 public:
30  HD_DECLARE_DATASOURCE(UsdImagingDataSourceFieldAsset);
31 
32  TfTokenVector GetNames() override;
33  HdDataSourceBaseHandle Get(const TfToken &name) override;
34 
35  USDVOLIMAGING_API
37 
38 private:
39 
40  // Private constructor, use static New() instead.
42  const SdfPath &sceneIndexPath,
43  UsdPrim usdPrim,
44  const UsdImagingDataSourceStageGlobals &stageGlobals);
45 
46 private:
47  const SdfPath _sceneIndexPath;
48  UsdPrim _usdPrim;
49  const UsdImagingDataSourceStageGlobals & _stageGlobals;
50 };
51 
52 HD_DECLARE_DATASOURCE_HANDLES(UsdImagingDataSourceFieldAsset);
53 
59 {
60 public:
61  HD_DECLARE_DATASOURCE(UsdImagingDataSourceFieldAssetPrim);
62 
63  TfTokenVector GetNames() override;
64  HdDataSourceBaseHandle Get(const TfToken &name) override;
65 
66  static
68  Invalidate(
69  UsdPrim const& prim,
70  const TfToken &subprim,
71  const TfTokenVector &properties,
72  UsdImagingPropertyInvalidationType invalidationType);
73 
74 private:
75 
76  // Private constructor, use static New() instead.
78  const SdfPath &sceneIndexPath,
79  UsdPrim usdPrim,
80  const UsdImagingDataSourceStageGlobals &stageGlobals);
81 };
82 
83 HD_DECLARE_DATASOURCE_HANDLES(UsdImagingDataSourceFieldAssetPrim);
84 
85 PXR_NAMESPACE_CLOSE_SCOPE
86 
87 #endif // PXR_USD_IMAGING_USD_VOL_IMAGING_DATA_SOURCE_FIELD_ASSET_H
A prim data source representing UsdVolOpenVDBAsset or UsdVolField3DAsset.
A container data source representing volumeField info.
TfTokenVector GetNames() override
Returns the names for which this data source can return meaningful results.
A datasource representing structured (named, hierarchical) data, for example a geometric primitive or...
Definition: dataSource.h:147
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:80
Data source representing a basic USD prim.
This class is used as a context object with global stage information, that gets passed down to dataso...
Represents a set of data source locators closed under descendancy.
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
Definition: prim.h:116
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:489
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:280
HdDataSourceBaseHandle Get(const TfToken &name) override
Returns the data source representing name, if valid.
HdDataSourceBaseHandle Get(const TfToken &name) override
Returns the child datasource of the given name.
TfTokenVector GetNames() override
Returns the list of names for which Get(...) is expected to return a non-null value.