OpenWalnut
1.5.0dev
|
Unit tests the Bresenham algorithm. More...
#include <WBresenham_test.h>
Public Member Functions | |
void | setUp (void) |
Creates a member variable with a WBresenham instance which you may use for testing. More... | |
void | tearDown (void) |
Clean up after each test. More... | |
void | testLineSegementWithSameStartAndEndPoint (void) |
If a line segments starts and ends on the same point only its voxel should be selected. More... | |
void | testPolySegmentOneVoxelRastering (void) |
Multiple segments in one voxel should also mark only this voxel. More... | |
void | testPolyLineRastering (void) |
Lines like WFibers consisting out of multiple line segements should be traced segment by segment. More... | |
void | testRasteringIn3rdQuadrant (void) |
Lines rastered in the 3rd Quadrant should also be traced. More... | |
void | testSymmetry (void) |
If you have a line from A to B then rastering it from B to should be equivalent. More... | |
void | testExactLineIsRasteredTheSameWayAsMidpointLines (void) |
Lines starting in a voxel A and ending in voxel B are rastered exactly the same way as all lines starting in A and ending in B as well as the line starting in the center of A and ending in the center of B. More... | |
Private Attributes | |
std::shared_ptr< WBresenham > | m_algo |
test instace of the WBresenham algo More... | |
Unit tests the Bresenham algorithm.
Definition at line 39 of file WBresenham_test.h.
|
inline |
Creates a member variable with a WBresenham instance which you may use for testing.
Definition at line 46 of file WBresenham_test.h.
References m_algo, and WLogger::startup().
|
inline |
|
inline |
Lines starting in a voxel A and ending in voxel B are rastered exactly the same way as all lines starting in A and ending in B as well as the line starting in the center of A and ending in the center of B.
Definition at line 167 of file WBresenham_test.h.
References wlimits::DBL_EPS, m_algo, and WMixinVector< ValueT >::push_back().
|
inline |
If a line segments starts and ends on the same point only its voxel should be selected.
Definition at line 66 of file WBresenham_test.h.
References m_algo, and WMixinVector< ValueT >::push_back().
|
inline |
Lines like WFibers consisting out of multiple line segements should be traced segment by segment.
Definition at line 96 of file WBresenham_test.h.
References m_algo, and WMixinVector< ValueT >::push_back().
|
inline |
Multiple segments in one voxel should also mark only this voxel.
Definition at line 80 of file WBresenham_test.h.
References m_algo, and WMixinVector< ValueT >::push_back().
|
inline |
Lines rastered in the 3rd Quadrant should also be traced.
Definition at line 113 of file WBresenham_test.h.
References m_algo, WMatrix< T >::makeIdentity(), and WMixinVector< ValueT >::push_back().
|
inline |
If you have a line from A to B then rastering it from B to should be equivalent.
Definition at line 141 of file WBresenham_test.h.
References WMixinVector< ValueT >::clear(), m_algo, and WMixinVector< ValueT >::push_back().
|
private |
test instace of the WBresenham algo
Definition at line 192 of file WBresenham_test.h.
Referenced by setUp(), tearDown(), testExactLineIsRasteredTheSameWayAsMidpointLines(), testLineSegementWithSameStartAndEndPoint(), testPolyLineRastering(), testPolySegmentOneVoxelRastering(), testRasteringIn3rdQuadrant(), and testSymmetry().