00001 // -*- Mode: C++; tab-width: 2; -*- 00002 // vi: set ts=2: 00003 // 00004 00005 #ifndef BALL_STRUCTURE_RECONSTRUCFRAGMENTPROCESSOR_H 00006 #define BALL_STRUCTURE_RECONSTRUCFRAGMENTPROCESSOR_H 00007 00008 #include <list> 00009 00010 #ifndef BALL_COMMON_H 00011 # include <BALL/common.h> 00012 #endif 00013 00014 #ifndef BALL_DATATYPE_TRIPLE_H 00015 # include <BALL/DATATYPE/triple.h> 00016 #endif 00017 00018 #ifndef BALL_MATHS_MATRIX44_H 00019 # include <BALL/MATHS/matrix44.h> 00020 #endif 00021 00022 #ifndef BALL_KERNEL_FRAGMENT_H 00023 # include <BALL/KERNEL/fragment.h> 00024 #endif 00025 00026 namespace BALL 00027 { 00028 class FragmentDB; 00029 00033 class BALL_EXPORT ReconstructFragmentProcessor 00034 : public UnaryProcessor<Fragment> 00035 { 00036 00037 public: 00038 00042 00048 ReconstructFragmentProcessor(); 00049 00054 ReconstructFragmentProcessor(const FragmentDB& db); 00055 00058 ReconstructFragmentProcessor(const ReconstructFragmentProcessor& db); 00059 00062 virtual ~ReconstructFragmentProcessor(); 00063 00065 00068 00071 virtual bool start(); 00072 00075 virtual bool finish(); 00076 00081 virtual Processor::Result operator() (Fragment&); 00082 00084 00088 00091 list<Atom*>& getInsertedAtoms(); 00092 00095 Size getNumberOfInsertedAtoms() const; 00096 00099 void setFragmentDB(const FragmentDB& fragment_db); 00100 00103 const FragmentDB* getFragmentDB() const; 00104 00106 00110 // ???? This should be replaced by the corresponding method in StructureMapper 00111 // We don't need two implementations with the same code. 00124 static Matrix4x4 mapThreeVectors 00125 (const Vector3& w1, const Vector3& w2, const Vector3& w3, 00126 const Vector3& v1, const Vector3& v2, const Vector3& v3); 00127 00134 static Triple<bool, const Atom*, const Atom*> 00135 getTwoReferenceAtoms(const Atom& ref_center_atom, const HashSet<const Atom*>& allowed) 00136 ; 00137 00140 static list<Atom*> reconstructFragment(Fragment& frag, const Fragment& tplate); 00142 00143 protected: 00144 00145 /*_ @name Protected attributes 00146 */ 00147 //_@{ 00148 00149 /*_ Pointer to the fragment DB 00150 */ 00151 const FragmentDB* fragment_db_; 00152 00153 /*_ List of atoms inserted during the last application of the processor. 00154 */ 00155 list<Atom*> inserted_atoms_; 00156 //_@} 00157 }; 00158 00159 } // namespace BALL 00160 00161 #endif // BALL_STRUCTURE_RECONSTRUCFRAGMENTPROCESSOR_H