DGtal  0.9.2
CPreCellularGridSpaceND.h
1 
17 #pragma once
18 
33 #if defined(CPreCellularGridSpaceND_RECURSES)
34 #error Recursive header files inclusion detected in CPreCellularGridSpaceND.h
35 #else // defined(CPreCellularGridSpaceND_RECURSES)
36 
37 #define CPreCellularGridSpaceND_RECURSES
38 
39 #if !defined CPreCellularGridSpaceND_h
40 
41 #define CPreCellularGridSpaceND_h
42 
44 // Inclusions
45 #include <iostream>
46 #include "DGtal/base/Common.h"
47 #include "DGtal/base/CConstSinglePassRange.h"
48 #include "DGtal/kernel/CInteger.h"
49 #include "DGtal/kernel/CUnsignedNumber.h"
50 #include "DGtal/kernel/CIntegralNumber.h"
51 
53 
54 // @since 0.8 In DGtal::concepts
55 namespace DGtal {
56  namespace concepts {
57 
59 // class CPreCellularGridSpaceND
282 template <typename T>
285 {
286  // ----------------------- Concept checks ------------------------------
287 public:
288  typedef typename T::Integer Integer;
289  typedef typename T::Space Space;
290  typedef typename T::PreCellularGridSpace PreCellularGridSpace;
291  typedef typename T::Cell Cell;
292  typedef typename T::SCell SCell;
293  typedef typename T::Surfel Surfel;
294  typedef typename T::Sign Sign;
295  typedef typename T::DirIterator DirIterator;
296  typedef typename T::Point Point;
297  typedef typename T::Vector Vector;
298  typedef typename T::Cells Cells;
299  typedef typename T::SCells SCells;
300  typedef typename T::CellSet CellSet;
301  typedef typename T::SCellSet SCellSet;
302  typedef typename T::SurfelSet SurfelSet;
303  typedef int Dummy;
304  typedef typename T::template CellMap<Dummy>::Type CellMap;
305  typedef typename T::template SCellMap<Dummy>::Type SCellMap;
306  typedef typename T::template SurfelMap<Dummy>::Type SurfelMap;
307 
326 
328  {
329  ConceptUtils::sameType( myDim, T::dimension );
330  ConceptUtils::sameType( myDim, T::DIM );
331  ConceptUtils::sameType( mySign, T::POS );
332  ConceptUtils::sameType( mySign, T::NEG );
334  }
336  {
337  ConceptUtils::sameType( myCell, myX.uCell( myP1 ) );
339  ConceptUtils::sameType( mySCell, myX.sCell( myP1 ) );
342  ConceptUtils::sameType( myCell, myX.uSpel( myP1 ) );
343  ConceptUtils::sameType( mySCell, myX.sSpel( myP1 ) );
345  ConceptUtils::sameType( myCell, myX.uPointel( myP1 ) );
346  ConceptUtils::sameType( mySCell, myX.sPointel( myP1 ) );
347  ConceptUtils::sameType( mySCell, myX.sPointel( myP1, myBool ) );
350  ConceptUtils::sameType( myP1, myX.uKCoords( myCell ) );
351  ConceptUtils::sameType( myP1, myX.uCoords( myCell ) );
354  ConceptUtils::sameType( myP1, myX.sKCoords( mySCell ) );
355  ConceptUtils::sameType( myP1, myX.sCoords( mySCell ) );
356  myX.uSetKCoord( myMutableCell, myDim, myInteger );
357  myX.uSetCoord( myMutableCell, myDim, myInteger );
358  myX.uSetKCoords( myMutableCell, myP1 );
359  myX.uSetCoords( myMutableCell, myP1 );
360  myX.sSetKCoord( myMutableSCell, myDim, myInteger );
361  myX.sSetCoord( myMutableSCell, myDim, myInteger );
362  myX.sSetKCoords( myMutableSCell, myP1 );
363  myX.sSetCoords( myMutableSCell, myP1 );
365  myX.sSetSign( myMutableSCell, mySign );
368  ConceptUtils::sameType( myCell, myX.unsigns( mySCell ) );
369  ConceptUtils::sameType( myInteger, myX.uTopology( myCell ) );
370  ConceptUtils::sameType( myInteger, myX.sTopology( mySCell ) );
373  ConceptUtils::sameType( myBool, myX.uIsSurfel( myCell ) );
374  ConceptUtils::sameType( myBool, myX.sIsSurfel( mySCell ) );
375  ConceptUtils::sameType( myBool, myX.uIsOpen( myCell, myDim ) );
379  ConceptUtils::sameType( myDirIt, myX.uOrthDirs( myCell ) );
380  ConceptUtils::sameType( myDirIt, myX.sOrthDirs( mySCell ) );
381  ConceptUtils::sameType( myDim, myX.uOrthDir( myCell ) );
382  ConceptUtils::sameType( myDim, myX.sOrthDir( mySCell ) );
383  // -------------------- Unsigned cell geometry services --------------------
384  ConceptUtils::sameType( myCell, myX.uGetIncr( myCell, myDim ) );
385  ConceptUtils::sameType( myCell, myX.uGetDecr( myCell, myDim ) );
388  ConceptUtils::sameType( myBool, myX.uIsInside( myCell, myDim ) );
391  ConceptUtils::sameType( myCell, myX.uTranslation( myCell, myV ) );
392  ConceptUtils::sameType( myCell, myX.uProjection( myCell, myCell, myDim ) );
393  myX.uProject( myMutableCell, myCell, myDim );
395  // -------------------- Signed cell geometry services --------------------
400  ConceptUtils::sameType( myBool, myX.sIsInside( mySCell, myDim ) );
403  ConceptUtils::sameType( mySCell, myX.sTranslation( mySCell, myV ) );
404  ConceptUtils::sameType( mySCell, myX.sProjection( mySCell, mySCell, myDim ) );
405  myX.sProject( myMutableSCell, mySCell, myDim );
407  // ----------------------- Neighborhood services --------------------------
408  ConceptUtils::sameType( myCells, myX.uNeighborhood( myCell ) );
409  ConceptUtils::sameType( myCells, myX.uProperNeighborhood( myCell ) );
410  ConceptUtils::sameType( mySCells, myX.sNeighborhood( mySCell ) );
411  ConceptUtils::sameType( mySCells, myX.sProperNeighborhood( mySCell ) );
412  ConceptUtils::sameType( myCell, myX.uAdjacent( myCell, myDim, myBool ) );
414  // ----------------------- Incidence services --------------------------
415  ConceptUtils::sameType( myCell, myX.uIncident( myCell, myDim, myBool ) );
417  ConceptUtils::sameType( myCells, myX.uLowerIncident( myCell ) );
418  ConceptUtils::sameType( myCells, myX.uUpperIncident( myCell ) );
419  ConceptUtils::sameType( mySCells, myX.sLowerIncident( mySCell ) );
420  ConceptUtils::sameType( mySCells, myX.sUpperIncident( mySCell ) );
422  ConceptUtils::sameType( myCells, myX.uCoFaces( myCell ) );
424  ConceptUtils::sameType( mySCell, myX.sDirectIncident( mySCell, myDim ) );
425  ConceptUtils::sameType( mySCell, myX.sIndirectIncident( mySCell, myDim ) );
426 
427 }
428  // ------------------------- Private Datas --------------------------------
429 private:
430  T myX; // do not require T to be default constructible.
431  Integer myInteger;
433  Point myP1, myP2;
434  Vector myV;
435  Cell myCell;
436  SCell mySCell;
437  mutable Cell myMutableCell;
438  mutable SCell myMutableSCell;
439  bool myBool;
440  Sign mySign;
441  DirIterator myDirIt;
442  Cells myCells;
443  SCells mySCells;
444 
445  // ------------------------- Internals ------------------------------------
446 private:
447 
448 }; // end of concept CPreCellularGridSpaceND
449 
450 } // namespace concepts
451 } // namespace DGtal
452 
453 // //
455 
456 #endif // !defined CPreCellularGridSpaceND_h
457 
458 #undef CPreCellularGridSpaceND_RECURSES
459 #endif // else defined(CPreCellularGridSpaceND_RECURSES)
Aim: Defines the concept describing a const single pass range.
Aim: This concept describes an unbounded cellular grid space in nD. In these spaces obtained by carte...
BOOST_CONCEPT_ASSERT((CInteger< Integer >))
BOOST_STATIC_ASSERT((ConceptUtils::SameType< Integer, typename Space::Integer >::value))
Go to http://www.sgi.com/tech/stl/PairAssociativeContainer.html.
Definition: Boost.dox:149
DGtal::uint32_t Dimension
Definition: Common.h:113
T::template CellMap< Dummy >::Type CellMap
Go to http://www.sgi.com/tech/stl/DefaultConstructible.html.
Definition: Boost.dox:30
T::template SCellMap< Dummy >::Type SCellMap
Aim: Concept checking for Integer Numbers. More precisely, this concept is a refinement of both CEucl...
Definition: CInteger.h:87
void sameType(const T &t1, const T &t2)
Go to http://www.sgi.com/tech/stl/SimpleAssociativeContainer.html.
Definition: Boost.dox:146
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.
T::template SurfelMap< Dummy >::Type SurfelMap
Go to http://www.sgi.com/tech/stl/UniqueAssociativeContainer.html.
Definition: Boost.dox:140