OpenStructure
Loading...
Searching...
No Matches
residue_view.hh
Go to the documentation of this file.
1//------------------------------------------------------------------------------
2// This file is part of the OpenStructure project <www.openstructure.org>
3//
4// Copyright (C) 2008-2020 by the OpenStructure authors
5//
6// This library is free software; you can redistribute it and/or modify it under
7// the terms of the GNU Lesser General Public License as published by the Free
8// Software Foundation; either version 3.0 of the License, or (at your option)
9// any later version.
10// This library is distributed in the hope that it will be useful, but WITHOUT
11// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13// details.
14//
15// You should have received a copy of the GNU Lesser General Public License
16// along with this library; if not, write to the Free Software Foundation, Inc.,
17// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18//------------------------------------------------------------------------------
19#ifndef OST_RESIDUE_VIEW_HH
20#define OST_RESIDUE_VIEW_HH
21
22#include <ost/mol/query.hh>
24#include <ost/geom/geom.hh>
30
31namespace ost { namespace mol {
32
40
41 friend class ChainView;
42
43public:
46
52 ResidueView(const ChainView& chain,
53 const ResidueHandle& residue);
54
55public:
56
58
59
65 operator bool() const { return this->IsValid(); }
68 bool IsValid() const;
70
72
73
77 const impl::ResidueImplPtr& impl);
78
81 return data_;
82 }
85 return data_;
86 }
88public:
90
91
101 AtomView AddAtom(const AtomView& atom_view,
102 ViewAddFlags flags=0);
103
113 AtomView AddAtom(const AtomHandle& atom_handle,
114 ViewAddFlags flags=0);
116
118 AtomView FindAtom(const String& atom_name) const;
119
121 AtomView ViewForHandle(const AtomHandle& handle) const;
122 AtomView FindAtom(const AtomHandle& handle) const;
123
125 bool IsAtomIncluded(const AtomHandle& handle) const;
126
131
137
139 void Apply(EntityVisitor& visitor);
140 void Apply(EntityViewVisitor& visitor);
141
143 int GetAtomCount() const;
144
146 const AtomViewList& GetAtomList() const;
147
150
153
155 int GetIndex() const;
158
160 double GetMass() const;
161
164
170
173
176 EntityView Select(const Query& q, QueryFlags flags=0) const;
177
180 EntityView Select(const String& query_string, QueryFlags flags=0) const;
181
186 unsigned long GetHashCode() const;
187
188 bool operator==(const ResidueView& rhs) const;
189
190 bool operator!=(const ResidueView& rhs) const;
191
192 bool HasAtoms() const;
193protected:
196 void SetIndex(int index);
197
198private:
199 ResidueViewDataPtr data_;
200};
201
202}} // ns
203
204#endif // OST_RESIDUE_VIEW_HH
205
axis-aligned cuboid
Three dimensional vector class, using Real precision.
Definition vec3.hh:48
Handle to atom datatype.
definition of AtomView
Definition atom_view.hh:34
definition of ChainView
Definition chain_view.hh:37
definition of EntityView
EntityViewVisitor interface.
EntityVisitor interface.
Selection Query.
Definition query.hh:74
base class for ResidueHandle and ResidueView
EntityView Select(const Query &q, QueryFlags flags=0) const
return view based on a query object
AtomView FindAtom(const AtomHandle &handle) const
void RemoveAtoms()
remove all atoms
void Apply(EntityViewVisitor &visitor)
ResidueHandle GetHandle() const
get handle this view points to
EntityView GetEntity() const
get entity
double GetMass() const
Get residue's mass.
ResidueView(const ResidueViewDataPtr &data, const impl::ResidueImplPtr &impl)
construct new view from view data and impl.
ChainView GetChain() const
get parent chain view.
void RemoveAtom(AtomView view)
remove given atom from view
ResidueViewDataPtr & ViewData()
Get internal view data.
void Apply(EntityVisitor &visitor)
Apply entity visitor to whole chain.
geom::AlignedCuboid GetBounds() const
Get residue's axis-aligned bounding box.
AtomView AddAtom(const AtomHandle &atom_handle, ViewAddFlags flags=0)
Add atom to view.
bool operator!=(const ResidueView &rhs) const
int GetAtomCount() const
return number of atoms in this residue view.
const ResidueViewDataPtr & ViewData() const
Get internal view data.
geom::Vec3 GetCenterOfMass() const
Get residue's center of mass (mass weighted)
bool HasAtoms() const
unsigned long GetHashCode() const
get unique id
const AtomViewList & GetAtomList() const
get list of atoms in this view
ResidueView(const ChainView &chain, const ResidueHandle &residue)
Create new residue view.
AtomView FindAtom(const String &atom_name) const
Find atom by name.
ResidueView()
Create invalid ResidueView.
AtomView AddAtom(const AtomView &atom_view, ViewAddFlags flags=0)
Add atom to view.
AtomView ViewForHandle(const AtomHandle &handle) const
Find residue by residue handle.
bool IsValid() const
check validity of handle
void SetIndex(int index)
set the index of residiue view in chain should be called from chainview whenever indexes change
bool IsAtomIncluded(const AtomHandle &handle) const
Check whether the view includes the the given atom.
geom::Vec3 GetCenterOfAtoms() const
Get residue's center of atoms (not mass weighted)
int GetIndex() const
get index of residue view in chain
EntityView Select(const String &query_string, QueryFlags flags=0) const
return view based on query String.
bool operator==(const ResidueView &rhs) const
std::string String
Definition base.hh:54
#define DLLEXPORT_OST_MOL
boost::shared_ptr< ResidueImpl > ResidueImplPtr
boost::shared_ptr< ResidueViewData > ResidueViewDataPtr
uint QueryFlags
Definition query.hh:69
std::vector< AtomView > AtomViewList
int ViewAddFlags
Definition base.dox:1