Pteros  2.0
Molecular modeling library for human beings!
pdb_file.h
1 /*
2  *
3  * This source code is part of
4  * ******************
5  * *** Pteros ***
6  * ******************
7  * molecular modeling library
8  *
9  * Copyright (c) 2009-2013, Semen Yesylevskyy
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of Artistic License:
13  *
14  * Please note, that Artistic License is slightly more restrictive
15  * then GPL license in terms of distributing the modified versions
16  * of this software (they should be approved first).
17  * Read http://www.opensource.org/licenses/artistic-license-2.0.php
18  * for details. Such license fits scientific software better then
19  * GPL because it prevents the distribution of bugged derivatives.
20  *
21 */
22 
23 // Remove this define to use internal PDB reader.
24 /*
25 Internal reader is currently broken!
26 On write very large files fail to align coordinate records correctly
27 For now VMD molfile plugin is used for PDB files
28 */
29 
30 #define VMD_PDB
31 
32 #ifndef PDB_FILE_H
33 #define PDB_FILE_H
34 
35 #include "vmd_molfile_plugin_wrapper.h"
36 
37 namespace pteros {
38 
39 #ifdef VMD_PDB
40 
43 public:
44 
45  PDB_file(std::string& fname);
46 
47  virtual Mol_file_content get_content_type() const {
48  return MFC_ATOMS | MFC_COORD;
49  }
50 
51 };
52 
53 
54 #else
55 // Use internal PDB reader
56 
57 // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1
58 This implementation is currently broken!
59 On write very large files fail to align coordinate records correctly
60 For now VMD molfile plugin is used for PDB files
61 // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1
62 
63 class PDB_file: public Mol_file {
64 public:
65 
66  PDB_file(std::string fname, char open_mode);
67  ~PDB_file();
68 
69  virtual bool do_read(System *sys, Frame *frame, Mol_file_content what);
70  virtual void do_write(Selection &sel, Mol_file_content what);
71 
72  virtual Mol_file_content get_content_type(){
73  Mol_file_content c;
74  c.structure = true;
75  c.coordinates = true;
76  return c;
77  }
78 
79 protected:
80  std::fstream f;
81 };
82 
83 #endif
84 
85 }
86 #endif /* MOL_FILE_H */
Definition of single trajectory frame.
Definition: system.h:67
Pteros namespace.
Definition: options.cpp:32
The system of atoms.
Definition: system.h:95
void write(const Selection &sel, const Mol_file_content &what)
Write data from selection specidied by what.
Definition: mol_file.cpp:52
Selection class.
Definition: atom_proxy.h:57
Use VMD plugin for PDB.
Definition: pdb_file.h:42
Generic API for reading and writing any molecule file formats.
Definition: vmd_molfile_plugin_wrapper.h:35
Generic API for reading and writing any molecule file formats.
Definition: mol_file.h:43
virtual Mol_file_content get_content_type() const
Reports content of this file type.
Definition: pdb_file.h:47