#include <Alignment/CocoaToDDL/interface/UnitConverter.h>
Public Member Functions | |
std::string | ucstring () |
UnitConverter (ALIdouble val, const ALIstring &category) | |
~UnitConverter () | |
Public Attributes | |
bool | angl_ |
CocoaBestUnit * | bu_ |
Definition at line 15 of file UnitConverter.h.
Definition at line 18 of file UnitConverter.cc.
References angl_.
00019 : bu_(new CocoaBestUnit(val,category)), angl_(false) 00020 { 00021 if (category=="Angle") 00022 angl_=true; 00023 }
UnitConverter::~UnitConverter | ( | ) |
std::string UnitConverter::ucstring | ( | ) |
Definition at line 30 of file UnitConverter.cc.
References angl_, bu_, CocoaBestUnit::GetValue(), s, and x.
00031 { 00032 00033 std::ostrstream str; 00034 00035 if (angl_) { 00036 str.precision(11); 00037 double x = ( *(bu_->GetValue()) ) / deg; 00038 str << x << std::string("*deg") << '\0'; 00039 return std::string(str.str()); 00040 00041 } 00042 else { 00043 str << *bu_ << '\0'; 00044 std::string s(str.str()); 00045 return s.replace(s.find(" "),1,"*"); 00046 } 00047 //return s; 00048 00049 }