forked from KhronosGroup/ANARI-SDK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mesh.h
55 lines (43 loc) · 1.39 KB
/
mesh.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
// Copyright 2024 The Khronos Group
// SPDX-License-Identifier: Apache-2.0
#pragma once
#include <anari/anari_cpp.hpp>
// pxr
#include <pxr/base/tf/token.h>
#include <pxr/base/vt/value.h>
#include <pxr/imaging/hd/enums.h>
#include <pxr/imaging/hd/sceneDelegate.h>
#include <pxr/imaging/hd/types.h>
#include <pxr/imaging/hd/vertexAdjacency.h>
#include <pxr/pxr.h>
#include <pxr/usd/sdf/path.h>
#include "geometry.h"
#include "material.h"
#include "meshUtil.h"
PXR_NAMESPACE_OPEN_SCOPE
class HdAnariMesh final : public HdAnariGeometry
{
public:
HF_MALLOC_TAG_NEW("new HdAnariMesh");
HdAnariMesh(anari::Device d,
const SdfPath &id,
const SdfPath &instancerId = SdfPath());
HdDirtyBits GetInitialDirtyBitsMask() const override;
protected:
HdAnariMaterial::PrimvarBinding UpdateGeometry(HdSceneDelegate *sceneDelegate,
HdDirtyBits *dirtyBits,
const TfToken::Set &allPrimvars,
const VtValue &points) override;
void UpdatePrimvarSource(HdSceneDelegate *sceneDelegate,
HdInterpolation interpolation,
const TfToken &attributeName,
const VtValue &value) override;
private:
HdAnariMesh(const HdAnariMesh &) = delete;
HdAnariMesh &operator=(const HdAnariMesh &) = delete;
HdMeshTopology topology_;
std::unique_ptr<HdAnariMeshUtil> meshUtil_;
std::optional<Hd_VertexAdjacency> adjacency_;
VtIntArray trianglePrimitiveParams_;
};
PXR_NAMESPACE_CLOSE_SCOPE