DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
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 namespace DGtal
51 {
52 
54  // class CDigitalSurfaceContainer
182  template <typename T>
183  struct CDigitalSurfaceContainer : boost::CopyConstructible<T>
184  {
185  // ----------------------- Concept checks ------------------------------
186  public:
187  typedef typename T::KSpace KSpace;
188  typedef typename T::Surfel Surfel;
189  typedef typename T::SurfelConstIterator SurfelConstIterator;
190  typedef typename T::DigitalSurfaceTracker DigitalSurfaceTracker;
191  typedef typename T::Size Size;
192 
193  BOOST_CONCEPT_ASSERT(( boost_concepts::SinglePassIteratorConcept<SurfelConstIterator> ));
196 
197  // 2. then check the presence of data members, operators and methods with
199  {
200  // check const methods.
202  }
204  {
205  // x.space() const, returns a const KSpace &
206  ConceptUtils::sameType( myKSpace, myX.space() );
207  // x.isInside( Surfel ) const, returns bool.
208  ConceptUtils::sameType( myBool, myX.isInside( mySurfel ) );
209  // x.begin() const, returns SurfelConstIterator
211  // x.end() const, returns SurfelConstIterator
213  // x.newTracker( Surfel ) const, returns DigitalSurfaceTracker*
215  // x.connectedness() const, returns Connectedness
216  ConceptUtils::sameType( myConnectedness, myX.connectedness() );
217  // x.nbSurfels() const, returns Connectedness
218  ConceptUtils::sameType( mySize, myX.nbSurfels() );
219  // x.empty() const, returns bool
220  ConceptUtils::sameType( myBool, myX.empty() );
221  }
222  // ------------------------- Private Datas --------------------------------
223  private:
224  T myX; // do not require T to be default constructible.
227  bool myBool;
232  // ------------------------- Internals ------------------------------------
233  private:
234 
235  }; // end of concept CDigitalSurfaceContainer
236 
237 } // namespace DGtal
238 
239 // //
241 
242 #endif // !defined CDigitalSurfaceContainer_h
243 
244 #undef CDigitalSurfaceContainer_RECURSES
245 #endif // else defined(CDigitalSurfaceContainer_RECURSES)