Lagrange
compute_dijkstra_distance.h
1/*
2 * Copyright 2017 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#ifdef LAGRANGE_ENABLE_LEGACY_FUNCTIONS
15 #include <lagrange/legacy/compute_dijkstra_distance.h>
16#endif
17
18#include <lagrange/SurfaceMesh.h>
19#include <lagrange/utils/SmallVector.h>
20#include <optional>
21
22namespace lagrange {
30
34template <typename Scalar, typename Index>
36{
38 Index seed_facet = invalid<Index>();
39
42
44 Scalar radius = 0.0;
45
47 std::string_view output_attribute_name = "@dijkstra_distance";
48
51};
52
53
65template <typename Scalar, typename Index>
66std::optional<std::vector<Index>> compute_dijkstra_distance(
68 const DijkstraDistanceOptions<Scalar, Index>& options = {});
69
70
72} // namespace lagrange
std::optional< std::vector< Index > > compute_dijkstra_distance(SurfaceMesh< Scalar, Index > &mesh, const DijkstraDistanceOptions< Scalar, Index > &options={})
Computes dijkstra distance from a seed facet.
Definition: compute_dijkstra_distance.cpp:24
Main namespace for Lagrange.
Definition: AABBIGL.h:30
Option struct for compute_dijkstra_distance.
Definition: compute_dijkstra_distance.h:36
bool output_involved_vertices
Output involved vertices.
Definition: compute_dijkstra_distance.h:50
Index seed_facet
Seed facet index.
Definition: compute_dijkstra_distance.h:38
Scalar radius
Maximum radius of the dijkstra distance.
Definition: compute_dijkstra_distance.h:44
std::string_view output_attribute_name
Output attribute name for dijkstra distance.
Definition: compute_dijkstra_distance.h:47
SmallVector< Scalar, 3 > barycentric_coords
Seed facet barycentric coordinate.
Definition: compute_dijkstra_distance.h:41