IMP  2.0.0
The Integrative Modeling Platform
XplorReaderWriter.h
Go to the documentation of this file.
1 /**
2  * \file IMP/em/XplorReaderWriter.h
3  * \brief Classes to read or write density files in XPLOR format.
4  *
5  * Copyright 2007-2013 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPEM_XPLOR_READER_WRITER_H
10 #define IMPEM_XPLOR_READER_WRITER_H
11 
12 #include <IMP/em/em_config.h>
13 #include "MapReaderWriter.h"
14 #include "DensityHeader.h"
15 #include "internal/XplorHeader.h"
16 #include <math.h>
17 #include <iostream>
18 #include <iomanip>
19 
20 IMPEM_BEGIN_NAMESPACE
21 
22 class IMPEMEXPORT XplorReaderWriter : public MapReaderWriter
23 {
24 #if !defined(DOXYGEN) && !defined(SWIG)
25 public:
26  void read(const char *filename, float **data, DensityHeader &header);
27  void write(const char *filename, const float *data,
28  const DensityHeader &header );
29 protected:
30  int read_header(std::ifstream & XPLORstream, internal::XplorHeader &header);
31  int read_map(std::ifstream &XPLORstream, float *data,
32  internal::XplorHeader &header);
33 #endif
34  IMP_OBJECT_METHODS(XplorReaderWriter);
35 };
36 
37 IMPEM_END_NAMESPACE
38 
39 #endif /* IMPEM_XPLOR_READER_WRITER_H */