OpenStructure
Public Member Functions | Friends | Related Functions
EntityHandle Class Reference

#include <entity_handle.hh>

Inherits EntityBase.

Public Member Functions

 EntityHandle (const impl::EntityImplPtr &)
 
 EntityHandle ()
 
EntityHandle Copy () const
 
Center, Mass and Extent
geom::Vec3 GetCenterOfAtoms () const
 
Real GetMass () const
 
geom::Vec3 GetCenterOfMass () const
 
geom::AlignedCuboid GetBounds () const
 
void Swap (EntityHandle &eh)
 
void DeepSwap (EntityHandle &eh)
 
Observer interface
void AttachObserver (const EntityObserverPtr &)
 
void DetachObserver (const EntityObserverPtr &)
 
void Apply (EntityVisitor &v)
 
TorsionHandle FindTorsion (const AtomHandle &a1, const AtomHandle &a2, const AtomHandle &a3, const AtomHandle &a4) const
 
ChainHandleList GetChainList () const
 
Single item addressing
ChainHandle FindChain (const String &name) const
 
ResidueHandle FindResidue (const String &chain_name, const ResNum &number) const
 
AtomHandle FindAtom (const String &chain_name, const ResNum &number, const String &atom_name) const
 
AtomHandleList FindWithin (const geom::Vec3 &pos, Real radius) const
 
void SetDefaultQueryFlags (QueryFlags flags)
 
QueryFlags GetDefaultQueryFlags () const
 
EntityView Select (const Query &q) const
 
EntityView Select (const String &query_string) const
 
EntityView Select (const Query &q, QueryFlags flags) const
 
EntityView Select (const String &query_string, QueryFlags flags) const
 
EntityView CreateFullView () const
 
EntityView CreateEmptyView () const
 
int GetAtomCount () const
 
int GetResidueCount () const
 
int GetChainCount () const
 
int GetBondCount () const
 
mol::BondHandleList GetBondList () const
 
Real GetAngle (const AtomHandle &a1, const AtomHandle &a2, const AtomHandle &a3) const
 
Real GetAngle (const AtomView &a1, const AtomView &a2, const AtomView &a3) const
 
geom::Mat4 GetTransformationMatrix () const
 
geom::Mat4 GetInvTransformationMatrix () const
 
bool IsTransformationIdentity () const
 
geom::Transform GetTransform () const
 
void SetTransform (const geom::Transform &t)
 
bool HasTransform () const
 
void ClearTransform ()
 
void FixTransform ()
 
ResidueHandleList GetResidueList () const
 
AtomHandleList GetAtomList () const
 
geom::Vec3List GetAtomPosList (bool ordered_by_index=false) const
 
XCSEditor EditXCS (EditMode mode=UNBUFFERED_EDIT) const
 
ICSEditor EditICS (EditMode mode=UNBUFFERED_EDIT) const
 
EntityHandle GetHandle () const
 
unsigned long GetHashCode () const
 
bool operator== (const EntityHandle &ref) const
 
bool operator!= (const EntityHandle &ref) const
 
- Public Member Functions inherited from EntityBase
 EntityBase (const impl::EntityImplPtr &impl)
 
 EntityBase ()
 
const StringGetName () const
 
void SetName (const String &ent_name)
 
 operator bool () const
 
bool IsValid () const
 
impl::EntityImplPtrImpl ()
 
const impl::EntityImplPtrImpl () const
 
- Public Member Functions inherited from GenericPropContainer< EntityBase >
void ClearProps ()
 
void SetStringProp (const String &key, const String &value)
 
void SetFloatProp (const String &key, Real value)
 
void SetIntProp (const String &key, int value)
 
void SetBoolProp (const String &key, bool value)
 
void SetVec3Prop (const String &key, geom::Vec3 value)
 
void RemoveProp (const String &key)
 
- Public Member Functions inherited from ConstGenericPropContainer< H >
bool HasProp (const String &key) const
 
String GetPropAsString (const String &key) const
 
String GetStringProp (const String &key) const
 
Real GetFloatProp (const String &key) const
 
int GetIntProp (const String &key) const
 
bool GetBoolProp (const String &key) const
 
geom::Vec3 GetVec3Prop (const String &key) const
 
String GetStringProp (const String &key, const String &def) const
 
