00001 // -*- Mode: C++; tab-width: 2; -*- 00002 // vi: set ts=2: 00003 // 00004 // $Id: assignTypes.h,v 1.16 2005/12/23 17:01:51 amoll Exp $ 00005 // 00006 00007 // Molecular Mechanics: atom type assignment 00008 00009 #ifndef BALL_MOLMEC_COMMON_ASSIGNTYPES_H 00010 #define BALL_MOLMEC_COMMON_ASSIGNTYPES_H 00011 00012 #ifndef BALL_CONCEPT_PROCESSOR_H 00013 # include <BALL/CONCEPT/processor.h> 00014 #endif 00015 00016 #ifndef BALL_MOLMEC_PARAMETER_ATOMTYPES_H 00017 # include <BALL/MOLMEC/PARAMETER/atomTypes.h> 00018 #endif 00019 00020 #include <vector> 00021 00022 namespace BALL 00023 { 00025 class BALL_EXPORT AssignBaseProcessor 00026 : public UnaryProcessor<Atom> 00027 { 00028 public: 00029 00031 AssignBaseProcessor(); 00032 00037 void setMaximumUnassignedAtoms(Size nr); 00038 00042 Size getMaximumUnassignedAtoms() const; 00043 00045 Size getNumberOfUnassignedAtoms() const; 00046 00048 HashSet<const Atom*>& getUnassignedAtoms(); 00049 00050 protected: 00051 00052 //_ Atoms, for which the setup of the force field fails 00053 HashSet<const Atom*> unassigned_atoms_; 00054 00055 //_ max number of unassigned atoms 00056 Size max_number_unassigned_atoms_; 00057 }; 00058 00059 00063 class BALL_EXPORT AssignTypeProcessor 00064 : public AssignBaseProcessor 00065 { 00066 public: 00067 00071 00074 AssignTypeProcessor(const AtomTypes& atom_types); 00075 00077 00080 00083 virtual Processor::Result operator () (Atom& atom); 00084 00086 00087 protected: 00088 00089 AtomTypes atom_types_; 00090 00091 }; 00092 00093 00097 class BALL_EXPORT AssignTypeNameProcessor 00098 : public AssignBaseProcessor 00099 { 00100 public: 00101 00105 00108 AssignTypeNameProcessor(const String& filename, bool overwrite = false); 00109 00111 00114 00117 virtual Processor::Result operator () (Atom& atom); 00118 00120 00121 protected: 00122 00123 StringHashMap<String> type_map_; 00124 00125 bool overwrite_; 00126 }; 00127 } // namespace BALL 00128 00129 00130 #endif // BALL_MOLMEC_COMMON_ASSIGNTYPES_H