DGtal  1.2.0
DomainPredicate.h
1 
17 #pragma once
18 
31 #if defined(DomainPredicate_RECURSES)
32 #error Recursive header files inclusion detected in DomainPredicate.h
33 #else // defined(DomainPredicate_RECURSES)
35 #define DomainPredicate_RECURSES
36 
37 #if !defined DomainPredicate_h
39 #define DomainPredicate_h
40 
42 // Inclusions
43 #include <iostream>
44 #include "DGtal/base/Common.h"
45 #include "DGtal/base/ConstAlias.h"
46 #include "DGtal/kernel/BasicPointPredicates.h"
48 
49 // @since 0.8 In DGtal::functors
50 namespace DGtal {
51  namespace functors {
52 
54  // template class DomainPredicate
69  template <typename TDomain>
71  {
72  // ----------------------- Standard services ------------------------------
73  public:
74  typedef TDomain Domain;
75  typedef typename Domain::Point Point;
76 
82 
87  DomainPredicate ( const DomainPredicate & other );
88 
96 
101  bool operator()( const Point & p ) const;
102 
106  const Domain & domain() const;
107 
108  // ------------------------- Hidden services ------------------------------
109  protected:
110 
116 
117 
118  // ------------------------- Internals ------------------------------------
119  private:
120 
122  const Domain* myDomain;
123 
124  }; // end of struct DomainPredicate
125 
126 } // namespace functors
127 } // namespace DGtal
128 
129 
131 // Includes inline functions.
132 #include "DGtal/kernel/domains/DomainPredicate.ih"
133 
134 // //
136 
137 #endif // !defined DomainPredicate_h
138 
139 #undef DomainPredicate_RECURSES
140 #endif // else defined(DomainPredicate_RECURSES)
Aim: This class encapsulates its parameter class so that to indicate to the user that the object/poin...
Definition: ConstAlias.h:187
DGtal is the top-level namespace which contains all DGtal functions and types.
Aim: The predicate returning true iff the point is in the domain given at construction....
bool operator()(const Point &p) const
DomainPredicate(ConstAlias< Domain > aDomain)
DomainPredicate(const DomainPredicate &other)
DomainPredicate & operator=(const DomainPredicate &other)
const Domain * myDomain
Aliasing pointer on the domain corresponding to this predicate.
const Domain & domain() const