00001
00002
00003
00004
00005
00006
00007 #ifndef BALL_STRUCTURE_ADDHYDROGENPROCESSOR_H
00008 #define BALL_STRUCTURE_ADDHYDROGENPROCESSOR_H
00009
00010 #ifndef BALL_CONCEPT_PROCESSOR_H
00011 #include <BALL/CONCEPT/processor.h>
00012 #endif
00013
00014 #ifndef BALL_MATHS_VECTOR3_H
00015 #include <BALL/MATHS/vector3.h>
00016 #endif
00017
00018 #ifndef BALL_KERNEL_ATOM_H
00019 #include <BALL/KERNEL/atom.h>
00020 #endif
00021
00022 #include <vector>
00023
00024 namespace BALL
00025 {
00026
00049 class BALL_EXPORT AddHydrogenProcessor
00050 : public UnaryProcessor<Composite>
00051 {
00052
00053 public:
00054
00056 AddHydrogenProcessor();
00057
00059 virtual ~AddHydrogenProcessor();
00060
00062 AddHydrogenProcessor(const AddHydrogenProcessor& hbp);
00063
00064 virtual bool start();
00065
00067 virtual Processor::Result operator() (Composite &composite);
00068
00070 Size getConnectivity(Atom& atom);
00071
00073 void setRings(const vector<vector<Atom*> >& rings);
00074
00076 Size getNumberOfAddedHydrogens() { return nr_hydrogens_;}
00077
00078 protected:
00079
00080 Size countBondOrders(Atom& atom);
00081 void addHydrogen_(Atom& atom, Vector3 position);
00082 inline bool isRingAtom_(Atom& atom);
00083 vector<Atom*> getPartners_(Atom& atom);
00084 Vector3 getNormal_(const Vector3& v);
00085 inline bool normalize_(Vector3& v);
00086 bool hasMultipleBond_(Atom& atom);
00087
00088 float getBondLength_(Position element);
00089
00090 HashSet<Atom*> ring_atoms_;
00091 Position atom_nr_;
00092 Atom* last_atom_;
00093 Size nr_hydrogens_;
00094 };
00095
00096 }
00097
00098 #endif // BALL_STRUCTURE_ADDHYDROGENPROCESSOR_H