OpenStructure
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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:
47  TorsionHandle();
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;
75  AtomHandle GetSecond() const;
77  AtomHandle GetThird() const;
79  AtomHandle GetFourth() const;
81 
84  Real GetAngle() const;
86  geom::Vec3 GetPos() const;
88  geom::Vec3 GetOriginalPos() 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 
103 Real DLLEXPORT_OST_MOL DihedralAngle(const AtomHandle& a1,
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
std::string String
Definition: base.hh:54
Handle to atom datatype.
Definition: atom_handle.hh:37
float Real
Definition: base.hh:44
DLLEXPORT_OST_MOL std::ostream & operator<<(std::ostream &os, const AtomBase &atom)
EntityVisitor interface.
Real DLLEXPORT_OST_MOL DihedralAngle(const AtomHandle &a1, const AtomHandle &a2, const AtomHandle &a3, const AtomHandle &a4)
boost::shared_ptr< TorsionImpl > TorsionImplP
Three dimensional vector class, using Real precision.
Definition: vec3.hh:43
impl::TorsionImplP & Impl()
#define DLLEXPORT_OST_MOL
Named torsion (dihedral) angle.
const impl::TorsionImplP & Impl() const