DGtal 0.3.0

CImplicitShape.h

Go to the documentation of this file.
00001 
00017 #pragma once
00018 
00031 #if defined(CImplicitShape_RECURSES)
00032 #error Recursive header files inclusion detected in CImplicitShape.h
00033 #else // defined(CImplicitShape_RECURSES)
00034 
00035 #define CImplicitShape_RECURSES
00036 
00037 #if !defined CImplicitShape_h
00038 
00039 #define CImplicitShape_h
00040 
00042 // Inclusions
00043 #include <iostream>
00044 #include "boost/concept_check.hpp"
00045 #include "DGtal/base/Common.h"
00046 
00047 #include "DGtal/kernel/domains/CDomain.h"
00048 #include "DGtal/kernel/CSpace.h"
00050 
00051 namespace DGtal
00052 {
00053 
00055   // class CImplicitShape
00091   template <typename TShape>
00092   struct CImplicitShape
00093   {
00094     // ----------------------- Concept checks ------------------------------
00095   public:
00096     
00097     typedef typename TShape::Space::Point Point;
00098     typedef typename TShape::Space Space;
00099     
00100     BOOST_CONCEPT_ASSERT((CSpace<Space>));
00101 
00102  
00103     BOOST_CONCEPT_USAGE( CImplicitShape )
00104     {
00105       // ImplicitShape should have a getUpperBound() returning a Point.
00106       ConceptUtils::sameType( myP, myT.getUpperBound() );
00107       // ImplicitShape should have a getLowerBound() returning a Point.
00108       ConceptUtils::sameType( myP, myT.getLowerBound() );
00109       // ImplicitShape should have a operator() returning a double.
00110       ConceptUtils::sameType( aDouble, myT(myP) );
00111       
00112     }
00113 
00114     // ------------------------- Private Datas --------------------------------
00115   private:
00116     TShape myT;
00117     Point myP;
00118     double aDouble;
00119     
00120   }; // end of concept CImplicitShape
00121   
00122 } // namespace DGtal
00123 
00124 
00125 //                                                                           //
00127 
00128 #endif // !defined CImplicitShape_h
00129 
00130 #undef CImplicitShape_RECURSES
00131 #endif // else defined(CImplicitShape_RECURSES)
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines