Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

atom_index_tetrad.h

Go to the documentation of this file.
00001 // -*- mode: c++; -*-
00002 //
00003 //The Biomolecule Toolkit (BTK) is a C++ library for use in the
00004 //modeling, analysis, and design of biological macromolecules.
00005 //Copyright (C) 2004, Christopher Saunders <ctsa@users.sourceforge.net>
00006 //
00007 //This program is free software; you can redistribute it and/or modify
00008 //it under the terms of the GNU Lesser General Public License as published
00009 //by the Free Software Foundation; either version 2.1 of the License, or (at
00010 //your option) any later version.
00011 //
00012 //This program is distributed in the hope that it will be useful,  but
00013 //WITHOUT ANY WARRANTY; without even the implied warranty of
00014 //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015 //Lesser General Public License for more details. 
00016 //
00017 //You should have received a copy of the GNU Lesser General Public License 
00018 //along with this program; if not, write to the Free Software Foundation, 
00019 //Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00020 //
00021 
00022 
00023 
00024 #ifndef BTK_ATOM_INDEX_TETRAD_H
00025 #define BTK_ATOM_INDEX_TETRAD_H
00026 
00027 
00028 #include "atom_types.h"
00029 
00030 #include <utility>
00031 
00032 namespace BTK{
00033 
00034   struct AtomIndexTetrad {
00035     typedef std::pair<int,ATOM::index_t> monomer_atom_idx_t;
00036 
00037     // need to make this default constructable for now
00038     AtomIndexTetrad() {}
00039     
00040     AtomIndexTetrad(monomer_atom_idx_t atom_index3,
00041         monomer_atom_idx_t atom_index2,
00042         monomer_atom_idx_t atom_index1,
00043         double len34,
00044         double ang234,
00045         double dih1234,
00046         bool is_real_torsion)
00047       : _atom_index3(atom_index3), 
00048         _atom_index2(atom_index2), 
00049         _atom_index1(atom_index1), 
00050         _len34(len34), 
00051         _ang234(ang234), 
00052         _dih1234(dih1234),
00053         _is_real_torsion(is_real_torsion) {}
00054 
00055     bool
00056     operator<(const AtomIndexTetrad& right) const
00057     {
00058       if ( _atom_index3 != right._atom_index3 ) {
00059         return _atom_index3 < right._atom_index3;
00060       } else if ( _atom_index2 != right._atom_index2 ) {
00061         return _atom_index2 < right._atom_index2;
00062       } else {
00063         return _atom_index1 < right._atom_index1;
00064       }
00065     }
00066 
00067     bool
00068     operator==(const AtomIndexTetrad& right) const
00069     {
00070       return 
00071         ( _atom_index3 == right._atom_index3 ) &&
00072         ( _atom_index2 == right._atom_index2 ) &&
00073         ( _atom_index1 == right._atom_index1 );
00074     }
00075 
00076     monomer_atom_idx_t atom_index3() const { return _atom_index3; }
00077     monomer_atom_idx_t atom_index2() const { return _atom_index2; }
00078     monomer_atom_idx_t atom_index1() const { return _atom_index1; }
00079     
00080     double len34() const { return _len34; }
00081     double ang234() const { return _ang234; }
00082     double dih1234() const { return _dih1234; }
00083 
00084     bool is_real_torsion() const { return _is_real_torsion; }
00085  
00086   private:
00087     monomer_atom_idx_t _atom_index3;
00088     monomer_atom_idx_t _atom_index2;
00089     monomer_atom_idx_t _atom_index1;
00090     double _len34;
00091     double _ang234;
00092     double _dih1234;
00093     bool _is_real_torsion;
00094   };
00095 
00096 }
00097 
00098 #endif

Generated on Wed Apr 14 00:43:16 2004 for BTK by doxygen 1.3.6