OpenStructure
Public Member Functions | Friends
ResidueView Class Reference

#include <residue_view.hh>

Inherits ResidueBase.

Public Member Functions

 ResidueView ()
 
 ResidueView (const ChainView &chain, const ResidueHandle &residue)
 
Handle validity
 operator bool () const
 
bool IsValid () const
 
internal
 ResidueView (const ResidueViewDataPtr &data, const impl::ResidueImplPtr &impl)
 
const ResidueViewDataPtrViewData () const
 
ResidueViewDataPtrViewData ()
 
- Public Member Functions inherited from ResidueBase
 ResidueBase ()
 
 ResidueBase (const impl::ResidueImplPtr &impl)
 
 ResidueBase (const ResidueBase &rhs)
 
 operator bool () const
 
bool IsValid () const
 
const ResNumGetNumber () const
 
const ResidueKeyGetKey () const
 
const StringGetName () const
 
String GetQualifiedName () const
 
AtomHandle GetCentralAtom () const
 
void SetCentralAtom (const AtomHandle &a)
 
geom::Vec3 GetCentralNormal () const
 
bool IsPeptideLinking () const
 
bool IsNucleotideLinking () const
 
ChemClass GetChemClass () const
 
void SetChemClass (ChemClass cc)
 
ChemType GetChemType () const
 
void SetChemType (ChemType ct)
 
SecStructure GetSecStructure () const
 
void SetSecStructure (SecStructure ss)
 
TorsionHandle GetPhiTorsion () const
 
TorsionHandle GetPsiTorsion () const
 
TorsionHandle GetOmegaTorsion () const
 
char GetOneLetterCode () const
 
void SetOneLetterCode (char olc)
 
String GetStringProperty (Prop::ID prop_id) const
 
Real GetFloatProperty (Prop::ID prop_id) const
 
int GetIntProperty (Prop::ID prop_id) const
 
bool IsProtein () const
 
void SetIsProtein (bool protein)
 
void SetIsLigand (bool ligand)
 
bool IsLigand () const
 
impl::ResidueImplPtrImpl ()
 
const impl::ResidueImplPtrImpl () const
 
- Public Member Functions inherited from GenericPropContainer< ResidueBase >
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
 

Friends

class ChainView
 

Adding and removing atoms

AtomView AddAtom (const AtomView &atom_view, ViewAddFlags flags=0)
 
AtomView AddAtom (const AtomHandle &atom_handle, ViewAddFlags flags=0)
 
AtomView FindAtom (const String &atom_name) const
 
AtomView ViewForHandle (const AtomHandle &handle) const
 
AtomView FindAtom (const AtomHandle &handle) const
 
bool IsAtomIncluded (const AtomHandle &handle) const
 
void RemoveAtom (AtomView view)
 
void RemoveAtoms ()
 
void Apply (EntityVisitor &visitor)
 
void Apply (EntityViewVisitor &visitor)
 
int GetAtomCount () const
 
const AtomViewListGetAtomList () const
 
ResidueHandle GetHandle () const
 
EntityView GetEntity () const
 
int GetIndex () const
 
ChainView GetChain () const
 
double GetMass () const
 
geom::Vec3 GetCenterOfMass () const
 
geom::Vec3 GetCenterOfAtoms () const
 
geom::AlignedCuboid GetBounds () 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 ResidueView &rhs) const
 
bool operator!= (const ResidueView &rhs) const
 
bool HasAtoms () const
 
void SetIndex (int index)
 

Additional Inherited Members

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

residue view

Atoms are added with ResidueView::AddAtom() and removed with ResidueView::RemoveAtom(). Like other view operations, these operations only affect the view and do not alter the structure and topology of the underlying residue.

Definition at line 39 of file residue_view.hh.

Constructor & Destructor Documentation

◆ ResidueView() [1/3]

Create invalid ResidueView.

◆ ResidueView() [2/3]

ResidueView ( const ChainView chain,
const ResidueHandle residue 
)

Create new residue view.

Parameters
chainis the parent chain view to insert into
residueis residue handle this view points to.
Note
For better readability consider using ChainView::AddResidue()

◆ ResidueView() [3/3]

ResidueView ( const ResidueViewDataPtr data,
const impl::ResidueImplPtr impl 
)

construct new view from view data and impl.

This has the same effect as using the default copy constructor of the view.

Member Function Documentation

◆ AddAtom() [1/2]

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

Add atom to view.

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

Parameters
atom_handlethe atom handle 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.

◆ AddAtom() [2/2]

AtomView AddAtom ( const AtomView atom_view,
ViewAddFlags  flags = 0 
)

Add atom to view.

If ViewAddFlag::CHECK_DUPLICATES is set, the method will ensure that the view is not already included in this view. This method is an alias for residue_view.AddAtom(atom_view.GetHandle())

Parameters
atom_viewis the atom view 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 view.

◆ Apply() [1/2]

void Apply ( EntityViewVisitor visitor)

◆ Apply() [2/2]

void Apply ( EntityVisitor visitor)

Apply entity visitor to whole chain.

◆ FindAtom() [1/2]

AtomView FindAtom ( const AtomHandle handle) const

◆ FindAtom() [2/2]

AtomView FindAtom ( const String atom_name) const

Find atom by name.

◆ GetAtomCount()

int GetAtomCount ( ) const

return number of atoms in this residue view.

◆ GetAtomList()

const AtomViewList& GetAtomList ( ) const

get list of atoms in this view

◆ GetBounds()

geom::AlignedCuboid GetBounds ( ) const

Get residue's axis-aligned bounding box.

◆ GetCenterOfAtoms()

geom::Vec3 GetCenterOfAtoms ( ) const

Get residue's center of atoms (not mass weighted)

Returns the center of all the atoms in this residue. This is similar to GetCenterOfMass(), but the atoms are not mass weighted

◆ GetCenterOfMass()

geom::Vec3 GetCenterOfMass ( ) const

Get residue's center of mass (mass weighted)

◆ GetChain()

ChainView GetChain ( ) const

get parent chain view.

◆ GetEntity()

EntityView GetEntity ( ) const

get entity

◆ GetHandle()

ResidueHandle GetHandle ( ) const

get handle this view points to

◆ GetHashCode()

unsigned long GetHashCode ( ) const

get unique id

The unique id is the same for all ResidueViews pointing to the same residue view data.

◆ GetIndex()

int GetIndex ( ) const

get index of residue view in chain

◆ GetMass()

double GetMass ( ) const

Get residue's mass.

◆ HasAtoms()

bool HasAtoms ( ) const

◆ IsAtomIncluded()

bool IsAtomIncluded ( const AtomHandle handle) const

Check whether the view includes the the given atom.

◆ IsValid()

bool IsValid ( ) const

check validity of handle

See also
operator bool()

◆ operator bool()

operator bool ( ) const
inline

check validity of view

check, whether the residue view points to a valid residue.

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 65 of file residue_view.hh.

◆ operator!=()

bool operator!= ( const ResidueView rhs) const

◆ operator==()

bool operator== ( const ResidueView rhs) const

◆ RemoveAtom()

void RemoveAtom ( AtomView  view)

remove given atom from view

all bonds involving this atom will be removed from the view as well.

◆ RemoveAtoms()

void RemoveAtoms ( )

remove all atoms

all bonds involving one of the atoms will be removed from the view as well.

◆ 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

◆ SetIndex()

void SetIndex ( int  index)
protected

set the index of residiue view in chain should be called from chainview whenever indexes change

◆ ViewData() [1/2]

ResidueViewDataPtr& ViewData ( )
inline

Get internal view data.

Definition at line 84 of file residue_view.hh.

◆ ViewData() [2/2]

const ResidueViewDataPtr& ViewData ( ) const
inline

Get internal view data.

Definition at line 80 of file residue_view.hh.

◆ ViewForHandle()

AtomView ViewForHandle ( const AtomHandle handle) const

Find residue by residue handle.

Friends And Related Function Documentation

◆ ChainView

friend class ChainView
friend

Definition at line 41 of file residue_view.hh.


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