dataSourceMesh.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_IMAGING_DATA_SOURCE_MESH_H
8 #define PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_MESH_H
9 
10 #include "pxr/usdImaging/usdImaging/dataSourceGprim.h"
11 #include "pxr/usdImaging/usdImaging/dataSourceStageGlobals.h"
12 
13 #include "pxr/usd/usdGeom/mesh.h"
14 
15 #include "pxr/imaging/hd/dataSource.h"
16 
17 PXR_NAMESPACE_OPEN_SCOPE
18 
24 {
25 public:
26  HD_DECLARE_DATASOURCE(UsdImagingDataSourceSubdivisionTags);
27 
28  TfTokenVector GetNames() override;
29  HdDataSourceBaseHandle Get(const TfToken &name) override;
30 
31 private:
33  UsdGeomMesh usdMesh,
34  const UsdImagingDataSourceStageGlobals &stageGlobals);
35 
36 private:
37  UsdGeomMesh _usdMesh;
38  const UsdImagingDataSourceStageGlobals & _stageGlobals;
39 };
40 
41 HD_DECLARE_DATASOURCE_HANDLES(UsdImagingDataSourceSubdivisionTags);
42 
43 // ----------------------------------------------------------------------------
44 
50 {
51 public:
52  HD_DECLARE_DATASOURCE(UsdImagingDataSourceMeshTopology);
53 
54  TfTokenVector GetNames() override;
55  HdDataSourceBaseHandle Get(const TfToken &name) override;
56 
57 private:
59  const SdfPath &sceneIndexPath,
60  UsdGeomMesh usdMesh,
61  const UsdImagingDataSourceStageGlobals &stageGlobals);
62 
63 private:
64  const SdfPath _sceneIndexPath;
65  UsdGeomMesh _usdMesh;
66  const UsdImagingDataSourceStageGlobals & _stageGlobals;
67 };
68 
69 HD_DECLARE_DATASOURCE_HANDLES(UsdImagingDataSourceMeshTopology);
70 
71 // ----------------------------------------------------------------------------
72 
73 
79 {
80 public:
81  HD_DECLARE_DATASOURCE(UsdImagingDataSourceMesh);
82 
83  TfTokenVector GetNames() override;
84  HdDataSourceBaseHandle Get(const TfToken &name) override;
85 
86 private:
88  const SdfPath &sceneIndexPath,
89  UsdGeomMesh usdMesh,
90  const UsdImagingDataSourceStageGlobals &stageGlobals);
91 
92 private:
93  const SdfPath _sceneIndexPath;
94  UsdGeomMesh _usdMesh;
95  const UsdImagingDataSourceStageGlobals & _stageGlobals;
96 };
97 
98 HD_DECLARE_DATASOURCE_HANDLES(UsdImagingDataSourceMesh);
99 
100 // ----------------------------------------------------------------------------
101 
107 {
108 public:
109  HD_DECLARE_DATASOURCE(UsdImagingDataSourceMeshPrim);
110 
111  TfTokenVector GetNames() override;
112  HdDataSourceBaseHandle Get(const TfToken &name) override;
113 
114  USDIMAGING_API
115  static HdDataSourceLocatorSet Invalidate(
116  UsdPrim const& prim,
117  const TfToken &subprim,
118  const TfTokenVector &properties,
119  UsdImagingPropertyInvalidationType invalidationType);
120 
121 private:
123  const SdfPath &sceneIndexPath,
124  UsdPrim usdPrim,
125  const UsdImagingDataSourceStageGlobals &stageGlobals);
126 };
127 
128 HD_DECLARE_DATASOURCE_HANDLES(UsdImagingDataSourceMeshPrim);
129 
130 PXR_NAMESPACE_CLOSE_SCOPE
131 
132 #endif // PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_MESH_H
A container data source representing data unique to meshes.
Data source representing a USD gprim.
TfTokenVector GetNames() override
Returns the list of names for which Get(...) is expected to return a non-null value.
A datasource representing structured (named, hierarchical) data, for example a geometric primitive or...
Definition: dataSource.h:147
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.
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:80
HdDataSourceBaseHandle Get(const TfToken &name) override
Returns the child datasource of the given name.
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.
TfTokenVector GetNames() override
Returns the list of names for which Get(...) is expected to return a non-null value.
A container data source representing mesh topology.
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
HdDataSourceBaseHandle Get(const TfToken &name) override
Returns the child datasource of the given name.
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:280
A prim data source representing UsdGeomMesh.
Encodes a mesh with optional subdivision properties and features.
Definition: mesh.h:116
A container data source representing subdivision tags.