IMP logo
IMP Reference Guide  2.16.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-2021 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,
27  DensityHeader &header) IMP_OVERRIDE;
28 
29  void write(const char *filename, const float *data,
30  const DensityHeader &header) IMP_OVERRIDE;
31 
32  protected:
33  int read_header(std::ifstream &XPLORstream, internal::XplorHeader &header);
34  int read_map(std::ifstream &XPLORstream, float *data,
35  internal::XplorHeader &header);
36 #endif
38 };
39 
40 IMPEM_END_NAMESPACE
41 
42 #endif /* IMPEM_XPLOR_READER_WRITER_H */
Helper functions to check for NaN or infinity.
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.
An abstract class for reading a map.
#define IMP_OVERRIDE
Cause a compile error if this method does not override a parent method.