OpenWalnut
1.5.0dev
|
Tests the WGridRegular3D class. More...
#include <WGridRegular3D_test.h>
Public Member Functions | |
void | setUp (void) |
Called before every test. More... | |
void | testInstantiation (void) |
Ensure that nothing is thrown when an instance is created. More... | |
void | testSize (void) |
After instantiation there should be the requested number of positions. More... | |
void | testConvinienceFunctions (void) |
Each convinience function just assembles the three values into an boost array. More... | |
void | testOrientation (void) |
After instantiation there should be the right vectors, matrix and origin. More... | |
void | testGetNbCoords (void) |
getNbCoords should return the samples prescribed by the use of the constructor More... | |
void | testGetVectorOffset (void) |
getOffset should return the vector offsets prescribed by the use of the constructor More... | |
void | testGetPositionScalarOffset (void) |
getPosition should return the correct position for scalar offsets More... | |
void | testGetVoxelNumberOfGeneralPosition (void) |
The cell number of a Position is defined as follows: More... | |
void | testGetVoxelNumberOfPositionOutsideOfGrid (void) |
If a grid point is outside of the grid then -1 should be returned. More... | |
void | testGetVoxelNumberOfPositionExactlyBetweenVoxels (void) |
All points of the surfaces belonging to the lower,left,front corner of a voxel belong to this voxel. More... | |
void | testNeighboursInsideAGrid (void) |
A voxel inside a grid (not located on a border) has 6 neighbours. More... | |
void | testRotatedVoxelNum () |
The correct voxel numbers should be returned in a rotated grid. More... | |
void | testRotatedVoxelOutOfGrid () |
Positions outside of a rotated grid should return voxel positions of -1. More... | |
void | testNeighboursOnFrontLowerLeft (void) |
A voxel with voxel-coordinates 0,0,0 has only three neighbours: 1,0,0; 0,1,0 and 0,0,1. More... | |
void | testNeighbourOnBackUpperRight (void) |
A voxel in the back upper right corner should also have only 3 neighbours. More... | |
void | testNeighbourOnLeftBorderPlane (void) |
A Voxel on a border plane should have neighbours on the plane but not out side the grid. More... | |
void | testNeighbourOfVoxelNotInsideThisGrid (void) |
If the neighbours of a voxel not inside this grid are requested an Exception WOutOfBounds should be thrown. More... | |
void | testGetCellVertexIds (void) |
Check whether we get the right Ids. More... | |
void | testGetCellId (void) |
Check whether we get the right cellId. More... | |
void | testEnclosesQuery (void) |
If a point is inside of the boundary of a grid encloses should return true, otherwise false. More... | |
void | testEnclosesRotated () |
If a point is inside of the boundary of a grid encloses should return true, otherwise false. More... | |
Private Attributes | |
double | m_delta |
Maximum amount to values are allowed to differ. More... | |
Tests the WGridRegular3D class.
Definition at line 45 of file WGridRegular3D_test.h.
|
inline |
|
inline |
Each convinience function just assembles the three values into an boost array.
Definition at line 77 of file WGridRegular3D_test.h.
|
inline |
If a point is inside of the boundary of a grid encloses should return true, otherwise false.
Definition at line 512 of file WGridRegular3D_test.h.
References WGridRegular3DTemplate< T >::encloses(), and wlimits::FLT_EPS.
|
inline |
If a point is inside of the boundary of a grid encloses should return true, otherwise false.
Definition at line 538 of file WGridRegular3D_test.h.
References WGridRegular3DTemplate< T >::encloses(), wlimits::FLT_EPS, and WMatrix< T >::makeIdentity().
|
inline |
Check whether we get the right cellId.
Definition at line 459 of file WGridRegular3D_test.h.
References wlimits::FLT_EPS, and WGridRegular3DTemplate< T >::getCellId().
|
inline |
Check whether we get the right Ids.
Definition at line 449 of file WGridRegular3D_test.h.
References WGridRegular3DTemplate< T >::getCellVertexIds().
|
inline |
getNbCoords should return the samples prescribed by the use of the constructor
Definition at line 112 of file WGridRegular3D_test.h.
References WGridRegular3DTemplate< T >::getNbCoordsX(), WGridRegular3DTemplate< T >::getNbCoordsY(), and WGridRegular3DTemplate< T >::getNbCoordsZ().
|
inline |
getPosition should return the correct position for scalar offsets
Definition at line 156 of file WGridRegular3D_test.h.
References WGridRegular3DTemplate< T >::getPosition(), m_delta, and WMatrix< T >::makeIdentity().
|
inline |
getOffset should return the vector offsets prescribed by the use of the constructor
Definition at line 127 of file WGridRegular3D_test.h.
References WGridRegular3DTemplate< T >::getOffsetX(), WGridRegular3DTemplate< T >::getOffsetY(), WGridRegular3DTemplate< T >::getOffsetZ(), m_delta, and WMatrix< T >::makeIdentity().
|
inline |
The cell number of a Position is defined as follows:
y-axis |_____ _____ ___ _ 3 | | | | | | | ... + dy |_____|_____|___ _| 2 | | . Line | |/ | ... |_____/___ _|___ 1 | /| | | ' | | ... |_____|_____|______ x-axis /0 1 2 / `--.--ยด / dx origin e.g. ( 3.1, 3.2, -6 ) and dx == dy == 1.0 ( the z-axis is ignored in this example )
Hence the line starts at approx. ( 3.85, 3.7, -6 ) and ends at approx. ( 4.35, 5.0 , -6 ). The Cell number e.g. of the start point is then: 4 and of the end point: 7.
Definition at line 220 of file WGridRegular3D_test.h.
References WMatrix< T >::makeIdentity().
|
inline |
All points of the surfaces belonging to the lower,left,front corner of a voxel belong to this voxel.
Instead all points located on the three surfaces belonging to the upper right back corner are considered not to belong to this voxel.
Definition at line 253 of file WGridRegular3D_test.h.
References WGridRegular3DTemplate< T >::getVoxelNum().
|
inline |
If a grid point is outside of the grid then -1 should be returned.
Definition at line 238 of file WGridRegular3D_test.h.
References m_delta.
|
inline |
Ensure that nothing is thrown when an instance is created.
Definition at line 59 of file WGridRegular3D_test.h.
|
inline |
If the neighbours of a voxel not inside this grid are requested an Exception WOutOfBounds should be thrown.
Definition at line 439 of file WGridRegular3D_test.h.
References WGridRegular3DTemplate< T >::getNeighbours(), and WException::what().
|
inline |
A voxel in the back upper right corner should also have only 3 neighbours.
Definition at line 415 of file WGridRegular3D_test.h.
References WGridRegular3DTemplate< T >::getNeighbours().
|
inline |
A Voxel on a border plane should have neighbours on the plane but not out side the grid.
Definition at line 427 of file WGridRegular3D_test.h.
References WGridRegular3DTemplate< T >::getNeighbours().
|
inline |
A voxel inside a grid (not located on a border) has 6 neighbours.
Definition at line 308 of file WGridRegular3D_test.h.
References WGridRegular3DTemplate< T >::getNeighbours().
|
inline |
A voxel with voxel-coordinates 0,0,0 has only three neighbours: 1,0,0; 0,1,0 and 0,0,1.
Definition at line 404 of file WGridRegular3D_test.h.
References WGridRegular3DTemplate< T >::getNeighbours().
|
inline |
After instantiation there should be the right vectors, matrix and origin.
Definition at line 92 of file WGridRegular3D_test.h.
References WGridRegular3DTemplate< T >::getDirectionX(), WGridRegular3DTemplate< T >::getDirectionY(), WGridRegular3DTemplate< T >::getDirectionZ(), WGridRegular3DTemplate< T >::getOrigin(), WMatrix< T >::makeIdentity(), and WGrid::size().
|
inline |
The correct voxel numbers should be returned in a rotated grid.
Definition at line 319 of file WGridRegular3D_test.h.
References WGridRegular3DTemplate< T >::getXVoxelCoord(), WGridRegular3DTemplate< T >::getYVoxelCoord(), WGridRegular3DTemplate< T >::getZVoxelCoord(), and WMatrix< T >::makeIdentity().
|
inline |
Positions outside of a rotated grid should return voxel positions of -1.
Definition at line 355 of file WGridRegular3D_test.h.
References wlimits::FLT_EPS, WGridRegular3DTemplate< T >::getXVoxelCoord(), WGridRegular3DTemplate< T >::getYVoxelCoord(), WGridRegular3DTemplate< T >::getZVoxelCoord(), and WMatrix< T >::makeIdentity().
|
inline |
After instantiation there should be the requested number of positions.
Definition at line 67 of file WGridRegular3D_test.h.
References WGrid::size().
|
private |
Maximum amount to values are allowed to differ.
Definition at line 590 of file WGridRegular3D_test.h.
Referenced by setUp(), testGetPositionScalarOffset(), testGetVectorOffset(), and testGetVoxelNumberOfPositionOutsideOfGrid().