<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>HippoDraw Class Library</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> <link href="tabs.css" rel="stylesheet" type="text/css"> <link rel="shortcut icon" href="hippoApp.ico"> </head><body> <!-- Generated by Doxygen 1.6.2 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> <li><a href="dirs.html"><span>Directories</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>File Members</span></a></li> </ul> </div> <div class="navpath"><a class="el" href="dir_6dcc65b7c74f97460af44109581e51d3.html">reps</a> </div> </div> <div class="contents"> <h1>FuncParmRep.cxx</h1><a href="FuncParmRep_8cxx.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <a name="l00012"></a>00012 <span class="preprocessor">#include "<a class="code" href="FuncParmRep_8h.html" title="FuncParmRep class interface.">FuncParmRep.h</a>"</span> <a name="l00013"></a>00013 <a name="l00014"></a>00014 <span class="preprocessor">#include "<a class="code" href="FunctionBase_8h.html" title="hippodraw::FunctionBase class interface">functions/FunctionBase.h</a>"</span> <a name="l00015"></a>00015 <span class="preprocessor">#include "<a class="code" href="ViewBase_8h.html" title="hippodraw::ViewBase class interface">graphics/ViewBase.h</a>"</span> <a name="l00016"></a>00016 <span class="preprocessor">#include "<a class="code" href="string__convert_8h.html" title="The namespace for conversion to string.">pattern/string_convert.h</a>"</span> <a name="l00017"></a>00017 <span class="preprocessor">#include "<a class="code" href="FunctionProjector_8h.html" title="hippodraw::FunctionProjector class interface">projectors/FunctionProjector.h</a>"</span> <a name="l00018"></a>00018 <a name="l00019"></a>00019 <span class="keyword">using</span> std::string; <a name="l00020"></a>00020 <span class="keyword">using</span> std::vector; <a name="l00021"></a>00021 <a name="l00022"></a>00022 <span class="keyword">using namespace </span>hippodraw; <a name="l00023"></a>00023 <a name="l00024"></a><a class="code" href="classhippodraw_1_1FuncParmRep.html#a50458bef3fe969e2190e60b9ae76851b">00024</a> FuncParmRep::FuncParmRep ( ) <a name="l00025"></a>00025 : <a class="code" href="classhippodraw_1_1TextRepBase.html" title="A base class for representations that draws a value as text.">TextRepBase</a> ( <span class="stringliteral">"Function Parameters"</span> ) <a name="l00026"></a>00026 { <a name="l00027"></a>00027 } <a name="l00028"></a>00028 <a name="l00029"></a><a class="code" href="classhippodraw_1_1FuncParmRep.html#ab17ba62bdb4a753c1c6086d03f04b1ce">00029</a> <a class="code" href="classhippodraw_1_1FuncParmRep.html#a50458bef3fe969e2190e60b9ae76851b" title="The default constructor.">FuncParmRep::FuncParmRep</a> ( <span class="keyword">const</span> <a class="code" href="classhippodraw_1_1FuncParmRep.html" title="A Representation that draws the values of function parameters.">FuncParmRep</a> & rep ) <a name="l00030"></a>00030 : <a class="code" href="classhippodraw_1_1TextRepBase.html" title="A base class for representations that draws a value as text.">TextRepBase</a>( rep ) <a name="l00031"></a>00031 { <a name="l00032"></a>00032 } <a name="l00033"></a>00033 <a name="l00034"></a><a class="code" href="classhippodraw_1_1FuncParmRep.html#ab2b96fa7b2189b29a67f432912d081c2">00034</a> <a class="code" href="classhippodraw_1_1RepBase.html" title="The base class for the point representation hierarchy.">RepBase</a> * <a class="code" href="classhippodraw_1_1FuncParmRep.html#ab2b96fa7b2189b29a67f432912d081c2" title="The clone function returns an object of its own kind which is a copy of this object...">FuncParmRep::clone</a> () <a name="l00035"></a>00035 { <a name="l00036"></a>00036 <span class="keywordflow">return</span> <span class="keyword">new</span> <a class="code" href="classhippodraw_1_1FuncParmRep.html#a50458bef3fe969e2190e60b9ae76851b" title="The default constructor.">FuncParmRep</a>( *<span class="keyword">this</span> ); <a name="l00037"></a>00037 } <a name="l00038"></a>00038 <a name="l00039"></a>00039 <span class="keywordtype">void</span> <a name="l00040"></a>00040 <a class="code" href="classhippodraw_1_1FuncParmRep.html#a4cc64b6a532e957ddfe09425f919c3bd" title="Draws the values from the projector to the view.">FuncParmRep::</a> <a name="l00041"></a><a class="code" href="classhippodraw_1_1FuncParmRep.html#a4cc64b6a532e957ddfe09425f919c3bd">00041</a> <a class="code" href="classhippodraw_1_1FuncParmRep.html#a4cc64b6a532e957ddfe09425f919c3bd" title="Draws the values from the projector to the view.">drawProjectedValues</a> ( <a class="code" href="classhippodraw_1_1ProjectorBase.html" title="The base class for the Projector hierarchy.">ProjectorBase</a> & proj, <a name="l00042"></a>00042 <a class="code" href="classhippodraw_1_1ViewBase.html" title="The abstract base class for views.">ViewBase</a> & view ) <a name="l00043"></a>00043 { <a name="l00044"></a>00044 <span class="keyword">const</span> <a class="code" href="classhippodraw_1_1FunctionProjector.html" title="A projector that plots one function.">FunctionProjector</a> & projector <a name="l00045"></a>00045 = <span class="keyword">dynamic_cast<</span> <span class="keyword">const </span><a class="code" href="classhippodraw_1_1FunctionProjector.html" title="A projector that plots one function.">FunctionProjector</a> & <span class="keyword">></span> ( proj ); <a name="l00046"></a>00046 <a name="l00047"></a>00047 <a class="code" href="classhippodraw_1_1FunctionBase.html" title="A function that can be added to a DataRep and used in a fitter.">FunctionBase</a> * function = projector.<a class="code" href="classhippodraw_1_1FunctionProjector.html#a3f4729504d1bf7595bec0c800e421bcd" title="Returns a pointer to the contained function.">function</a> (); <a name="l00048"></a>00048 <a name="l00049"></a>00049 <span class="keywordtype">string</span> text = function -> <a class="code" href="classhippodraw_1_1RepBase.html#a11c23a386abb9eb8a42f0c2c2835d640" title="Returns the name of the representation.">name</a> (); <a name="l00050"></a>00050 <a name="l00051"></a>00051 <span class="keyword">const</span> vector < string > & parm_names = function-><a class="code" href="classhippodraw_1_1FunctionBase.html#a5cd61d6494588c53f64ea1b4497a58e8" title="Returns a reference to a vector of parameter names.">parmNames</a> (); <a name="l00052"></a>00052 <span class="keyword">const</span> vector < double > & parm_values =function-><a class="code" href="classhippodraw_1_1FunctionBase.html#ab6d95a533aca7f862becee6eca151a68" title="Returns the values of the parameters as a vector.">getParameters</a> (); <a name="l00053"></a>00053 <a name="l00054"></a>00054 <span class="keywordflow">for</span> ( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = 0; i < parm_names.size (); i++ ) { <a name="l00055"></a>00055 text += <span class="stringliteral">"\n"</span> + parm_names[i]; <a name="l00056"></a>00056 text += <span class="stringliteral">" = "</span>; <a name="l00057"></a>00057 text += <a class="code" href="namespacehippodraw_1_1Axes.html#ae2337bddf33bc8b17dd5c08e665422cd" title="Converts from string representation ot Axes::Type representation.">String::convert</a> ( parm_values[i] ); <a name="l00058"></a>00058 } <a name="l00059"></a>00059 <a name="l00060"></a>00060 view.<a class="code" href="classhippodraw_1_1ViewBase.html#a22a47195eeee5c3564b9cb9389460ff5" title="Draws a text string at a point in the view&#39;s coordinate system.">drawText</a> ( text, 5.0, 0., <a class="code" href="classhippodraw_1_1RepBase.html#a62b5da1fc596e97288d8b46245437ade" title="The size of the representation.">m_size</a>, 0, <span class="charliteral">'l'</span>, <span class="charliteral">'t'</span>, <span class="keyword">true</span>, 0, & <a class="code" href="classhippodraw_1_1RepBase.html#a84fab7a272aa627b0cdac824474d3a17" title="The color of the representation.">m_color</a> ); <a name="l00061"></a>00061 } </pre></div></div> <hr size="1"><address style="align: right;"><small> Generated for HippoDraw Class Library by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border=0> </a> </small></address> </body> </html>