Ocean
Loading...
Searching...
No Matches
TestBox3.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7
8#ifndef META_OCEAN_TEST_TESTMATH_TEST_BOX3_H
9#define META_OCEAN_TEST_TESTMATH_TEST_BOX3_H
10
12
14
15#include "ocean/math/Box3.h"
16#include "ocean/math/Line3.h"
17
18namespace Ocean
19{
20
21namespace Test
22{
23
24namespace TestMath
25{
26
27/**
28 * This class implements box tests.
29 * @ingroup testmath
30 */
31class OCEAN_TEST_MATH_EXPORT TestBox3
32{
33 public:
34
35 /**
36 * Tests the entire box functionalities.
37 * @param testDuration Duration of each test, with range (0, infinity)
38 * @param selector The test selector
39 * @return True, if succeeded
40 */
41 static bool test(const double testDuration, const TestSelector& selector);
42
43 /**
44 * Point test.
45 * @param testDuration Duration of each test, with range (0, infinity)
46 * @return True, if succeeded
47 * @tparam T The data type of the scalar to be used for testing, either 'float' or 'double'
48 */
49 template <typename T>
50 static bool testPoint(const double testDuration);
51
52 /**
53 * Is inside test.
54 * @param testDuration Duration of each test, with range (0, infinity)
55 * @return True, if succeeded
56 * @tparam T The data type of the scalar to be used for testing, either 'float' or 'double'
57 */
58 template <typename T>
59 static bool testIsInside(const double testDuration);
60
61 /**
62 * Addition test.
63 * @param testDuration Duration of each test, with range (0, infinity)
64 * @return True, if succeeded
65 * @tparam T The data type of the scalar to be used for testing, either 'float' or 'double'
66 */
67 template <typename T>
68 static bool testAddition(const double testDuration);
69
70 /**
71 * Transformation test.
72 * @param testDuration Duration of each test, with range (0, infinity)
73 * @return True, if succeeded
74 * @tparam T The data type of the scalar to be used for testing, either 'float' or 'double'
75 */
76 template <typename T>
77 static bool testTransformation(const double testDuration);
78
79 /**
80 * Line test.
81 * @param testDuration Duration of each test, with range (0, infinity)
82 * @return True, if succeeded
83 * @tparam T The data type of the scalar to be used for testing, either 'float' or 'double'
84 */
85 template <typename T>
86 static bool testLine(const double testDuration);
87
88 /**
89 * Plane test.
90 * @param testDuration Duration of each test, with range (0, infinity)
91 * @return True, if succeeded
92 * @tparam T The data type of the scalar to be used for testing, either 'float' or 'double'
93 */
94 template <typename T>
95 static bool testPlane(const double testDuration);
96
97 /**
98 * Space test.
99 * @param testDuration Duration of each test, with range (0, infinity)
100 * @return True, if succeeded
101 * @tparam T The data type of the scalar to be used for testing, either 'float' or 'double'
102 */
103 template <typename T>
104 static bool testSpace(const double testDuration);
105
106 /**
107 * Has intersection test.
108 * @param testDuration Duration of each test, with range (0, infinity)
109 * @return True, if succeeded
110 * @tparam T The data type of the scalar to be used for testing, either 'float' or 'double'
111 */
112 template <typename T>
113 static bool testHasIntersection(const double testDuration);
114
115 /**
116 * Tests the expand function.
117 * @param testDuration Duration of each test, with range (0, infinity)
118 * @return True, if succeeded
119 * @tparam T The data type of the scalar to be used for testing, either 'float' or 'double'
120 */
121 template <typename T>
122 static bool testExpand(const double testDuration);
123
124 private:
125
126 /**
127 * Validate has intersection test.
128 * @param testDuration Duration of each test, with range (0, infinity)
129 * @return True, if succeeded
130 * @tparam T The data type of the scalar to be used for testing, either 'float' or 'double'
131 */
132 template <typename T>
133 static bool validateHasIntersection(const double testDuration);
134
135 /**
136 * Returns whether a ray has an intersection with a given box or not.
137 * @param box Box to be tested
138 * @param line Line to be tested
139 * @return True, if so
140 * @tparam T The data type of the scalar to be used for testing, either 'float' or 'double'
141 */
142 template <typename T>
143 static bool hasIntersection(const BoxT3<T>& box, const LineT3<T>& line);
144};
145
146}
147
148}
149
150}
151
152#endif // META_OCEAN_TEST_TESTMATH_TEST_BOX3_H
This class implements an axis aligned 3D bounding box.
Definition Box3.h:67
This class implements an infinite line in 3D space.
Definition Line3.h:68
This class implements box tests.
Definition TestBox3.h:32
static bool testIsInside(const double testDuration)
Is inside test.
static bool validateHasIntersection(const double testDuration)
Validate has intersection test.
static bool testPoint(const double testDuration)
Point test.
static bool testTransformation(const double testDuration)
Transformation test.
static bool testLine(const double testDuration)
Line test.
static bool testPlane(const double testDuration)
Plane test.
static bool hasIntersection(const BoxT3< T > &box, const LineT3< T > &line)
Returns whether a ray has an intersection with a given box or not.
static bool test(const double testDuration, const TestSelector &selector)
Tests the entire box functionalities.
static bool testSpace(const double testDuration)
Space test.
static bool testAddition(const double testDuration)
Addition test.
static bool testHasIntersection(const double testDuration)
Has intersection test.
static bool testExpand(const double testDuration)
Tests the expand function.
This class implements a test selector that parses test function strings and determines which tests sh...
Definition TestSelector.h:51
The namespace covering the entire Ocean framework.
Definition Accessor.h:15