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 |
Protected Member Functions inherited from ConstGenericPropContainer< EntityBase > | |
T | gp_get (const String &key) const |
T | gp_get (const String &key, const T &def) const |
GenericPropContainerImpl * | GetImpl () |
const GenericPropContainerImpl * | GetImpl () 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 86 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.
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.
deprecated. Use ViewForHandle instead
locate atom view for given atom handle
returns an invalid AtomView if the residue could not be located in the structure
ChainView FindChain | ( | const ChainHandle & | chain | ) | const |
Find chain for given chain handle.
deprecated: Use ViewForHandle instead
ResidueView FindResidue | ( | const ResidueHandle & | residue | ) | const |
Find atom for given residue handle.
deprecated. Use ViewForHandle instead
ResidueView FindResidue | ( | const String & | chain, |
const ResNum & | num | ||
) | const |
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 HasAtoms | ( | ) | const |
true if view contains at least one atom
bool IsChainIncluded | ( | const ChainHandle & | chain | ) | const |
Check whether the view includes the given chain.
|
inline |
|
inline |
check validity of handle
check, whether the entity view points to a valid entity.
Definition at line 106 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
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.
ResidueView ViewForHandle | ( | const ResidueHandle & | residue | ) | const |
locate residue view for given residue handle
returns an invalid ResidueView if the residue could not be located in the structure
AtomView ViewForHandle | ( | const AtomHandle & | atom | ) | const |
ChainView ViewForHandle | ( | const ChainHandle & | chain | ) | const |
locate chain view for given chain handle
returns an invalid AtomView if the residue could not be located in the structure
|
friend |
Definition at line 87 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 88 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.