DGtal  0.9.2
CDigitalSurfaceContainer.h
1 
17 #pragma once
18 
31 #if defined(CDigitalSurfaceContainer_RECURSES)
32 #error Recursive header files inclusion detected in CDigitalSurfaceContainer.h
33 #else // defined(CDigitalSurfaceContainer_RECURSES)
34 
35 #define CDigitalSurfaceContainer_RECURSES
36 
37 #if !defined CDigitalSurfaceContainer_h
38 
39 #define CDigitalSurfaceContainer_h
40 
42 // Inclusions
43 #include <iostream>
44 #include "DGtal/base/Common.h"
45 #include "DGtal/topology/Topology.h"
46 #include "DGtal/topology/CCellularGridSpaceND.h"
47 #include "DGtal/topology/CDigitalSurfaceTracker.h"
49 
50 // @since 0.8 In DGtal::concepts
51 namespace DGtal {
52  namespace concepts {
53 
55  // class CDigitalSurfaceContainer
126  template <typename T>
128  {
129  // ----------------------- Concept checks ------------------------------
130  public:
131  typedef typename T::KSpace KSpace;
132  typedef typename T::Surfel Surfel;
133  typedef typename T::SurfelConstIterator SurfelConstIterator;
134  typedef typename T::DigitalSurfaceTracker DigitalSurfaceTracker;
135  typedef typename T::Size Size;
136 
141 
142  // 2. then check the presence of data members, operators and methods with
144  {
145  // check const methods.
147  }
149  {
150  // x.space() const, returns a const KSpace &
151  ConceptUtils::sameType( myKSpace, myX.space() );
152  // x.isInside( Surfel ) const, returns bool.
153  ConceptUtils::sameType( myBool, myX.isInside( mySurfel ) );
154  // x.begin() const, returns SurfelConstIterator
156  // x.end() const, returns SurfelConstIterator
158  // x.newTracker( Surfel ) const, returns DigitalSurfaceTracker*
160  // x.connectedness() const, returns Connectedness
161  ConceptUtils::sameType( myConnectedness, myX.connectedness() );
162  // x.nbSurfels() const, returns Connectedness
163  ConceptUtils::sameType( mySize, myX.nbSurfels() );
164  // x.empty() const, returns bool
165  ConceptUtils::sameType( myBool, myX.empty() );
166  }
167  // ------------------------- Private Datas --------------------------------
168  private:
169  T myX; // do not require T to be default constructible.
170  KSpace myKSpace;
171  Surfel mySurfel;
172  bool myBool;
173  SurfelConstIterator mySurfelCIt;
174  DigitalSurfaceTracker* myPtrTracker;
176  Size mySize;
177  // ------------------------- Internals ------------------------------------
178  private:
179 
180  }; // end of concept CDigitalSurfaceContainer
181 
182 } // namespace concepts
183 } // namespace DGtal
184 
185 // //
187 
188 #endif // !defined CDigitalSurfaceContainer_h
189 
190 #undef CDigitalSurfaceContainer_RECURSES
191 #endif // else defined(CDigitalSurfaceContainer_RECURSES)
BOOST_CONCEPT_ASSERT((boost_concepts::SinglePassIteratorConcept< SurfelConstIterator >))
void sameType(const T &t1, const T &t2)
Go to http://www.sgi.com/tech/stl/CopyConstructible.html.
Definition: Boost.dox:34
DGtal is the top-level namespace which contains all DGtal functions and types.
Aim: This concept describes a cellular grid space in nD. In these spaces obtained by cartesian produc...
Go to http://www.boost.org/doc/libs/1_52_0/libs/iterator/doc/SinglePassIterator.html.
Connectedness
Definition: Topology.h:50
Aim: The digital surface container concept describes a minimal set of inner types and methods so as t...
Go to http://www.boost.org/doc/libs/1_52_0/libs/iterator/doc/ReadableIterator.html.