PIKAlgorithms.h

Go to the documentation of this file.
00001 /*
00002     LoopTK: Protein Loop Kinematic Toolkit
00003     Copyright (C) 2007 Stanford University
00004 
00005     This program is free software; you can redistribute it and/or modify
00006     it under the terms of the GNU General Public License as published by
00007     the Free Software Foundation; either version 2 of the License, or
00008     (at your option) any later version.
00009 
00010     This program is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013     GNU General Public License for more details.
00014 
00015     You should have received a copy of the GNU General Public License along
00016     with this program; if not, write to the Free Software Foundation, Inc.,
00017     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00018 */
00019 
00020 /*
00021  * Contains inverse kinematic
00022  * algorithms to be called on
00023  * chains.
00024 */
00025 
00026 #ifndef PIK_ALGORITHMS_H
00027 #define PIK_ALGORITHMS_H
00028 
00029 #include "PBasic.h"
00030 
00031 typedef vector<ChainMove> IKSolution;
00032 typedef vector<IKSolution> IKSolutions;
00033 
00039 class PCCDSolver {
00040   public:
00041 
00046     PCCDSolver(PChain *loop, PAtom *effectorPrior, PAtom *effectorEnd, Vector3 goalPrior, Vector3 goalEnd);
00047 
00053     Real DoDescent();
00054 
00055     void GetGoals(Vector3 &goalPrior, Vector3 &goalEnd);
00056 
00057   private:
00058     PChain *m_chain;
00059     Vector3 m_goalPrior, m_goalEnd;
00060     PAtom *m_effectorPrior, *m_effectorEnd;
00061 
00062     /* Degrees of freedom in the chain. */
00063     vector<PBond *> m_DOFs;
00064 
00065     /* Current iteration of CCD algorithm. */
00066     int m_ccdIter;
00067 
00068     void UpdateSides(const Vector3 &axisOfRotation, const Vector3 &basePrior, const Vector3 &atom,
00069                         const Vector3 &goal, Real &k1, Real &k2);
00070 
00071 };
00072 
00082 class PProteinCCDSolver {
00083   public:
00084 
00094     PProteinCCDSolver(PProtein *loop);
00095 
00102     PProteinCCDSolver(PProtein *loop, ProteinSide side);
00103     ~PProteinCCDSolver() { delete m_solver; }
00104 
00111     Real DoDescent() { return m_solver->DoDescent(); }
00112 
00113   private:
00114     PCCDSolver *m_solver;
00115 
00116     void ConstructorHelper(PProtein *loop, ProteinSide side, Vector3 goalPrior, Vector3 goalEnd);
00117 };
00118 
00119 
00124 class PExactIKSolver {
00125   public:
00126 
00131     static IKSolutions FindSolutions(PProtein *loop,int Res_indices_to_use[3]);
00136     static IKSolutions FindSolutions(PProtein *loop, int Res_indices_to_use[3], Vector3 *endPriorG, Vector3 *endG, Vector3 *endNextG);
00137   private:
00138     static double AngleBetweenVectors(Vector3 n1,Vector3 n2);
00139 
00140 };
00141 
00142 
00143 #endif

Generated on Wed May 16 20:22:08 2007 for LoopTK: Protein Loop Kinematic Toolkit by  doxygen 1.5.1