OpenStructure
Public Member Functions
ChainView Class Reference

#include <chain_view.hh>

Inherits ChainBase.

Public Member Functions

 ChainView ()
 
 ChainView (ChainViewDataPtr data, impl::ChainImplPtr impl)
 
 ChainView (const EntityView &entity, const ChainHandle &chain)
 
Handle validity
 operator bool () const
 
bool IsValid () const
 
EntityView GetEntity () const
 
void Apply (EntityVisitor &visitor)
 
void Apply (EntityViewVisitor &visitor)
 
int GetResidueCount () const
 
int GetAtomCount () const
 
int GetBondCount () const
 
ResidueView AddResidue (const ResidueHandle &residue_handle, ViewAddFlags flags=0)
 
ResidueView AddResidue (const ResidueView &residue_view, ViewAddFlags flags=0)
 
AtomView AddAtom (const AtomHandle &atom_handle, ViewAddFlags flags=0)
 
ResidueView FindResidue (const ResNum &number) const
 
AtomView FindAtom (const AtomHandle &atom) const
 
AtomView ViewForHandle (const AtomHandle &atom) const
 
AtomView FindAtom (const ResNum &num, const String &name) const
 
ResidueView ViewForHandle (const ResidueHandle &handle) const
 
ResidueView FindResidue (const ResidueHandle &handle) const
 
bool IsResidueIncluded (const ResidueHandle &handle) const
 
ChainHandle GetHandle () const
 
const ResidueViewListGetResidueList () const
 
void RemoveResidue (ResidueView view)
 
int GetResidueIndex (const ResNum &number) const
 
ResidueView GetResidueByIndex (int index) const
 
Real GetMass () const
 
geom::Vec3 GetCenterOfMass () const
 
geom::Vec3 GetCenterOfAtoms () const
 
geom::AlignedCuboid GetBounds () const
 
void RemoveResidues ()
 
- Public Member Functions inherited from ChainBase
 ChainBase ()
 
 ChainBase (const impl::ChainImplPtr &impl)
 
 operator bool () const
 
bool IsValid () const
 
String GetName () const
 
ChainType GetType () const
 
String GetDescription () const
 
const impl::ChainImplPtrImpl () const
 
bool IsPolymer () const
 
bool IsPolysaccharide () const
 
bool IsOligosaccharide () const
 
bool IsPolypeptide () const
 
bool IsPolynucleotide () const
 
impl::ChainImplPtrImpl ()
 
- Public Member Functions inherited from GenericPropContainer< ChainBase >
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
 

Internal

ChainViewDataPtrViewData ()
 
const ChainViewDataPtrViewData () const
 
bool InSequence () const
 
EntityView Select (const Query &q, QueryFlags flags=0) const
 
EntityView Select (const String &query_string, QueryFlags flags=0) const
 
unsigned long GetHashCode () const
 
bool operator== (const ChainView &rhs) const
 
bool operator!= (const ChainView &rhs) const
 
bool HasAtoms () const
 

Additional Inherited Members

- Protected Member Functions inherited from ChainBase
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

definition of ChainView

Definition at line 37 of file chain_view.hh.

Constructor & Destructor Documentation

◆ ChainView() [1/3]

ChainView ( )

◆ ChainView() [2/3]

◆ ChainView() [3/3]

ChainView ( const EntityView entity,
const ChainHandle chain 
)

Member Function Documentation

◆ AddAtom()

AtomView AddAtom ( const AtomHandle atom_handle,
ViewAddFlags  flags = 0 
)

Add atom to view.

If the atoms's residue has not been added to the view it will be added.

Parameters
atom_handleThe atom to add
flagsCan be a ORed together combination of ViewAddFlag
Returns
The added atom view, or a reference to the existing atom view that points to the very same handle.

◆ AddResidue() [1/2]

ResidueView AddResidue ( const ResidueHandle residue_handle,
ViewAddFlags  flags = 0 
)

Add residue to view.

If ViewAddFlag::CHECK_DUPLICATES is set, the method will ensure that the handle is not already included in the view.

Parameters
residue_handleThe residue handle to add
flagsCan be a ORed together combination of ViewAddFlag. Flags that do not affect the operation are silently ignored.
Returns
the added residue view, or a reference to the existing residue view that points to the very same handle.

◆ AddResidue() [2/2]

ResidueView AddResidue ( const ResidueView residue_view,
ViewAddFlags  flags = 0 
)

Add residue to view.

