DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Surfaces.h
1 
17 #pragma once
18 
31 #if defined(Surfaces_RECURSES)
32 #error Recursive header files inclusion detected in Surfaces.h
33 #else // defined(Surfaces_RECURSES)
34 
35 #define Surfaces_RECURSES
36 
37 #if !defined Surfaces_h
38 
39 #define Surfaces_h
40 
42 // Inclusions
43 #include <iostream>
44 #include "DGtal/base/Common.h"
45 #include "DGtal/base/Exceptions.h"
46 #include "DGtal/topology/SurfelAdjacency.h"
47 #include "DGtal/topology/SurfelNeighborhood.h"
48 
50 
51 #ifdef _MSC_VER
52 #pragma warning(disable : 4290)
53 #endif
54 
55 namespace DGtal
56 {
57 
59  // template class Surfaces
77  template <typename TKSpace>
78  class Surfaces
79  {
80  // ----------------------- Types ------------------------------
81  public:
82  typedef TKSpace KSpace;
83  typedef typename KSpace::Integer Integer;
84  typedef typename KSpace::Point Point;
85  typedef typename KSpace::Cell Cell;
86  typedef typename KSpace::SCell SCell;
87  typedef typename KSpace::DirIterator DirIterator;
88 
89  // ----------------------- Static services ------------------------------
90  public:
91 
112  template <typename PointPredicate>
113  static
114  SCell findABel( const KSpace & K,
115  const PointPredicate & pp,
116  unsigned int nbtries = 1000 ) throw (DGtal::InputException);
142  template <typename PointPredicate>
143  static
144  SCell findABel( const KSpace & K,
145  const PointPredicate & pp,
146  Point x1, Point x2 );
147 
178  template <typename SCellSet, typename PointPredicate >
179  static
180  void trackBoundary( SCellSet & surface,
181  const KSpace & K,
182  const SurfelAdjacency<KSpace::dimension> & surfel_adj,
183  const PointPredicate & pp,
184  const SCell & start_surfel );
185 
219  template <typename SCellSet, typename PointPredicate >
220  static
221  void trackClosedBoundary( SCellSet & surface,
222  const KSpace & K,
223  const SurfelAdjacency<KSpace::dimension> & surfel_adj,
224  const PointPredicate & pp,
225  const SCell & start_surfel );
226 
227 
253  template <typename SCellSet, typename SurfelPredicate >
254  static
255  void trackSurface( SCellSet & surface,
256  const KSpace & K,
257  const SurfelAdjacency<KSpace::dimension> & surfel_adj,
258  const SurfelPredicate & pp,
259  const SCell & start_surfel );
260 
288  template <typename SCellSet, typename SurfelPredicate >
289  static
290  void trackClosedSurface( SCellSet & surface,
291  const KSpace & K,
292  const SurfelAdjacency<KSpace::dimension> & surfel_adj,
293  const SurfelPredicate & pp,
294  const SCell & start_surfel );
295 
296 
329  template <typename PointPredicate >
330  static
331  void track2DBoundary( std::vector<SCell> & aSCellContour2D,
332  const KSpace & K,
333  const SurfelAdjacency<KSpace::dimension> & surfel_adj,
334  const PointPredicate & pp,
335  const SCell & start_surfel );
336 
337 
338 
378  template <typename PointPredicate>
379  static
380  void track2DSliceBoundary( std::vector<SCell> & aSCellContour2D,
381  const KSpace & K,
382  const Dimension & trackDir,
383  const SurfelAdjacency<KSpace::dimension> & surfel_adj,
384  const PointPredicate & pp,
385  const SCell & start_surfel );
386 
387 
421  template <typename SurfelPredicate >
422  static
423  void track2DSurface( std::vector<SCell> & aSCellContour,
424  const KSpace & K,
425  const SurfelAdjacency<KSpace::dimension> & surfel_adj,
426  const SurfelPredicate & sp,
427  const SCell & start_surfel );
428 
429 
430 
472  template <typename SurfelPredicate>
473  static
474  void track2DSliceSurface( std::vector<SCell> & aSCellContour,
475  const KSpace & K,
476  const Dimension & trackDir,
477  const SurfelAdjacency<KSpace::dimension> & surfel_adj,
478  const SurfelPredicate & sp,
479  const SCell & start_surfel );
480 
481 
482 
507  template <typename PointPredicate>
508  static
509  void
510  track2DBoundaryPoints( std::vector<Point> & aVectorOfPoints,
511  const KSpace & K,
512  const SurfelAdjacency<KSpace::dimension> & surfel_adj,
513  const PointPredicate & pp,
514  const SCell & start_surfel );
515 
516 
543  template <typename PointPredicate>
544  static
546  ( std::vector< std::vector< Point > > & aVectPointContour2D,
547  const KSpace & aKSpace,
548  const PointPredicate & pp,
549  const SurfelAdjacency<2> &aSAdj );
550 
551 
552 
575  template <typename PointPredicate>
576  static
578  ( std::vector< std::vector<SCell> > & aVectSCellContour2D,
579  const KSpace & aKSpace,
580  const SurfelAdjacency<KSpace::dimension> & aSurfelAdj,
581  const PointPredicate & pp );
582 
583 
611  template <typename PointPredicate >
612  static
614  ( std::vector< std::vector<SCell> > & aVectConnectedSCell,
615  const KSpace & aKSpace,
616  const SurfelAdjacency<KSpace::dimension> & aSurfelAdj,
617  const PointPredicate & pp,
618  bool forceOrientCellExterior=false );
619 
620 
621 
622 
647  template <typename PointPredicate>
648  static
649  void orientSCellExterior(std::vector<SCell> & aVectOfSCell,
650  const KSpace & aKSpace,
651  const PointPredicate & pp );
652 
653 
654 
655 
656 
657 
679  template <typename CellSet, typename PointPredicate >
680  static
681  void uMakeBoundary( CellSet & aBoundary,
682  const KSpace & aKSpace,
683  const PointPredicate & pp,
684  const Point & aLowerBound,
685  const Point & aUpperBound );
686 
708  template <typename SCellSet, typename PointPredicate >
709  static
710  void sMakeBoundary( SCellSet & aBoundary,
711  const KSpace & aKSpace,
712  const PointPredicate & pp,
713  const Point & aLowerBound,
714  const Point & aUpperBound );
715 
740  template <typename OutputIterator, typename PointPredicate >
741  static
742  void uWriteBoundary( OutputIterator & out_it,
743  const KSpace & aKSpace,
744  const PointPredicate & pp,
745  const Point & aLowerBound,
746  const Point & aUpperBound );
747 
772  template <typename OutputIterator, typename PointPredicate >
773  static
774  void sWriteBoundary( OutputIterator & out_it,
775  const KSpace & aKSpace,
776  const PointPredicate & pp,
777  const Point & aLowerBound,
778  const Point & aUpperBound );
779 
780 
781 
782 
783 
784 
785 
786  // ----------------------- Standard services ------------------------------
787  public:
788 
792  ~Surfaces();
793 
794  // ----------------------- Interface --------------------------------------
795  public:
796 
801  void selfDisplay ( std::ostream & out ) const;
802 
807  bool isValid() const;
808 
809  // ------------------------- Protected Datas ------------------------------
810  private:
811  // ------------------------- Private Datas --------------------------------
812  private:
813 
814  // ------------------------- Hidden services ------------------------------
815  protected:
816 
821  Surfaces();
822 
823  private:
824 
830  Surfaces ( const Surfaces & other );
831 
838  Surfaces & operator= ( const Surfaces & other );
839 
840  // ------------------------- Internals ------------------------------------
841  private:
842 
843  }; // end of class Surfaces
844 
845 
852  template <typename TKSpace>
853  std::ostream&
854  operator<< ( std::ostream & out, const Surfaces<TKSpace> & object );
855 
856 } // namespace DGtal
857 
858 
860 // Includes inline functions.
861 #include "DGtal/topology/helpers/Surfaces.ih"
862 
863 // //
865 
866 #endif // !defined Surfaces_h
867 
868 #undef Surfaces_RECURSES
869 #endif // else defined(Surfaces_RECURSES)