DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions | Protected Member Functions | Private Attributes
DGtal::DomainPredicate< TDomain > Struct Template Reference

#include <DomainPredicate.h>

Inheritance diagram for DGtal::DomainPredicate< TDomain >:
Inheritance graph
[legend]

Public Types

typedef TDomain Domain
typedef Domain::Point Point

Public Member Functions

 DomainPredicate (const Domain &aDomain)
 DomainPredicate (const DomainPredicate &other)
DomainPredicateoperator= (const DomainPredicate &other)
bool operator() (const Point &p) const
const Domaindomain () const

Protected Member Functions

 DomainPredicate ()

Private Attributes

const DomainmyDomain

Detailed Description

template<typename TDomain>
struct DGtal::DomainPredicate< TDomain >

Aim: The predicate returning true iff the point is in the domain given at construction. It is just a wrapper class around the methods Domain::isInside( const Point & ), where Domain stands for any model of CDomain.

Description of template class 'DomainPredicate'

It is used by domains to define the type by their method predicate().

Model of CPointPredicate

See also:
DomainAdjacency::predicate.

Definition at line 68 of file DomainPredicate.h.


Member Typedef Documentation

template<typename TDomain>
typedef TDomain DGtal::DomainPredicate< TDomain >::Domain

Definition at line 72 of file DomainPredicate.h.

template<typename TDomain>
typedef Domain::Point DGtal::DomainPredicate< TDomain >::Point

Definition at line 73 of file DomainPredicate.h.


Constructor & Destructor Documentation

template<typename TDomain >
DGtal::DomainPredicate< TDomain >::DomainPredicate ( const Domain aDomain)
inline

Constructor from domain.

Parameters:
aDomainany domain.

Definition at line 45 of file DomainPredicate.ih.

: myDomain( &aDomain )
{
}
template<typename TDomain >
DGtal::DomainPredicate< TDomain >::DomainPredicate ( const DomainPredicate< TDomain > &  other)
inline

Copy constructor.

Parameters:
otherthe object to clone.

Definition at line 53 of file DomainPredicate.ih.

: myDomain( other.myDomain )
{
}
template<typename TDomain>
DGtal::DomainPredicate< TDomain >::DomainPredicate ( )
protected

Constructor. Forbidden by default (protected to avoid g++ warnings).


Member Function Documentation

template<typename TDomain >
const TDomain & DGtal::DomainPredicate< TDomain >::domain ( ) const
inline
Returns:
a const reference to the associated domain.

Definition at line 76 of file DomainPredicate.ih.

{
return *myDomain;
}
template<typename TDomain >
bool DGtal::DomainPredicate< TDomain >::operator() ( const Point p) const
inline
Parameters:
pany point.
Returns:
true iff p is in the domain.

Definition at line 85 of file DomainPredicate.ih.

{
// std::cerr << "DomainPred.operator(" << p << ")" << std::endl;
return myDomain->isInside( p );
}
template<typename TDomain >
DGtal::DomainPredicate< TDomain > & DGtal::DomainPredicate< TDomain >::operator= ( const DomainPredicate< TDomain > &  other)
inline

Assignment.

Parameters:
otherthe object to copy.
Returns:
a reference on 'this'. Forbidden by default.

Definition at line 62 of file DomainPredicate.ih.

References DGtal::DomainPredicate< TDomain >::myDomain.

{
if (this != &other)
{
myDomain = other.myDomain;
}
return *this;
}

Field Documentation

template<typename TDomain>
const Domain* DGtal::DomainPredicate< TDomain >::myDomain
private

Aliasing pointer on the domain corresponding to this predicate.

Definition at line 120 of file DomainPredicate.h.

Referenced by DGtal::DomainPredicate< TDomain >::operator=().


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