APM:Libraries
Classes | Functions | Variables
test_geodesic_grid.cpp File Reference
#include <cassert>
#include <vector>
#include "math_test.h"
#include <AP_Math/AP_GeodesicGrid.h>
Include dependency graph for test_geodesic_grid.cpp:

Go to the source code of this file.

Classes

class  TestParam
 
class  GeodesicGridTest
 

Functions

static bool section_triangle (unsigned int section_index, Vector3f &a, Vector3f &b, Vector3f &c)
 
 AP_GTEST_PRINTATBLE_PARAM_MEMBER (TestParam, v)
 
 TEST_P (GeodesicGridTest, Sections)
 
 INSTANTIATE_TEST_CASE_P (IcosahedronVertices, GeodesicGridTest, ::testing::ValuesIn(icosahedron_vertices))
 
 INSTANTIATE_TEST_CASE_P (GeneralVectors, GeodesicGridTest, ::testing::ValuesIn(general_vectors))
 
 INSTANTIATE_TEST_CASE_P (HardcodedVectors, GeodesicGridTest, ::testing::ValuesIn(hardcoded_vectors))
 

Variables

static const Vector3f triangles [20][3]
 
static TestParam icosahedron_vertices []
 
static std::vector< TestParamgeneral_vectors
 
static TestParam hardcoded_vectors []
 

Function Documentation

◆ AP_GTEST_PRINTATBLE_PARAM_MEMBER()

AP_GTEST_PRINTATBLE_PARAM_MEMBER ( TestParam  ,
v   
)

Referenced by section_triangle().

Here is the caller graph for this function:

◆ INSTANTIATE_TEST_CASE_P() [1/3]

INSTANTIATE_TEST_CASE_P ( IcosahedronVertices  ,
GeodesicGridTest  ,
::testing::ValuesIn(icosahedron_vertices  
)

◆ INSTANTIATE_TEST_CASE_P() [2/3]

INSTANTIATE_TEST_CASE_P ( GeneralVectors  ,
GeodesicGridTest  ,
::testing::ValuesIn(general_vectors  
)

◆ INSTANTIATE_TEST_CASE_P() [3/3]

INSTANTIATE_TEST_CASE_P ( HardcodedVectors  ,
GeodesicGridTest  ,
::testing::ValuesIn(hardcoded_vectors  
)

◆ section_triangle()

static bool section_triangle ( unsigned int  section_index,
Vector3f a,
Vector3f b,
Vector3f c 
)
static

Definition at line 98 of file test_geodesic_grid.cpp.

Here is the call graph for this function:

◆ TEST_P()

TEST_P ( GeodesicGridTest  ,
Sections   
)

Definition at line 139 of file test_geodesic_grid.cpp.

Here is the call graph for this function:

Variable Documentation

◆ general_vectors

std::vector<TestParam> general_vectors
static

Definition at line 180 of file test_geodesic_grid.cpp.

◆ hardcoded_vectors

TestParam hardcoded_vectors[]
static
Initial value:
= {
{{.25f * M_GOLDEN, -.25f * (13.0f * M_GOLDEN + 1.0f), - 1.25f}, 17},
{{M_GOLDEN, -4.0f * M_GOLDEN -1.0f, 1.0f}, -1, {16, 18, -1}},
{{-.2667f, .1667f * M_GOLDEN, 2.2667f * M_GOLDEN + .1667f}, 55},
{{-.875f, 6.125f * M_GOLDEN, -1.125f * M_GOLDEN - 6.125f}, 34},
}
#define M_GOLDEN
Definition: definitions.h:17
#define f(i)

Definition at line 221 of file test_geodesic_grid.cpp.

◆ icosahedron_vertices

TestParam icosahedron_vertices[]
static
Initial value:
= {
{{ M_GOLDEN, 1.0f, 0.0f}, -1, {27, 30, 43, 46, 49, -1}},
{{ M_GOLDEN, -1.0f, 0.0f}, -1, {19, 23, 25, 41, 78, -1}},
{{-M_GOLDEN, 1.0f, 0.0f}, -1, { 1, 38, 59, 63, 65, -1}},
{{-M_GOLDEN, -1.0f, 0.0f}, -1, { 3, 6, 9, 67, 70, -1}},
{{ 1.0f, 0.0f, M_GOLDEN}, -1, {42, 45, 53, 75, 79, -1}},
{{-1.0f, 0.0f, M_GOLDEN}, -1, {55, 62, 66, 69, 73, -1}},
{{ 1.0f, 0.0f, -M_GOLDEN}, -1, {15, 22, 26, 29, 33, -1}},
{{-1.0f, 0.0f, -M_GOLDEN}, -1, { 2, 5, 13, 35, 39, -1}},
{{0.0f, M_GOLDEN, 1.0f}, -1, {47, 50, 54, 57, 61, -1}},
{{0.0f, M_GOLDEN, -1.0f}, -1, {31, 34, 37, 51, 58, -1}},
{{0.0f, -M_GOLDEN, 1.0f}, -1, {11, 18, 71, 74, 77, -1}},
{{0.0f, -M_GOLDEN, -1.0f}, -1, { 7, 10, 14, 17, 21, -1}},
}
#define M_GOLDEN
Definition: definitions.h:17

Definition at line 161 of file test_geodesic_grid.cpp.

◆ triangles

const Vector3f triangles[20][3]
static
Initial value:
= {
{{-M_GOLDEN, 1, 0}, {-1, 0,-M_GOLDEN}, {-M_GOLDEN,-1, 0}},
{{-1, 0,-M_GOLDEN}, {-M_GOLDEN,-1, 0}, { 0,-M_GOLDEN,-1}},
{{-M_GOLDEN,-1, 0}, { 0,-M_GOLDEN,-1}, { 0,-M_GOLDEN, 1}},
{{-1, 0,-M_GOLDEN}, { 0,-M_GOLDEN,-1}, { 1, 0,-M_GOLDEN}},
{{ 0,-M_GOLDEN,-1}, { 0,-M_GOLDEN, 1}, { M_GOLDEN,-1, 0}},
{{ 0,-M_GOLDEN,-1}, { 1, 0,-M_GOLDEN}, { M_GOLDEN,-1, 0}},
{{ M_GOLDEN,-1, 0}, { 1, 0,-M_GOLDEN}, { M_GOLDEN, 1, 0}},
{{ 1, 0,-M_GOLDEN}, { M_GOLDEN, 1, 0}, { 0, M_GOLDEN,-1}},
{{ 1, 0,-M_GOLDEN}, { 0, M_GOLDEN,-1}, {-1, 0,-M_GOLDEN}},
{{ 0, M_GOLDEN,-1}, {-M_GOLDEN, 1, 0}, {-1, 0,-M_GOLDEN}},
{{ M_GOLDEN,-1, 0}, { 1, 0, M_GOLDEN}, { M_GOLDEN, 1, 0}},
{{ 1, 0, M_GOLDEN}, { M_GOLDEN, 1, 0}, { 0, M_GOLDEN, 1}},
{{ M_GOLDEN, 1, 0}, { 0, M_GOLDEN, 1}, { 0, M_GOLDEN,-1}},
{{ 1, 0, M_GOLDEN}, { 0, M_GOLDEN, 1}, {-1, 0, M_GOLDEN}},
{{ 0, M_GOLDEN, 1}, { 0, M_GOLDEN,-1}, {-M_GOLDEN, 1, 0}},
{{ 0, M_GOLDEN, 1}, {-1, 0, M_GOLDEN}, {-M_GOLDEN, 1, 0}},
{{-M_GOLDEN, 1, 0}, {-1, 0, M_GOLDEN}, {-M_GOLDEN,-1, 0}},
{{-1, 0, M_GOLDEN}, {-M_GOLDEN,-1, 0}, { 0,-M_GOLDEN, 1}},
{{-1, 0, M_GOLDEN}, { 0,-M_GOLDEN, 1}, { 1, 0, M_GOLDEN}},
{{ 0,-M_GOLDEN, 1}, { M_GOLDEN,-1, 0}, { 1, 0, M_GOLDEN}},
}
#define M_GOLDEN
Definition: definitions.h:17

Definition at line 74 of file test_geodesic_grid.cpp.