OpenStructure
|
#include <entity_view.hh>
Inherits EntityBase.
Protected Member Functions | |
void | AddAtomInternal (const AtomView &av) |
void | RemoveAtomInternal (const AtomView &av) |
Protected Member Functions inherited from EntityBase | |
GenericPropContainerImpl * | GpImpl () |
const GenericPropContainerImpl * | GpImpl () const |
void | CheckValidity () const |
Friends | |
class | AtomView |
class | ResidueView |
Related Functions | |
(Note that these are not member functions.) | |
EntityView DLLEXPORT_OST_MOL | Union (const EntityView &ev1, const EntityView &ev2) |
EntityView DLLEXPORT_OST_MOL | Difference (const EntityView &ev1, const EntityView &ev2) |
EntityView DLLEXPORT_OST_MOL | Intersection (const EntityView &ev1, const EntityView &ev2) |
EntityView DLLEXPORT_OST_MOL | CreateViewFromAtomList (const AtomHandleList &atoms) |
EntityView DLLEXPORT_OST_MOL | CreateViewFromAtomList (const AtomViewList &atoms) |
definition of EntityView
Views are very widely used as an input to algorithms and the link between graphical objects and entities.
Views point to the same data as their corresponding handle classes. When modifying and entity, such as applying a coordinate transform to the atoms, these changes will also be reflected in the views.
The entity - chain -residue - atom hierarchy of the entity handles is replicated in the views, the most important difference being that not all atoms, residues and chains present in the entity must be present in the view. One can think of the views as a selection.
Views can be assembled in several different ways: To create a full view containing all the atoms, residues, chains and bonds of the entity, use EntityHandle::CreateFullView(), an empty view containing basically nothing is created with EntityHandle::CreateEmptyView().
Elements can be added with EntitView::AddAtom(), EntityView::AddResidue(), EntityView::AddChain(). The behaviour of these methods is influenced by a combination of ViewAddFlag. Note that none of the add methods insert bonds. Bonds can be added with EntityView::AddAllInclusiveBonds() or manually with EntityView::AddBond(). The elements can be removed with EntityView::RemoveChain(), EntityView::RemoveResidue() and EntityView::RemoveAtom().
A very convenient way to create views is with so-called Query query statements. The queries are executed via EntityHandle::Select() and EntityView::Select().
Two views can be combined by applying boolean operators such as Union(), Intersection() and Difference().
Definition at line 87 of file entity_view.hh.
EntityView | ( | ) |
|
explicit |
create new entity view from entity handle
entity | The handle the view is created from. |
flags | An ORed together list of ViewAddFlag |
EntityView | ( | const EntityViewDataPtr & | data, |
const impl::EntityImplPtr | impl | ||
) |
construct entity view from data and entity impl
void AddAllInclusiveBonds | ( | ) |
clear bonds and add all inclusive ones (ie where both atoms are present)
AtomView AddAtom | ( | const AtomHandle & | atom_handle, |
ViewAddFlags | flags = 0 |
||
) |
Add atom to view.
If the atom's chain or residue have not been added to the view, they will be added
atom_handle | is the atom to add |
flags | can be a ORed together combination of ViewAddFlag |
AtomView AddAtom | ( | const AtomView & | atom_view, |
ViewAddFlags | flags = 0 |
||
) |
|
protected |
bool AddBond | ( | const BondHandle & | bond_handle | ) |
Add a bond.
ChainView AddChain | ( | const ChainHandle & | chain_handle, |
ViewAddFlags | flags = 0 |
||
) |
Add chain to view.
If ViewAddFlag::CHECK_DUPLICATES is set, the method will ensure that the handle is not already included in the view.
chain_handle | The chain handle to add |
flags | Can be a ORed together combination of ViewAddFlag |
ChainView AddChain | ( | const ChainView & | chain_view, |
ViewAddFlags | flags = 0 |
||
) |
Add chain to view.
Same as AddChain(const ChainHandle&) but with the difference that only the residues or atoms included in the chain view are included when one of ViewAddFlag::INCLUDE_ATOMS or ViewAddFlag::INCLUDE_RESIDUES is set.
chain_view | the handle that the view points to will be added to the view. |
flags | can be a ORed together combination of ViewAddFlag |
ResidueView AddResidue | ( | const ResidueHandle & | residue_handle, |
ViewAddFlags | flags = 0 |
||
) |
Add residue to view.
If the residues's chain has not been added to the chain already, it will be added.
residue_handle | is the residue to add |
flags | can be a ORed together combination of ViewAddFlag |
ResidueView AddResidue | ( | const ResidueView & | residue_view, |
ViewAddFlags | flags = 0 |
||
) |
Add residue to view.
Same as AddReside(const ResidueHandle&, ViewAddFlags) but with the difference that only atoms included in the residue view are added when ViewAddFlag::INCLUDE_ATOMS is set.
void Apply | ( | EntityVisitor & | visitor | ) |
Apply entity visitor to whole view.
void Apply | ( | EntityViewVisitor & | visitor | ) |
Apply entity view visitor to whole view.
AtomViewIter AtomsBegin | ( | ) | const |
Get iterator pointing to the beginning of atoms.
AtomViewIter AtomsEnd | ( | ) | const |
Get iterator pointing to the end of atoms.
EntityView Copy | ( | ) | const |
create copy of view
The copy has the semantics of a deep copy.
EntityView CreateEmptyView | ( | ) | const |
create empty view
EntityView CreateFullView | ( | ) | const |
create a new full view
This is an alias of EntityView::Copy()
String Dump | ( | ) | const |
returns a string containing a human-readable summary of the entity view
EntityView ExtendViewToResidues | ( | ) | const |
Extend current view to include all atoms of each residue where at least one atom is selected currently.
EntityView ExtendViewToSurrounding | ( | Real | gap | ) | const |
Extend current view to include all atoms that are within the sum of their vdw radii + gap.
Include all atoms within: at1.GetRadius() + at2.GetRadius() + gap
AtomView FindAtom | ( | const AtomHandle & | atom | ) | const |
Find view for given atom handle.
ChainView FindChain | ( | const ChainHandle & | chain | ) | const |
Find chain for given chain handle.
ResidueView FindResidue | ( | const ResidueHandle & | residue | ) | const |
Find atom for given residue handle.
AtomViewList FindWithin | ( | const geom::Vec3 & | center, |
Real | radius | ||
) | const |
find atoms close to point
Real GetAngle | ( | const AtomHandle & | a1, |
const AtomHandle & | a2, | ||
const AtomHandle & | a3 | ||
) | const |
Get angle in radians between bonds a1-a2 and a2-a3.
Get angle in radians between bonds a1-a2 and a2-a3.
int GetAtomCount | ( | ) | const |
Get total number of atoms in this entity.
AtomViewList GetAtomList | ( | ) | const |
Get list of all atoms included in the view.
int GetBondCount | ( | ) | const |
Get number of bonds.
const BondHandleList& GetBondList | ( | ) | const |
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 in this entity.
const ChainViewList& GetChainList | ( | ) | const |
EntityHandle GetHandle | ( | ) | const |
Get handle this view points to.
Real GetMass | ( | ) | const |
Get entity's mass.
std::pair<Real,Real> GetMinMax | ( | const String & | prop, |
Prop::Level | hint = Prop::UNSPECIFIED |
||
) | const |
Return the min/max pair for the given property.
int GetResidueCount | ( | ) | const |
Get total number of residues in this entity.
ResidueViewList GetResidueList | ( | ) | const |
Get list of all residues included in the view.
bool IsChainIncluded | ( | const ChainHandle & | chain | ) | const |
Check whether the view includes the given chain.
|
inline |
check validity of handle
Reimplemented from EntityBase.
Definition at line 110 of file entity_view.hh.
|
inline |
check validity of handle
check, whether the entity view points to a valid entity.
Reimplemented from EntityBase.
Definition at line 107 of file entity_view.hh.
void RemoveAtom | ( | AtomView | view | ) |
remove atom from view
|
protected |
void RemoveBond | ( | const BondHandle & | bond | ) |
void RemoveChain | ( | ChainView | view | ) |
remove chain from view
void RemoveResidue | ( | ResidueView | view | ) |
remove residue from view
ResidueViewIter ResiduesBegin | ( | ) | const |
Get iterator pointing to the beginnin of residues.
ResidueViewIter ResiduesEnd | ( | ) | const |
get iterator pointing to the end of residues
EntityView Select | ( | const String & | query_string, |
QueryFlags | flags = 0 |
||
) | const |
Select a structural subset of the entity view.
EntityView Select | ( | const Query & | query, |
QueryFlags | flags = 0 |
||
) | const |
Select a structural subset of the entity view.
const EntityViewDataPtr& ViewData | ( | ) | const |
Get entity view-specific data.
EntityViewDataPtr& ViewData | ( | ) |
Get entity view-specific data.
|
friend |
Definition at line 88 of file entity_view.hh.
|
related |
create view from atom list
IntegrityError | if atoms belonging to different entities are encountered |
|
related |
create view from atom list
IntegrityError | if atoms belonging to different entities are encountered |
|
related |
return difference between two entity views
a view containing elements in ev1 but not in ev2 is returned.
|
related |
return intersection of two entity views
a view containing elements in ev1 and ev2 is returned
|
friend |
Definition at line 89 of file entity_view.hh.
|
related |
return union of two entity views
a view containing elements that are either in ev1 or ev2 are included. no duplicates are generated.