DHART
|
Functions | |
C_INTERFACE | CreateVisibilityGraphAllToAll (HF::RayTracer::EmbreeRayTracer *ert, const float *nodes, int num_nodes, HF::SpatialStructures::Graph **out_graph, float height) |
Create a new directed visibility graph between all nodes in parameter nodes. More... | |
C_INTERFACE | CreateVisibilityGraphAllToAllUndirected (HF::RayTracer::EmbreeRayTracer *ert, const float *nodes, int num_nodes, HF::SpatialStructures::Graph **out_graph, float height, const int cores) |
Create a new undirected visibility graph between all nodes in nodes. More... | |
C_INTERFACE | CreateVisibilityGraphGroupToGroup (HF::RayTracer::EmbreeRayTracer *ert, const float *group_a, const int size_a, const float *group_b, const int size_b, HF::SpatialStructures::Graph **out_graph, float height) |
Create a new visibility graph from the nodes in group_a, into the nodes of group_b. More... | |
Determine which points are visible from other points in space.
C_INTERFACE CreateVisibilityGraphAllToAll | ( | HF::RayTracer::EmbreeRayTracer * | ert, |
const float * | nodes, | ||
int | num_nodes, | ||
HF::SpatialStructures::Graph ** | out_graph, | ||
float | height | ||
) |
#include <Cinterface/visibility_graph_C.h>
Create a new directed visibility graph between all nodes in parameter nodes.
ert | The raytracer to cast rays from |
nodes | Coordinates of nodes to use in generating the visibility graph. Every three floats (every three members in nodes) should represent a single node (point) {x, y, z} |
num_nodes | Amount of nodes (points) that will be used to generate the visibility graph. This should be equal to (size of nodes / 3), since every three floats represents a single point. |
out_graph | Address of (HF::SpatialStructures::Graph *); address of a pointer to a HF::SpatialStructures::Graph. (out_graph) will point to memory allocated by CreateVisibilityGraphAllToAll. |
height | How far to offset nodes from the ground. |
Begin by loading an .obj file (Mesh setup).
Then, create a BVH (Raytracer setup) using the mesh.
Set up the parameters for the visibility graph.
Now we are ready to call CreateVisibilityGraphAllToAll .
Very important: after generating/adding edges to a graph – it must be compressed.
You are now ready to use the visibility graph. Start by retrieving the CSR representation of the graph:
Set up the pointers required to iterate over the CSR. Then output the CSR to the console:
After use, the visibility graph resources must be relinquished:
From here, please review the example at Raytracer teardown for instructions
on how to free the remainder of the resources used by the visibility graph –
which are the (vector<HF::Geometry::MeshInfo> *) and (HF::Raytracer::EmbreeRayTracer *) instances.
>>> LoadOBJ loaded mesh successfully into loaded_obj at address 0000014ECADE5200, code: 1
>>> CreateRaytracer created EmbreeRayTracer successfully into bvh at address 0000014ECAD825A0, code: 1
>>> (0, 2) 2.23607
>>> (2, 0) 2.23607
Definition at line 16 of file visibility_graph_C.cpp.
References HF::VisibilityGraph::AllToAll(), ConvertRawFloatArrayToPoints(), and HF::Exceptions::OK.
C_INTERFACE CreateVisibilityGraphAllToAllUndirected | ( | HF::RayTracer::EmbreeRayTracer * | ert, |
const float * | nodes, | ||
int | num_nodes, | ||
HF::SpatialStructures::Graph ** | out_graph, | ||
float | height, | ||
const int | cores | ||
) |
#include <Cinterface/visibility_graph_C.h>
Create a new undirected visibility graph between all nodes in nodes.
ert | The raytracer to cast rays from |
nodes | Coordinates of nodes to use in generating the visibility graph. Every three floats (every three members in nodes) should represent a single node (point) {x, y, z} |
num_nodes | Amount of nodes (points) that will be used to generate the visibility graph. This should be equal to (size of nodes / 3), since every three floats represents a single point. |
out_graph | Address of (HF::SpatialStructures::Graph *); address of a pointer to a HF::SpatialStructures::Graph. (out_graph) will point to memory allocated by CreateVisibilityGraphAllToAllUndirected. |
height | How far to offset nodes from the ground. |
cores | CPU core count. A value of (-1) means to use all available cores on the system. |
Begin by loading an .obj file (Mesh setup).
Then, create a BVH (Raytracer setup) using the mesh.
Now we are ready to call CreateVisibilityGraphAllToAllUndirected .
Very important: after generating/adding edges to a graph – it must be compressed.
You are now ready to use the visibility graph. Start by retrieving the CSR representation of the graph:
Set up the pointers required to iterate over the CSR. Then output the CSR to the console:
After use, the visibility graph resources must be relinquished:
From here, please review the example at Raytracer teardown for instructions
on how to free the remainder of the resources used by the visibility graph –
which are the (vector<HF::Geometry::MeshInfo> *) and (HF::Raytracer::EmbreeRayTracer *) instances.
>>> LoadOBJ loaded mesh successfully into loaded_obj at address 0000014ECADE5140, code: 1
>>> CreateRaytracer created EmbreeRayTracer successfully into bvh at address 0000014ECAD82AA0, code: 1
>>> (0, 2) 2.23607
Definition at line 40 of file visibility_graph_C.cpp.
References HF::VisibilityGraph::AllToAllUndirected(), ConvertRawFloatArrayToPoints(), and HF::Exceptions::OK.
C_INTERFACE CreateVisibilityGraphGroupToGroup | ( | HF::RayTracer::EmbreeRayTracer * | ert, |
const float * | group_a, | ||
const int | size_a, | ||
const float * | group_b, | ||
const int | size_b, | ||
HF::SpatialStructures::Graph ** | out_graph, | ||
float | height | ||
) |
#include <Cinterface/visibility_graph_C.h>
Create a new visibility graph from the nodes in group_a, into the nodes of group_b.
ert | The raytracer to cast rays from |
group_a | Coordinates of nodes to cast rays from. (source node coordinates) Every three floats (every three members in nodes) should represent a single node (point) {x, y, z} |
size_a | Amount of nodes (points) in group_a. This should be equal to (size of group_a / 3), since every three floats represents a single point. |
group_b | Coordinates of nodes to cast rays at. (destination node coordinates) |
size_b | Amount of nodes (points) in group_b. This should be equal to (size of group_b / 3), since every three floats represents a single point. |
out_graph | Address of (HF::SpatialStructures::Graph *); address of a pointer to a HF::SpatialStructures::Graph. (out_graph) will point to memory allocated by CreateVisibilityGraphGroupToGroup. |
height | How far to offset nodes from the ground. |
Begin by loading an .obj file (Mesh setup).
Then, create a BVH (Raytracer setup) using the mesh.
Set up the parameters for the visibility graph.
Now we are ready to call CreateVisibilityGraphGroupToGroup .
Very important: after generating/adding edges to a graph – it must be compressed.
You are now ready to use the visibility graph. Start by retrieving the CSR representation of the graph:
Set up the pointers required to iterate over the CSR. Then output the CSR to the console:
After use, the visibility graph resources must be relinquished:
From here, please review the example at Raytracer teardown for instructions
on how to free the remainder of the resources used by the visibility graph –
which are the (vector<HF::Geometry::MeshInfo> *) and (HF::Raytracer::EmbreeRayTracer *) instances.
>>> LoadOBJ loaded mesh successfully into loaded_obj at address 0000014ECADE4C60, code: 1
>>> CreateRaytracer created EmbreeRayTracer successfully into bvh at address 0000014ECAD82320, code: 1
>>> (0, 3) 17.3205
>>> (0, 4) 14.1774
>>> (0, 5) 18.0278
>>> (2, 3) 16.8819
>>> (2, 4) 12.8062
>>> (2, 5) 17.3205
Definition at line 64 of file visibility_graph_C.cpp.
References ConvertRawFloatArrayToPoints(), HF::VisibilityGraph::GroupToGroup(), HF::Exceptions::NO_GRAPH, and HF::Exceptions::OK.