OpenStructure
entity_handle.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_ENTITY_HANDLE_HH
20 #define OST_ENTITY_HANDLE_HH
21 
22 #include <ost/mol/module_config.hh>
23 #include <ost/mol/transform.hh>
24 
25 #include "impl/entity_impl_fw.hh"
26 #include "entity_visitor_fw.hh"
27 #include "query.hh"
28 #include "entity_observer_fw.hh"
29 #include "residue_prop.hh"
30 #include "entity_view.hh"
31 #include "chain_handle.hh"
32 #include "handle_type_fw.hh"
33 #include "iterator_fw.hh"
34 
35 
36 #include "editor_type_fw.hh"
37 
38 namespace ost { namespace mol {
39 
42 DLLEXPORT_OST_MOL EntityHandle CreateEntity();
43 
57 public:
58  friend class XCSEditor;
59  friend class ICSEditor;
60 
63 
65  EntityHandle();
66 
67 
69 
70 
71 
72  EntityHandle Copy() const;
73 
74 
75 
77 
78 
79 
80 
81 
82  geom::Vec3 GetCenterOfAtoms() const;
83 
85  Real GetMass() const;
86 
88  geom::Vec3 GetCenterOfMass() const;
89 
90  geom::AlignedCuboid GetBounds() const;
92 
95  void Swap(EntityHandle& eh);
96 
99  void DeepSwap(EntityHandle& eh);
100 
102 
103 
104  void AttachObserver(const EntityObserverPtr&);
105 
106 
108  void DetachObserver(const EntityObserverPtr&);
110 
111 
113  void Apply(EntityVisitor& v);
114 
115 
123  TorsionHandle FindTorsion(const AtomHandle& a1, const AtomHandle& a2,
124  const AtomHandle& a3, const AtomHandle& a4) const;
125 
127  ChainHandleList GetChainList() const;
128 
134  ResidueHandleIter ResiduesBegin() const;
135 
147  ResidueHandleIter ResiduesEnd() const;
148 
150  ChainHandleIter ChainsBegin() const;
151 
153  ChainHandleIter ChainsEnd() const;
154 
156  AtomHandleIter AtomsBegin() const;
157 
159  AtomHandleIter AtomsEnd() const;
160 
162 
163 
164 
165 
166 
167 
168 
169  ChainHandle FindChain(const String& name) const;
170 
186  ResidueHandle FindResidue(const String& chain_name,
187  const ResNum& number) const;
188 
196  AtomHandle FindAtom(const String& chain_name,
197  const ResNum& number,
198  const String& atom_name) const;
200 
202  AtomHandleList FindWithin(const geom::Vec3& pos, Real radius) const;
203 
206  EntityView Select(const Query& q, QueryFlags flags=0) const;
207 
210  EntityView Select(const String& query_string, QueryFlags flags=0) const;
211 
213  EntityView CreateFullView() const;
214 
216  EntityView CreateEmptyView() const;
217 
223  int GetAtomCount() const;
224 
230  int GetResidueCount() const;
231 
233  int GetChainCount() const;
234 
236  int GetBondCount() const;
237 
239  mol::BondHandleList GetBondList() const;
240 
241 
243  Real GetAngle(const AtomHandle& a1, const AtomHandle& a2,
244  const AtomHandle& a3) const;
245 
247  Real GetAngle(const AtomView& a1, const AtomView& a2,
248  const AtomView& a3) const;
249 
250  const geom::Mat4& GetTransformationMatrix() const;
251 
252 
253  const geom::Mat4& GetInvTransformationMatrix() const;
254 
255  bool IsTransformationIdentity() const;
256 
259  ResidueHandleList GetResidueList() const;
260 
263  AtomHandleList GetAtomList() const;
264 
268  XCSEditor EditXCS(EditMode mode=UNBUFFERED_EDIT) const;
269 
273  ICSEditor EditICS(EditMode mode=UNBUFFERED_EDIT) const;
274 
278  EntityHandle GetHandle() const;
279  bool operator==(const EntityHandle& ref) const;
280  bool operator!=(const EntityHandle& ref) const;
281 };
282 
283 }}
284 
285 #endif // OST_ENTITY_HANDLE_HH
286