DGtal  0.9.2
BoundaryPredicate.h
1 
17 #pragma once
18 
31 #if defined(BoundaryPredicate_RECURSES)
32 #error Recursive header files inclusion detected in BoundaryPredicate.h
33 #else // defined(BoundaryPredicate_RECURSES)
34 
35 #define BoundaryPredicate_RECURSES
36 
37 #if !defined BoundaryPredicate_h
38 
39 #define BoundaryPredicate_h
40 
42 // Inclusions
43 #include <iostream>
44 #include <boost/array.hpp>
45 
46 #include "DGtal/base/Common.h"
47 #include "DGtal/base/ConstAlias.h"
48 #include "DGtal/images/CConstImage.h"
49 #include "DGtal/topology/CCellularGridSpaceND.h"
51 
52 // @since 0.8 In DGtal::functors
53 namespace DGtal {
54  namespace functors {
55 
57  // class BoundaryPredicate
68  template <typename TKSpace, typename TImage>
70  {
71  // ----------------------- public types ------------------------------
72  public:
75  typedef TKSpace KSpace;
76  typedef TImage Image;
77  typedef typename KSpace::Surfel Surfel;
78  typedef typename KSpace::Point Point;
79  typedef typename KSpace::SCell SCell;
80  typedef typename Image::Value Value;
81  // KSpace::Point same type as Image::Point
83  (( concepts::ConceptUtils::SameType< typename KSpace::Point,
84  typename Image::Point>::value ));
85 
86 
87  // ----------------------- Standard services ------------------------------
88  public:
89 
94 
104  const Value & l1 );
105 
110  BoundaryPredicate ( const BoundaryPredicate & other );
111 
118 
128  bool operator()( const Surfel & s ) const;
129 
130  // ----------------------- Interface --------------------------------------
131  public:
132 
137  void selfDisplay ( std::ostream & out ) const;
138 
143  bool isValid() const;
144 
145  // ------------------------- Private Datas --------------------------------
146  private:
147 
149  const KSpace* myPtrSpace;
150  // the image of interest
151  const Image* myPtrImage;
153  Value myLabel1;
154 
155  // ------------------------- Hidden services ------------------------------
156  protected:
157  // ------------------------- Internals ------------------------------------
158  private:
159 
160  }; // end of class BoundaryPredicate
161 
162  } // namespace functors
163 
170  template <typename TKSpace, typename TImage>
171  std::ostream&
172  operator<< ( std::ostream & out,
174 
175 
176 } // namespace DGtal
177 
178 
180 // Includes inline functions.
181 #include "DGtal/topology/helpers/BoundaryPredicate.ih"
182 
183 // //
185 
186 #endif // !defined BoundaryPredicate_h
187 
188 #undef BoundaryPredicate_RECURSES
189 #endif // else defined(BoundaryPredicate_RECURSES)
void selfDisplay(std::ostream &out) const
Aim: This class encapsulates its parameter class so that to indicate to the user that the object/poin...
Definition: ConstAlias.h:186
Aim: The predicate on surfels that represents the frontier between a region and its complementary in ...
std::ostream & operator<<(std::ostream &out, const ClosedIntegerHalfPlane< TSpace > &object)
BOOST_CONCEPT_ASSERT((concepts::CCellularGridSpaceND< TKSpace >))
const KSpace * myPtrSpace
the cellular space where lies the image.
DGtal is the top-level namespace which contains all DGtal functions and types.
bool operator()(const Surfel &s) const
BoundaryPredicate & operator=(const BoundaryPredicate &other)
Aim: This concept describes a cellular grid space in nD. In these spaces obtained by cartesian produc...
BoundaryPredicate(ConstAlias< KSpace > aSpace, ConstAlias< Image > anImage, const Value &l1)
Aim: Defines the concept describing a read-only image, which is a refinement of CPointFunctor.
Definition: CConstImage.h:94
BOOST_STATIC_ASSERT((concepts::ConceptUtils::SameType< typename KSpace::Point, typename Image::Point >::value))
Value myLabel1
the label of the inner region that defines the boundary.