27#include "DGtalCatch.h"
29#include <DGtal/kernel/SpaceND.h>
30#include <DGtal/kernel/domains/HyperRectDomain.h>
31#include <DGtal/kernel/domains/Linearizer.h>
32#include <DGtal/images/ImageContainerBySTLVector.h>
37TEST_CASE(
"Testing SimpleRandomAccess(Const)RangeFromPoint from ImageContainerBySTLVector",
"" )
39 using namespace DGtal;
66 SECTION(
"Testing constant forward iterators" )
68 const Range range = image.range();
77 SECTION(
"Testing constant forward iterators from a point" )
79 const Range range = image.range();
88 SECTION(
"Testing mutable forward iterators" )
90 Range range = image.range();
94 for (
Range::Iterator it = range.begin(), it_end = range.end(); it != it_end; ++it )
109 SECTION(
"Testing mutable forward iterators from a point" )
111 Range range = image.range();
130 SECTION(
"Testing constant reverse iterators" )
132 const Range range = image.range();
134 REQUIRE( std::equal(range.rbegin(), range.rend(),
refImage.rbegin()) );
141 SECTION(
"Testing constant reverse iterators from a point" )
143 const Range range = image.range();
152 SECTION(
"Testing mutable reverse iterators" )
154 Range range = image.range();
170 REQUIRE( std::equal(range.rbegin(), range.rend(),
refImage.rbegin()) );
173 SECTION(
"Testing mutable reverse iterators from a point" )
175 Range range = image.range();
192 REQUIRE( std::equal(range.rbegin(), range.rend(),
refImage.rbegin()) );
197 Range range = image.range();
211 SECTION(
"Testing forward output iterators from a point" )
213 Range range = image.range();
229 Range range = image.range();
240 REQUIRE( std::equal(range.rbegin(), range.rend(),
refImage.rbegin()) );
243 SECTION(
"Testing reverse output iterators from a point" )
245 Range range = image.range();
256 REQUIRE( std::equal(range.rbegin(), range.rend(),
refImage.rbegin()) );
259 SECTION(
"Testing constant forward circulators" )
269 const Range range = image.range();
277 REQUIRE( sum == Approx(refSum) );
288 REQUIRE( sum == Approx(refSum) );
299 REQUIRE( sum == Approx(refSum) );
310 REQUIRE( sum == Approx(refSum) );
313 SECTION(
"Testing constant reverse circulators" )
323 const Range range = image.range();
331 REQUIRE( sum == Approx(refSum) );
342 REQUIRE( sum == Approx(refSum) );
353 REQUIRE( sum == Approx(refSum) );
364 REQUIRE( sum == Approx(refSum) );
367 SECTION(
"Testing mutable circulators in forward way" )
369 Range range = image.range();
387 SECTION(
"Testing mutable circulators in backward way" )
389 Range range = image.range();
407 SECTION(
"Testing mutable reverse circulators in forward way" )
409 Range range = image.range();
427 SECTION(
"Testing mutable reverse circulators in backward way" )
429 Range range = image.range();
Aim: Provides an adapter for classical iterators that can iterate through the underlying data structu...
Reverse iterator for HyperRectDomain.
Aim: Parallelepidec region of a digital space, model of a 'CDomain'.
std::vector< Value >::const_iterator ConstIterator
Aim: model of CConstBidirectionalRangeFromPoint that adapts any range of elements bounded by two iter...
ConstIterator begin() const
ConstCirculator c() const
ConstReverseIterator rbegin() const
ConstIterator end() const
ConstReverseCirculator rc() const
ConstReverseIterator rend() const
Aim: model of CBidirectionalRangeFromPoint that adapts any range of elements bounded by two iterators...
std::reverse_iterator< Iterator > ReverseIterator
std::reverse_iterator< ConstCirculator > ConstReverseCirculator
std::reverse_iterator< Circulator > ReverseCirculator
DGtal::Circulator< ConstIterator > ConstCirculator
PointVector< dim, Integer > Point
Points in DGtal::SpaceND.
DGtal is the top-level namespace which contains all DGtal functions and types.
TEST_CASE("int container traits", "[int][traits]")
Linearizer< Domain, ColMajorStorage > Linearizer
ImageContainerBySTLVector< Domain, Value > Image
Image::ConstRange ConstRange
SECTION("Testing constant forward iterators")
HyperRectDomain< Space > Domain
REQUIRE(domain.isInside(aPoint))