DGtal  0.9.3beta
Public Types | Public Member Functions | Private Attributes
DGtal::HyperRectDomain< TSpace >::ConstSubRange Struct Reference

#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
 
Point myUpperBound
 
Point myStartingPoint
 
std::vector< DimensionmyPermutation
 

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

Member Typedef Documentation

Definition at line 236 of file HyperRectDomain.h.

Definition at line 237 of file HyperRectDomain.h.

Constructor & Destructor Documentation

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

References DGtal::HyperRectDomain< TSpace >::isInside(), 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().

250  : myLowerBound(domain.myLowerBound),
251  myUpperBound(domain.myUpperBound),
252  myStartingPoint(startingPoint)
253  {
254  ASSERT_MSG(
255  domain.isInside(startingPoint) || startingPoint == myLowerBound || startingPoint == myUpperBound,
256  "The point must be inside the given domain or be equal to one of his bound."
257  );
258 
259  myPermutation.reserve( permutation.size() );
260  std::copy(permutation.begin(), permutation.end(), std::back_inserter(myPermutation));
263  }
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 Self &pv, std::initializer_list< Dimension > dimensions)
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 273 of file HyperRectDomain.h.

References DGtal::HyperRectDomain< TSpace >::isInside(), 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().

276  : myLowerBound(domain.myLowerBound),
277  myUpperBound(domain.myUpperBound),
278  myStartingPoint(startingPoint)
279  {
280  ASSERT_MSG(
281  domain.isInside(startingPoint) || startingPoint == myLowerBound || startingPoint == myUpperBound,
282  "The point must be inside the given domain or be equal to one of his bound."
283  );
284 
285  myPermutation.reserve( permutation.size() );
286  for ( const unsigned int *c = permutation.begin(); c != permutation.end(); ++c )
287  {
288  myPermutation.push_back( *c );
289  }
292  }
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 Self &pv, std::initializer_list< Dimension > dimensions)
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 301 of file HyperRectDomain.h.

References DGtal::HyperRectDomain< TSpace >::isInside(), 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().

304  : myLowerBound(domain.myLowerBound),
305  myUpperBound(domain.myUpperBound),
306  myStartingPoint(startingPoint)
307  {
308  ASSERT_MSG(
309  domain.isInside(startingPoint) || startingPoint == myLowerBound || startingPoint == myUpperBound,
310  "The point must be inside the given domain or be equal to one of his bound."
311  );
312 
313  myPermutation.push_back( adim );
316  }
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 Self &pv, std::initializer_list< Dimension > dimensions)
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 326 of file HyperRectDomain.h.

References DGtal::HyperRectDomain< TSpace >::isInside(), 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().

329  : myLowerBound(domain.myLowerBound),
330  myUpperBound(domain.myUpperBound),
331  myStartingPoint(startingPoint)
332  {
333  ASSERT_MSG(
334  domain.isInside(startingPoint) || startingPoint == myLowerBound || startingPoint == myUpperBound,
335  "The point must be inside the given domain or be equal to one of his bound."
336  );
337 
338  myPermutation.push_back( adim1 );
339  myPermutation.push_back( adim2 );
342  }
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 Self &pv, std::initializer_list< Dimension > dimensions)
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 353 of file HyperRectDomain.h.

References DGtal::HyperRectDomain< TSpace >::isInside(), 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().

356  : myLowerBound(domain.myLowerBound),
357  myUpperBound(domain.myUpperBound),
358  myStartingPoint(startingPoint)
359  {
360  ASSERT_MSG(
361  domain.isInside(startingPoint) || startingPoint == myLowerBound || startingPoint == myUpperBound,
362  "The point must be inside the given domain or be equal to one of his bound."
363  );
364 
365  myPermutation.push_back( adim1 );
366  myPermutation.push_back( adim2 );
367  myPermutation.push_back( adim3 );
370  }
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 Self &pv, std::initializer_list< Dimension > dimensions)

Member Function Documentation

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

begin method.

Returns
ConstIterator on the beginning of the range.

Definition at line 376 of file HyperRectDomain.h.

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().

377  {
379  }
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.
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 387 of file HyperRectDomain.h.

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

388  {
389  ASSERT(aPoint.partialEqualInv(myLowerBound, myPermutation) );
390  ASSERT_MSG(
391  ( myLowerBound.isLower(aPoint) && aPoint.isLower(myUpperBound) ) || aPoint == myLowerBound || aPoint == myUpperBound,
392  "The point must be inside the given domain or be equal to one of his bound."
393  );
394 
396  }
bool isLower(const Self &p) const
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.
template<typename TSpace>
ConstIterator DGtal::HyperRectDomain< TSpace >::ConstSubRange::end ( ) const
inline

end method.

Returns
ConstIterator on the end of the range.

Definition at line 402 of file HyperRectDomain.h.

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

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

403  {
405  ++it;
406  return it;
407  }
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.
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 413 of file HyperRectDomain.h.

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

414  {
415  return ConstReverseIterator(end());
416  }
myreverse_iterator< ConstIterator > ConstReverseIterator
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 424 of file HyperRectDomain.h.

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

425  {
426  ConstIterator it(begin(aPoint));
427  ++it;
428  return ConstReverseIterator(it);
429  }
myreverse_iterator< ConstIterator > ConstReverseIterator
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 435 of file HyperRectDomain.h.

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

436  {
437  return ConstReverseIterator(begin());
438  }
myreverse_iterator< ConstIterator > ConstReverseIterator

Field Documentation

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

Starting point of the subrange.

Definition at line 446 of file HyperRectDomain.h.

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

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

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