HBondProcessor.h

Go to the documentation of this file.
00001 // -*- Mode: C++; tab-width: 2; -*-
00002 // vi: set ts=2:
00003 //
00004 // $Id: HBondProcessor.h,v 1.7.18.1 2007/03/25 21:25:22 oliver Exp $
00005 //
00006 
00007 #ifndef BALL_STRUCTURE_HBONDPROCESSOR_H
00008 #define BALL_STRUCTURE_HBONDPROCESSOR_H
00009 
00010 #ifndef BALL_CONCEPT_PROCESSOR_H
00011 #include <BALL/CONCEPT/processor.h>
00012 #endif
00013 
00014 #ifndef BALL_KERNEL_RESIDUE_H
00015 #include <BALL/KERNEL/residue.h>
00016 #endif
00017 
00018 #ifndef BALL_MATHS_VECTOR3_H
00019 #include <BALL/MATHS/vector3.h> 
00020 #endif
00021 
00022 #include <vector>
00023 
00024 namespace BALL
00025 {
00026 
00034   class BALL_EXPORT HBondProcessor 
00035     : public UnaryProcessor<Composite>
00036   {
00037  
00038     public:
00039 
00040     // constants 
00041     // 5.2 Angstrom is the maximum distance between N and O in a hydrogen bond.
00042     // 4.2 Angstrom is an upper bound for the distance between N and O in the same
00043     // residue. Therefore, if two residues are farther apart than MAX_LENGTH, N and O
00044     // are farther apart than 5.2 Angstroms and there will be no hydrogen bond.
00045     const float MAX_LENGTH;
00046     const float BOND_LENGTH_N_H;
00047     const float BOND_LENGTH_C_O;
00048 
00050     struct BALL_EXPORT ResidueData
00051     {
00052       Vector3 pos_C;
00053       Vector3 pos_N;
00054       Vector3 pos_H;
00055       Vector3 pos_O;
00056       Size    number;
00057       Residue*  res; 
00059       bool is_complete; 
00060     };
00061   
00062     
00065     
00067     HBondProcessor();
00068     
00070     virtual ~HBondProcessor();
00071     
00073     HBondProcessor(const HBondProcessor& hbp);
00074     
00076 
00078     
00080     virtual bool finish();
00081     
00083     virtual Processor::Result operator() (Composite &composite);
00084     
00086 
00088     const std::vector< std::vector<Position> >& getHBondPairs() const;
00089 
00091     const std::vector<ResidueData>& getResidueData() const;
00092 
00093     protected:  
00094 
00095     void preComputeBonds_(ResidueIterator& data);
00096 
00097     //_ lower point of the grid
00098     Vector3 upper_;
00099     //_ upper point of the grid
00100     Vector3 lower_;
00101     
00103     vector<ResidueData> residue_data_;
00104 
00106     std::vector<std::vector<Position> > h_bond_pairs_;
00107 
00108   }; //class HBondProcessor
00109 } //namesspace BALL
00110 
00111 
00112 #endif // BALL_STRUCTURE_HBONDPROCESSOR_H