DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
VolWriter.h
1 
17 #pragma once
18 
31 #if defined(VolWriter_RECURSES)
32 #error Recursive header files inclusion detected in VolWriter.h
33 #else // defined(VolWriter_RECURSES)
34 
35 #define VolWriter_RECURSES
36 
37 #if !defined VolWriter_h
38 
39 #define VolWriter_h
40 
42 // Inclusions
43 #include <iostream>
44 #include <string>
45 #include <boost/static_assert.hpp>
46 #include <boost/type_traits.hpp>
47 #include "DGtal/base/Common.h"
48 #include "DGtal/base/CUnaryFunctor.h"
49 #include "DGtal/base/BasicFunctors.h"
51 
52 namespace DGtal
53 {
54 
56  // template class VolWriter
67  template <typename TImage, typename TFunctor = DefaultFunctor>
68  struct VolWriter
69  {
70  // ----------------------- Standard services ------------------------------
71  typedef TImage Image;
72  typedef typename TImage::Value Value;
73  typedef TFunctor Functor;
74 
76  BOOST_STATIC_ASSERT(TImage::Domain::dimension == 3);
77 
86  static bool exportVol(const std::string & filename, const Image &aImage,
87  const Functor & aFunctor = Functor()) throw(DGtal::IOException);
88  };
89 }//namespace
90 
92 // Includes inline functions.
93 #include "DGtal/io/writers/VolWriter.ih"
94 
95 // //
97 
98 #endif // !defined VolWriter_h
99 
100 #undef VolWriter_RECURSES
101 #endif // else defined(VolWriter_RECURSES)