25 #ifndef WBRESENHAMDBL_TEST_H
26 #define WBRESENHAMDBL_TEST_H
31 #include <cxxtest/TestSuite.h>
33 #include "../WBresenhamDBL.h"
34 #include "core/common/WLogger.h"
50 std::shared_ptr< WGridRegular3D > grid(
new WGridRegular3D( 3, 3, 3 ) );
72 std::vector< double > expected( 27, 0.0 );
74 TS_ASSERT_EQUALS(
m_algo->m_values, expected );
87 std::vector< double > expected( 27, 0.0 );
89 TS_ASSERT_EQUALS(
m_algo->m_values, expected );
103 std::vector< double > expected( 27, 0.0 );
107 TS_ASSERT_EQUALS(
m_algo->m_values, expected );
144 std::vector< double > expected( 27, 0.0 );
148 TS_ASSERT_EQUALS(
m_algo->m_values, expected );
155 TS_ASSERT_EQUALS(
m_algo->m_values, expected );
167 std::vector< double > expected( 27, 0.0 );
171 TS_ASSERT_EQUALS(
m_algo->m_values, expected );
183 TS_ASSERT_EQUALS(
m_algo->m_values, expected );
Unit tests the Bresenham algorithm.
void testLineSegementWithSameStartAndEndPoint(void)
If a line segments starts and ends on the same point only its voxel should be selected.
void tearDown(void)
Clean up after each test.
void testExactLineIsNotRasteredTheSameWayAsMidpointLines(void)
Rasterization of exact lines must not match rasteriation of midpoint lines.
void testSymmetry(void)
If you have a line from A to B then rastering it from B to should be equivalent.
void testPolySegmentOneVoxelRastering(void)
Multiple segments in one voxel should also mark only this voxel.
void testPolyLineRastering(void)
Lines like WFibers consisting out of multiple line segements should be traced segment by segment.
std::shared_ptr< WBresenhamDBL > m_algo
test instace of the WBresenham algo
void setUp(void)
Creates a member variable with a WBresenham instance which you may use for testing.
This is a modified version the Bresenham algorithm.
A grid that has parallelepiped cells which all have the same proportion.
A line is an ordered sequence of WPositions.
static void startup(std::ostream &output=std::cout, LogLevel level=LL_DEBUG)
Create the first and only instance of the logger as it is a singleton.
void push_back(const value_type &value)
Wrapper around std::vector member function.
void clear()
Wrapper around std::vector member function.
This only is a 3d double vector.
const double DBL_EPS
Smallest double such: 1.0 + DBL_EPS == 1.0 is still true.