OpenStructure
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
24 #include "impl/entity_impl_fw.hh"
25 #include "entity_visitor_fw.hh"
26 #include "query.hh"
27 #include "entity_observer_fw.hh"
28 #include "residue_prop.hh"
29 #include "entity_view.hh"
30 #include "chain_handle.hh"
31 #include "handle_type_fw.hh"
32 
33 
34 #include "editor_type_fw.hh"
35 
36 namespace ost { namespace mol {
37 
40 DLLEXPORT_OST_MOL EntityHandle CreateEntity();
41 
55 public:
56  friend class XCSEditor;
57  friend class ICSEditor;
58 
61 
63  EntityHandle();
64 
65 
67 
68 
69 
70  EntityHandle Copy() const;
71 
72 
73 
75 
76 
77 
78 
79 
80  geom::Vec3 GetCenterOfAtoms() const;
81 
83  Real GetMass() const;
84 
86  geom::Vec3 GetCenterOfMass() const;
87 
88  geom::AlignedCuboid GetBounds() const;
90 
93  void Swap(EntityHandle& eh);
94 
97  void DeepSwap(EntityHandle& eh);
98 
100 
101 
102  void AttachObserver(const EntityObserverPtr&);
103 
104 
106  void DetachObserver(const EntityObserverPtr&);
108 
109 
111  void Apply(EntityVisitor& v);
112 
113 
121  TorsionHandle FindTorsion(const AtomHandle& a1, const AtomHandle& a2,
122  const AtomHandle& a3, const AtomHandle& a4) const;
123 
125  ChainHandleList GetChainList() const;
126 
128 
129 
130 
131 
132 
133 
134 
135  ChainHandle FindChain(const String& name) const;
136 
152  ResidueHandle FindResidue(const String& chain_name,
153  const ResNum& number) const;
154 
162  AtomHandle FindAtom(const String& chain_name,
163  const ResNum& number,
164  const String& atom_name) const;
166 
168  AtomHandleList FindWithin(const geom::Vec3& pos, Real radius) const;
169 
173  void SetDefaultQueryFlags(QueryFlags flags);
174 
176  QueryFlags GetDefaultQueryFlags() const;
177 
181  EntityView Select(const Query& q) const;
182 
186  EntityView Select(const String& query_string) const;
187 
190  EntityView Select(const Query& q, QueryFlags flags) const;
191 
194  EntityView Select(const String& query_string, QueryFlags flags) const;
195 
197  EntityView CreateFullView() const;
198 
200  EntityView CreateEmptyView() const;
201 
207  int GetAtomCount() const;
208 
214  int GetResidueCount() const;
215 
217  int GetChainCount() const;
218 
220  int GetBondCount() const;
221 
223  mol::BondHandleList GetBondList() const;
224 
225 
227  Real GetAngle(const AtomHandle& a1, const AtomHandle& a2,
228  const AtomHandle& a3) const;
229 
231  Real GetAngle(const AtomView& a1, const AtomView& a2,
232  const AtomView& a3) const;
233 
235  geom::Mat4 GetTransformationMatrix() const;
237  geom::Mat4 GetInvTransformationMatrix() const;
239  bool IsTransformationIdentity() const;
240 
242  geom::Transform GetTransform() const;
244  void SetTransform(const geom::Transform& t);
246  bool HasTransform() const;
248  void ClearTransform();
250  void FixTransform();
251 
254  ResidueHandleList GetResidueList() const;
255 
258  AtomHandleList GetAtomList() const;
259 
261  geom::Vec3List GetAtomPosList(bool ordered_by_index = false) const;
262 
266  XCSEditor EditXCS(EditMode mode=UNBUFFERED_EDIT) const;
267 
271  ICSEditor EditICS(EditMode mode=UNBUFFERED_EDIT) const;
272 
276  EntityHandle GetHandle() const;
277  bool operator==(const EntityHandle& ref) const;
278  bool operator!=(const EntityHandle& ref) const;
279 };
280 
281 }}
282 
283 #endif // OST_ENTITY_HANDLE_HH
284