DGtal  0.9.2
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)
34 
35 #define DomainPredicate_RECURSES
36 
37 #if !defined DomainPredicate_h
38 
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 
95  DomainPredicate & operator= ( const DomainPredicate & other );
96 
101  bool operator()( const Point & p ) const;
102 
106  const Domain & domain() const;
107 
108  // ------------------------- Hidden services ------------------------------
109  protected:
110 
115  DomainPredicate();
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)
DomainPredicate & operator=(const DomainPredicate &other)
Aim: This class encapsulates its parameter class so that to indicate to the user that the object/poin...
Definition: ConstAlias.h:186
const Domain & domain() const
bool operator()(const Point &p) const
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.
DGtal is the top-level namespace which contains all DGtal functions and types.
const Domain * myDomain
Aliasing pointer on the domain corresponding to this predicate.