File failed to load: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.3/config/TeX-MML-AM_CHTML/MathJax.js
DGtal 2.0.0
DGtal::HyperRectDomain< TSpace >::ConstSubRange Struct Reference

Aim: range through some subdomain of all the points in the domain. Defines a constructor taking a domain in parameter plus some additional parameters to specify the subdomain, begin and end methods returning ConstIterator, and rbegin and rend methods returning ConstReverseIterator. More...

#include <DGtal/kernel/domains/HyperRectDomain.h>

Public Types

typedef HyperRectDomain_subIterator< PointConstIterator
typedef HyperRectDomain_ReverseIterator< ConstIteratorConstReverseIterator

Public Member Functions

 ConstSubRange (const HyperRectDomain< TSpace > &domain, const std::vector< Dimension > &permutation, const Point &startingPoint)
 ConstSubRange (const HyperRectDomain< TSpace > &domain, std::initializer_list< Dimension > permutation, const Point &startingPoint)
 ConstSubRange (const HyperRectDomain< TSpace > &domain, Dimension adim, const Point &startingPoint)
 ConstSubRange (const HyperRectDomain< TSpace > &domain, Dimension adim1, Dimension adim2, const Point &startingPoint)
 ConstSubRange (const HyperRectDomain< TSpace > &domain, Dimension adim1, Dimension adim2, Dimension adim3, const Point &startingPoint)
ConstIterator begin () const
ConstIterator begin (const Point &aPoint) const
ConstIterator end () const
ConstReverseIterator rbegin () const
ConstReverseIterator rbegin (const Point &aPoint) const
ConstReverseIterator rend () const

Private Attributes

Point myLowerBound
 Lower bound of the subrange.
Point myUpperBound
 Upper bound of the subrange.
Point myStartingPoint
 Starting point of the subrange.
std::vector< DimensionmyPermutation
 Permutation on dimensions used in the subrange.

Detailed Description

template<typename TSpace>
struct DGtal::HyperRectDomain< TSpace >::ConstSubRange

Aim: range through some subdomain of all the points in the domain. Defines a constructor taking a domain in parameter plus some additional parameters to specify the subdomain, begin and end methods returning ConstIterator, and rbegin and rend methods returning ConstReverseIterator.

Description of class 'ConstSubRange'

Definition at line 249 of file HyperRectDomain.h.

Member Typedef Documentation

◆ ConstIterator

template<typename TSpace>
typedef HyperRectDomain_subIterator<Point> DGtal::HyperRectDomain< TSpace >::ConstSubRange::ConstIterator

Definition at line 251 of file HyperRectDomain.h.

◆ ConstReverseIterator

template<typename TSpace>
typedef HyperRectDomain_ReverseIterator<ConstIterator> DGtal::HyperRectDomain< TSpace >::ConstSubRange::ConstReverseIterator
Examples
doc-examples/range.cpp.

Definition at line 252 of file HyperRectDomain.h.

Constructor & Destructor Documentation

◆ ConstSubRange() [1/5]

template<typename TSpace>
DGtal::HyperRectDomain< TSpace >::ConstSubRange::ConstSubRange ( const HyperRectDomain< TSpace > & domain,
const std::vector< Dimension > & permutation,
const Point & startingPoint )
inline

ConstSubRange constructor from a given domain.

Parameters
domainthe domain.
permutationa vector containing the dimensions used for the subrange. Dimensions are iterated in the given order.
startingPointthe initial point.
Precondition
startingPoint must belong to the range.

Definition at line 262 of file HyperRectDomain.h.

268 {
271 "The point must be inside the given domain or be equal to one of his bound."
272 );
273
274 myPermutation.reserve( permutation.size() );
278 }
Aim: Parallelepidec region of a digital space, model of a 'CDomain'.
Point myUpperBound
The highest point of the space diagonal.
Point myLowerBound
The lowest point of the space diagonal.
bool isInside(const Point &p) const
const ConstIterator & begin() const
const ConstIterator & end() const
Point myStartingPoint
Starting point of the subrange.
Point myUpperBound
Upper bound of the subrange.
Point myLowerBound
Lower bound of the subrange.
std::vector< Dimension > myPermutation
Permutation on dimensions used in the subrange.

References domain, DGtal::HyperRectDomain< TSpace >::HyperRectDomain(), myLowerBound, myPermutation, myStartingPoint, and myUpperBound.

