DGtal 1.3.0
|
#include <iostream>
#include <array>
#include <algorithm>
#include "DGtal/base/Common.h"
#include "DGtal/helpers/StdDefs.h"
#include "DGtal/images/CConstImage.h"
#include "DGtal/geometry/volumes/distance/VoronoiMap.h"
#include "DGtal/geometry/volumes/distance/ExactPredicateLpSeparableMetric.h"
#include "DGtal/geometry/volumes/distance/InexactPredicateLpSeparableMetric.h"
#include "DGtal/geometry/volumes/distance/DistanceTransformation.h"
#include "DGtal/kernel/BasicPointPredicates.h"
#include "DGtal/io/boards/Board2D.h"
#include "DGtal/io/colormaps/HueShadeColorMap.h"
Go to the source code of this file.
Functions | |
template<typename Point > | |
double | mynorm (const Point &point, const double p) |
template<typename VoroMap > | |
void | saveVoroMap (const std::string &filename, const VoroMap &output, const double p) |
template<typename Point , typename Domain > | |
Point | calcPointModuloDomain (Point aPoint, Domain const &aDomain) |
template<std::size_t N> | |
std::array< bool, N > | getPeriodicityFromInteger (std::size_t anInteger) |
template<std::size_t N> | |
std::string | formatPeriodicity (std::array< bool, N > const &aPeriodicity) |
template<typename Set , typename Voro > | |
bool | checkVoronoi (const Set &aSet, const Voro &voro) |
bool | testCheckConcept () |
bool | testVoronoiMap (std::array< bool, 2 > const &periodicity={ {false, false} }) |
template<typename Set > | |
bool | testVoronoiMapFromSites2D (const Set &aSet, const std::string &name, std::array< bool, 2 > const &periodicity={ {false, false} }) |
template<typename Set > | |
bool | testVoronoiMapFromSites (const Set &aSet) |
template<typename Set > | |
bool | testVoronoiMapFromSites (const Set &aSet, std::array< bool, Set::Space::dimension > const &periodicity) |
bool | testSimple2D () |
bool | testSimpleRandom2D () |
bool | testSimple3D () |
bool | testSimpleRandom3D () |
bool | testSimple4D () |
int | main (int argc, char **argv) |
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Functions for testing class VoronoiMap.
This file is part of the DGtal library.
Definition in file testVoronoiMap.cpp.
Modify a point coordinates as if the given domain is periodic and so that the coordinates are between the lower and upper bounds of the domain.
aPoint | the point. |
aDomain | the periodic domain. |
Definition at line 96 of file testVoronoiMap.cpp.
References aPoint(), DGtal::HyperRectDomain< TSpace >::lowerBound(), and DGtal::HyperRectDomain< TSpace >::upperBound().
bool checkVoronoi | ( | const Set & | aSet, |
const Voro & | voro | ||
) |
Validates the VoronoiMap
Definition at line 146 of file testVoronoiMap.cpp.
References dim, DGtal::Trace::error(), and DGtal::trace.
Referenced by testVoronoiMapFromSites().
std::string formatPeriodicity | ( | std::array< bool, N > const & | aPeriodicity | ) |
Format a periodicity specification array as a string.
aPeriodicity | the periodicity specification array. |
Definition at line 134 of file testVoronoiMap.cpp.
Referenced by testSimple2D(), testSimple3D(), testSimple4D(), testSimpleRandom2D(), and testSimpleRandom3D().
std::array< bool, N > getPeriodicityFromInteger | ( | std::size_t | anInteger | ) |
Returns periodicity specification from an integer between 0 and 2^n - 1.
From an integer between 0 and 2^n-1, it returns a boolean array of size n whith value true at position i if the ith bit of the integer is set, false otherwise.
N | size of the periodicity specification array. |
anInteger | an integer between 0 and 2^N-1. |
Definition at line 118 of file testVoronoiMap.cpp.
int main | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 681 of file testVoronoiMap.cpp.
References DGtal::Trace::beginBlock(), DGtal::Trace::emphase(), DGtal::Trace::endBlock(), DGtal::Trace::info(), testCheckConcept(), testSimple2D(), testSimple3D(), testSimple4D(), testSimpleRandom2D(), testSimpleRandom3D(), testVoronoiMap(), and DGtal::trace.
Definition at line 55 of file testVoronoiMap.cpp.
Referenced by saveVoroMap().
void saveVoroMap | ( | const std::string & | filename, |
const VoroMap & | output, | ||
const double | p | ||
) |
Definition at line 65 of file testVoronoiMap.cpp.
References mynorm(), and LibBoard::Board::saveSVG().
bool testCheckConcept | ( | ) |
Definition at line 220 of file testVoronoiMap.cpp.
Referenced by main().
bool testSimple2D | ( | ) |
Definition at line 526 of file testVoronoiMap.cpp.
References DGtal::Trace::beginBlock(), domain, DGtal::Trace::endBlock(), formatPeriodicity(), DGtal::DigitalSetByAssociativeContainer< TDomain, TContainer >::insertNew(), testVoronoiMapFromSites2D(), and DGtal::trace.
Referenced by main().
bool testSimple3D | ( | ) |
Definition at line 594 of file testVoronoiMap.cpp.
References DGtal::Trace::beginBlock(), domain, DGtal::Trace::endBlock(), formatPeriodicity(), DGtal::DigitalSetByAssociativeContainer< TDomain, TContainer >::insertNew(), testVoronoiMapFromSites(), and DGtal::trace.
Referenced by main().
bool testSimple4D | ( | ) |
Definition at line 651 of file testVoronoiMap.cpp.
References DGtal::Trace::beginBlock(), domain, DGtal::Trace::endBlock(), formatPeriodicity(), DGtal::DigitalSetBySTLSet< TDomain, TCompare >::insertNew(), testVoronoiMapFromSites(), and DGtal::trace.
Referenced by main().
bool testSimpleRandom2D | ( | ) |
Definition at line 552 of file testVoronoiMap.cpp.
References DGtal::Trace::beginBlock(), domain, DGtal::Trace::endBlock(), formatPeriodicity(), DGtal::DigitalSetByAssociativeContainer< TDomain, TContainer >::insert(), testVoronoiMapFromSites2D(), and DGtal::trace.
Referenced by main().
bool testSimpleRandom3D | ( | ) |
Definition at line 619 of file testVoronoiMap.cpp.
References DGtal::Trace::beginBlock(), domain, DGtal::Trace::endBlock(), formatPeriodicity(), DGtal::DigitalSetByAssociativeContainer< TDomain, TContainer >::insert(), testVoronoiMapFromSites(), and DGtal::trace.
Referenced by main().
bool testVoronoiMap | ( | std::array< bool, 2 > const & | periodicity = { {false, false} } | ) |
Example of a test. To be completed.
Definition at line 232 of file testVoronoiMap.cpp.
Referenced by main().
bool testVoronoiMapFromSites | ( | const Set & | aSet | ) |
Example of a test. To be completed.
Definition at line 465 of file testVoronoiMap.cpp.
References testVoronoiMapFromSites().
Referenced by testSimple3D(), testSimple4D(), testSimpleRandom3D(), and testVoronoiMapFromSites().
bool testVoronoiMapFromSites | ( | const Set & | aSet, |
std::array< bool, Set::Space::dimension > const & | periodicity | ||
) |
Definition at line 473 of file testVoronoiMap.cpp.
References DGtal::Trace::beginBlock(), checkVoronoi(), DGtal::Trace::endBlock(), and DGtal::trace.
bool testVoronoiMapFromSites2D | ( | const Set & | aSet, |
const std::string & | name, | ||
std::array< bool, 2 > const & | periodicity = { {false, false} } |
||
) |
Example of a test. To be completed.
Definition at line 307 of file testVoronoiMap.cpp.
Referenced by testSimple2D(), and testSimpleRandom2D().