/usr/include/BALL/STRUCTURE/defaultProcessors.h is in libball1.4-dev 1.4.3~beta1-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 | // -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
#ifndef BALL_STRUCTURE_DEFAULTPROCESSORS_H
#define BALL_STRUCTURE_DEFAULTPROCESSORS_H
#ifndef BALL_COMMON_H
# include <BALL/common.h>
#endif
#ifndef BALL_KERNEL_atom_H
# include <BALL/KERNEL/atom.h>
#endif
#ifndef BALL_MATHS_VECTOR3_H
# include <BALL/MATHS/vector3.h>
#endif
#ifndef BALL_CONCEPT_PROCESSOR_H
# include <BALL/CONCEPT/processor.h>
#endif
#ifndef BALL_DATATYPE_STRINGHASHMAP_H
# include <BALL/DATATYPE/stringHashMap.h>
#endif
namespace BALL
{
/** Clears the charge on all atoms
\ingroup StructureMiscellaneous
*/
class BALL_EXPORT ClearChargeProcessor
: public UnaryProcessor<Atom>
{
public:
/// Sets the charge to zero.
virtual Processor::Result operator()(Atom& atom);
};
/** Clears the radius of all atoms
\ingroup StructureMiscellaneous
*/
class BALL_EXPORT ClearRadiusProcessor
: public UnaryProcessor<Atom>
{
public:
/// Sets the radius to zero..
virtual Processor::Result operator()(Atom& atom);
};
/** Assigns the radius to each atom.
This processor reads a radius table from a file and assigns each
atom a radius according to its name and the name of the fragment
the atom is contained in.
\ingroup StructureMiscellaneous
*/
class BALL_EXPORT AssignRadiusProcessor
: public UnaryProcessor<Atom>
{
public:
/// Default constructor
AssignRadiusProcessor();
/** Detailled constructor.
If the file can not be found in the actual path, FileNotFound is thrown.
*/
AssignRadiusProcessor(const String& filename)
throw(Exception::FileNotFound);
/** Start Method.
* The number of errors and the numbers of assignments are reset to 0.
* The radius data from the file is extracted.
* @return bool, allways true
*/
virtual bool start();
/** Finish method.
* Allways returns true and does nothing.
*/
virtual bool finish();
/** Applicator method
* The full names of all atoms in the container are compared to the
* atomnames from the file. For all matching atoms, the radii from the
* file are set.
* If for an atom from the container no matching atom from the file can be found,
* a warning is displayed and the number of errors increases.
* If in the file, the is a nonmatching atom, nothing happens.
* \par
* The matching of the atoms from the file with the atom of the container works like
* this: \par
* 1.) The original atomnames are tested. \par
* 2.) The full name of the atoms are compared. \par
* 3.) Wild card matching: <tt> "*:" + atom_name</tt> \par
* @see Residue
*/
virtual Processor::Result operator()(Atom& atom);
/** Set the filename to read the radii from.
* If the file can not be found in the actual path, FileNotFound is thrown.
*/
void setFilename(const String& filename)
throw(Exception::FileNotFound);
/** Return the current filename
*/
String& getFilename();
/** Return the number of assigned atoms.
*/
Size getNumberOfAssignments();
/** Return the number of unassignable atoms.
* Only the atoms from the container, which cannot be matched, count as errors.
* The unmatched atoms from the file dont care.
*/
Size getNumberOfErrors();
protected:
//_ Extract the data from the file.
bool buildTable_()
throw(Exception::FileNotFound);
String filename_;
StringHashMap<float> table_;
Size number_of_errors_;
Size number_of_assignments_;
};
/** Assigns a charge to each atom.
This processor reads a charge table from a file and assigns each
atom a charge according to its name and the name of the fragment
the atom is contained in.
\ingroup StructureMiscellaneous
*/
class BALL_EXPORT AssignChargeProcessor
: public AssignRadiusProcessor
{
public:
/// Default constructor
AssignChargeProcessor();
/** Detailled constructor.
* If the file can not be found in the actual path, FileNotFound is thrown.
*/
AssignChargeProcessor(const String& filename)
throw(Exception::FileNotFound);
/** Start Method.
* The number of errors and the numbers of assignments are reset to 0.
* The charge data from the file is extracted.
* @return bool, always true
*/
virtual bool start();
/** Applicator method.
* This method works like its counterpart in AssignRadiusProcessor, but for charges.
* @see AssignRadiusProcessor::operator()
*/
virtual Processor::Result operator () (Atom& atom);
/** Returns the net assigned charge for all atoms.
*/
float getTotalCharge();
protected:
float total_charge_;
};
} // namespace BALL
#endif // BALL_STRUCTURE_DEFAULTPROCESSORS_H
|