reconstructFragmentProcessor.h

Go to the documentation of this file.
00001 // -*- Mode: C++; tab-width: 2; -*-
00002 // vi: set ts=2:
00003 //
00004 // $Id: reconstructFragmentProcessor.h,v 1.11 2005/12/23 17:02:04 amoll Exp $
00005 //
00006 
00007 #ifndef BALL_STRUCTURE_RECONSTRUCFRAGMENTPROCESSOR_H
00008 #define BALL_STRUCTURE_RECONSTRUCFRAGMENTPROCESSOR_H
00009 
00010 #include <list>
00011 
00012 #ifndef BALL_COMMON_H
00013 # include <BALL/common.h>
00014 #endif
00015 
00016 #ifndef BALL_DATATYPE_TRIPLE_H
00017 # include <BALL/DATATYPE/triple.h>
00018 #endif
00019 
00020 #ifndef BALL_MATHS_MATRIX44_H
00021 # include <BALL/MATHS/matrix44.h>
00022 #endif
00023 
00024 #ifndef BALL_KERNEL_FRAGMENT_H
00025 # include <BALL/KERNEL/fragment.h>
00026 #endif
00027 
00028 namespace BALL 
00029 {
00030   class FragmentDB;
00031 
00035   class BALL_EXPORT ReconstructFragmentProcessor 
00036     : public UnaryProcessor<Fragment> 
00037   { 
00038     
00039     public:
00040 
00044 
00050     ReconstructFragmentProcessor();
00051 
00056     ReconstructFragmentProcessor(const FragmentDB& db);
00057 
00060     ReconstructFragmentProcessor(const ReconstructFragmentProcessor& db);
00061 
00064     virtual ~ReconstructFragmentProcessor();
00065 
00067 
00070 
00073     virtual bool start();
00074     
00077     virtual bool finish();
00078     
00083     virtual Processor::Result operator() (Fragment&);
00084 
00086 
00090     
00093     list<Atom*>& getInsertedAtoms();
00094 
00097     Size getNumberOfInsertedAtoms() const;
00098 
00101     void setFragmentDB(const FragmentDB& fragment_db);
00102 
00105     const FragmentDB* getFragmentDB() const;
00106 
00108 
00112     // ???? This should be replaced by the corresponding method in StructureMapper
00113     // We don't need two implementations with the same code.
00126     static Matrix4x4 mapThreeVectors
00127       (const Vector3& w1, const Vector3& w2, const Vector3& w3,
00128        const Vector3& v1, const Vector3& v2, const Vector3& v3);
00129 
00136     static Triple<bool, const Atom*, const Atom*>
00137     getTwoReferenceAtoms(const Atom& ref_center_atom, const HashSet<const Atom*>& allowed)
00138       ;
00139 
00142     static list<Atom*> reconstructFragment(Fragment& frag, const Fragment& tplate);
00144 
00145     protected:
00146     
00147     /*_ @name Protected attributes
00148     */
00149     //_@{
00150 
00151     /*_ Pointer to the fragment DB 
00152     */  
00153     const FragmentDB* fragment_db_;
00154     
00155     /*_ List of atoms inserted during the last application of the processor.
00156     */
00157     list<Atom*> inserted_atoms_;
00158     //_@}
00159   };
00160   
00161 } // namespace BALL
00162 
00163 #endif // BALL_STRUCTURE_RECONSTRUCFRAGMENTPROCESSOR_H