◆ ConstSubRange() [2/5]

template<typename TSpace>
DGtal::HyperRectDomain< TSpace >::ConstSubRange::ConstSubRange ( const HyperRectDomain< TSpace > & domain,
std::initializer_list< Dimension > permutation,
const Point & startingPoint )
inline

ConstSubRange constructor from a given domain.

Parameters
domainthe domain.
permutationan initializer_list containing the dimensions used for the subrange. Dimensions are iterated in the given order.
startingPointthe initial point.
Precondition
startingPoint must belong to the range.

Definition at line 288 of file HyperRectDomain.h.

294 {
297 "The point must be inside the given domain or be equal to one of his bound."
298 );
299
300 myPermutation.reserve( permutation.size() );
301 for ( const unsigned int *c = permutation.begin(); c != permutation.end(); ++c )
302 {
303 myPermutation.push_back( *c );
304 }
307 }

References domain, DGtal::HyperRectDomain< TSpace >::HyperRectDomain(), myLowerBound, myPermutation, myStartingPoint, and myUpperBound.

◆ ConstSubRange() [3/5]

template<typename TSpace>
DGtal::HyperRectDomain< TSpace >::ConstSubRange::ConstSubRange ( const HyperRectDomain< TSpace > & domain,
Dimension adim,
const Point & startingPoint )
inline

ConstSubRange constructor from a given domain for one dimension.

Parameters
domainthe domain.
adimthe dimension used for the subrange.
startingPointthe initial point.
Precondition
startingPoint must belong to the range.

Definition at line 316 of file HyperRectDomain.h.

322 {
325 "The point must be inside the given domain or be equal to one of his bound."
326 );
327
328 myPermutation.push_back( adim );
331 }

References domain, DGtal::HyperRectDomain< TSpace >::HyperRectDomain(), myLowerBound, myPermutation, myStartingPoint, and myUpperBound.

◆ ConstSubRange() [4/5]

template<typename TSpace>
DGtal::HyperRectDomain< TSpace >::ConstSubRange::ConstSubRange ( const HyperRectDomain< TSpace > & domain,
Dimension adim1,
Dimension adim2,
const Point & startingPoint )
inline

ConstSubRange constructor from a given domain for two dimensions.

Parameters
domainthe domain.
adim1the first dimension used for the subrange.
adim2the second dimension used for the subrange.
startingPointthe initial point.
Precondition
startingPoint must belong to the range.

Definition at line 341 of file HyperRectDomain.h.

347 {
350 "The point must be inside the given domain or be equal to one of his bound."
351 );
352
353 myPermutation.push_back( adim1 );
354 myPermutation.push_back( adim2 );
357 }

References domain, DGtal::HyperRectDomain< TSpace >::HyperRectDomain(), myLowerBound, myPermutation, myStartingPoint, and myUpperBound.

◆ ConstSubRange() [5/5]

template<typename TSpace>
DGtal::HyperRectDomain< TSpace >::ConstSubRange::ConstSubRange ( const HyperRectDomain< TSpace > & domain,
Dimension adim1,
Dimension adim2,
Dimension adim3,
const Point & startingPoint )
inline

ConstSubRange constructor from a given domain for two dimensions.

Parameters
domainthe domain.
adim1the first dimension used for the subrange.
adim2the second dimension used for the subrange.
adim3the third dimension used for the subrange.
startingPointthe initial point.
Precondition
startingPoint must belong to the range.

Definition at line 368 of file HyperRectDomain.h.

374 {
377 "The point must be inside the given domain or be equal to one of his bound."
378 );
379
380 myPermutation.push_back( adim1 );
381 myPermutation.push_back( adim2 );
382 myPermutation.push_back( adim3 );
385 }

References domain, DGtal::HyperRectDomain< TSpace >::HyperRectDomain(), myLowerBound, myPermutation, myStartingPoint, and myUpperBound.

Member Function Documentation

◆ begin() [1/2]

template<typename TSpace>
ConstIterator DGtal::HyperRectDomain< TSpace >::ConstSubRange::begin ( ) const
inline

begin method.

Returns
ConstIterator on the beginning of the range.

Definition at line 391 of file HyperRectDomain.h.

392 {
394 }
HyperRectDomain_subIterator< Point > ConstIterator

References myLowerBound, myPermutation, and myUpperBound.

