Loading...
Searching...
No Matches
dataSourcePointInstancer.h
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
10#include "pxr/imaging/hd/dataSourceTypeDefs.h"
11
13
14#include "pxr/usdImaging/usdImaging/dataSourcePrim.h"
15#include "pxr/usdImaging/usdImaging/dataSourcePrimvars.h"
16
17PXR_NAMESPACE_OPEN_SCOPE
18
19// ----------------------------------------------------------------------------
20
28{
29public:
30 HD_DECLARE_DATASOURCE(UsdImagingDataSourcePointInstancerMask);
31
32 VtValue GetValue(HdSampledDataSource::Time shutterOffset) override;
33
34 VtBoolArray GetTypedValue(
35 HdSampledDataSource::Time shutterOffset) override;
36
38 HdSampledDataSource::Time startTime,
39 HdSampledDataSource::Time endTime,
40 std::vector<HdSampledDataSource::Time> * outSampleTimes) override;
41
42private:
44 const SdfPath &sceneIndexPath,
45 const UsdGeomPointInstancer &usdPI,
46 const UsdImagingDataSourceStageGlobals &stageGlobals);
47
48private:
50 const UsdImagingDataSourceStageGlobals &_stageGlobals;
51};
52
53HD_DECLARE_DATASOURCE_HANDLES(UsdImagingDataSourcePointInstancerMask);
54
55// ----------------------------------------------------------------------------
56
65{
66public:
67 HD_DECLARE_DATASOURCE(UsdImagingDataSourcePointInstancerTopology);
68
70 HdDataSourceBaseHandle Get(const TfToken &name) override;
71
72private:
73 // Private constructor, use static New() instead.
75 const SdfPath &sceneIndexPath,
77 const UsdImagingDataSourceStageGlobals &stageGlobals);
78
79private:
80 const SdfPath _sceneIndexPath;
82 const UsdImagingDataSourceStageGlobals &_stageGlobals;
83};
84
85HD_DECLARE_DATASOURCE_HANDLES(UsdImagingDataSourcePointInstancerTopology);
86
87// ----------------------------------------------------------------------------
88
93class UsdImagingDataSourcePointInstancerPrim
95{
96public:
97 HD_DECLARE_DATASOURCE(UsdImagingDataSourcePointInstancerPrim);
98
99 TfTokenVector GetNames() override;
100 HdDataSourceBaseHandle Get(const TfToken &name) override;
101
104 USDIMAGING_API
106 UsdPrim const &prim,
107 const TfToken &subprim,
108 const TfTokenVector &properties,
109 UsdImagingPropertyInvalidationType invalidationType);
110
111private:
112 // Private constructor, use static New() instead.
113 USDIMAGING_API
114 UsdImagingDataSourcePointInstancerPrim(
115 const SdfPath &sceneIndexPath,
116 UsdPrim usdPrim,
117 const UsdImagingDataSourceStageGlobals &stageGlobals);
118
119};
120
121HD_DECLARE_DATASOURCE_HANDLES(UsdImagingDataSourcePointInstancerPrim);
122
123PXR_NAMESPACE_CLOSE_SCOPE
124
125#endif // PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_POINT_INSTANCER_H
A datasource representing structured (named, hierarchical) data, for example a geometric primitive or...
Definition: dataSource.h:99
Represents a set of data source locators closed under descendancy.
A datasource representing a concretely-typed sampled value.
Definition: dataSource.h:193
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
Encodes vectorized instancing of multiple, potentially animated, prototypes (object/instance masters)...
A data source representing a point instancer's instance mask.
VtBoolArray GetTypedValue(HdSampledDataSource::Time shutterOffset) override
Returns the value of this data source at frame-relative time shutterOffset, as type T.
bool GetContributingSampleTimesForInterval(HdSampledDataSource::Time startTime, HdSampledDataSource::Time endTime, std::vector< HdSampledDataSource::Time > *outSampleTimes) override
Given a shutter window of interest (startTime and endTime relative to the current frame),...
VtValue GetValue(HdSampledDataSource::Time shutterOffset) override
Returns the value of this data source at frame-relative time shutterOffset.
A data source representing a point instancer's instance topology.
TfTokenVector GetNames() override
Returns the list of names for which Get(...) is expected to return a non-null value.
HdDataSourceBaseHandle Get(const TfToken &name) override
Returns the child datasource of the given name.
Data source representing a basic USD prim.
USDIMAGING_API TfTokenVector GetNames() override
Returns the names for which this data source can return meaningful results.
static USDIMAGING_API HdDataSourceLocatorSet Invalidate(UsdPrim const &prim, const TfToken &subprim, const TfTokenVector &properties, UsdImagingPropertyInvalidationType invalidationType)
Returns the hydra attribute set we should invalidate if the value of the USD properties in properties...
USDIMAGING_API HdDataSourceBaseHandle Get(const TfToken &name) override
Returns the data source representing name, if valid.
This class is used as a context object with global stage information, that gets passed down to dataso...
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
Definition: prim.h:117
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition: value.h:90
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:440