19 #include <basic/Tracer.hh>
20 #include <utility/exit.hh>
21 #include <utility/stream_util.hh>
22 #include <utility/string_util.hh>
23 #include <basic/MetricValue.hh>
28 #include <utility/vector1.hh>
32 using namespace core::pose;
33 using namespace core::pose::metrics;
38 namespace simple_calculators {
40 void SasaCalculator::lookup(
std::string const & key, basic::MetricValueBase * valptr )
const {
42 if ( key ==
"total_sasa" ) {
43 basic::check_cast( valptr, &total_sasa_,
"total_sasa expects to return a Real" );
44 (
static_cast<basic::MetricValue<Real> *
>(valptr))->set( total_sasa_ );
46 }
else if ( key ==
"atom_sasa" ) {
47 basic::check_cast( valptr, &atom_sasa_,
"atom_sasa expects to return a id::AtomID_Map< Real >" );
48 (
static_cast<basic::MetricValue<id::AtomID_Map< Real >
> *>(valptr))->set( atom_sasa_ );
50 }
else if ( key ==
"residue_sasa" ) {
51 basic::check_cast( valptr, &residue_sasa_,
"residue_sasa expects to return a utility::vector1< Real >" );
52 (
static_cast<basic::MetricValue<utility::vector1< Real >
> *>(valptr))->set( residue_sasa_ );
55 basic::Error() <<
"This Calculator cannot compute metric " << key << std::endl;
64 if ( key ==
"total_sasa" ) {
65 return utility::to_string( total_sasa_ );
66 }
else if ( key ==
"atom_sasa" ) {
67 basic::Error() <<
"id::AtomID_Map< Real > has no output operator, for metric " << key << std::endl;
69 }
else if ( key ==
"residue_sasa" ) {
70 return utility::to_string( residue_sasa_ );
73 basic::Error() <<
"This Calculator cannot compute metric " << key << std::endl;
80 void SasaCalculator::recompute(
Pose const & this_pose ) {