DHART
Loading...
Searching...
No Matches
CInterface.cpp File Reference

Contains implementation for the CInterface. More...

#include <spatialstructures_C.h>
#include <iostream>
#include <Constants.h>
#include <HFExceptions.h>
#include <graph.h>
#include <node.h>
#include <edge.h>
+ Include dependency graph for CInterface.cpp:

Go to the source code of this file.

Functions

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 More...
 
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 More...
 
C_INTERFACE GetEdgesForNode (const Graph *graph, const Node *Node, vector< Edge > **out_vector_ptr, Edge **out_edge_list_ptr, int *out_edge_list_size)
 
C_INTERFACE GetSizeOfNodeVector (const std::vector< HF::SpatialStructures::Node > *node_list, int *out_size)
 Get the size of a node vector. More...
 
C_INTERFACE GetSizeOfEdgeVector (const std::vector< HF::SpatialStructures::Edge > *edge_list, int *out_size)
 Get the size of an edge vector. More...
 
C_INTERFACE DestroyNodes (std::vector< HF::SpatialStructures::Node > *nodelist_to_destroy)
 Delete the vector of nodes at the given pointer. More...
 
C_INTERFACE DestroyEdges (std::vector< HF::SpatialStructures::Edge > *edgelist_to_destroy)
 Delete the vector of edges at the given pointer. More...
 
C_INTERFACE DestroyGraph (HF::SpatialStructures::Graph *graph_to_destroy)
 Delete a graph. More...
 

Detailed Description

Contains implementation for the CInterface.

Author
TBA
Date
06 Jun 2020

Definition in file CInterface.cpp.

Function Documentation

◆ ConvertRawFloatArrayToPoints()

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

Parameters
raw_arrayPointer to the external array
sizeThe number of points stored in the raw array, equal to the total number of floats / 3
Returns

Definition at line 24 of file CInterface.cpp.

Referenced by CastMultipleDirectionsOneOrigin(), CastMultipleOriginsOneDirection(), CastMultipleRays(), CastOcclusionRays(), CastRaysDistance(), CreateVisibilityGraphAllToAll(), CreateVisibilityGraphAllToAllUndirected(), CreateVisibilityGraphGroupToGroup(), SphereicalViewAnalysisAggregateFlat(), and SphericalViewAnalysisNoAggregateFlat().

+ Here is the caller graph for this function:

◆ ConvertRawIntArrayToPoints()

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

Parameters
raw_arrayPointer to the external array
sizeThe number of points stored in the raw array, equal to the total number of ints / 3
Returns
A list of points
// Requires #include "cinterface_utils.h"
int raw_array = { 0, 1, 2, 3, 4, 5, 6, 7, 8 };
const int size = 9;
std::vector<std::array<int, 3>> points = ConvertRawIntArrayToPoints(raw_array, 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
Definition: CInterface.cpp:35

Definition at line 35 of file CInterface.cpp.

◆ GetEdgesForNode()

C_INTERFACE GetEdgesForNode ( const Graph *  graph,
const Node *  Node,
vector< Edge > **  out_vector_ptr,
Edge **  out_edge_list_ptr,
int *  out_edge_list_size 
)

Definition at line 46 of file CInterface.cpp.