FuncChiRep.cxx
Go to the documentation of this file.
1 
12 #include "FuncChiRep.h"
13 
14 #include "graphics/ViewBase.h"
15 #include "pattern/string_convert.h"
17 
18 #include <iomanip>
19 #include <sstream>
20 
21 using std::string;
22 
23 using namespace hippodraw;
24 
26  : TextRepBase ( "Chi-squared" )
27 {
28 }
29 
31  : TextRepBase( rep )
32 {
33 }
34 
36 {
37  return new FuncChiRep ( *this );
38 }
39 
40 void
43  ViewBase & view )
44 {
45  const FunctionProjector & projector
46  = dynamic_cast< const FunctionProjector & > ( proj );
47 
48  int dof = projector.degreesOfFreedom ();
49 
50  std::ostringstream message;
51  message << "chi^2 / dof = "
52  << std::setprecision(3)
53  << projector.objectiveValue()
54  << " / " << dof;
55 
56  view.drawText ( message.str(), 5.0, 0.0, m_size, 0, 'l', 't', true,
57  0, &m_color );
58 }

Generated for HippoDraw Class Library by doxygen