BALL 1.5.0
Loading...
Searching...
No Matches
BALL::AssignRadiusProcessor Class Reference

#include <BALL/STRUCTURE/defaultProcessors.h>

Inheritance diagram for BALL::AssignRadiusProcessor:
BALL::UnaryProcessor< Atom > BALL::UnaryFunctor< Atom, Processor::Result > BALL::AssignChargeProcessor

Public Member Functions

 AssignRadiusProcessor ()
 Default constructor.
 
 AssignRadiusProcessor (const String &filename)
 
virtual bool start ()
 
virtual bool finish ()
 
virtual Processor::Result operator() (Atom &atom)
 
void setFilename (const String &filename)
 
StringgetFilename ()
 
Size getNumberOfAssignments ()
 
Size getNumberOfErrors ()
 
- Public Member Functions inherited from BALL::UnaryProcessor< Atom >
 UnaryProcessor ()
 
 UnaryProcessor (const UnaryProcessor &)
 
virtual ~UnaryProcessor ()
 

Protected Member Functions

bool buildTable_ ()
 

Protected Attributes

String filename_
 
StringHashMap< floattable_
 
Size number_of_errors_
 
Size number_of_assignments_
 

Additional Inherited Members

- Public Types inherited from BALL::UnaryFunctor< Atom, Processor::Result >
typedef Processor::Result result_type
 
typedef Atom argument_type
 
typedef Atomargument_reference
 
typedef const Atomconst_argument_reference
 
typedef Atomargument_pointer
 
typedef const Atomconst_argument_pointer
 

Detailed Description

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.

Definition at line 62 of file defaultProcessors.h.

Constructor & Destructor Documentation

◆ AssignRadiusProcessor() [1/2]

BALL::AssignRadiusProcessor::AssignRadiusProcessor ( )

Default constructor.

◆ AssignRadiusProcessor() [2/2]

BALL::AssignRadiusProcessor::AssignRadiusProcessor ( const String & filename)

Detailled constructor.

Exceptions
BALL::Exception::FileNotFoundif the file can not be found in the actual path.

Member Function Documentation

◆ buildTable_()

bool BALL::AssignRadiusProcessor::buildTable_ ( )
protected

Extract the data from the file.

Exceptions
BALL::Exception::FileNotFound

◆ finish()

virtual bool BALL::AssignRadiusProcessor::finish ( )
virtual

Finish method. Allways returns true and does nothing.

Reimplemented from BALL::UnaryProcessor< Atom >.

◆ getFilename()

String & BALL::AssignRadiusProcessor::getFilename ( )

Return the current filename

◆ getNumberOfAssignments()

Size BALL::AssignRadiusProcessor::getNumberOfAssignments ( )

Return the number of assigned atoms.

◆ getNumberOfErrors()

Size BALL::AssignRadiusProcessor::getNumberOfErrors ( )

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.

◆ operator()()

virtual Processor::Result BALL::AssignRadiusProcessor::operator() ( Atom & atom)
virtual

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.

The matching of the atoms from the file with the atom of the container works like this:
1.) The original atomnames are tested.
2.) The full name of the atoms are compared.
3.) Wild card matching: "*:" + atom_name
See also
Residue

Reimplemented from BALL::UnaryProcessor< Atom >.

Reimplemented in BALL::AssignChargeProcessor.

◆ setFilename()

void BALL::AssignRadiusProcessor::setFilename ( const String & filename)

Set the filename to read the radii from.

Exceptions
BALL::Exception::FileNotFoundif the file can not be found in the actual path.

◆ start()

virtual bool BALL::AssignRadiusProcessor::start ( )
virtual

Start Method. The number of errors and the numbers of assignments are reset to 0. The radius data from the file is extracted.

Returns
bool, allways true

Reimplemented from BALL::UnaryProcessor< Atom >.

Reimplemented in BALL::AssignChargeProcessor.

Member Data Documentation

◆ filename_

String BALL::AssignRadiusProcessor::filename_
protected

Definition at line 131 of file defaultProcessors.h.

◆ number_of_assignments_

Size BALL::AssignRadiusProcessor::number_of_assignments_
protected

Definition at line 134 of file defaultProcessors.h.

◆ number_of_errors_

Size BALL::AssignRadiusProcessor::number_of_errors_
protected

Definition at line 133 of file defaultProcessors.h.

◆ table_

StringHashMap<float> BALL::AssignRadiusProcessor::table_
protected

Definition at line 132 of file defaultProcessors.h.