Data Structures | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Attributes

DGtal::HyperRectDomain< TSpace > Class Template Reference

Aim: Parallelepidec region of a digital space, model of a 'CDomain'. More...

#include <HyperRectDomain.h>

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

Data Structures

struct  DefaultDrawStyleGrid
struct  DefaultDrawStylePaving

Public Types

typedef TSpace Space
typedef HyperRectDomain< SpaceDomain
typedef Space::Point Point
typedef Space::Integer Integer
typedef Space::Vector Vector
typedef Space::Dimension Dimension
typedef Space::Size Size
typedef Point::Coordinate Coordinate
typedef
HyperRectDomain_Iterator
< Point, Size
ConstIterator
typedef IsWithinPointPredicate
< Point
Predicate

Public Member Functions

 BOOST_CONCEPT_ASSERT ((CSpace< TSpace >))
 HyperRectDomain ()
 HyperRectDomain (const Point &aPointA, const Point &aPointB)
 ~HyperRectDomain ()
 HyperRectDomain (const HyperRectDomain &other)
HyperRectDomainoperator= (const HyperRectDomain &other)
const ConstIterator begin () const
ConstIterator begin (const Point &aPoint) const
const ConstIterator end () const
ConstIterator end (const Point &aPoint) const
ConstIterator subDomainBegin (const std::vector< Size > &permutation) const
ConstIterator subDomainBegin (const std::vector< Size > &permutation, const Point &startingPoint) const
ConstIterator subDomainEnd (const std::vector< Size > &aSubDomain, const Point &startingPoint) const
ConstIterator subDomainEnd (const std::vector< Size > &aSubDomain) const
ConstIterator spanBegin (const Point &aPoint, const std::size_t aDimension) const
ConstIterator spanEnd (const std::size_t aDimension) const
std::size_t extent () const
const PointlowerBound () const
const PointupperBound () const
bool isInside (const Point &p) const
const Predicatepredicate () const
DrawableWithDGtalBoarddefaultStyle (std::string mode="") const
std::string styleName () const
void selfDraw (DGtalBoard &board) const
void selfDrawAsGrid (DGtalBoard &board) const
void selfDrawAsPaving (DGtalBoard &board) const
void selfDisplay (std::ostream &out) const
bool isValid () const

Static Public Member Functions

static std::size_t extent (const Point &aLowerBound, const Point &aUpperBound)

Static Public Attributes

static const Space::Dimension staticDimension = Space::staticDimension

Private Attributes

Point myLowerBound
Point myUpperBound
Predicate myPredicate
ConstIterator myIteratorBegin
ConstIterator myIteratorEnd

Detailed Description

template<typename TSpace>
class DGtal::HyperRectDomain< TSpace >

Aim: Parallelepidec region of a digital space, model of a 'CDomain'.

Description of class 'HyperRectDomain'

The following code snippet demonstrates how to use HyperRectDomain

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

 //We create a digital Space based on 'int' integers and in dimension 4
 typedef DGtal::Space<4> Space4DType;
 typedef Space4DType::TPoint Point4DType;

 const int rawA[ ] = { 1, 2, 3 ,4};
 const int rawB[ ] = { 5, 5, 3 ,4};
 Point4DType A ( rawA );
 Point4DType B ( rawB );

 //Domain construction from two points
 DGtal::HyperRectDomain<Space4DType> myDomain ( A, B );

 //We just iterate on the Domain points and print out the point coordinates.
 std::copy ( myDomain.begin(),
             myDomain.end(),
             std::ostream_iterator<Point4DType> ( std::cout, " " ) );
See also:
testHyperRectDomain.cpp
testHyperRectDomain-snippet.cpp
Examples:

dgtalboard-1-points.cpp, dgtalboard-3-custom-classes.cpp, and dgtalboard-3-custom-points.cpp.


Member Typedef Documentation

template<typename TSpace>
typedef HyperRectDomain_Iterator<Point,Size> DGtal::HyperRectDomain< TSpace >::ConstIterator

Typedef of domain iterators.

template<typename TSpace>
typedef Point::Coordinate DGtal::HyperRectDomain< TSpace >::Coordinate
template<typename TSpace>
typedef Space::Dimension DGtal::HyperRectDomain< TSpace >::Dimension
template<typename TSpace>
typedef HyperRectDomain<Space> DGtal::HyperRectDomain< TSpace >::Domain
template<typename TSpace>
typedef Space::Integer DGtal::HyperRectDomain< TSpace >::Integer
template<typename TSpace>
typedef Space::Point DGtal::HyperRectDomain< TSpace >::Point
template<typename TSpace>
typedef IsWithinPointPredicate<Point> DGtal::HyperRectDomain< TSpace >::Predicate
template<typename TSpace>
typedef Space::Size DGtal::HyperRectDomain< TSpace >::Size
template<typename TSpace>
typedef TSpace DGtal::HyperRectDomain< TSpace >::Space
template<typename TSpace>
typedef Space::Vector DGtal::HyperRectDomain< TSpace >::Vector

Constructor & Destructor Documentation

template<typename TSpace>
DGtal::HyperRectDomain< TSpace >::HyperRectDomain (  ) 

Default Constructor.

template<typename TSpace>
DGtal::HyperRectDomain< TSpace >::HyperRectDomain ( const Point aPointA,
const Point aPointB 
)

Constructor from two points

Parameters:
aPointA and
aPoint B defining the space diagonal.
template<typename TSpace>
DGtal::HyperRectDomain< TSpace >::~HyperRectDomain (  ) 

Destructor.

template<typename TSpace>
DGtal::HyperRectDomain< TSpace >::HyperRectDomain ( const HyperRectDomain< TSpace > &  other  ) 

Copy constructor.

Parameters:
other the object to clone. Forbidden by default.

Member Function Documentation

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

begin(aPoint) iterator. Returns an iterator starting at

Parameters:
aPoint 
template<typename TSpace>
DGtal::HyperRectDomain< TSpace >::BOOST_CONCEPT_ASSERT ( (CSpace< TSpace >)   ) 
template<typename TSpace>
DrawableWithDGtalBoard* DGtal::HyperRectDomain< TSpace >::defaultStyle ( std::string  mode = ""  )  const

Default drawing style object.

Returns:
the dyn. alloc. default style for this object.
template<typename TSpace>
const ConstIterator DGtal::HyperRectDomain< TSpace >::end (  )  const
template<typename TSpace>
ConstIterator DGtal::HyperRectDomain< TSpace >::end ( const Point aPoint  )  const

end() iterator.

Returns:
a ConstIterator at the endpoint
Parameters:
aPoint 
template<typename TSpace>
std::size_t DGtal::HyperRectDomain< TSpace >::extent (  )  const
Returns:
the extent of the HyperRectDomain

Referenced by testSimpleHyperRectDomain().

template<typename TSpace>
static std::size_t DGtal::HyperRectDomain< TSpace >::extent ( const Point aLowerBound,
const Point aUpperBound 
) [inline, static]

Returns the extent of the HyperRectDomain (static method).

Parameters:
aLowerBound a Point corresponding to the lower bound.
aUpperBound a Point corresponding to the upper bound.
Returns:
the extent.
template<typename TSpace>
bool DGtal::HyperRectDomain< TSpace >::isInside ( const Point p  )  const
Parameters:
p any point.
Returns:
'true' if point [p] is inside this domain.
template<typename TSpace>
bool DGtal::HyperRectDomain< TSpace >::isValid (  )  const

Checks the validity/consistency of the object.

Returns:
'true' if the object is valid, 'false' otherwise.

Referenced by testIterator(), testReverseIterator(), testSimpleHyperRectDomain(), and testSTLCompat().

template<typename TSpace>
const Point& DGtal::HyperRectDomain< TSpace >::lowerBound (  )  const

Returns the lowest point of the space diagonal.

template<typename TSpace>
HyperRectDomain& DGtal::HyperRectDomain< TSpace >::operator= ( const HyperRectDomain< TSpace > &  other  ) 

Assignment.

Parameters:
other the object to copy.
Returns:
a reference on 'this'. Forbidden by default.
template<typename TSpace>
const Predicate& DGtal::HyperRectDomain< TSpace >::predicate (  )  const
Returns:
a const reference to the "IsInside" predicate.

