OpenStructure
editor_base.hh
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 // This file is part of the OpenStructure project <www.openstructure.org>
3 //
4 // Copyright (C) 2008-2011 by the OpenStructure authors
5 //
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License as published by the Free
8 // Software Foundation; either version 3.0 of the License, or (at your option)
9 // any later version.
10 // This library is distributed in the hope that it will be useful, but WITHOUT
11 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13 // details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with this library; if not, write to the Free Software Foundation, Inc.,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 //------------------------------------------------------------------------------
19 #ifndef OST_EDITOR_BASE_HS
20 #define OST_EDITOR_BASE_HS
21 /*
22  Author: Marco Biasini
23  */
24 
25 #include <ost/mol/module_config.hh>
26 
27 #include <ost/geom/geom.hh>
28 
29 #include "entity_handle.hh"
30 #include "residue_prop.hh"
31 #include "editor_type_fw.hh"
32 
33 namespace ost { namespace mol {
34 
47 public:
58  ChainHandle InsertChain(const String& chain_name);
59 
75  ResidueHandle AppendResidue(ChainHandle chain, const ResidueKey& k);
76 
77  ResidueHandle AppendResidue(ChainHandle chain, const ResidueKey& k,
78  const ResNum& num);
94  ResidueHandle InsertResidueBefore(ChainHandle chain, int index,
95  const ResNum& num,
96  const ResidueKey& k);
102  ResidueHandle InsertResidueAfter(ChainHandle chain, int index,
103  const ResNum& num,
104  const ResidueKey& k);
105 
107 
108 
109 
110 
111 
112 
113 
114 
115 
116 
117 
118  AtomHandle InsertAtom(ResidueHandle residue, const String& name,
119  const geom::Vec3& pos, const String& ele="",
120  Real occupancy=1.0, Real b_factor=0.0,
121  bool is_hetatm=false);
122 
125  AtomHandle InsertAltAtom(ResidueHandle residue, const String& name,
126  const String& alt_group, const geom::Vec3& pos,
127  const String& ele="");
138  void AddAltAtomPos(const String& group, const AtomHandle& atom,
139  const geom::Vec3& position);
140  //\}
141 
146  BondHandle Connect(const AtomHandle& first, const AtomHandle& second);
147  BondHandle Connect(const AtomHandle& first, const AtomHandle& second,
148  unsigned char bond_order);
149  BondHandle Connect(const AtomHandle& first, const AtomHandle& second,
150  Real len, Real theta, Real phi);
151  BondHandle Connect(const AtomHandle& first, const AtomHandle& second,
152  Real len, Real theta, Real phi,
153  unsigned char bond_order);
154 
155  void RenameChain(ChainHandle chain, const String& new_name);
159  void DeleteAllAtoms(ResidueHandle res);
160 
168  void DeleteAtom(const AtomHandle& atom);
169 
171  TorsionHandle AddTorsion(const String& name, const AtomHandle& a1,
172  const AtomHandle& a2, const AtomHandle& a3,
173  const AtomHandle& a4);
177  void DeleteChain(const ChainHandle& chain);
178 
184  void DeleteResidue(const ResidueHandle& residue_handle);
185 
187  void ReorderResidues(const ChainHandle& chain);
188 
190  void ReorderAllResidues();
191 
193  EditMode GetMode() const;
194 
196  void RenameAtom(AtomHandle atom, const String& new_name);
197 protected:
198  EditorBase(const EntityHandle& ent, EditMode mode);
199  void UpdateTrace();
202 };
203 
204 }} //ns
205 
206 #endif