Loading...
Searching...
No Matches
dataSourcePointInstancer.h
1//
2// Copyright 2020 Pixar
3//
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
5// with the following modification; you may not use this file except in
6// compliance with the Apache License and the following modification to it:
7// Section 6. Trademarks. is deleted and replaced with:
8//
9// 6. Trademarks. This License does not grant permission to use the trade
10// names, trademarks, service marks, or product names of the Licensor
11// and its affiliates, except as required to comply with Section 4(c) of
12// the License and to reproduce the content of the NOTICE file.
13//
14// You may obtain a copy of the Apache License at
15//
16// http://www.apache.org/licenses/LICENSE-2.0
17//
18// Unless required by applicable law or agreed to in writing, software
19// distributed under the Apache License with the above modification is
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21// KIND, either express or implied. See the Apache License for the specific
22// language governing permissions and limitations under the Apache License.
23//
24#ifndef PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_POINT_INSTANCER_H
25#define PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_POINT_INSTANCER_H
26
27#include "pxr/imaging/hd/dataSourceTypeDefs.h"
28
30
31#include "pxr/usdImaging/usdImaging/dataSourcePrim.h"
32#include "pxr/usdImaging/usdImaging/dataSourcePrimvars.h"
33
34PXR_NAMESPACE_OPEN_SCOPE
35
36// ----------------------------------------------------------------------------
37
45{
46public:
47 HD_DECLARE_DATASOURCE(UsdImagingDataSourcePointInstancerMask);
48
49 VtValue GetValue(HdSampledDataSource::Time shutterOffset) override;
50
51 VtBoolArray GetTypedValue(
52 HdSampledDataSource::Time shutterOffset) override;
53
55 HdSampledDataSource::Time startTime,
56 HdSampledDataSource::Time endTime,
57 std::vector<HdSampledDataSource::Time> * outSampleTimes) override;
58
59private:
61 const SdfPath &sceneIndexPath,
62 const UsdGeomPointInstancer &usdPI,
63 const UsdImagingDataSourceStageGlobals &stageGlobals);
64
65private:
67 const UsdImagingDataSourceStageGlobals &_stageGlobals;
68};
69
70HD_DECLARE_DATASOURCE_HANDLES(UsdImagingDataSourcePointInstancerMask);
71
72// ----------------------------------------------------------------------------
73
82{
83public:
84 HD_DECLARE_DATASOURCE(UsdImagingDataSourcePointInstancerTopology);
85
87 HdDataSourceBaseHandle Get(const TfToken &name) override;
88
89private:
90 // Private constructor, use static New() instead.
92 const SdfPath &sceneIndexPath,
94 const UsdImagingDataSourceStageGlobals &stageGlobals);
95
96private:
97 const SdfPath _sceneIndexPath;
99 const UsdImagingDataSourceStageGlobals &_stageGlobals;
100};
101
102HD_DECLARE_DATASOURCE_HANDLES(UsdImagingDataSourcePointInstancerTopology);
103
104// ----------------------------------------------------------------------------
105
110class UsdImagingDataSourcePointInstancerPrim
112{
113public:
114 HD_DECLARE_DATASOURCE(UsdImagingDataSourcePointInstancerPrim);
115
116 TfTokenVector GetNames() override;
117 HdDataSourceBaseHandle Get(const TfToken &name) override;
118
121 USDIMAGING_API
123 UsdPrim const &prim,
124 const TfToken &subprim,
125 const TfTokenVector &properties,
126 UsdImagingPropertyInvalidationType invalidationType);
127
128private:
129 // Private constructor, use static New() instead.
130 USDIMAGING_API
131 UsdImagingDataSourcePointInstancerPrim(
132 const SdfPath &sceneIndexPath,
133 UsdPrim usdPrim,
134 const UsdImagingDataSourceStageGlobals &stageGlobals);
135
136};
137
138HD_DECLARE_DATASOURCE_HANDLES(UsdImagingDataSourcePointInstancerPrim);
139
140PXR_NAMESPACE_CLOSE_SCOPE
141
142#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:116
Represents a set of data source locators closed under descendancy.
A datasource representing a concretely-typed sampled value.
Definition: dataSource.h:210
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:290
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:88
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:134
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition: value.h:164
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:457