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  EntityHandle Copy() const;
71 
72 
73 
75 
76  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  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  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 
253  ResidueHandleList GetResidueList() const;
254 
256  AtomHandleList GetAtomList() const;
257 
259  geom::Vec3List GetAtomPosList(bool ordered_by_index = false) const;
260 
264  XCSEditor EditXCS(EditMode mode=UNBUFFERED_EDIT) const;
265 
269  ICSEditor EditICS(EditMode mode=UNBUFFERED_EDIT) const;
270 
274  EntityHandle GetHandle() const;
275  bool operator==(const EntityHandle& ref) const;
276  bool operator!=(const EntityHandle& ref) const;
277 };
278 
279 }}
280 
281 #endif // OST_ENTITY_HANDLE_HH
282 
std::string String
Definition: base.hh:54
Handle to atom datatype.
Definition: atom_handle.hh:37
float Real
Definition: base.hh:44
axis-aligned cuboid
Protein or molecule.
bool DLLEXPORT_OST_GEOM operator==(const Line2 &l1, const Line2 &l2)
std::vector< ResidueHandle > ResidueHandleList
DLLEXPORT_OST_IMG_BASE bool operator!=(const ImageHandle &lhs, const ConstImageHandle &rhs)
editor for internal molecule coordinates
Definition: ics_editor.hh:34
EntityVisitor interface.
Selection Query.
Definition: query.hh:74
uint QueryFlags
Definition: query.hh:69
basic and essential transformation class, including translation, rotation and center of rotation ...
Definition: transform.hh:39
boost::shared_ptr< EntityImpl > EntityImplPtr
linear chain of residues
Definition: chain_handle.hh:52
Three dimensional vector class, using Real precision.
Definition: vec3.hh:42
external coordinate system editor
Definition: xcs_editor.hh:36
#define DLLEXPORT_OST_MOL
Named torsion (dihedral) angle.
std::vector< BondHandle > BondHandleList
definition of AtomView
Definition: atom_view.hh:34
std::vector< AtomHandle > AtomHandleList
definition of EntityView
Definition: entity_view.hh:86
definition of EntityBase
Definition: entity_base.hh:30
std::vector< ChainHandle > ChainHandleList
boost::shared_ptr< EntityObserver > EntityObserverPtr