HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
dataSourcePointInstancer.h
Go to the documentation of this file.
1 //
2 // Copyright 2020 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_POINT_INSTANCER_H
8 #define PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_POINT_INSTANCER_H
9 
11 
13 
16 
18 
19 // ----------------------------------------------------------------------------
20 
21 /// \class UsdImagingDataSourcePointInstancerMask
22 ///
23 /// A data source representing a point instancer's instance mask. It stores,
24 /// per instance, whether an instance is deactivated. If it has zero length,
25 /// all instances are active.
26 ///
28 {
29 public:
31 
32  VtValue GetValue(HdSampledDataSource::Time shutterOffset) override;
33 
34  VtBoolArray GetTypedValue(
35  HdSampledDataSource::Time shutterOffset) override;
36 
38  HdSampledDataSource::Time startTime,
40  std::vector<HdSampledDataSource::Time> * outSampleTimes) override;
41 
42 private:
44  const SdfPath &sceneIndexPath,
45  const UsdGeomPointInstancer &usdPI,
46  const UsdImagingDataSourceStageGlobals &stageGlobals);
47 
48 private:
49  UsdGeomPointInstancer _usdPI;
50  const UsdImagingDataSourceStageGlobals &_stageGlobals;
51 };
52 
54 
55 // ----------------------------------------------------------------------------
56 
57 /// \class UsdImagingDataSourcePointInstancerTopology
58 ///
59 /// A data source representing a point instancer's instance topology. This
60 /// is made up of "prototypes", "protoIndices", and "mask", which is enough
61 /// to define the right number of instances with the right assigned prototype
62 /// and primvar index.
63 ///
65 {
66 public:
68 
69  TfTokenVector GetNames() override;
70  HdDataSourceBaseHandle Get(const TfToken &name) override;
71 
72 private:
73  // Private constructor, use static New() instead.
75  const SdfPath &sceneIndexPath,
77  const UsdImagingDataSourceStageGlobals &stageGlobals);
78 
79 private:
80  const SdfPath _sceneIndexPath;
81  UsdGeomPointInstancer _usdPI;
82  const UsdImagingDataSourceStageGlobals &_stageGlobals;
83 };
84 
86 
87 // ----------------------------------------------------------------------------
88 
89 /// \class UsdImagingDataSourcePointInstancer
90 ///
91 /// A data source representing the UsdGeom PointInstancer prim.
92 ///
95 {
96 public:
98 
99  TfTokenVector GetNames() override;
100  HdDataSourceBaseHandle Get(const TfToken &name) override;
101 
102  /// Returns the hydra attribute set we should invalidate if the value of
103  /// the USD properties in \p properties change.
106  UsdPrim const &prim,
107  const TfToken &subprim,
108  const TfTokenVector &properties,
109  UsdImagingPropertyInvalidationType invalidationType);
110 
111 private:
112  // Private constructor, use static New() instead.
115  const SdfPath &sceneIndexPath,
116  UsdPrim usdPrim,
117  const UsdImagingDataSourceStageGlobals &stageGlobals);
118 
119 };
120 
122 
124 
125 #endif // PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_POINT_INSTANCER_H
#define USDIMAGING_API
Definition: api.h:23
VtValue GetValue(HdSampledDataSource::Time shutterOffset) override
HD_DECLARE_DATASOURCE(UsdImagingDataSourcePointInstancerMask)
bool GetContributingSampleTimesForInterval(HdSampledDataSource::Time startTime, HdSampledDataSource::Time endTime, std::vector< HdSampledDataSource::Time > *outSampleTimes) override
TfTokenVector GetNames() override
Definition: token.h:70
HdDataSourceBaseHandle Get(const TfToken &name) override
Definition: prim.h:116
HD_DECLARE_DATASOURCE_HANDLES(UsdImagingDataSourcePointInstancerMask)
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:440
HD_DECLARE_DATASOURCE(UsdImagingDataSourcePointInstancerTopology)
GLuint const GLchar * name
Definition: glcorearb.h:786
Definition: path.h:273
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
VtBoolArray GetTypedValue(HdSampledDataSource::Time shutterOffset) override
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
static USDIMAGING_API HdDataSourceLocatorSet Invalidate(UsdPrim const &prim, const TfToken &subprim, const TfTokenVector &properties, UsdImagingPropertyInvalidationType invalidationType)
HdDataSourceBaseHandle Get(const TfToken &name) override
HD_DECLARE_DATASOURCE(UsdImagingDataSourcePointInstancerPrim)
Definition: value.h:146
UsdImagingPropertyInvalidationType
Definition: types.h:17