17 return std::vector<T>(0);
19 return std::vector<T>(in_ptr, in_ptr + length);
24 const float* start_point,
31 int max_step_connections,
36 const std::array<float, 3> start_array{ start_point[0], start_point[1], start_point[2] };
37 const std::array<double, 3> spacing_array{ spacing[0], spacing[1], spacing[2] };
54 if (G->
Nodes().size() < 1) {
56 return HF_STATUS::NO_GRAPH;
64 const float* start_point,
71 int max_step_connections,
74 const int* obstacle_ids,
75 const int* walkable_ids,
80 const std::array<float, 3> start_array{ start_point[0], start_point[1], start_point[2] };
81 const std::array<double, 3> spacing_array{ spacing[0], spacing[1], spacing[2] };
83 const std::vector<int> obstacle_vector =
MapToVector(num_obstacles, obstacle_ids);
84 const std::vector<int> walkable_vector =
MapToVector(num_walkables, walkable_ids);
87 GraphGenerator GraphGen(*ray_tracer, obstacle_vector, walkable_vector);
101 if (G->
Nodes().size() < 1) {
103 return HF_STATUS::NO_GRAPH;
Contains declarations for all functions related to the graph generator.
Contains definitions for the Exceptions namespace.
Contains definitions for the EmbreeRayTracer
Contains definitions for the Graph class.
std::vector< T > MapToVector(int length, const T *in_ptr)
Header file for C Interface functions related to graph generation.
C_INTERFACE GenerateGraph(HF::RayTracer::EmbreeRayTracer *ray_tracer, const float *start_point, const float *spacing, int MaxNodes, float UpStep, float UpSlope, float DownStep, float DownSlope, int max_step_connections, int min_connections, int core_count, Graph **out_graph)
Construct a graph by performing a breadth-first search of accessible space.
C_INTERFACE GenerateGraphObstacles(HF::RayTracer::EmbreeRayTracer *ray_tracer, const float *start_point, const float *spacing, int MaxNodes, float UpStep, float UpSlope, float DownStep, float DownSlope, int max_step_connections, int min_connections, int core_count, const int *obstacle_ids, const int *walkable_ids, int num_obstacles, int num_walkables, Graph **out_graph)
Construct a graph by performing a breadth-first search of accessible space, seperating obstacles from...
Custom exceptions and error codes used interally by DHARTAPI.
@ OK
Operation was successful.
Generate a graph of accessible space from a given start point.
SpatialStructures::Graph BuildNetwork(const node_type &start_point, const node2_type &Spacing, int MaxNodes, up_step_type UpStep, up_slope_type UpSlope, down_step_type DownStep, down_slope_type DownSlope, int max_step_connections, int min_connections=1, int cores=-1, z_precision_type node_z_precision=default_z_precision, connect_offset_type node_spacing_precision=default_spacing_precision, spacing_precision_type ground_offset=default_ground_offset)
Generate a graph of accessible space.
A wrapper for Intel's Embree Library.
A Graph of nodes connected by edges that supports both integers and HF::SpatialStructures::Node.
std::vector< Node > Nodes() const
Get a list of nodes from the graph sorted by ID.