24 #include <utility/exit.hh>
26 #include <basic/MetricValue.hh>
31 #include <utility/vector1.hh>
36 using namespace core::pose;
37 using namespace core::pose::metrics;
42 namespace pose_metric_calculators {
44 ChargeCalculator::ChargeCalculator()
45 : total_charge_(0.0), total_pos_charges_(0),
46 total_neg_charges_(0), SR_total_charge_(0.0),
47 SR_total_pos_charges_(0), SR_total_neg_charges_(0)
51 std::set< core::Size >
const & special_region
52 ) : total_charge_(0.0), total_pos_charges_(0),
53 total_neg_charges_(0), SR_total_charge_(0.0),
54 SR_total_pos_charges_(0), SR_total_neg_charges_(0),
55 special_region_(special_region)
65 basic::MetricValueBase * valptr
69 if ( key ==
"total_charge" ) {
70 basic::check_cast( valptr, &
total_charge_,
"total_charge expects to return a Real" );
71 (
static_cast<basic::MetricValue<Real> *
>(valptr))->set(
total_charge_ );
73 }
else if ( key ==
"total_pos_charges" ) {
74 basic::check_cast( valptr, &
total_pos_charges_,
"total_pos_charges expects to return a Size" );
77 }
else if ( key ==
"total_neg_charges" ) {
78 basic::check_cast( valptr, &
total_neg_charges_,
"total_neg_charges expects to return a Size" );
81 }
else if ( key ==
"SR_total_charge" ) {
82 basic::check_cast( valptr, &
SR_total_charge_,
"SR_total_charge expects to return a Real" );
85 }
else if ( key ==
"SR_total_pos_charges" ) {
89 }
else if ( key ==
"SR_total_neg_charges" ) {
95 basic::Error() <<
"ChargeCalculator cannot compute the requested metric " << key << std::endl;
108 basic::Error() <<
"ChargeCalculator print function not written yet, developer too lazy, cannot compute metric " << key << std::endl;
121 using namespace core::chemical;