IMP  2.3.1
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-2014 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 /** Reader/Writer for xplor files. */
23 class IMPEMEXPORT XplorReaderWriter : public MapReaderWriter {
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 
30  protected:
31  int read_header(std::ifstream &XPLORstream, internal::XplorHeader &header);
32  int read_map(std::ifstream &XPLORstream, float *data,
33  internal::XplorHeader &header);
34 #endif
36 };
37 
38 IMPEM_END_NAMESPACE
39 
40 #endif /* IMPEM_XPLOR_READER_WRITER_H */
Declare an efficient stl-compatible map.
The base class to handle reading and writing of density maps.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition: object_macros.h:25
Metadata for a density file.
DensityMap * read_map(std::string filename, MapReaderWriter *reader)
Read a density map from a file and return it.
An abstract class for reading a map.