Referenced by DGtal::ImageFactoryFromHDF5< TImageContainer >::flushImage(), rbegin(), and rend().

◆ begin() [2/2]

template<typename TSpace>
ConstIterator DGtal::HyperRectDomain< TSpace >::ConstSubRange::begin ( const Point & aPoint) const
inline

begin method from a given point.

Parameters
aPointthe initial point.
Returns
a ConstIterator initialized to aPoint.
Precondition
aPoint must belong to the range.

Definition at line 402 of file HyperRectDomain.h.

403 {
404 ASSERT(aPoint.partialEqualInv(myLowerBound, myPermutation) );
406 ( myLowerBound.isLower(aPoint) && aPoint.isLower(myUpperBound) ) || aPoint == myLowerBound || aPoint == myUpperBound,
407 "The point must be inside the given domain or be equal to one of his bound."
408 );
409
411 }

References aPoint, myLowerBound, myPermutation, and myUpperBound.

◆ end()

template<typename TSpace>
ConstIterator DGtal::HyperRectDomain< TSpace >::ConstSubRange::end ( ) const
inline

end method.

Returns
ConstIterator on the end of the range.

Definition at line 417 of file HyperRectDomain.h.

References myLowerBound, myPermutation, and myUpperBound.

Referenced by DGtal::ImageFactoryFromHDF5< TImageContainer >::flushImage(), and rbegin().

◆ rbegin() [1/2]

template<typename TSpace>
ConstReverseIterator DGtal::HyperRectDomain< TSpace >::ConstSubRange::rbegin ( ) const
inline

reverse begin method.

Returns
ConstIterator on the beginning of the reverse range.

Definition at line 428 of file HyperRectDomain.h.

429 {
430 return ConstReverseIterator(end());
431 }
HyperRectDomain_ReverseIterator< ConstIterator > ConstReverseIterator

References end().

◆ rbegin() [2/2]

template<typename TSpace>
ConstReverseIterator DGtal::HyperRectDomain< TSpace >::ConstSubRange::rbegin ( const Point & aPoint) const
inline

reverse begin method from a given point.

Parameters
aPointthe initial point.
Returns
a ConstIterator initialized to aPoint.
Precondition
aPoint must belong to the range.

Definition at line 439 of file HyperRectDomain.h.

440 {
442 ++it;
443 return ConstReverseIterator(it);
444 }

References aPoint, and begin().

◆ rend()

template<typename TSpace>
ConstReverseIterator DGtal::HyperRectDomain< TSpace >::ConstSubRange::rend ( ) const
inline

reverse end method.

Returns
ConstIterator on the end of the reverse range.

Definition at line 450 of file HyperRectDomain.h.

451 {
452 return ConstReverseIterator(begin());
453 }

References begin().

Field Documentation

◆ myLowerBound

template<typename TSpace>
Point DGtal::HyperRectDomain< TSpace >::ConstSubRange::myLowerBound
private

Lower bound of the subrange.

Definition at line 457 of file HyperRectDomain.h.

Referenced by begin(), begin(), ConstSubRange(), ConstSubRange(), ConstSubRange(), ConstSubRange(), ConstSubRange(), and end().

◆ myPermutation

template<typename TSpace>
std::vector<Dimension> DGtal::HyperRectDomain< TSpace >::ConstSubRange::myPermutation
private

Permutation on dimensions used in the subrange.

Definition at line 463 of file HyperRectDomain.h.

Referenced by begin(), begin(), ConstSubRange(), ConstSubRange(), ConstSubRange(), ConstSubRange(), ConstSubRange(), and end().

◆ myStartingPoint

template<typename TSpace>
Point DGtal::HyperRectDomain< TSpace >::ConstSubRange::myStartingPoint
private

Starting point of the subrange.

Definition at line 461 of file HyperRectDomain.h.

Referenced by ConstSubRange(), ConstSubRange(), ConstSubRange(), ConstSubRange(), and ConstSubRange().

◆ myUpperBound

template<typename TSpace>
Point DGtal::HyperRectDomain< TSpace >::ConstSubRange::myUpperBound
private

Upper bound of the subrange.

Definition at line 459 of file HyperRectDomain.h.

Referenced by begin(), begin(), ConstSubRange(), ConstSubRange(), ConstSubRange(), ConstSubRange(), ConstSubRange(), and end().


The documentation for this struct was generated from the following file: