OpenStructure
torsion_handle.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_TORSION_HANDLE_HH
20 #define OST_TORSION_HANDLE_HH
21 
23 #include <ost//mol/atom_handle.hh>
24 
26 
27 namespace ost { namespace mol {
28 
45 public:
50 
52 
53  operator bool() const;
62  bool IsValid() const;
64 
66  void Apply(EntityVisitor& v);
67 
68  const String& GetName() const;
69 
71 
72  AtomHandle GetFirst() const;
81 
84  Real GetAngle() const;
86  geom::Vec3 GetPos() const;
89 
91  return impl_;
92  }
93 
94  const impl::TorsionImplP& Impl() const {
95  return impl_;
96  }
97 protected:
98  void CheckValidity() const;
99 private:
100  impl::TorsionImplP impl_;
101 };
102 
104  const AtomHandle& a2,
105  const AtomHandle& a3,
106  const AtomHandle& a4);
107 
108 DLLEXPORT_OST_MOL std::ostream& operator<<(std::ostream& os,
109  const TorsionHandle& torsion);
110 
111 }} // ns
112 
113 #endif
Three dimensional vector class, using Real precision.
Definition: vec3.hh:48
Handle to atom datatype.
Definition: atom_handle.hh:37
EntityVisitor interface.
Named torsion (dihedral) angle.
impl::TorsionImplP & Impl()
Real GetAngle() const
get dihedral angle based on whatever coordinate system is available
TorsionHandle(const impl::TorsionImplP &im)
ctor for internal use, in public interface for convenience purposes
geom::Vec3 GetOriginalPos() const
get position, i.e midpoint between the second and third atom (original coordinates)
geom::Vec3 GetPos() const
get position, i.e midpoint between the second and third atom (transformed coordinates)
TorsionHandle()
necessary dummy ctor, creates invalid handle
const impl::TorsionImplP & Impl() const
void CheckValidity() const
AtomHandle GetSecond() const
return second atom
AtomHandle GetFourth() const
return fourth atom
void Apply(EntityVisitor &v)
entry point for entity visitor
bool IsValid() const
check validity of handle
const String & GetName() const
AtomHandle GetThird() const
return third atom
float Real
Definition: base.hh:44
std::string String
Definition: base.hh:54
#define DLLEXPORT_OST_MOL
boost::shared_ptr< TorsionImpl > TorsionImplP
DLLEXPORT_OST_MOL std::ostream & operator<<(std::ostream &os, const AtomBase &atom)
Real DLLEXPORT_OST_MOL DihedralAngle(const AtomHandle &a1, const AtomHandle &a2, const AtomHandle &a3, const AtomHandle &a4)
Definition: base.dox:1