Lagrange
Loading...
Searching...
No Matches
AttributeEvaluator.h
1/*
2 * Copyright 2024 Adobe. All rights reserved.
3 * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License. You may obtain a copy
5 * of the License at http://www.apache.org/licenses/LICENSE-2.0
6 *
7 * Unless required by applicable law or agreed to in writing, software distributed under
8 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9 * OF ANY KIND, either express or implied. See the License for the specific language
10 * governing permissions and limitations under the License.
11 */
12#pragma once
13
14#include <lagrange/SurfaceMesh.h>
15#include <lagrange/poisson/CommonOptions.h>
16#include <lagrange/poisson/api.h>
17
18#include <array>
19#include <memory>
20#include <string_view>
21
22namespace lagrange::poisson {
23
28
33{
36};
37
43{
44public:
54 template <typename Scalar, typename Index>
55 LA_POISSON_API AttributeEvaluator(
56 const SurfaceMesh<Scalar, Index>& points,
57 const EvaluatorOptions& options = {});
58
62 LA_POISSON_API ~AttributeEvaluator();
63
73 template <typename Scalar, typename ValueType>
74 LA_POISSON_API void eval(span<const Scalar> pos, span<ValueType> out) const;
75
76private:
77 struct Impl;
78
79 // Opaque implementation (non-copyable)
80 std::unique_ptr<Impl> m_impl;
81};
82
84
85} // namespace lagrange::poisson
A general purpose polygonal mesh class.
Definition SurfaceMesh.h:73
void eval(span< const Scalar > pos, span< ValueType > out) const
Evaluate the extrapolated attribute at any point in 3D space.
Definition AttributeEvaluator.cpp:188
AttributeEvaluator(const SurfaceMesh< Scalar, Index > &points, const EvaluatorOptions &options={})
Constructs a new attribute evaluator for a point cloud.
Definition AttributeEvaluator.cpp:145
~AttributeEvaluator()
Destroys the object.
::nonstd::span< T, Extent > span
A bounds-safe view for sequences of objects.
Definition span.h:27
Definition AttributeEvaluator.cpp:115
Shared options for Poisson surface reconstruction.
Definition CommonOptions.h:24
Option struct for Poisson surface reconstruction.
Definition AttributeEvaluator.h:33
std::string_view interpolated_attribute_name
Attribute name of data to be interpolated at the vertices.
Definition AttributeEvaluator.h:35