NB: Could have used template class DomainPredicate but, for performance reason, directly used the IsWithinPointPredicate which fits perfectly.

template<typename TSpace>
void DGtal::HyperRectDomain< TSpace >::selfDisplay ( std::ostream &  out  )  const

Writes/Displays the object on an output stream.

Parameters:
out the output stream where the object is written.
template<typename TSpace>
void DGtal::HyperRectDomain< TSpace >::selfDraw ( DGtalBoard board  )  const

Draw the object on a DGtalBoard board.

Parameters:
board the output board where the object is drawn.
template<typename TSpace>
void DGtal::HyperRectDomain< TSpace >::selfDrawAsGrid ( DGtalBoard board  )  const

Draw the object (as a Grid) on a LiBoard board.

Parameters:
board the output board where the object is drawn.
asGrid to choose between paving vs. grid representation.
template<typename TSpace>
void DGtal::HyperRectDomain< TSpace >::selfDrawAsPaving ( DGtalBoard board  )  const

Draw the object (as a Grid) on a LiBoard board.

Parameters:
board the output board where the object is drawn.
asGrid to choose between paving vs. grid representation.
template<typename TSpace>
ConstIterator DGtal::HyperRectDomain< TSpace >::spanBegin ( const Point aPoint,
const std::size_t  aDimension 
) const

Returns a Span iterator starting at

Parameters:
aPoint and moving toward the dimension
aDimension. 

Referenced by testIterator().

template<typename TSpace>
ConstIterator DGtal::HyperRectDomain< TSpace >::spanEnd ( const std::size_t  aDimension  )  const

Creates a end() Span iterator along the dimension

Parameters:
aDimension. 

Referenced by testIterator().

template<typename TSpace>
std::string DGtal::HyperRectDomain< TSpace >::styleName (  )  const
Returns:
the style name used for drawing this object.

Referenced by testSimplePoints2D().

template<typename TSpace>
ConstIterator DGtal::HyperRectDomain< TSpace >::subDomainBegin ( const std::vector< Size > &  permutation  )  const

begin() iterator on a sub-domain with a order than the lexicographic one.

Parameters:
aSubDomain the sub-domain given by a vector of dimension.
Returns:
a ConstIterator

Referenced by testIterator().

template<typename TSpace>
ConstIterator DGtal::HyperRectDomain< TSpace >::subDomainBegin ( const std::vector< Size > &  permutation,
const Point startingPoint 
) const

begin() iterator on a sub-domain with a order than the lexicographic one.

Parameters:
aSubDomain the sub-domain given by a vector of dimension.
Returns:
a ConstIterator
template<typename TSpace>
ConstIterator DGtal::HyperRectDomain< TSpace >::subDomainEnd ( const std::vector< Size > &  aSubDomain  )  const

end() iterator with an order different from lexicographic.

template<typename TSpace>
ConstIterator DGtal::HyperRectDomain< TSpace >::subDomainEnd ( const std::vector< Size > &  aSubDomain,
const Point startingPoint 
) const

end() iterator with an order different from lexicographic.

template<typename TSpace>
const Point& DGtal::HyperRectDomain< TSpace >::upperBound (  )  const

Returns the highest point of the space diagonal.


Field Documentation

template<typename TSpace>
ConstIterator DGtal::HyperRectDomain< TSpace >::myIteratorBegin [private]

Begin iterator.

template<typename TSpace>
ConstIterator DGtal::HyperRectDomain< TSpace >::myIteratorEnd [private]

End iterator.

template<typename TSpace>
Point DGtal::HyperRectDomain< TSpace >::myLowerBound [private]

The lowest point of the space diagonal.

template<typename TSpace>
Predicate DGtal::HyperRectDomain< TSpace >::myPredicate [private]

"IsInside" predicate.

template<typename TSpace>
Point DGtal::HyperRectDomain< TSpace >::myUpperBound [private]

The highest point of the space diagonal.

template<typename TSpace>
const Space::Dimension DGtal::HyperRectDomain< TSpace >::staticDimension = Space::staticDimension [static]

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