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-2020 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 
41 
55 public:
56  friend class XCSEditor;
57  friend class ICSEditor;
58 
61 
64 
65 
67  EntityHandle Copy() const;
71 
72 
73 
75 
76  geom::Vec3 GetCenterOfAtoms() const;
81 
83  Real GetMass() const;
84 
87 
90 
93  void Swap(EntityHandle& eh);
94 
98 
100 
101  void AttachObserver(const EntityObserverPtr&);
103 
104 
108 
109 
112 
113 
122  const AtomHandle& a3, const AtomHandle& a4) const;
123 
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 
174 
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 
198 
201 
207  int GetAtomCount() const;
208 
214  int GetResidueCount() const;
215 
217  int GetChainCount() const;
218 
220  int GetBondCount() const;
221 
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 
240 
246  bool HasTransform() const;
250  void FixTransform();
251 
254 
257 
259  geom::Vec3List GetAtomPosList(bool ordered_by_index = false) const;
260 
265 
270 
275 
276  unsigned long GetHashCode() const;
277 
278  bool operator==(const EntityHandle& ref) const;
279  bool operator!=(const EntityHandle& ref) const;
280 };
281 
282 }}
283 
284 #endif // OST_ENTITY_HANDLE_HH
285 
axis-aligned cuboid
basic and essential transformation class, including translation, rotation and center of rotation
Definition: transform.hh:39
Three dimensional vector class, using Real precision.
Definition: vec3.hh:48
Handle to atom datatype.
Definition: atom_handle.hh:37
definition of AtomView
Definition: atom_view.hh:34
linear chain of residues
Definition: chain_handle.hh:52
definition of EntityBase
Definition: entity_base.hh:31
Protein or molecule.
XCSEditor EditXCS(EditMode mode=UNBUFFERED_EDIT) const
Get editor for external coordinate system to manipulate atom positions.
EntityView Select(const Query &q, QueryFlags flags) const
return view based on a query object, specifying behavior flags
EntityHandle(const impl::EntityImplPtr &)
internally used ctor
bool HasTransform() const
checks whether a transform has been set
EntityView CreateFullView() const
return a (new) full view of this entity
EntityHandle()
default ctor. creates invalid handle.
TorsionHandle FindTorsion(const AtomHandle &a1, const AtomHandle &a2, const AtomHandle &a3, const AtomHandle &a4) const
Search a specific torsion.
EntityView Select(const String &query_string) const
return view based on query String.
void SetDefaultQueryFlags(QueryFlags flags)
set default query flags these will be used if flags are not explicitely specified as a second argumen...
void ClearTransform()
remove transform
bool operator==(const EntityHandle &ref) const
geom::Vec3List GetAtomPosList(bool ordered_by_index=false) const
get complete list of atom positions
void FixTransform()
write transformed pos to orig, and the clear tf
ResidueHandle FindResidue(const String &chain_name, const ResNum &number) const
Real GetMass() const
Get entity's mass.
DLLEXPORT_OST_MOL EntityHandle CreateEntity()
create entity
geom::Transform GetTransform() const
retrieve transformation of this entity
void SetTransform(const geom::Transform &t)
set transformation that will affect this entity
ICSEditor EditICS(EditMode mode=UNBUFFERED_EDIT) const
Get editor for the internal coordinate system to manipulate torsions bond lengths and angles between ...
void Swap(EntityHandle &eh)
swaps implementations on the entity handle level
EntityView CreateEmptyView() const
return a (new) empty view of this entity
AtomHandle FindAtom(const String &chain_name, const ResNum &number, const String &atom_name) const
geom::AlignedCuboid GetBounds() const
void DeepSwap(EntityHandle &eh)
ChainHandleList GetChainList() const
Get list of chains.
bool operator!=(const EntityHandle &ref) const
int GetAtomCount() const
Get number of atoms of this entity.
geom::Vec3 GetCenterOfMass() const
Get entity's center of mass (mass weighted)
unsigned long GetHashCode() const
EntityView Select(const String &query_string, QueryFlags flags) const
return view based on query String, specifying behavior flags
Real GetAngle(const AtomHandle &a1, const AtomHandle &a2, const AtomHandle &a3) const
Get angle in radians between bonds a1-a2 and a2-a3.
ResidueHandleList GetResidueList() const
get complete list of residues
Real GetAngle(const AtomView &a1, const AtomView &a2, const AtomView &a3) const
Get angle in radians between bonds a1-a2 and a2-a3.
EntityHandle GetHandle() const
get this handle
geom::Mat4 GetTransformationMatrix() const
DEPRECATED.
void Apply(EntityVisitor &v)
visitor interface
mol::BondHandleList GetBondList() const
Get list of bonds.
EntityView Select(const Query &q) const
return view based on a query object
void DetachObserver(const EntityObserverPtr &)
remove observer
AtomHandleList FindWithin(const geom::Vec3 &pos, Real radius) const
use atom hash to perform fast within lookup
geom::Mat4 GetInvTransformationMatrix() const
DEPRECATED.
int GetBondCount() const
Get number of bonds.
int GetResidueCount() const
Get number of residues of this entity.
AtomHandleList GetAtomList() const
get complete list of atoms
int GetChainCount() const
Get number of chains of this entity.
bool IsTransformationIdentity() const
DEPRECATED.
QueryFlags GetDefaultQueryFlags() const
return default query flags
definition of EntityView
Definition: entity_view.hh:86
EntityVisitor interface.
editor for internal molecule coordinates
Definition: ics_editor.hh:34
Selection Query.
Definition: query.hh:74
Named torsion (dihedral) angle.
external coordinate system editor
Definition: xcs_editor.hh:36
float Real
Definition: base.hh:44
std::string String
Definition: base.hh:54
#define DLLEXPORT_OST_MOL
boost::shared_ptr< EntityImpl > EntityImplPtr
std::vector< AtomHandle > AtomHandleList
boost::shared_ptr< EntityObserver > EntityObserverPtr
uint QueryFlags
Definition: query.hh:69
std::vector< BondHandle > BondHandleList
std::vector< ChainHandle > ChainHandleList
std::vector< ResidueHandle > ResidueHandleList
Definition: base.dox:1