diff --git a/src/DGtal/geometry/volumes/distance/VoronoiMap.h b/src/DGtal/geometry/volumes/distance/VoronoiMap.h index eadddcb67d..72aaae9c72 100644 --- a/src/DGtal/geometry/volumes/distance/VoronoiMap.h +++ b/src/DGtal/geometry/volumes/distance/VoronoiMap.h @@ -182,7 +182,7 @@ namespace DGtal * The method associates to each point satisfying the foreground predicate, * the closest site for which the predicate is false. This algorithm is * @f$ O(h.d.|domain size|)@f$ if the separable metric "hiddenBy" - * predicate is in @f$ O(h)$@f$. + * predicate is in @f$ O(h)@f$. * * @param aDomain a pointer to the (hyper-rectangular) domain on * which the computation is performed. @@ -206,7 +206,7 @@ namespace DGtal * The method associates to each point satisfying the foreground predicate, * the closest site for which the predicate is false. This algorithm is * @f$ O(h.d.|domain size|)@f$ if the separable metric "hiddenBy" - * predicate is in @f$ O(h)$@f$. + * predicate is in @f$ O(h)@f$. * * @param aDomain a pointer to the (hyper-rectangular) domain on * which the computation is performed. @@ -229,6 +229,11 @@ namespace DGtal */ ~VoronoiMap(); + /** + * Disabling default constructor. + */ + VoronoiMap() = delete; + public: // ------------------- ConstImage model ------------------------ @@ -289,10 +294,10 @@ namespace DGtal /** Periodicity specification along one dimensions. * - * @param n the dimension index. + * @param [in] n the dimension index. * @return \c true if the n-th dimension is periodic, \c false otherwise. */ - bool isPeriodic( Dimension n ) const + bool isPeriodic( const Dimension n ) const { return myPeriodicitySpec[ n ]; } @@ -334,16 +339,6 @@ namespace DGtal void computeOtherStep1D (const Point &row, const Dimension dim) const; - // ------------------- protected methods ------------------------ - protected: - - /** - * Default Constructor. - * - */ - VoronoiMap(); - - // ------------------- Private members ------------------------ private: diff --git a/src/DGtal/geometry/volumes/distance/VoronoiMap.ih b/src/DGtal/geometry/volumes/distance/VoronoiMap.ih index b24a133eb7..825f16469f 100644 --- a/src/DGtal/geometry/volumes/distance/VoronoiMap.ih +++ b/src/DGtal/geometry/volumes/distance/VoronoiMap.ih @@ -85,7 +85,6 @@ DGtal::VoronoiMap::compute( ) myUpperBoundCopy = myDomainPtr->upperBound(); //Point outside the domain - //myInfinity = myDomainPtr->upperBound() + Point::diagonal(1); for ( auto & coord : myInfinity ) coord = DGtal::NumberTraits< typename Point::Coordinate >::max(); @@ -109,7 +108,7 @@ void DGtal::VoronoiMap::computeOtherSteps ( const Dimension dim ) const { #ifdef VERBOSE - std::string title = "Voro dimension " + boost::lexical_cast( dim ) ; + std::string title = "VoronoiMap dimension " + boost::lexical_cast( dim ) ; trace.beginBlock ( title ); #endif @@ -170,7 +169,7 @@ DGtal::VoronoiMap::computeOtherStep1D ( const Point &startingP // Extent along current dimension. const auto extent = myUpperBoundCopy[dim] - myLowerBoundCopy[dim] + 1; - // Sites storage. + // Site storage. std::vector Sites; // Reserve sites storage. diff --git a/tests/geometry/volumes/distance/testVoronoiMap.cpp b/tests/geometry/volumes/distance/testVoronoiMap.cpp index 6be492f839..012501f6f7 100644 --- a/tests/geometry/volumes/distance/testVoronoiMap.cpp +++ b/tests/geometry/volumes/distance/testVoronoiMap.cpp @@ -219,7 +219,7 @@ bool testCheckConcept() * Example of a test. To be completed. * */ -bool testVoronoiMap( std::array const& periodicity = { false, false } ) +bool testVoronoiMap( std::array const& periodicity = { {false, false} } ) { unsigned int nbok = 0; unsigned int nb = 0; @@ -296,7 +296,7 @@ bool testVoronoiMap( std::array const& periodicity = { false, false } ) template bool testVoronoiMapFromSites2D( const Set &aSet, const std::string &name, - std::array const& periodicity = { false, false } ) + std::array const& periodicity = { {false, false} } ) { unsigned int nbok = 0; unsigned int nb = 0; @@ -679,9 +679,9 @@ int main( int argc, char** argv ) bool res = testCheckConcept() && testVoronoiMap() - && testVoronoiMap( { true, false } ) - && testVoronoiMap( { false, true } ) - && testVoronoiMap( { true, true } ) + && testVoronoiMap( { {true, false} } ) + && testVoronoiMap( { {false, true} } ) + && testVoronoiMap( { {true, true} } ) && testSimple2D() && testSimpleRandom2D() && testSimple3D()