]> Creatis software - cpMesh.git/blob - lib/cpm/IO/MeshReader.h
2096ae3599719b96d192086eff60b0e561cb0bf5
[cpMesh.git] / lib / cpm / IO / MeshReader.h
1 #ifndef __CPM__IO__MESHREADER__H__
2 #define __CPM__IO__MESHREADER__H__
3
4 #include <string>
5 #include <itkMeshSource.h>
6
7 namespace cpm
8 {
9   namespace IO
10   {
11     /**
12      */
13     template< typename M >
14     class MeshReader
15       : public itk::MeshSource< M >
16     {
17     public:
18       typedef MeshReader                      Self;
19       typedef itk::MeshSource< M >            Superclass;
20       typedef itk::SmartPointer< Self >       Pointer;
21       typedef itk::SmartPointer< const Self > ConstPointer;
22
23       typedef M MeshType;
24
25     public:
26       itkNewMacro( Self );
27       itkTypeMacro( MeshReader, itkMeshSource );
28
29       itkSetStringMacro( FileName );
30       itkGetStringMacro( FileName );
31
32     public:
33       virtual itk::ModifiedTimeType GetMTime( ) const;
34
35     protected:
36       MeshReader( );
37       virtual ~MeshReader( );
38
39       virtual void GenerateData( );
40
41       template< class R >
42       void _Read( );
43
44     private:
45       // Purposely not implemented
46       MeshReader( const Self& );
47       Self& operator=( const Self & );
48
49     protected:
50       typename Superclass::Pointer m_Reader;
51       std::string m_FileName;
52     };
53
54   } // ecapseman
55
56 } // ecapseman
57
58 #include <cpm/IO/MeshReader.hxx>
59
60 #endif // __CPM__IO__MESHREADER__H__
61
62 // eof - $RCSfile$