DGtal 1.4.0
Loading...
Searching...
No Matches
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

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.

265 : myLowerBound(domain.myLowerBound),
266 myUpperBound(domain.myUpperBound),
267 myStartingPoint(startingPoint)
268 {
269 ASSERT_MSG(
270 domain.isInside(startingPoint) || startingPoint == myLowerBound || startingPoint == myUpperBound,
271 "The point must be inside the given domain or be equal to one of his bound."
272 );
273
274 myPermutation.reserve( permutation.size() );
275 std::copy(permutation.begin(), permutation.end(), std::back_inserter(myPermutation));
278 }
Self & partialCopyInv(const PointVector< dim, OtherComponent, OtherContainer > &pv, const std::vector< Dimension > &dimensions)
Partial copy of a given PointVector.
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.
Domain domain

References domain, DGtal::HyperRectDomain< TSpace >::ConstSubRange::myLowerBound, DGtal::HyperRectDomain< TSpace >::ConstSubRange::myPermutation, DGtal::HyperRectDomain< TSpace >::ConstSubRange::myStartingPoint, DGtal::HyperRectDomain< TSpace >::ConstSubRange::myUpperBound, and DGtal::PointVector< dim, TEuclideanRing, TContainer >::partialCopyInv().

◆ 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.

291 : myLowerBound(domain.myLowerBound),
292 myUpperBound(domain.myUpperBound),
293 myStartingPoint(startingPoint)
294 {
295 ASSERT_MSG(
296 domain.isInside(startingPoint) || startingPoint == myLowerBound || startingPoint == myUpperBound,
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 >::ConstSubRange::myLowerBound, DGtal::HyperRectDomain< TSpace >::ConstSubRange::myPermutation, DGtal::HyperRectDomain< TSpace >::ConstSubRange::myStartingPoint, DGtal::HyperRectDomain< TSpace >::ConstSubRange::myUpperBound, and DGtal::PointVector< dim, TEuclideanRing, TContainer >::partialCopyInv().

◆ 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.

319 : myLowerBound(domain.myLowerBound),
320 myUpperBound(domain.myUpperBound),
321 myStartingPoint(startingPoint)
322 {
323 ASSERT_MSG(
324 domain.isInside(startingPoint) || startingPoint == myLowerBound || startingPoint == myUpperBound,
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 >::ConstSubRange::myLowerBound, DGtal::HyperRectDomain< TSpace >::ConstSubRange::myPermutation, DGtal::HyperRectDomain< TSpace >::ConstSubRange::myStartingPoint, DGtal::HyperRectDomain< TSpace >::ConstSubRange::myUpperBound, and DGtal::PointVector< dim, TEuclideanRing, TContainer >::partialCopyInv().

◆ 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.

344 : myLowerBound(domain.myLowerBound),
345 myUpperBound(domain.myUpperBound),
346 myStartingPoint(startingPoint)
347 {
348 ASSERT_MSG(
349 domain.isInside(startingPoint) || startingPoint == myLowerBound || startingPoint == myUpperBound,
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 >::ConstSubRange::myLowerBound, DGtal::HyperRectDomain< TSpace >::ConstSubRange::myPermutation, DGtal::HyperRectDomain< TSpace >::ConstSubRange::myStartingPoint, DGtal::HyperRectDomain< TSpace >::ConstSubRange::myUpperBound, and DGtal::PointVector< dim, TEuclideanRing, TContainer >::partialCopyInv().

◆ 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.

371 : myLowerBound(domain.myLowerBound),
372 myUpperBound(domain.myUpperBound),
373 myStartingPoint(startingPoint)
374 {
375 ASSERT_MSG(
376 domain.isInside(startingPoint) || startingPoint == myLowerBound || startingPoint == myUpperBound,
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 >::ConstSubRange::myLowerBound, DGtal::HyperRectDomain< TSpace >::ConstSubRange::myPermutation, DGtal::HyperRectDomain< TSpace >::ConstSubRange::myStartingPoint, DGtal::HyperRectDomain< TSpace >::ConstSubRange::myUpperBound, and DGtal::PointVector< dim, TEuclideanRing, TContainer >::partialCopyInv().

Member Function Documentation

◆ begin() [1/2]

◆ 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) );
405 ASSERT_MSG(
407 "The point must be inside the given domain or be equal to one of his bound."
408 );
409
411 }
bool isLower(const PointVector< dim, OtherComponent, OtherStorage > &p) const
Return true if this point is below a given point.
const Point aPoint(3, 4)

References aPoint(), DGtal::PointVector< dim, TEuclideanRing, TContainer >::isLower(), DGtal::HyperRectDomain< TSpace >::ConstSubRange::myLowerBound, DGtal::HyperRectDomain< TSpace >::ConstSubRange::myPermutation, and DGtal::HyperRectDomain< TSpace >::ConstSubRange::myUpperBound.

◆ end()

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

◆ 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 DGtal::HyperRectDomain< TSpace >::ConstSubRange::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 DGtal::HyperRectDomain< TSpace >::ConstSubRange::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 DGtal::HyperRectDomain< TSpace >::ConstSubRange::begin().

Field Documentation

◆ myLowerBound

◆ myPermutation

◆ myStartingPoint

◆ myUpperBound


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