00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
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
00063 vector<PBond *> m_DOFs;
00064
00065
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