Victor
 All Data Structures Functions Variables Friends Pages
XyzSaver.h
1 /* This file is part of Victor.
2 
3  Victor is free software: you can redistribute it and/or modify
4  it under the terms of the GNU General Public License as published by
5  the Free Software Foundation, either version 3 of the License, or
6  (at your option) any later version.
7 
8  Victor is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  GNU General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License
14  along with Victor. If not, see <http://www.gnu.org/licenses/>.
15  */
16 
17 #ifndef _XYZ_SAVER_H_
18 #define _XYZ_SAVER_H_
19 
20 // Includes:
21 #include <Group.h>
22 #include <SideChain.h>
23 #include <AminoAcid.h>
24 #include <Spacer.h>
25 #include <Ligand.h>
26 #include <Saver.h>
27 #include <Debug.h>
28 #include <string>
29 #include <iostream>
30 
31 // Global constants, typedefs, etc. (to avoid):
32 
33 namespace Victor { namespace Biopool {
34 
42  class XyzSaver : public Saver {
43  public:
44 
45  // CONSTRUCTORS/DESTRUCTOR:
46 
47  XyzSaver(ostream& _output = cout, int _offset = 1)
48  : output(_output), delimit(true), offset(_offset) {
49  }
50  // this class uses the implicit copy operator.
51 
52  virtual ~XyzSaver() {
53  PRINT_NAME;
54  }
55 
56  // MODIFIERS:
57  virtual void saveGroup(Group& gr);
58  virtual void saveSideChain(SideChain& sc);
59  virtual void saveAminoAcid(AminoAcid& aa);
60  virtual void saveSpacer(Spacer& sp);
61  virtual void saveLigand(Ligand& l);
62 
63  void setDelimit(bool _d) {
64  delimit = _d;
65  }
66 
67  protected:
68  virtual void pSaveAtomVector(vector<Atom>& va);
69 
70  private:
71  ostream& output; // output stream
72  bool delimit; // write delimiters ("aminoacid", "sidechain", etc.)
73  int offset; // ID offset for saving (optional)
74  };
75 }}
76 #endif //_XYZ_SAVER_H_
virtual void saveSideChain(SideChain &sc)
Definition: XyzSaver.cc:53
Base class for saving components (Atoms, Groups, etc.).
Definition: Saver.h:39
This class implements a side chain.
Definition: SideChain.h:32
Saves components (Atoms, Groups, etc.) in carthesian format.
Definition: XyzSaver.h:42
This class implements a simple chemical group.
Definition: Group.h:35
virtual void saveSpacer(Spacer &sp)
Definition: XyzSaver.cc:83
virtual void saveGroup(Group &gr)
Definition: XyzSaver.cc:40
Implements methods to verify the ligand properties.
Definition: Ligand.h:38
It mplements a simple amino acid.
Definition: AminoAcid.h:43
virtual void saveAminoAcid(AminoAcid &aa)
Definition: XyzSaver.cc:66
Implements a "Spacer" for a protein chain. Includes methods to obtain values from the atoms and its p...
Definition: Spacer.h:42
virtual void pSaveAtomVector(vector< Atom > &va)
Definition: XyzSaver.cc:113