OpenWalnut  1.5.0dev
Public Member Functions | Private Attributes | List of all members
WBresenhamTest Class Reference

Unit tests the Bresenham algorithm. More...

#include <WBresenham_test.h>

+ Inheritance diagram for WBresenhamTest:
+ Collaboration diagram for WBresenhamTest:

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< WBresenhamm_algo
 test instace of the WBresenham algo More...
 

Detailed Description

Unit tests the Bresenham algorithm.

Definition at line 39 of file WBresenham_test.h.

Member Function Documentation

◆ setUp()

void WBresenhamTest::setUp ( void  )
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().

+ Here is the call graph for this function:

◆ tearDown()

void WBresenhamTest::tearDown ( void  )
inline

Clean up after each test.

Definition at line 57 of file WBresenham_test.h.

References m_algo.

◆ testExactLineIsRasteredTheSameWayAsMidpointLines()

void WBresenhamTest::testExactLineIsRasteredTheSameWayAsMidpointLines ( void  )
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().

+ Here is the call graph for this function:

◆ testLineSegementWithSameStartAndEndPoint()

void WBresenhamTest::testLineSegementWithSameStartAndEndPoint ( void  )
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().

+ Here is the call graph for this function:

◆ testPolyLineRastering()

void WBresenhamTest::testPolyLineRastering ( void  )
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().

+ Here is the call graph for this function:

◆ testPolySegmentOneVoxelRastering()

void WBresenhamTest::testPolySegmentOneVoxelRastering ( void  )
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().

+ Here is the call graph for this function:

◆ testRasteringIn3rdQuadrant()

void WBresenhamTest::testRasteringIn3rdQuadrant ( void  )
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().

+ Here is the call graph for this function:

◆ testSymmetry()

void WBresenhamTest::testSymmetry ( void  )
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().

+ Here is the call graph for this function:

Member Data Documentation

◆ m_algo

std::shared_ptr< WBresenham > WBresenhamTest::m_algo
private

The documentation for this class was generated from the following file: