DGtal  1.0.0
Public Types | Public Member Functions | Private Attributes
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>

Collaboration diagram for DGtal::HyperRectDomain< TSpace >::ConstSubRange:
[legend]

Public Types

typedef HyperRectDomain_subIterator< PointConstIterator
 
typedef myreverse_iterator< 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. More...
 
Point myUpperBound
 Upper bound of the subrange. More...
 
Point myStartingPoint
 Starting point of the subrange. More...
 
std::vector< DimensionmyPermutation
 Permutation on dimensions used in the subrange. More...
 

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 242 of file HyperRectDomain.h.

Member Typedef Documentation

◆ ConstIterator

Definition at line 244 of file HyperRectDomain.h.

◆ ConstReverseIterator

Definition at line 245 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 255 of file HyperRectDomain.h.

258  : myLowerBound(domain.myLowerBound),
259  myUpperBound(domain.myUpperBound),
260  myStartingPoint(startingPoint)
261  {
262  ASSERT_MSG(
263  domain.isInside(startingPoint) || startingPoint == myLowerBound || startingPoint == myUpperBound,
264  "The point must be inside the given domain or be equal to one of his bound."
265  );
266 
267  myPermutation.reserve( permutation.size() );
268  std::copy(permutation.begin(), permutation.end(), std::back_inserter(myPermutation));
271  }
Domain domain
Point myLowerBound
Lower bound of the subrange.
std::vector< Dimension > myPermutation
Permutation on dimensions used in the subrange.
Point myUpperBound
Upper bound of the subrange.
Point myStartingPoint
Starting point of the subrange.
Self & partialCopyInv(const PointVector< dim, OtherComponent, OtherContainer > &pv, const std::vector< Dimension > &dimensions)
Partial copy of a given PointVector.

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 281 of file HyperRectDomain.h.

284  : myLowerBound(domain.myLowerBound),
285  myUpperBound(domain.myUpperBound),
286  myStartingPoint(startingPoint)
287  {
288  ASSERT_MSG(
289  domain.isInside(startingPoint) || startingPoint == myLowerBound || startingPoint == myUpperBound,
290  "The point must be inside the given domain or be equal to one of his bound."
291  );
292 
293  myPermutation.reserve( permutation.size() );
294  for ( const unsigned int *c = permutation.begin(); c != permutation.end(); ++c )
295  {
296  myPermutation.push_back( *c );
297  }
300  }
Domain domain
Point myLowerBound
Lower bound of the subrange.
std::vector< Dimension > myPermutation
Permutation on dimensions used in the subrange.
Point myUpperBound
Upper bound of the subrange.
Point myStartingPoint
Starting point of the subrange.
Self & partialCopyInv(const PointVector< dim, OtherComponent, OtherContainer > &pv, const std::vector< Dimension > &dimensions)
Partial copy of a given PointVector.

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 309 of file HyperRectDomain.h.

312  : myLowerBound(domain.myLowerBound),
313  myUpperBound(domain.myUpperBound),
314  myStartingPoint(startingPoint)
315  {
316  ASSERT_MSG(
317  domain.isInside(startingPoint) || startingPoint == myLowerBound || startingPoint == myUpperBound,
318  "The point must be inside the given domain or be equal to one of his bound."
319  );
320 
321  myPermutation.push_back( adim );
324  }
Domain domain
Point myLowerBound
Lower bound of the subrange.
std::vector< Dimension > myPermutation
Permutation on dimensions used in the subrange.
Point myUpperBound
Upper bound of the subrange.
Point myStartingPoint
Starting point of the subrange.
Self & partialCopyInv(const PointVector< dim, OtherComponent, OtherContainer > &pv, const std::vector< Dimension > &dimensions)
Partial copy of a given PointVector.

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 334 of file HyperRectDomain.h.

337  : myLowerBound(domain.myLowerBound),
338  myUpperBound(domain.myUpperBound),
339  myStartingPoint(startingPoint)
340  {
341  ASSERT_MSG(
342  domain.isInside(startingPoint) || startingPoint == myLowerBound || startingPoint == myUpperBound,
343  "The point must be inside the given domain or be equal to one of his bound."
344  );
345 
346  myPermutation.push_back( adim1 );
347  myPermutation.push_back( adim2 );
350  }
Domain domain
Point myLowerBound
Lower bound of the subrange.
std::vector< Dimension > myPermutation
Permutation on dimensions used in the subrange.
Point myUpperBound
Upper bound of the subrange.
Point myStartingPoint
Starting point of the subrange.
Self & partialCopyInv(const PointVector< dim, OtherComponent, OtherContainer > &pv, const std::vector< Dimension > &dimensions)
Partial copy of a given PointVector.

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 361 of file HyperRectDomain.h.

364  : myLowerBound(domain.myLowerBound),
365  myUpperBound(domain.myUpperBound),
366  myStartingPoint(startingPoint)
367  {
368  ASSERT_MSG(
369  domain.isInside(startingPoint) || startingPoint == myLowerBound || startingPoint == myUpperBound,
370  "The point must be inside the given domain or be equal to one of his bound."
371  );
372 
373  myPermutation.push_back( adim1 );
374  myPermutation.push_back( adim2 );
375  myPermutation.push_back( adim3 );
378  }
Domain domain
Point myLowerBound
Lower bound of the subrange.
std::vector< Dimension > myPermutation
Permutation on dimensions used in the subrange.
Point myUpperBound
Upper bound of the subrange.
Point myStartingPoint
Starting point of the subrange.
Self & partialCopyInv(const PointVector< dim, OtherComponent, OtherContainer > &pv, const std::vector< Dimension > &dimensions)
Partial copy of a given PointVector.

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]

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

begin method.

Returns
ConstIterator on the beginning of the range.

Definition at line 384 of file HyperRectDomain.h.

385  {
387  }
HyperRectDomain_subIterator< Point > ConstIterator
Point myLowerBound
Lower bound of the subrange.
std::vector< Dimension > myPermutation
Permutation on dimensions used in the subrange.
Point myUpperBound
Upper bound of the subrange.

References DGtal::HyperRectDomain< TSpace >::ConstSubRange::myLowerBound, DGtal::HyperRectDomain< TSpace >::ConstSubRange::myPermutation, and DGtal::HyperRectDomain< TSpace >::ConstSubRange::myUpperBound.

Referenced by DGtal::HyperRectDomain< TSpace >::ConstSubRange::rbegin(), and DGtal::HyperRectDomain< TSpace >::ConstSubRange::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 395 of file HyperRectDomain.h.

396  {
397  ASSERT(aPoint.partialEqualInv(myLowerBound, myPermutation) );
398  ASSERT_MSG(
400  "The point must be inside the given domain or be equal to one of his bound."
401  );
402 
404  }
const Point aPoint(3, 4)
HyperRectDomain_subIterator< Point > ConstIterator
Point myLowerBound
Lower bound of the subrange.
std::vector< Dimension > myPermutation
Permutation on dimensions used in the subrange.
Point myUpperBound
Upper bound of the subrange.
bool isLower(const PointVector< dim, OtherComponent, OtherStorage > &p) const
Return true if this point is below a given point.

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

end method.

Returns
ConstIterator on the end of the range.

Definition at line 410 of file HyperRectDomain.h.

411  {
413  ++it;
414  return it;
415  }
MyDigitalSurface::ConstIterator ConstIterator
HyperRectDomain_subIterator< Point > ConstIterator
Point myLowerBound
Lower bound of the subrange.
std::vector< Dimension > myPermutation
Permutation on dimensions used in the subrange.
Point myUpperBound
Upper bound of the subrange.

References DGtal::HyperRectDomain< TSpace >::ConstSubRange::myLowerBound, DGtal::HyperRectDomain< TSpace >::ConstSubRange::myPermutation, and DGtal::HyperRectDomain< TSpace >::ConstSubRange::myUpperBound.

Referenced by DGtal::HyperRectDomain< TSpace >::ConstSubRange::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 421 of file HyperRectDomain.h.

422  {
423  return ConstReverseIterator(end());
424  }
myreverse_iterator< 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 432 of file HyperRectDomain.h.

433  {
435  ++it;
436  return ConstReverseIterator(it);
437  }
const Point aPoint(3, 4)
MyDigitalSurface::ConstIterator ConstIterator
myreverse_iterator< ConstIterator > ConstReverseIterator

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 443 of file HyperRectDomain.h.

444  {
445  return ConstReverseIterator(begin());
446  }
myreverse_iterator< ConstIterator > ConstReverseIterator

References DGtal::HyperRectDomain< TSpace >::ConstSubRange::begin().

Field Documentation

◆ myLowerBound

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

◆ myPermutation

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

◆ myStartingPoint

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

Starting point of the subrange.

Definition at line 454 of file HyperRectDomain.h.

Referenced by DGtal::HyperRectDomain< TSpace >::ConstSubRange::ConstSubRange().

◆ myUpperBound

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

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