Lagrange
Loading...
Searching...
No Matches
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{
39
42
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
Hybrid vector that uses the stack upto a maximum size, and the heap beyond that.
Definition SmallVector.h:124
A general purpose polygonal mesh class.
Definition SurfaceMesh.h:66
@ Scalar
Mesh attribute must have exactly 1 channel.
Definition AttributeFwd.h:56
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
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
Main namespace for Lagrange.
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