FuncParmRep.cxx
Go to the documentation of this file.
1 
12 #include "FuncParmRep.h"
13 
14 #include "functions/FunctionBase.h"
15 #include "graphics/ViewBase.h"
16 #include "pattern/string_convert.h"
18 
19 using std::string;
20 using std::vector;
21 
22 using namespace hippodraw;
23 
25  : TextRepBase ( "Function Parameters" )
26 {
27 }
28 
30  : TextRepBase( rep )
31 {
32 }
33 
35 {
36  return new FuncParmRep( *this );
37 }
38 
39 void
42  ViewBase & view )
43 {
44  const FunctionProjector & projector
45  = dynamic_cast< const FunctionProjector & > ( proj );
46 
47  FunctionBase * function = projector.function ();
48 
49  string text = function -> name ();
50 
51  const vector < string > & parm_names = function->parmNames ();
52  const vector < double > & parm_values =function->getParameters ();
53 
54  for ( unsigned int i = 0; i < parm_names.size (); i++ ) {
55  text += "\n" + parm_names[i];
56  text += " = ";
57  text += String::convert ( parm_values[i] );
58  }
59 
60  view.drawText ( text, 5.0, 0., m_size, 0, 'l', 't', true, 0, & m_color );
61 }

Generated for HippoDraw Class Library by doxygen