25 std::vector<std::array<float, 3>> out_array(size);
26 for (
int i = 0; i < size; i++) {
28 out_array[i][0] = raw_array[os];
29 out_array[i][1] = raw_array[os + 1];
30 out_array[i][2] = raw_array[os + 2];
36 std::vector<std::array<int, 3>> out_array(size);
37 for (
int i = 0; i < size; i++) {
39 out_array[i][0] = raw_array[os];
40 out_array[i][1] = raw_array[os + 1];
41 out_array[i][2] = raw_array[os + 2];
46C_INTERFACE GetEdgesForNode(
const Graph* graph,
const Node* Node, vector<Edge>** out_vector_ptr, Edge** out_edge_list_ptr,
int* out_edge_list_size) {
48 if (!(graph->hasKey(*Node))) {
49 return HF_STATUS::OUT_OF_RANGE;
52 vector<Edge>* Edges =
new vector<Edge>();
53 *Edges = (*graph)[*Node];
54 *out_edge_list_ptr = Edges->data();
55 *out_edge_list_size = Edges->size();
56 *out_vector_ptr = Edges;
61 *out_size = node_list->size();
66 *out_size = edge_list->size();
71 if (nodelist_to_destroy)
delete nodelist_to_destroy;
76 if (edgelist_to_destroy)
delete edgelist_to_destroy;
81 if (graph_to_destroy)
delete graph_to_destroy;
Contains definitions for the Exceptions namespace.
std::vector< std::array< float, 3 > > ConvertRawFloatArrayToPoints(const float *raw_array, int size)
Convert a raw array from an external caller to an organized vector of points
C_INTERFACE GetEdgesForNode(const Graph *graph, const Node *Node, vector< Edge > **out_vector_ptr, Edge **out_edge_list_ptr, int *out_edge_list_size)
std::vector< std::array< int, 3 > > ConvertRawIntArrayToPoints(const int *raw_array, int size)
Convert a raw array from an external caller to an organized vector of points
Contains definitions for the HF::SpatialStructures namespace.
Contains definitions for the Edge structure.
Contains definitions for the Graph class.
Contains definitions for the Node structure.
Header file related to manipulating nodes, edges, and graphs via CInterface.
C_INTERFACE DestroyGraph(HF::SpatialStructures::Graph *graph_to_destroy)
Delete a graph.
C_INTERFACE GetSizeOfEdgeVector(const std::vector< HF::SpatialStructures::Edge > *edge_list, int *out_size)
Get the size of an edge vector.
C_INTERFACE DestroyNodes(std::vector< HF::SpatialStructures::Node > *nodelist_to_destroy)
Delete the vector of nodes at the given pointer.
C_INTERFACE GetSizeOfNodeVector(const std::vector< HF::SpatialStructures::Node > *node_list, int *out_size)
Get the size of a node vector.
C_INTERFACE DestroyEdges(std::vector< HF::SpatialStructures::Edge > *edgelist_to_destroy)
Delete the vector of edges at the given pointer.
A Graph of nodes connected by edges that supports both integers and HF::SpatialStructures::Node.