Real GetFloatProp (const String &key, Real def) const
 
int GetIntProp (const String &key, int def) const
 
bool GetBoolProp (const String &key, bool def) const
 
std::map< String, GenericPropValueGetPropMap () const
 
std::vector< StringGetPropList () const
 

Friends

class XCSEditor
 
class ICSEditor
 

Related Functions

(Note that these are not member functions.)

DLLEXPORT_OST_MOL EntityHandle CreateEntity ()
 

Additional Inherited Members

- Protected Member Functions inherited from EntityBase
GenericPropContainerImplGpImpl ()
 
const GenericPropContainerImplGpImpl () const
 
void CheckValidity () const
 
- Protected Member Functions inherited from ConstGenericPropContainer< H >
template<typename T >
gp_get (const String &key) const
 
template<typename T >
gp_get (const String &key, const T &def) const
 
GenericPropContainerImplGetImpl ()
 
const GenericPropContainerImplGetImpl () const
 

Detailed Description

Protein or molecule.

Molecules such as proteins and ligands are all represented as entities in OpenStructure. To work with subsets of atoms, residues, chains and bonds, refer to EntityView

Entities consist of zero or more chains of residues. The interface of entities is tailored to proteins, but is not limited to that. An entity may also represent a ligand or a collection of water molecules - hence the rather generic name. A new, empty entity is created with CreateEntity(). Atoms, residues, chains and bonds are added,removed or manipulated via editors.

Definition at line 54 of file entity_handle.hh.

Constructor & Destructor Documentation

◆ EntityHandle() [1/2]

internally used ctor

◆ EntityHandle() [2/2]

default ctor. creates invalid handle.

Member Function Documentation

◆ Apply()

void Apply ( EntityVisitor v)

visitor interface

◆ AttachObserver()

void AttachObserver ( const EntityObserverPtr )

attach observer

◆ ClearTransform()

void ClearTransform ( )

remove transform

◆ Copy()

EntityHandle Copy ( ) const

copy entity, effectively duplicating the whole data structure

Alternative atom positions are not handled at all!

◆ CreateEmptyView()

EntityView CreateEmptyView ( ) const

return a (new) empty view of this entity

◆ CreateFullView()

EntityView CreateFullView ( ) const

return a (new) full view of this entity

◆ DeepSwap()

void DeepSwap ( EntityHandle eh)

deep swaps the implementations, effectively affecting all entity handles that point to either

◆ DetachObserver()

void DetachObserver ( const EntityObserverPtr )

remove observer

◆ EditICS()

ICSEditor EditICS ( EditMode  mode = UNBUFFERED_EDIT) const

Get editor for the internal coordinate system to manipulate torsions bond lengths and angles between bonds.

See also
editors

◆ EditXCS()

XCSEditor EditXCS ( EditMode  mode = UNBUFFERED_EDIT) const

Get editor for external coordinate system to manipulate atom positions.

See also
editors

◆ FindAtom()

AtomHandle FindAtom ( const String chain_name,
const ResNum number,
const String atom_name 
) const

◆ FindChain()

ChainHandle FindChain ( const String name) const

Find chain by name.

Find chain within this entity with given name.

See also
IsValid, FindResidue, FindAtom
Returns
The found chain, or an invalid chain handle if no such chain exists

◆ FindResidue()

ResidueHandle FindResidue ( const String chain_name,
const ResNum number 
) const

◆ FindTorsion()

TorsionHandle FindTorsion ( const AtomHandle a1,
const AtomHandle a2,
const AtomHandle a3,
const AtomHandle a4 
) const

Search a specific torsion.

The order of atoms is important. For the torsion to exist, it must have been added before via AddTorsion.

Returns
the torsion or an invalid torsion handle if the torsion could not be found
See also
DihedralAngle, SetDihedralAngle

◆ FindWithin()

AtomHandleList FindWithin ( const geom::Vec3 pos,
Real  radius 
) const

use atom hash to perform fast within lookup

◆ FixTransform()

void FixTransform ( )

write transformed pos to orig, and the clear tf

◆ GetAngle() [1/2]

Real GetAngle ( const AtomHandle a1,
const AtomHandle a2,
const AtomHandle a3 
) const

Get angle in radians between bonds a1-a2 and a2-a3.

◆ GetAngle() [2/2]

Real GetAngle ( const AtomView a1,
const AtomView a2,
const AtomView a3 
) const

Get angle in radians between bonds a1-a2 and a2-a3.

◆ GetAtomCount()

int GetAtomCount ( ) const

Get number of atoms of this entity.

To count the atoms of a specific chain or residue, use the respective method of ChainHandle and ResidueHandle.

See also
ResidueHandle::GetAtomCount, ChainHandle::GetAtomCount, GetResidueCount

◆ GetAtomList()

AtomHandleList GetAtomList ( ) const

get complete list of atoms

◆ GetAtomPosList()

geom::Vec3List GetAtomPosList ( bool  ordered_by_index = false) const

get complete list of atom positions

◆ GetBondCount()

int GetBondCount ( ) const

Get number of bonds.

◆ GetBondList()

mol::BondHandleList GetBondList ( ) const

Get list of bonds.

◆ GetBounds()

geom::AlignedCuboid GetBounds ( ) const

◆ GetCenterOfAtoms()

geom::Vec3 GetCenterOfAtoms ( ) const

Get entity's center of atoms (not mass weighted)

Returns the center of all the atoms in an entity. This is similar to GetCenterOfMass(), but the atoms are not mass weighted

◆ GetCenterOfMass()

geom::Vec3 GetCenterOfMass ( ) const

Get entity's center of mass (mass weighted)

◆ GetChainCount()

int GetChainCount ( ) const

Get number of chains of this entity.

◆ GetChainList()

ChainHandleList GetChainList ( ) const

Get list of chains.

◆ GetDefaultQueryFlags()

QueryFlags GetDefaultQueryFlags ( ) const

return default query flags

◆ GetHandle()

EntityHandle GetHandle ( ) const

get this handle

Useful for templated code and duck-typing in Python

◆ GetHashCode()

unsigned long GetHashCode ( ) const

◆ GetInvTransformationMatrix()

geom::Mat4 GetInvTransformationMatrix ( ) const

DEPRECATED.

◆ GetMass()

Real GetMass ( ) const

Get entity's mass.

◆ GetResidueCount()

int GetResidueCount ( ) const

Get number of residues of this entity.

To count the atoms of a chain, use the GetResidueCount() of ChainHandle.

See also
GetAtomCount, ChainHandle::GetResidueCount

◆ GetResidueList()

ResidueHandleList GetResidueList ( ) const

get complete list of residues

◆ GetTransform()

geom::Transform GetTransform ( ) const

retrieve transformation of this entity

◆ GetTransformationMatrix()

geom::Mat4 GetTransformationMatrix ( ) const

DEPRECATED.

◆ HasTransform()

bool HasTransform ( ) const

checks whether a transform has been set

◆ IsTransformationIdentity()

bool IsTransformationIdentity ( ) const

DEPRECATED.

◆ operator!=()

bool operator!= ( const EntityHandle ref) const

◆ operator==()

bool operator== ( const EntityHandle ref) const

◆ Select() [1/4]

EntityView Select ( const Query q) const

return view based on a query object

See also
Query The default query flags will be used for the selection

◆ Select() [2/4]

EntityView Select ( const Query q,
QueryFlags  flags 
) const

return view based on a query object, specifying behavior flags

See also
Query

◆ Select() [3/4]

EntityView Select ( const String query_string) const

return view based on query String.

See also
Query The default query flags will be used for the selection

◆ Select() [4/4]

EntityView Select ( const String query_string,
QueryFlags  flags 
) const

return view based on query String, specifying behavior flags

See also
Query

◆ SetDefaultQueryFlags()

void SetDefaultQueryFlags ( QueryFlags  flags)

set default query flags these will be used if flags are not explicitely specified as a second argument to a Select call

◆ SetTransform()

void SetTransform ( const geom::Transform t)

set transformation that will affect this entity

◆ Swap()

void Swap ( EntityHandle eh)

swaps implementations on the entity handle level

Friends And Related Function Documentation

◆ CreateEntity()

DLLEXPORT_OST_MOL EntityHandle CreateEntity ( )
related

create entity

◆ ICSEditor

friend class ICSEditor
friend

Definition at line 57 of file entity_handle.hh.

◆ XCSEditor

friend class XCSEditor
friend

Definition at line 56 of file entity_handle.hh.


The documentation for this class was generated from the following file: