OpenStructure
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
void Swap (EntityHandle &eh)
void DeepSwap (EntityHandle &eh)
void Apply (EntityVisitor &v)
TorsionHandle FindTorsion (const AtomHandle &a1, const AtomHandle &a2, const AtomHandle &a3, const AtomHandle &a4) const
ChainHandleList GetChainList () const
ResidueHandleIter ResiduesBegin () const
ResidueHandleIter ResiduesEnd () const
ChainHandleIter ChainsBegin () const
ChainHandleIter ChainsEnd () const
AtomHandleIter AtomsBegin () const
AtomHandleIter AtomsEnd () 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 ()
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
bool operator== (const EntityHandle &ref) const
bool operator!= (const EntityHandle &ref) const
Center, Mass and Extent
geom::Vec3 GetCenterOfAtoms () const
Real GetMass () const
geom::Vec3 GetCenterOfMass () const
geom::AlignedCuboid GetBounds () const
Observer interface
void AttachObserver (const EntityObserverPtr &)
void DetachObserver (const EntityObserverPtr &)
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
- 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 RemoveProp (const String &key)
- Public Member Functions inherited from ConstGenericPropContainer< EntityBase >
bool HasProp (const String &key) const
String GetPropAsString (const String &key) const
String GetStringProp (const String &key) const
String GetStringProp (const String &key, const String &def) const
Real GetFloatProp (const String &key) const
Real GetFloatProp (const String &key, Real def) const
int GetIntProp (const String &key) const
int GetIntProp (const String &key, int def) const
bool GetBoolProp (const String &key) const
bool GetBoolProp (const String &key, bool def) const
std::map< String,
GenericPropValue
GetPropMap () 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

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 55 of file entity_handle.hh.


Constructor & Destructor Documentation

internally used ctor

default ctor. creates invalid handle.


Member Function Documentation

void Apply ( EntityVisitor v)

visitor interface

AtomHandleIter AtomsBegin ( ) const

Iterator pointing to the beginning of atoms.

AtomHandleIter AtomsEnd ( ) const

Iterator pointing to the end of atoms.

void AttachObserver ( const EntityObserverPtr )

attach observer

ChainHandleIter ChainsBegin ( ) const

Iterator pointing to the beginning of the chains.

ChainHandleIter ChainsEnd ( ) const

Iterator pointing to the end of the chains.

void ClearTransform ( )

remove transform

EntityHandle Copy ( ) const

copy entity, effectively duplicating the whole data structure

Alternative atom positions are not handled at all!

EntityView CreateEmptyView ( ) const

return a (new) empty view of this entity

EntityView CreateFullView ( ) const

return a (new) full view of this entity

void DeepSwap ( EntityHandle eh)

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

void DetachObserver ( const EntityObserverPtr )

remove observer

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
XCSEditor EditXCS ( EditMode  mode = UNBUFFERED_EDIT) const

Get editor for external coordinate system to manipulate atom positions.

See also:
editors
AtomHandle FindAtom ( const String chain_name,
const ResNum number,
const String atom_name 
) const
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
ResidueHandle FindResidue ( const String chain_name,
const ResNum number 
) const
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
AtomHandleList FindWithin ( const geom::Vec3 pos,
Real  radius 
) const

use atom hash to perform fast within lookup

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

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

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

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

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
AtomHandleList GetAtomList ( ) const

get complete list of atoms

See also:
AtomsBegin, AtomsEnd
geom::Vec3List GetAtomPosList ( bool  ordered_by_index = false) const

get complete list of atom positions

int GetBondCount ( ) const

Get number of bonds.

mol::BondHandleList GetBondList ( ) const

Get list of bonds.

geom::AlignedCuboid GetBounds ( ) const
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

geom::Vec3 GetCenterOfMass ( ) const

Get entity's center of mass (mass weighted)

int GetChainCount ( ) const

Get number of chains of this entity.

ChainHandleList GetChainList ( ) const

Get list of chains.

QueryFlags GetDefaultQueryFlags ( ) const

return default query flags

EntityHandle GetHandle ( ) const

get this handle

Useful for templated code and duck-typing in Python

geom::Mat4 GetInvTransformationMatrix ( ) const

DEPRECATED.

Real GetMass ( ) const

Get entity's mass.

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
ResidueHandleList GetResidueList ( ) const

get complete list of residues

See also:
ResiduesBegin, ResiduesEnd
geom::Transform GetTransform ( ) const

retrieve transformation of this entity

geom::Mat4 GetTransformationMatrix ( ) const

DEPRECATED.

bool HasTransform ( ) const

checks whether a transform has been set

bool IsTransformationIdentity ( ) const

DEPRECATED.

bool operator!= ( const EntityHandle ref) const
bool operator== ( const EntityHandle ref) const
ResidueHandleIter ResiduesBegin ( ) const

Iterator pointing to the beginning of the residues.

The residues are first ordered by chain and then ascending residue number.

Note:
The residue range is not fail-safe. If residues are removed or the iterators become invalid and the behaviour undefined.
ResidueHandleIter ResiduesEnd ( ) const

Iterator pointing to the end of th residues.

 The two iterators returned by ResiduesBegin() and ResiduesEnd() form a
 half-closed range. It is cheaper to cache the iterator returned by
 ResiduesEnd() than to call ResiduesEnd() after every loop, i.e. like
 @code 

// e is an instance of EntityHandle for (ResidueHandleIter i=e.ResiduesBegin(), x=e.ResiduesEnd(); i!=x; ++i) { . . . }

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
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
EntityView Select ( const Query q,
QueryFlags  flags 
) const

return view based on a query object, specifying behavior flags

See also:
Query
EntityView Select ( const String query_string,
QueryFlags  flags 
) const

return view based on query String, specifying behavior flags

See also:
Query
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

void SetTransform ( const geom::Transform t)

set transformation that will affect this entity

void Swap ( EntityHandle eh)

swaps implementations on the entity handle level


Friends And Related Function Documentation

DLLEXPORT_OST_MOL EntityHandle CreateEntity ( )
related

create entity

friend class ICSEditor
friend

Definition at line 58 of file entity_handle.hh.

friend class XCSEditor
friend

Definition at line 57 of file entity_handle.hh.


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