12using std::make_unique;
27 const char * cost_type,
33 std::unique_ptr<BoostGraph, BoostGraphDeleter> bg;
58 *out_size = P->
size();
74 const char* cost_type,
81 vector<int> starts(start, start + num_paths);
82 vector<int> ends(end, end + num_paths);
85 std::unique_ptr<BoostGraph, BoostGraphDeleter> bg;
105 out_path_member_ptr_holder,
121 *out_size = p->
size();
127 *out_member_ptr = NULL;
140 const char* cost_type,
148 std::string cost(cost_type);
158 return HF_STATUS::OK;
163 return HF_STATUS::NO_COST;
167 return HF_STATUS::GENERIC_ERROR;
173 const char* cost_name,
174 vector<float>** out_dist_vector,
175 float** out_dist_data,
176 vector<int>** out_pred_vector,
188 *out_dist_vector = matricies.
dist;
189 *out_dist_data = matricies.
dist->data();
190 *out_pred_vector = matricies.
pred;
191 *out_pred_data = matricies.
pred->data();
194 return HF_STATUS::NO_COST;
197 return HF_STATUS::OK;
Contains definitions for the Exceptions namespace.
Contains definition for the BoostGraphDeleter structure.
Contains definitions for the Graph class.
Contains definitions for the Path structure.
void DeleteRawPtr(T *ptr)
Delete some object pointed to by ptr
Header file for C Interface pathfinding functionality.
C_INTERFACE CalculateDistanceAndPredecessor(const Graph *g, const char *cost_name, vector< float > **out_dist_vector, float **out_dist_data, vector< int > **out_pred_vector, int **out_pred_data)
Calculate the distance and predecessor matricies for a graph.
C_INTERFACE CreatePath(const HF::SpatialStructures::Graph *g, int start, int end, const char *cost_type, int *out_size, HF::SpatialStructures::Path **out_path, HF::SpatialStructures::PathMember **out_data)
Find the shortest path from start to end.
C_INTERFACE DestroyPath(Path *path_to_destroy)
Delete a path.
C_INTERFACE GetPathInfo(HF::SpatialStructures::Path *p, PathMember **out_member_ptr, int *out_size)
Get the size of a path
C_INTERFACE CreateAllToAllPaths(const HF::SpatialStructures::Graph *g, const char *cost_type, HF::SpatialStructures::Path **out_path_ptr_holder, HF::SpatialStructures::PathMember **out_path_member_ptr_holder, int *out_sizes, int num_paths)
Find a path from every node in a graph to every other node.
C_INTERFACE CreatePaths(const HF::SpatialStructures::Graph *g, const int *start, const int *end, const char *cost_type, HF::SpatialStructures::Path **out_path_ptr_holder, HF::SpatialStructures::PathMember **out_path_member_ptr_holder, int *out_sizes, int num_paths)
Find multiple shortest paths in paralllel.
HF_STATUS
A set of error codes standard throughout every DHARTAPI codebase.
@ OK
Operation was successful.
@ GENERIC_ERROR
Not sure what happened here (If this gets thrown, either fix it or give it a status code!...
@ NO_COST
There is no cost with the given name in the given graph.
@ NO_PATH
There is no path between the start and end points.
Algorithms to find the shortest path between nodes in a HF::SpatialStructures::Graph.
void InsertPathsIntoArray(const BoostGraph *bg, const std::vector< int > &start_points, const std::vector< int > &end_points, HF::SpatialStructures::Path **out_paths, HF::SpatialStructures::PathMember **out_path_members, int *out_sizes)
A special version of FindPaths optimized for the C_Interface.
Path FindPath(BoostGraph *bg, int start_id, int end_id)
Find a path between points A and B using Dijkstra's Shortest Path algorithm.
void InsertAllToAllPathsIntoArray(BoostGraph *bg, Path **out_paths, PathMember **out_path_members, int *out_sizes)
A special version of FindPaths optimized for the C_Interface, such that all paths possible from each ...
DistanceAndPredecessor GenerateDistanceAndPred(const BoostGraph &bg)
Generate the distance and predecessor matricies for a specific boost graph.
std::unique_ptr< BoostGraph, BoostGraphDeleter > CreateBoostGraph(const Graph &g, const std::string &cost_type)
Create a new boost graph from a HF::SpatialStructures:Graph.
Thrown when a dependency is missing such as Embree.
Holds and maintains a distance and predecessor matrix.
std::vector< int > * pred
std::vector< float > * dist
A Graph of nodes connected by edges that supports both integers and HF::SpatialStructures::Node.
The ID of a node, and the cost cost to the node after it.
A collection of nodes that form a path.
int size() const
Determine how many nodes are in this path.
bool empty() const
Determine if this path has any nodes in it.
PathMember * GetPMPointer()
Get a pointer to the path's underlying path members vector.