DGtal 0.3.0

CAdjacency.h

Go to the documentation of this file.
00001 
00017 #pragma once
00018 
00031 #if defined(CAdjacency_RECURSES)
00032 #error Recursive header files inclusion detected in CAdjacency.h
00033 #else // defined(CAdjacency_RECURSES)
00034 
00035 #define CAdjacency_RECURSES
00036 
00037 #if !defined CAdjacency_h
00038 
00039 #define CAdjacency_h
00040 
00042 // Inclusions
00043 #include <iostream>
00044 #include <vector>
00045 #include "boost/concept_check.hpp"
00046 #include "DGtal/utils/ConceptUtils.h"
00047 #include "DGtal/base/Common.h"
00049 
00050 namespace DGtal
00051 {
00052 
00054   // class CAdjacency
00134   template <typename Adj>
00135   struct CAdjacency
00136   {
00137     // ----------------------- Concept checks ------------------------------
00138   public:
00139     
00140     typedef typename Adj::Space Space;
00141     typedef typename Adj::Point Point;
00142     typedef typename Adj::Adjacency Adjacency;
00143 
00144     BOOST_CONCEPT_USAGE( CAdjacency )
00145     {
00146       // check isAdjacentTo
00147       ConceptUtils::sameType( myBool, myAdj.isAdjacentTo( myP1, myP2 ) );
00148       // check isProperlyAdjacentTo
00149       ConceptUtils::sameType( myBool, 
00150                               myAdj.isProperlyAdjacentTo( myP1, myP2 ) );
00151       // Check writeNeighborhood
00152       myAdj.writeNeighborhood( myP1, myInserter );
00153       // Check writeProperNeighborhood
00154       myAdj.writeProperNeighborhood( myP1, myInserter );
00155     }
00156 
00157     // ------------------------- Private Datas --------------------------------
00158   private:
00159     Adj myAdj;
00160     Point myP1;
00161     Point myP2;
00162     bool myBool;
00163     std::back_insert_iterator< std::vector<Point> > myInserter;
00164 
00165     // ------------------------- Internals ------------------------------------
00166   private:
00167     
00168   }; // end of concept CAdjacency
00169   
00170 } // namespace DGtal
00171 
00172 
00174 // Includes inline functions.
00175 #include "DGtal/topology/CAdjacency.ih"
00176 
00177 //                                                                           //
00179 
00180 #endif // !defined CAdjacency_h
00181 
00182 #undef CAdjacency_RECURSES
00183 #endif // else defined(CAdjacency_RECURSES)
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines