OpenStructure
atom_base.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_ATOM_BASE_HH
20 #define OST_ATOM_BASE_HH
21 
22 #include <ost/geom/vec3.hh>
23 
24 #include <ost/mol/module_config.hh>
26 #include <ost/generic_property.hh>
27 
28 #include "property_id.hh"
29 
30 namespace ost { namespace mol {
31 
45 public:
48 public:
50 
51  operator bool() const { return this->IsValid(); }
60  bool IsValid() const;
62  friend class ConstGenericPropContainer<AtomBase>;
66  const String& GetName() const;
67 
77  void SetName(const String& atom_name);
78 
80  const geom::Vec3& GetPos() const;
81 
83  const geom::Vec3& GetOriginalPos() const;
85  geom::Vec3 GetAltPos(const String& alt_group) const;
86  Real GetAltBFactor(const String& alt_group) const;
87  Real GetAltOcc(const String& alt_group) const;
88 
89  std::vector<String> GetAltGroupNames() const;
90 
92 
99 
102 
105 
107  int GetIntProperty(Prop::ID prop_id) const;
108 
110  unsigned long GetIndex() const;
111 
113  Real GetRadius() const;
114 
116  const String& GetElement() const;
117 
119  bool IsHetAtom() const;
120 
124  Real GetBFactor() const;
125 
126 
127  void SetBFactor(Real factor);
128 
129  void SetOccupancy(Real occ);
130 
131 
132  void SetCharge(Real charge);
133 
134  void SetMass(Real mass);
135 
136  void SetHetAtom(bool het);
137 
138  void SetRadius(Real radius);
139 
140  void SetIndex (const unsigned long index);
141 
142  const geom::Mat3& GetAnisou() const;
143 
144  void SetAnisou(const geom::Mat3& anisou);
148  Real GetMass() const;
149 
151  Real GetCharge() const;
152 
155 
159  const impl::AtomImplPtr& Impl() const;
160 
163 
164 
165  void SetElement(const String& element);
166 protected:
167 
169 
171 
172  void CheckValidity() const;
174 };
175 
176 DLLEXPORT_OST_MOL std::ostream& operator<<(std::ostream& os,
177  const AtomBase& atom);
178 }} // ns
179 
180 #endif // OST_ATOM_BASE_HH
181 
Three dimensional vector class, using Real precision.
Definition: vec3.hh:48
base class for the handler classes
base class for the implementation
base class for AtomHandle and AtomView
Definition: atom_base.hh:44
const impl::AtomImplPtr & Impl() const
get atom implementation.
String GetStringProperty(Prop::ID prop_id) const
Get String property by id
std::vector< String > GetAltGroupNames() const
void SetName(const String &atom_name)
Set atom name.
int GetIntProperty(Prop::ID prop_id) const
Get int property by id.
impl::AtomImplPtr & Impl()
get atom implementation
Real GetAltOcc(const String &alt_group) const
void SetHetAtom(bool het)
const geom::Vec3 & GetOriginalPos() const
Get original global position in cartesian coordinates (no entity transformation is applied)
const geom::Mat3 & GetAnisou() const
geom::Vec3 GetAltPos(const String &alt_group) const
get alternative atom position
void SetCharge(Real charge)
const geom::Vec3 & GetPos() const
Get global position in cartesian coordinates with entity transformations applied.
Real GetMass() const
get mass of atom
void CheckValidity() const
unsigned long GetIndex() const
Get the internal index.
Real GetRadius() const
returns the van-der-Waals radius of the atom
void SetIndex(const unsigned long index)
void SetBFactor(Real factor)
void SetElement(const String &element)
String GetQualifiedName() const
Get qualified name for atom.
GenericPropContainerImpl * GpImpl()
bool IsHetAtom() const
whether the atom is a hetatm
impl::AtomImplPtr impl_
Definition: atom_base.hh:173
Real GetAltBFactor(const String &alt_group) const
const GenericPropContainerImpl * GpImpl() const
void SetOccupancy(Real occ)
Real GetBFactor() const
Get isotropic temperature factor of atom.
void SetRadius(Real radius)
const String & GetElement() const
returns the element name of the atom
Real GetCharge() const
get charge
Real GetOccupancy() const
get atom occupancy
void SetMass(Real mass)
const String & GetName() const
Get atom name.
void SetAnisou(const geom::Mat3 &anisou)
AtomBase(const impl::AtomImplPtr &impl)
Real GetFloatProperty(Prop::ID prop_id) const
Get float property by id
float Real
Definition: base.hh:44
std::string String
Definition: base.hh:54
#define DLLEXPORT_OST_MOL
boost::shared_ptr< AtomImpl > AtomImplPtr
Definition: atom_impl_fw.hh:33
DLLEXPORT_OST_MOL std::ostream & operator<<(std::ostream &os, const AtomBase &atom)
Definition: base.dox:1
ID
Defined properties.
Definition: property_id.hh:41