DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
CCellularGridSpaceND.h
1 
17 #pragma once
18 
31 #if defined(CCellularGridSpaceND_RECURSES)
32 #error Recursive header files inclusion detected in CCellularGridSpaceND.h
33 #else // defined(CCellularGridSpaceND_RECURSES)
34 
35 #define CCellularGridSpaceND_RECURSES
36 
37 #if !defined CCellularGridSpaceND_h
38 
39 #define CCellularGridSpaceND_h
40 
42 // Inclusions
43 #include <iostream>
44 #include "DGtal/base/Common.h"
45 #include "DGtal/base/CConstSinglePassRange.h"
46 #include "DGtal/kernel/CInteger.h"
47 #include "DGtal/kernel/CUnsignedInteger.h"
48 
50 
51 namespace DGtal
52 {
53 
55 // class CCellularGridSpaceND
315 template <typename T>
317  : boost::DefaultConstructible<T>, boost::CopyConstructible<T>
318 {
319  // ----------------------- Concept checks ------------------------------
320 public:
321  typedef typename T::Integer Integer;
322  typedef typename T::Size Size;
323  typedef typename T::Space Space;
324  typedef typename T::Cell Cell;
325  typedef typename T::SCell SCell;
326  typedef typename T::Surfel Surfel;
327  typedef typename T::Sign Sign;
328  typedef typename T::DirIterator DirIterator;
329  typedef typename T::Point Point;
330  typedef typename T::Vector Vector;
331  typedef typename T::Cells Cells;
332  typedef typename T::SCells SCells;
333  typedef typename T::CellSet CellSet;
334  typedef typename T::SCellSet SCellSet;
335  typedef typename T::SurfelSet SurfelSet;
336  typedef int Dummy;
337  typedef typename T::template CellMap<Dummy>::Type CellMap;
338  typedef typename T::template SCellMap<Dummy>::Type SCellMap;
339  typedef typename T::template SurfelMap<Dummy>::Type SurfelMap;
340 
348  BOOST_CONCEPT_ASSERT(( boost::UniqueAssociativeContainer< CellSet > ));
349  BOOST_CONCEPT_ASSERT(( boost::UniqueAssociativeContainer< SCellSet > ));
350  BOOST_CONCEPT_ASSERT(( boost::UniqueAssociativeContainer< SurfelSet > ));
351  BOOST_CONCEPT_ASSERT(( boost::SimpleAssociativeContainer< CellSet > ));
352  BOOST_CONCEPT_ASSERT(( boost::SimpleAssociativeContainer< SCellSet > ));
353  BOOST_CONCEPT_ASSERT(( boost::SimpleAssociativeContainer< SurfelSet > ));
354  BOOST_CONCEPT_ASSERT(( boost::UniqueAssociativeContainer< CellMap > ));
355  BOOST_CONCEPT_ASSERT(( boost::UniqueAssociativeContainer< SCellMap > ));
356  BOOST_CONCEPT_ASSERT(( boost::UniqueAssociativeContainer< SurfelMap > ));
357  BOOST_CONCEPT_ASSERT(( boost::PairAssociativeContainer< CellMap > ));
358  BOOST_CONCEPT_ASSERT(( boost::PairAssociativeContainer< SCellMap > ));
359  BOOST_CONCEPT_ASSERT(( boost::PairAssociativeContainer< SurfelMap > ));
360 
362  {
363  ConceptUtils::sameType( myDim, T::dimension );
364  ConceptUtils::sameType( myDim, T::DIM );
365  ConceptUtils::sameType( mySign, T::POS );
366  ConceptUtils::sameType( mySign, T::NEG );
369  }
371  {
375  ConceptUtils::sameType( myP1, myX.lowerBound() );
376  ConceptUtils::sameType( myP2, myX.upperBound() );
377  ConceptUtils::sameType( myCell, myX.lowerCell() );
378  ConceptUtils::sameType( myCell, myX.upperCell() );
379  ConceptUtils::sameType( myBool, myX.isSpaceClosed() );
380  ConceptUtils::sameType( myCell, myX.uCell( myP1 ) );
382  ConceptUtils::sameType( mySCell, myX.sCell( myP1 ) );
385  ConceptUtils::sameType( myCell, myX.uSpel( myP1 ) );
386  ConceptUtils::sameType( mySCell, myX.sSpel( myP1 ) );
388  ConceptUtils::sameType( myCell, myX.uPointel( myP1 ) );
389  ConceptUtils::sameType( mySCell, myX.sPointel( myP1 ) );
390  ConceptUtils::sameType( mySCell, myX.sPointel( myP1, myBool ) );
393  ConceptUtils::sameType( myP1, myX.uKCoords( myCell ) );
394  ConceptUtils::sameType( myP1, myX.uCoords( myCell ) );
397  ConceptUtils::sameType( myP1, myX.sKCoords( mySCell ) );
398  ConceptUtils::sameType( myP1, myX.sCoords( mySCell ) );
399  myX.uSetKCoord( myMutableCell, myDim, myInteger );
400  myX.uSetCoord( myMutableCell, myDim, myInteger );
401  myX.uSetKCoords( myMutableCell, myP1 );
402  myX.uSetCoords( myMutableCell, myP1 );
403  myX.sSetKCoord( myMutableSCell, myDim, myInteger );
404  myX.sSetCoord( myMutableSCell, myDim, myInteger );
405  myX.sSetKCoords( myMutableSCell, myP1 );
406  myX.sSetCoords( myMutableSCell, myP1 );
408  myX.sSetSign( myMutableSCell, mySign );
411  ConceptUtils::sameType( myCell, myX.unsigns( mySCell ) );
412  ConceptUtils::sameType( myInteger, myX.uTopology( myCell ) );
413  ConceptUtils::sameType( myInteger, myX.sTopology( mySCell ) );
416  ConceptUtils::sameType( myBool, myX.uIsSurfel( myCell ) );
417  ConceptUtils::sameType( myBool, myX.sIsSurfel( mySCell ) );
418  ConceptUtils::sameType( myBool, myX.uIsOpen( myCell, myDim ) );
422  ConceptUtils::sameType( myDirIt, myX.uOrthDirs( myCell ) );
423  ConceptUtils::sameType( myDirIt, myX.sOrthDirs( mySCell ) );
424  ConceptUtils::sameType( myDim, myX.uOrthDir( myCell ) );
425  ConceptUtils::sameType( myDim, myX.sOrthDir( mySCell ) );
426  // -------------------- Unsigned cell geometry services --------------------
427  ConceptUtils::sameType( myCell, myX.uFirst( myCell ) );
429  ConceptUtils::sameType( myCell, myX.uGetIncr( myCell, myDim ) );
430  ConceptUtils::sameType( myCell, myX.uGetDecr( myCell, myDim ) );
433  ConceptUtils::sameType( myCell, myX.uGetMax( myCell, myDim ) );
434  ConceptUtils::sameType( myCell, myX.uGetMin( myCell, myDim ) );
435  ConceptUtils::sameType( myBool, myX.uIsInside( myCell, myDim ) );
438  ConceptUtils::sameType( myInteger, myX.uDistanceToMax( myCell, myDim ) );
439  ConceptUtils::sameType( myInteger, myX.uDistanceToMin( myCell, myDim ) );
440  ConceptUtils::sameType( myCell, myX.uTranslation( myCell, myV ) );
441  ConceptUtils::sameType( myCell, myX.uProjection( myCell, myCell, myDim ) );
442  myX.uProject( myMutableCell, myCell, myDim );
444  // -------------------- Signed cell geometry services --------------------
453  ConceptUtils::sameType( myBool, myX.sIsInside( mySCell, myDim ) );
456  ConceptUtils::sameType( myInteger, myX.sDistanceToMax( mySCell, myDim ) );
457  ConceptUtils::sameType( myInteger, myX.sDistanceToMin( mySCell, myDim ) );
458  ConceptUtils::sameType( mySCell, myX.sTranslation( mySCell, myV ) );
459  ConceptUtils::sameType( mySCell, myX.sProjection( mySCell, mySCell, myDim ) );
460  myX.sProject( myMutableSCell, mySCell, myDim );
462  // ----------------------- Neighborhood services --------------------------
463  ConceptUtils::sameType( myCells, myX.uNeighborhood( myCell ) );
464  ConceptUtils::sameType( myCells, myX.uProperNeighborhood( myCell ) );
465  ConceptUtils::sameType( mySCells, myX.sNeighborhood( mySCell ) );
466  ConceptUtils::sameType( mySCells, myX.sProperNeighborhood( mySCell ) );
467  ConceptUtils::sameType( myCell, myX.uAdjacent( myCell, myDim, myBool ) );
469  // ----------------------- Incidence services --------------------------
470  ConceptUtils::sameType( myCell, myX.uIncident( myCell, myDim, myBool ) );
472  ConceptUtils::sameType( myCells, myX.uLowerIncident( myCell ) );
473  ConceptUtils::sameType( myCells, myX.uUpperIncident( myCell ) );
474  ConceptUtils::sameType( mySCells, myX.sLowerIncident( mySCell ) );
475  ConceptUtils::sameType( mySCells, myX.sUpperIncident( mySCell ) );
477  ConceptUtils::sameType( myCells, myX.uCoFaces( myCell ) );
479  ConceptUtils::sameType( mySCell, myX.sDirectIncident( mySCell, myDim ) );
480  ConceptUtils::sameType( mySCell, myX.sIndirectIncident( mySCell, myDim ) );
481 
482 }
483  // ------------------------- Private Datas --------------------------------
484 private:
485  T myX; // do not require T to be default constructible.
495  bool myBool;
500 
501  // ------------------------- Internals ------------------------------------
502 private:
503 
504 }; // end of concept CCellularGridSpaceND
505 
506 } // namespace DGtal
507 
508 // //
510 
511 #endif // !defined CCellularGridSpaceND_h
512 
513 #undef CCellularGridSpaceND_RECURSES
514 #endif // else defined(CCellularGridSpaceND_RECURSES)