Loading...
Searching...
No Matches
dataSourceRelationship.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_RELATIONSHIP_H
8#define PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_RELATIONSHIP_H
9
10#include "pxr/usdImaging/usdImaging/api.h"
11#include "pxr/usdImaging/usdImaging/dataSourceStageGlobals.h"
12
13#include "pxr/imaging/hd/dataSource.h"
14#include "pxr/imaging/hd/dataSourceTypeDefs.h"
15
16#include "pxr/usd/sdf/path.h"
17#include "pxr/usd/usd/relationship.h"
18
19#include "pxr/base/vt/value.h"
20
21#include <vector>
22
23PXR_NAMESPACE_OPEN_SCOPE
24
30{
31public:
32 HD_DECLARE_DATASOURCE(UsdImagingDataSourceRelationship);
33
36 USDIMAGING_API
37 VtValue GetValue(HdSampledDataSource::Time shutterOffset) override;
38
41 USDIMAGING_API
43 HdSampledDataSource::Time shutterOffset) override;
44
46 USDIMAGING_API
48 HdSampledDataSource::Time startTime,
49 HdSampledDataSource::Time endTime,
50 std::vector<HdSampledDataSource::Time> *outSampleTimes) override;
51
52private:
58 USDIMAGING_API
60 const UsdRelationship &usdRel,
61 const UsdImagingDataSourceStageGlobals &stageGlobals);
62
63private:
64 UsdRelationship _usdRel;
65 const UsdImagingDataSourceStageGlobals & _stageGlobals;
66};
67
74{
75public:
76 HD_DECLARE_DATASOURCE(UsdImagingDataSourceSingleRelationship);
77
80 USDIMAGING_API
81 VtValue GetValue(HdSampledDataSource::Time shutterOffset) override;
82
85 USDIMAGING_API
86 SdfPath GetTypedValue(HdSampledDataSource::Time shutterOffset) override;
87
89 USDIMAGING_API
91 HdSampledDataSource::Time startTime,
92 HdSampledDataSource::Time endTime,
93 std::vector<HdSampledDataSource::Time>* outSampleTimes) override;
94
95private:
101 USDIMAGING_API
103 const UsdRelationship& usdRel,
104 const UsdImagingDataSourceStageGlobals& stageGlobals);
105
106private:
107 UsdRelationship _usdRel;
108 const UsdImagingDataSourceStageGlobals& _stageGlobals;
109};
110
111HD_DECLARE_DATASOURCE_HANDLES(UsdImagingDataSourceRelationship);
112
113PXR_NAMESPACE_CLOSE_SCOPE
114
115#endif // PXR_USD_IMAGING_USD_IMAGING_DATA_SOURCE_RELATIONSHIP_H
A datasource representing a concretely-typed sampled value.
Definition dataSource.h:248
A path value used to locate objects in layers or scenegraphs.
Definition path.h:281
A data source that represents a USD relationship as an array of paths.
USDIMAGING_API bool GetContributingSampleTimesForInterval(HdSampledDataSource::Time startTime, HdSampledDataSource::Time endTime, std::vector< HdSampledDataSource::Time > *outSampleTimes) override
Returns false indicating USD relationships cannot vary with time.
USDIMAGING_API VtValue GetValue(HdSampledDataSource::Time shutterOffset) override
Returns the extracted path array value of the relationship, as a VtValue.
USDIMAGING_API VtArray< SdfPath > GetTypedValue(HdSampledDataSource::Time shutterOffset) override
Returns the extracted path array value of the relationship.
A data source that represents only the first authored, non-empty path of a USD relationship as a sing...
USDIMAGING_API SdfPath GetTypedValue(HdSampledDataSource::Time shutterOffset) override
Returns the first non-empty path in the path array value of the relationship.
USDIMAGING_API bool GetContributingSampleTimesForInterval(HdSampledDataSource::Time startTime, HdSampledDataSource::Time endTime, std::vector< HdSampledDataSource::Time > *outSampleTimes) override
Returns false indicating USD relationships cannot vary with time.
USDIMAGING_API VtValue GetValue(HdSampledDataSource::Time shutterOffset) override
Returns the first non-empty path in the path array value of the relationship, as a VtValue.
This class is used as a context object with global stage information, that gets passed down to dataso...
A UsdRelationship creates dependencies between scenegraph objects by allowing a prim to target other ...
Represents an arbitrary dimensional rectangular container class.
Definition array.h:213
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition value.h:90