OpenStructure
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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)
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 ()
Handle validity
 operator bool () const
bool IsValid () 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
bool operator== (const ChainView &rhs) const
bool operator!= (const ChainView &rhs) const
- Public Member Functions inherited from ChainBase
 ChainBase ()
 ChainBase (const impl::ChainImplPtr &impl)
String GetName () const
ChainType GetType () const
String GetDescription () const
const impl::ChainImplPtrImpl () const
bool IsPolymer () const
bool IsPolysaccharide () 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 RemoveProp (const String &key)
- Public Member Functions inherited from ConstGenericPropContainer< ChainBase >
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

Additional Inherited Members

- Protected Member Functions inherited from ChainBase
GenericPropContainerImplGpImpl ()
const GenericPropContainerImplGpImpl () const
void CheckValidity () const

Detailed Description

definition of ChainView

Definition at line 37 of file chain_view.hh.


Constructor & Destructor Documentation

ChainView ( )
ChainView ( const EntityView entity,
const ChainHandle chain 
)

Member Function Documentation

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.
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.
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.
void Apply ( EntityVisitor visitor)
void Apply ( EntityViewVisitor visitor)
AtomView FindAtom ( const AtomHandle atom) const

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

AtomView FindAtom ( const ResNum num,
const String name 
) const
ResidueView FindResidue ( const ResNum number) const

Find residue by number.

ResidueView FindResidue ( const ResidueHandle handle) const
int GetAtomCount ( ) const

Get number of atoms in this chain view.

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

Get entity's axis aligned bounding box.

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)

EntityView GetEntity ( ) const

Get parent entity view.

ChainHandle GetHandle ( ) const

Get handle this view points to.

Real GetMass ( ) const

Get entity's mass.

ResidueView GetResidueByIndex ( int  index) const

get residue by index

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

int GetResidueCount ( ) const

Get number of residues in this chain view.

int GetResidueIndex ( const ResNum number) const
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?
bool InSequence ( ) const

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

bool IsResidueIncluded ( const ResidueHandle handle) const

Check whether the view includes the given residue.

bool IsValid ( ) const
inline

check validity of handle

See also:
operator bool()

Reimplemented from ChainBase.

Definition at line 59 of file chain_view.hh.

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.

Reimplemented from ChainBase.

Definition at line 56 of file chain_view.hh.

bool operator!= ( const ChainView rhs) const
bool operator== ( const ChainView rhs) const
void RemoveResidue ( ResidueView  view)

remove given residue from the view

void RemoveResidues ( )

///

remove all residues from the view

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

return view based on a query object

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

return view based on query String.

See also:
Query
ChainViewDataPtr& ViewData ( )
inline

Get view data.

Definition at line 180 of file chain_view.hh.

const ChainViewDataPtr& ViewData ( ) const
inline

Get view data.

Definition at line 185 of file chain_view.hh.

AtomView ViewForHandle ( const AtomHandle atom) const
ResidueView ViewForHandle ( const ResidueHandle handle) const

Find residue by residue handle.


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