Blender V5.3
BLI_astar.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2014 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
11
12#include "DNA_listBase.h"
13
14#include "BLI_bitmap.hh"
15
16namespace blender {
17
18/* -------------------------------------------------------------------- */
19
21 int nodes[2];
22 float cost;
23
25};
26
28 ListBaseT<LinkData> neighbor_links;
29
31};
32
34 /* Final 'most useful' data. */
39 int steps;
44
46
47 /* Mostly runtime data. */
49 float *g_costs;
50 int *g_steps;
51
52 struct MemArena *mem; /* Memory arena. */
53};
54
58
60
61 struct MemArena *mem; /* Memory arena. */
62};
63
70void BLI_astar_node_init(BLI_AStarGraph *as_graph, int node_index, void *custom_data);
80 BLI_AStarGraph *as_graph, int node1_index, int node2_index, float cost, void *custom_data);
85
95 BLI_AStarSolution *as_solution,
96 void *custom_data);
108
120using astar_f_cost = float (*)(BLI_AStarGraph *as_graph,
121 BLI_AStarSolution *as_solution,
122 BLI_AStarGNLink *link,
123 int node_idx_curr,
124 int node_idx_next,
125 int node_idx_dst);
126
135void BLI_astar_graph_init(BLI_AStarGraph *as_graph, int node_num, void *custom_data);
146 int node_index_src,
147 int node_index_dst,
148 astar_f_cost f_cost_cb,
149 BLI_AStarSolution *r_solution,
150 int max_steps);
151
152} // namespace blender
These structs are the foundation for all linked lists in the library system.
BMesh Iterators.
void BLI_astar_node_init(BLI_AStarGraph *as_graph, int node_index, void *custom_data)
Definition astar.cc:40
int BLI_astar_node_link_other_node(BLI_AStarGNLink *lnk, int idx)
Definition astar.cc:66
bool BLI_astar_graph_solve(BLI_AStarGraph *as_graph, int node_index_src, int node_index_dst, astar_f_cost f_cost_cb, BLI_AStarSolution *r_solution, int max_steps)
Definition astar.cc:144
float(*)(BLI_AStarGraph *as_graph, BLI_AStarSolution *as_solution, BLI_AStarGNLink *link, int node_idx_curr, int node_idx_next, int node_idx_dst) astar_f_cost
Definition BLI_astar.hh:120
void BLI_astar_node_link_add(BLI_AStarGraph *as_graph, int node1_index, int node2_index, float cost, void *custom_data)
Definition astar.cc:45
void BLI_astar_solution_free(BLI_AStarSolution *as_solution)
Definition astar.cc:112
unsigned int BLI_bitmap
Definition BLI_bitmap.hh:15
void BLI_astar_solution_init(BLI_AStarGraph *as_graph, BLI_AStarSolution *as_solution, void *custom_data)
Definition astar.cc:71
void BLI_astar_graph_init(BLI_AStarGraph *as_graph, int node_num, void *custom_data)
Definition astar.cc:120
void BLI_astar_solution_clear(BLI_AStarSolution *as_solution)
Definition astar.cc:95
void BLI_astar_graph_free(BLI_AStarGraph *as_graph)
Definition astar.cc:136
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
ListBaseT< LinkData > neighbor_links
Definition BLI_astar.hh:28
BLI_AStarGNode * nodes
Definition BLI_astar.hh:57
struct MemArena * mem
Definition BLI_astar.hh:61
struct MemArena * mem
Definition BLI_astar.hh:52
BLI_AStarGNLink ** prev_links
Definition BLI_astar.hh:43