forked from wetadigital/USDPluginExamples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
triangleAdapter.h
67 lines (53 loc) · 2.35 KB
/
triangleAdapter.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
//
// Copyright © 2023 Weta Digital Limited
//
// SPDX-License-Identifier: Apache-2.0
//
#pragma once
#include <pxr/usdImaging/usdImaging/gprimAdapter.h>
PXR_NAMESPACE_OPEN_SCOPE
/// \class UsdTriImagingTriangleAdapter
///
/// PrimAdapter plugin for the "Triangle" prim type.
class UsdTriImagingTriangleAdapter : public UsdImagingGprimAdapter
{
public:
using BaseAdapter = UsdImagingGprimAdapter;
// ---------------------------------------------------------------------- //
/// \name Initialization
// ---------------------------------------------------------------------- //
virtual SdfPath Populate(
const UsdPrim& usdPrim,
UsdImagingIndexProxy* index,
const UsdImagingInstancerContext* instancerContext = nullptr) override;
virtual bool IsSupported(const UsdImagingIndexProxy* index) const override;
// ---------------------------------------------------------------------- //
/// \name Parallel Setup and Resolve
// ---------------------------------------------------------------------- //
virtual void TrackVariability(
const UsdPrim& usdPrim,
const SdfPath& cachePath,
HdDirtyBits* timeVaryingBits,
const UsdImagingInstancerContext* i_instancerContext =
nullptr) const override;
// ---------------------------------------------------------------------- //
/// \name Change processing
// ---------------------------------------------------------------------- //
virtual HdDirtyBits ProcessPropertyChange(
const UsdPrim& usdPrim,
const SdfPath& cachePath,
const TfToken& propertyName) override;
// ---------------------------------------------------------------------- //
/// \name GprimAdapter overrides
// ---------------------------------------------------------------------- //
/// Override the implementation in GprimAdapter and provide \em custom
/// points for a triangle.
virtual VtValue GetPoints(const UsdPrim& usdPrim,
UsdTimeCode timeCode) const override;
/// Override the implementation in GprimAdapter and provide \em custom
/// topology for a triangle.
virtual VtValue GetTopology(const UsdPrim& usdPrim,
const SdfPath& cachePath,
UsdTimeCode time) const override;
};
PXR_NAMESPACE_CLOSE_SCOPE