This method is identical to AddResidue(const ResidueHandle&) except that in case ViewAddFlag::INCLUDE_ATOMS is set only the atoms included in the residue view are considered.

If ViewAddFlag::CHECK_DUPLICATES is set, the method will ensure that the view is not already included in the view.

Parameters
residue_viewThe residue view to add
flagsCan be a ORed together combination of ViewAddFlag. Flags that do not affect the operation are silently ignored.
Returns
The added residue view, or a reference to the existing residue view that points to the very same handle.

◆ Apply() [1/2]

void Apply ( EntityViewVisitor visitor)

◆ Apply() [2/2]

void Apply ( EntityVisitor visitor)

◆ FindAtom() [1/2]

AtomView FindAtom ( const AtomHandle atom) const

Find view for given atom handle Deprecated: Use ViewForHandle instead.

◆ FindAtom() [2/2]

AtomView FindAtom ( const ResNum num,
const String name 
) const

◆ FindResidue() [1/2]

ResidueView FindResidue ( const ResidueHandle handle) const

◆ FindResidue() [2/2]

ResidueView FindResidue ( const ResNum number) const

Find residue by number

◆ GetAtomCount()

int GetAtomCount ( ) const

Get number of atoms in this chain view.

◆ GetBondCount()

int GetBondCount ( ) const

Get number of all inclusive bonds of this chain.

Warning
For a bond between two different chains, it is not clearly defined to which chain it belongs. Therefore, this method will only return the number of bonds where both bonded atoms are within the same chain (all inclusive bonds).

◆ GetBounds()

geom::AlignedCuboid GetBounds ( ) const

Get entity's axis aligned bounding box.

◆ 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)

◆ GetEntity()

EntityView GetEntity ( ) const

Get parent entity view.

◆ GetHandle()

ChainHandle GetHandle ( ) const

Get handle this view points to.

◆ GetHashCode()

unsigned long GetHashCode ( ) const

get unique id

The unique id is the same for all ChainViews pointing to the same chain view data.

◆ GetMass()

Real GetMass ( ) const

Get entity's mass.

◆ GetResidueByIndex()

ResidueView GetResidueByIndex ( int  index) const

get residue by index

returns an invalid residue handle if the index is out of bounds

◆ GetResidueCount()

int GetResidueCount ( ) const

Get number of residues in this chain view.

◆ GetResidueIndex()

int GetResidueIndex ( const ResNum number) const

◆ GetResidueList()

const ResidueViewList& GetResidueList ( ) const

Get residues of this chain view.

Todo:
Residue list may be unordered. Is it the responsibility of the method building the view to have them ordered or is it our job?

◆ HasAtoms()

bool HasAtoms ( ) const

◆ InSequence()

bool InSequence ( ) const

whether the residues form an ordered sequence with respect to their residue numbers.

◆ IsResidueIncluded()

bool IsResidueIncluded ( const ResidueHandle handle) const

Check whether the view includes the given residue.

◆ IsValid()

bool IsValid ( ) const

check validity of handle

See also
operator bool()

◆ operator bool()

operator bool ( ) const
inline

check validity of handle

check, whether the chain handle points to a valid handle.

Note
It is an error to use any method other than IsValid, Impl() and operator bool() when the handle is invalid. An InvalidHandle exception will be thrown.

Definition at line 56 of file chain_view.hh.

◆ operator!=()

bool operator!= ( const ChainView rhs) const

◆ operator==()

bool operator== ( const ChainView rhs) const

◆ RemoveResidue()

void RemoveResidue ( ResidueView  view)

remove given residue from the view

◆ RemoveResidues()

void RemoveResidues ( )

///

remove all residues from the view

◆ Select() [1/2]

EntityView Select ( const Query q,
QueryFlags  flags = 0 
) const

return view based on a query object

See also
Query

◆ Select() [2/2]

EntityView Select ( const String query_string,
QueryFlags  flags = 0 
) const

return view based on query String.

See also
Query

◆ ViewData() [1/2]

ChainViewDataPtr& ViewData ( )
inline

Get view data.

Definition at line 180 of file chain_view.hh.

◆ ViewData() [2/2]

const ChainViewDataPtr& ViewData ( ) const
inline

Get view data.

Definition at line 185 of file chain_view.hh.

◆ ViewForHandle() [1/2]

AtomView ViewForHandle ( const AtomHandle atom) const

◆ ViewForHandle() [2/2]

ResidueView ViewForHandle ( const ResidueHandle handle) const

Find residue by residue handle.


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