![]() |
OpenWalnut
1.5.0dev
|
Unit test the WFiberCluster class. More...
#include <WFiberCluster_test.h>
Public Member Functions | |
void | testMerge (void) |
When merging two clusters the indices are merged and the second cluster becomes empty. More... | |
void | testCenterLine (void) |
Generates a dataset for some unit tests. More... | |
void | testUnifyDirectionOnTwoNearlyParallelFibers (void) |
If there are two fibers which are nearly parallel changing ones direction will have huge effect. More... | |
void | testUnifyDirectionOnTwoConsecutiveFibers (void) |
Check determination of the direction of a pair of fibers which are in the following shape (all points having the same Y and Z coordinate). More... | |
void | testUnifyDirectionOnTwoCSTShapedFibers (void) |
Check determination of the direction of a pair of fibers which are in the following shape. More... | |
void | testUnifyDirectionOnTwoCircularShapedFibersInSameCircle (void) |
Check determination of the direction of a pair of fibers which are in the following shape. More... | |
void | testUnifyDirectionOnTwoCircularShapedFibersInDifferentCircle (void) |
Check determination of the direction of a pair of fibers which are in the following shape. More... | |
void | testUnifyDirectionOnTwoInverseCSTShapedFibers (void) |
Check determination of the direction of a pair of fibers which are in the following shape. More... | |
Private Member Functions | |
void | assert_equals_delta (const WLine &first, const WLine &second, double delta=wlimits::DBL_EPS) const |
Compares to point sequences (aka lines) with a given delta. More... | |
void | setUp (void) |
Generates a dataset for some unit tests. More... | |
void | generateFiberCluster (const std::shared_ptr< WDataSetFiberVector > ds) |
Generates out of the given dataset a WFiberCluster containing all fibers. More... | |
void | tearDown (void) |
Tidyups the dataset used in some unit tests. More... | |
Private Attributes | |
std::shared_ptr< WFiberCluster > | m_cluster |
pre generated cluster for some unit tests More... | |
Unit test the WFiberCluster class.
Definition at line 41 of file WFiberCluster_test.h.
|
inlineprivate |
Compares to point sequences (aka lines) with a given delta.
first | First line to compare with |
second | Second line to compare with |
delta | The delta within two points are considered as equally |
Definition at line 362 of file WFiberCluster_test.h.
Referenced by testCenterLine().
|
inlineprivate |
Generates out of the given dataset a WFiberCluster containing all fibers.
ds | The fiber dataset |
Definition at line 428 of file WFiberCluster_test.h.
References m_cluster.
Referenced by setUp().
|
inlineprivate |
Generates a dataset for some unit tests.
Fiber B has 3 points: [0;2],[2;2],[4;2] Fiber A has 7 points: [0;0],[1;1],[2;1],[3;1],[4;1],[5;1],[6;1] | 2 -b----------b------------b | | | | | 1 -| a-----a-----a-----a-----a-----a | / | / | / | / |/ a-----+-----+-----+-----+-----+-----+--- 0 1 2 3 4 5 6
Definition at line 402 of file WFiberCluster_test.h.
References generateFiberCluster(), and WMixinVector< ValueT >::push_back().
|
inlineprivate |
Tidyups the dataset used in some unit tests.
Definition at line 444 of file WFiberCluster_test.h.
References m_cluster.
|
inline |
Generates a dataset for some unit tests.
Fiber B had initially 3 points: [0;2],[2;2],[4;2] after resampling there are 5 points: [0;2],[1;2],[2;2],[3;2],[4;2] Fiber A had initially 7 points: [0;0],[1;1],[2;1],[3;1],[4;1],[5;1],[6;1] after resampling there are 5 points: [0;0],[1.5;1],[3;1],[4.5;1],[6;1] | 2 -B----B-----B------B-----B | | | ,.m------m---------m-------m (center line) | / | / 1 -m aA----a--A--a---A-a----Aa-----A | / | / | / | / |/ A-----+-----+-----+-----+-----+-----+--- 0 1 2 3 4 5 6
Definition at line 90 of file WFiberCluster_test.h.
References assert_equals_delta(), wlimits::FLT_EPS, m_cluster, and WMixinVector< ValueT >::push_back().
|
inline |
When merging two clusters the indices are merged and the second cluster becomes empty.
Definition at line 48 of file WFiberCluster_test.h.
References WFiberCluster::empty(), WFiberCluster::m_memberIndices, and WFiberCluster::merge().
|
inline |
Check determination of the direction of a pair of fibers which are in the following shape.
,,---._ ,' \ / \ | | \ ,' \ ,' `-AS AE BS BE ,' `. / \ | | | | | | \ / `-._ _,-' `''
Definition at line 273 of file WFiberCluster_test.h.
References m_cluster, and WMixinVector< ValueT >::push_back().
|
inline |
Check determination of the direction of a pair of fibers which are in the following shape.
_.-----AS ,' / ,-'BS | ,' | / AE | / BE | | | | | | | | | \ \ ,| | \ `. ,Y' _,' `\_ `'''''' _.' '`--------''
Definition at line 220 of file WFiberCluster_test.h.
References m_cluster, and WMixinVector< ValueT >::push_back().
|
inline |
Check determination of the direction of a pair of fibers which are in the following shape (all points having the same Y and Z coordinate).
AS--------------------------->AE BS------------------------->BE
Definition at line 125 of file WFiberCluster_test.h.
References m_cluster, and WMixinVector< ValueT >::push_back().
|
inline |
Check determination of the direction of a pair of fibers which are in the following shape.
AS. _BS `. ,-' `. / \ / \ | `. .' | | | | | | | | | | | | AE BE
Definition at line 174 of file WFiberCluster_test.h.
References m_cluster, and WMixinVector< ValueT >::push_back().
|
inline |
Check determination of the direction of a pair of fibers which are in the following shape.
,,-'-AE BS''`-._ ,' `. / \ / `. / `. / | | | | | | | | | | | | | AS BE
Definition at line 326 of file WFiberCluster_test.h.
References m_cluster, and WMixinVector< ValueT >::push_back().
|
inline |
If there are two fibers which are nearly parallel changing ones direction will have huge effect.
Definition at line 107 of file WFiberCluster_test.h.
References m_cluster.
|
private |
pre generated cluster for some unit tests
Definition at line 449 of file WFiberCluster_test.h.
Referenced by generateFiberCluster(), tearDown(), testCenterLine(), testUnifyDirectionOnTwoCircularShapedFibersInDifferentCircle(), testUnifyDirectionOnTwoCircularShapedFibersInSameCircle(), testUnifyDirectionOnTwoConsecutiveFibers(), testUnifyDirectionOnTwoCSTShapedFibers(), testUnifyDirectionOnTwoInverseCSTShapedFibers(), and testUnifyDirectionOnTwoNearlyParallelFibers().