Lagrange
Loading...
Searching...
No Matches
ClosestPointResult.h
1/*
2 * Copyright 2020 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/common.h>
15#include <lagrange/legacy/inline.h>
16
17#include <Eigen/Core>
18
19#include <functional>
20
21namespace lagrange {
22namespace raycasting {
23LAGRANGE_LEGACY_INLINE
24namespace legacy {
25
26template <typename Scalar>
28{
29 // Point type
30 using Point = Eigen::Matrix<Scalar, 3, 1>;
31
32 // Callback to populate triangle corner position given a (mesh_id, facet_id)
33 std::function<void(unsigned, unsigned, Point&, Point&, Point&)> populate_triangle;
34
35 // Current best result
36 unsigned mesh_index = invalid<unsigned>();
37 unsigned facet_index = invalid<unsigned>();
38 Point closest_point;
39 Point barycentric_coord;
40};
41
42} // namespace legacy
43} // namespace raycasting
44} // namespace lagrange
constexpr T invalid()
You can use invalid<T>() to get a value that can represent "invalid" values, such as invalid indices ...
Definition invalid.h:40
Raycasting operations.
Definition ClosestPointResult.h:22
Main namespace for Lagrange.
Definition ClosestPointResult.h:28