DHART
|
Analyze space from the perspective of observers within a 3D environment. More...
Enumerations | |
enum class | AGGREGATE_TYPE { COUNT = 0 , SUM = 1 , AVERAGE = 2 , MAX = 3 , MIN = 4 } |
The type of aggregation to use for ViewAnalysisAggregate More... | |
Functions | |
constexpr float | ConvertToRadians (float num_in_degrees) |
Convert a number from degrees to radians. More... | |
void | Normalize (std::array< float, 3 > &vec) |
Normalize a vector. More... | |
bool | AltitudeWithinRange (const std::array< float, 3 > &vec, float max_angle, float min_angle) |
vector< std::array< float, 3 > > | FibbonacciDist (int num_points, float upwards_fov, float downward_fov) |
vector< std::array< float, 3 > > | FibbonacciDistributePoints (int num_points, float upwards_fov=50.0f, float downward_fov=70.0f) |
Evenly distribute a set of points around a sphere centered at the origin. More... | |
void | Aggregate (float &out_total, float new_value, const AGGREGATE_TYPE agg_type, int count=0) |
template<typename RES , typename RT , typename N > | |
std::vector< RES > | SphericalViewAnalysis (RT &ray_tracer, const std::vector< N > &Nodes, int num_rays, float upward_limit=50.0f, float downward_limit=70.0f, float height=1.7f) |
Conduct view analysis with any Raytracer in parallel. More... | |
template<typename RT , typename N > | |
std::vector< float > | SphericalRayshootWithAnyRTForDistance (RT &ray_tracer, const std::vector< N > &Nodes, int num_rays, float upward_limit=50.0f, float downward_limit=70.0f, float height=1.7f, const AGGREGATE_TYPE aggregation=AGGREGATE_TYPE::SUM) |
Conduct view analysis and recieve a summarized set of results for each node. More... | |
Analyze space from the perspective of observers within a 3D environment.
View Analysis contains a set of algorithms dedicated to evaluating the view of an observer from specific points in a model. Generally this consists of equally distributing a series of rays in a sphere around the observer, then casting the rays and calculating a result or returning the raw results of each intersection.
|
strong |
The type of aggregation to use for ViewAnalysisAggregate
Definition at line 49 of file view_analysis.h.
|
inline |
Apply an aggregation to the given value.
out_total | The total of the current aggregation. This will be modified depending on agg_type. |
new_value | New value to aggregate into out_total. |
agg_type | The type of aggregation to use. |
count | Number of elements encountered so far. Used for Count/Average. |
std::out_of_range | agg_type didn't match any valid AGGREGATE_TYPE. |
This can be called in a loop to summarize the results of some calculation as new values become available. This avoids having to allocate entire arrays of values then calculating the result at the end.
>>> Average: 3
>>> Sum: 15
>>> Max: 5
>>> Min: 1
>>> Count: 5
Definition at line 194 of file view_analysis.h.
References AVERAGE, COUNT, MAX, MIN, and SUM.
Referenced by SphericalRayshootWithAnyRTForDistance().
|
inline |
Check if a vector's altitude is between max and min angle.
vec | Vector to check the altitude of |
max_angle | Maximum allowed angle in radians |
min_angle | Minimum allowed angle in radians |
vec is converted to spherical coordinates to determine phi, which is then compared to max and min angle to calculate the result.
Definition at line 62 of file view_analysis.cpp.
Referenced by FibbonacciDist().
|
constexpr |
Convert a number from degrees to radians.
Definition at line 27 of file view_analysis.cpp.
Referenced by FibbonacciDist().
vector< std::array< float, 3 > > HF::ViewAnalysis::FibbonacciDist | ( | int | num_points, |
float | upwards_fov, | ||
float | downward_fov | ||
) |
Equally distribute points on a sphere using Fibbonacci
num_points | Number of points to generate. The actual number of points generated will be lower based given field of view limits. |
upwards_fov | Maximum altitude of generated points in degrees. |
downward_fov | Minimum altitude of points in degrees. |
Implementation is based on https://stackoverflow.com/questions/9600801/evenly-distributing-n-points-on-a-sphere.
Definition at line 84 of file view_analysis.cpp.
References AltitudeWithinRange(), ConvertToRadians(), and Normalize().
Referenced by FibbonacciDistributePoints().
|
inline |
Normalize a vector.
vec | Vector to normalize. Will be updated with the normalized value. |
Definition at line 33 of file view_analysis.cpp.
Referenced by FibbonacciDist().