Sophie

Sophie

distrib > Fedora > 13 > i386 > by-pkgid > eebc325dc36bd6e3b09b9b45133e42f8 > files > 2213

HippoDraw-devel-docs-1.21.1-10.fc13.i686.rpm

<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&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;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&nbsp;List</span></a></li>
      <li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
    </ul>
  </div>
  <div class="navpath"><a class="el" href="dir_390cfd4b32d48f53301526c593d2b8f8.html">datareps</a>
  </div>
</div>
<div class="contents">
<h1>XYPlot.cxx</h1><a href="XYPlot_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="comment">// for truncation warning in debug mode</span>
<a name="l00013"></a>00013 <span class="preprocessor">#ifdef _MSC_VER</span>
<a name="l00014"></a>00014 <span class="preprocessor"></span><span class="preprocessor">#include &quot;msdevstudio/MSconfig.h&quot;</span>
<a name="l00015"></a>00015 <span class="preprocessor">#endif</span>
<a name="l00016"></a>00016 <span class="preprocessor"></span>
<a name="l00017"></a>00017 <span class="preprocessor">#include &quot;<a class="code" href="XYPlot_8h.html" title="XYPlot classes interface.">XYPlot.h</a>&quot;</span>
<a name="l00018"></a>00018 
<a name="l00019"></a>00019 <span class="preprocessor">#include &quot;<a class="code" href="Map2Projector_8h.html" title="hippodraw::Map2Projector class interface">projectors/Map2Projector.h</a>&quot;</span>
<a name="l00020"></a>00020 <span class="preprocessor">#include &quot;<a class="code" href="SymbolPointRep_8h.html" title="hippodraw::SymbolPointRep class interface">reps/SymbolPointRep.h</a>&quot;</span>
<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>00024 <span class="keyword">using</span> std::string;
<a name="l00025"></a>00025 <span class="keyword">using</span> std::vector;
<a name="l00026"></a>00026 
<a name="l00027"></a>00027 
<a name="l00028"></a><a class="code" href="classhippodraw_1_1XYPlot.html#ada1b48adc919fd7cf4808fed8830297b">00028</a> XYPlot::XYPlot ( )
<a name="l00029"></a>00029 {
<a name="l00030"></a>00030   <a class="code" href="classhippodraw_1_1DataRep.html#adb41893ba19e889e56c559f25fc1a68a" title="The name of the display as it might be displayed in a GUI.">m_name</a> = <span class="stringliteral">&quot;XY Plot&quot;</span>;
<a name="l00031"></a>00031 
<a name="l00032"></a>00032   <a class="code" href="classhippodraw_1_1Map2Projector.html" title="A derived class of NTupleProjector that maps 2 ntuple columns to a two dimensional...">Map2Projector</a> * projector = <span class="keyword">new</span> <a class="code" href="classhippodraw_1_1Map2Projector.html" title="A derived class of NTupleProjector that maps 2 ntuple columns to a two dimensional...">Map2Projector</a>();
<a name="l00033"></a>00033   projector-&gt;<a class="code" href="classhippodraw_1_1Map2Projector.html#a476d8a1119e3342b231096ff604ec731" title="Sets whether the X error options are to be enabled or not.">setXErrorOption</a> ( <span class="keyword">true</span> ); <span class="comment">// method not in ProjectorBase</span>
<a name="l00034"></a>00034   projector-&gt;<a class="code" href="classhippodraw_1_1Map2Projector.html#a96a94e4d660d3fcfb12d9efa5804e943" title="Sets whether the Y error options are to be enabled or not.">setYErrorOption</a> ( <span class="keyword">true</span> );
<a name="l00035"></a>00035   <a class="code" href="classhippodraw_1_1DataRep.html#aa7c0d96e4919970f6e1823693f5cdc27" title="A projector used to transform data to projected values that will be plotted.">m_projector</a> = projector;
<a name="l00036"></a>00036 
<a name="l00037"></a>00037   <a class="code" href="classhippodraw_1_1DataRep.html#a4a95e3eb102edf27f2493407c711908d" title="The representation used for drawing each data point in the view.">m_rep</a> = <span class="keyword">new</span> <a class="code" href="classhippodraw_1_1SymbolPointRep.html" title="A PointRep class draws a symbol to represent the value.">SymbolPointRep</a> ( <a class="code" href="namespacehippodraw_1_1Symbol.html#a1d1cfd8ffb84e947f82999c682b666a7a422a101b5abb93b446234c65ff7efc29">Symbol::SOLIDSQUARE</a>, 4.0 );
<a name="l00038"></a>00038 }
<a name="l00039"></a>00039 
<a name="l00040"></a><a class="code" href="classhippodraw_1_1XYPlot.html#a9c1ed0172b026722ac23a85d45862cd2">00040</a> <a class="code" href="classhippodraw_1_1DataRep.html" title="The base class for data representations.">DataRep</a> * <a class="code" href="classhippodraw_1_1XYPlot.html#a9c1ed0172b026722ac23a85d45862cd2" title="The clone function returns an object of its own kind which is a copy of this object...">XYPlot::clone</a> ()
<a name="l00041"></a>00041 {
<a name="l00042"></a>00042   <span class="keywordflow">return</span> <span class="keyword">new</span> <a class="code" href="classhippodraw_1_1XYPlot.html#ada1b48adc919fd7cf4808fed8830297b" title="The default constructor.">XYPlot</a>( *<span class="keyword">this</span> );
<a name="l00043"></a>00043 }
<a name="l00044"></a>00044 
<a name="l00050"></a>00050 <span class="keywordtype">void</span>
<a name="l00051"></a>00051 <a class="code" href="classhippodraw_1_1XYPlot.html#aed4864dc0d19e3e5df5ea36529d6f164" title="Sets the point representation.">XYPlot::</a>
<a name="l00052"></a><a class="code" href="classhippodraw_1_1XYPlot.html#aed4864dc0d19e3e5df5ea36529d6f164">00052</a> <a class="code" href="classhippodraw_1_1XYPlot.html#aed4864dc0d19e3e5df5ea36529d6f164" title="Sets the point representation.">setRepresentation</a> ( <a class="code" href="classhippodraw_1_1RepBase.html" title="The base class for the point representation hierarchy.">RepBase</a> * rep )
<a name="l00053"></a>00053 {
<a name="l00054"></a>00054   <a class="code" href="classhippodraw_1_1DataRep.html#a9870b1378e32b2789ab4c68a0445c348" title="Sets the representation of the data points.">DataRep::setPointRep</a> ( rep );
<a name="l00055"></a>00055   <span class="keywordflow">if</span> ( rep -&gt; <a class="code" href="classhippodraw_1_1DataRep.html#a11c23a386abb9eb8a42f0c2c2835d640" title="Returns the name of the display.">name</a> () == <span class="stringliteral">&quot;Symbol&quot;</span> ) {
<a name="l00056"></a>00056     rep -&gt; setSize ( 4.0 );
<a name="l00057"></a>00057     <span class="keyword">const</span> vector &lt; string &gt; &amp; bindings = <a class="code" href="classhippodraw_1_1DataRep.html#aa7c0d96e4919970f6e1823693f5cdc27" title="A projector used to transform data to projected values that will be plotted.">m_projector</a> -&gt; getAxisBindings ();
<a name="l00058"></a>00058 
<a name="l00059"></a>00059     <span class="keywordtype">bool</span> yes = bindings[2] != <span class="stringliteral">&quot;nil&quot;</span>;
<a name="l00060"></a>00060     <a class="code" href="classhippodraw_1_1DataRep.html#a41def2e9cbc6b5be5674c5666e8d7593" title="Sets the display of error bar, if applicable, on the specified axis.">setErrorDisplay</a> ( <a class="code" href="namespacehippodraw_1_1Axes.html#a1d1cfd8ffb84e947f82999c682b666a7a58833a3110c570fb05130d40c365d1e4" title="X axis.">Axes::X</a>, yes );
<a name="l00061"></a>00061 
<a name="l00062"></a>00062     yes = bindings[3] != <span class="stringliteral">&quot;nil&quot;</span>;
<a name="l00063"></a>00063     <a class="code" href="classhippodraw_1_1DataRep.html#a41def2e9cbc6b5be5674c5666e8d7593" title="Sets the display of error bar, if applicable, on the specified axis.">setErrorDisplay</a> ( <a class="code" href="namespacehippodraw_1_1Axes.html#a1d1cfd8ffb84e947f82999c682b666a7a5596231eabd6cf29050967d5ac83ad84" title="Y axis.">Axes::Y</a>, yes );
<a name="l00064"></a>00064   }
<a name="l00065"></a>00065 }
<a name="l00066"></a>00066 
<a name="l00067"></a><a class="code" href="classhippodraw_1_1XYPlot.html#a12f8420575a62be909314e481c74ebd8">00067</a> <span class="keywordtype">bool</span> <a class="code" href="classhippodraw_1_1XYPlot.html#a12f8420575a62be909314e481c74ebd8" title="Returns true if the DataRep accepts functions on number variables.">XYPlot::acceptFunction</a> ( <span class="keywordtype">int</span> num )
<a name="l00068"></a>00068 {
<a name="l00069"></a>00069   <span class="keywordflow">return</span> num == 1;
<a name="l00070"></a>00070 }
<a name="l00071"></a>00071 
<a name="l00072"></a>00072 <span class="keywordtype">bool</span>
<a name="l00073"></a>00073 <a class="code" href="classhippodraw_1_1XYPlot.html#a16e2ab72fa2989c0bc12e5a4fce6baf1" title="Returns true.">XYPlot::</a>
<a name="l00074"></a><a class="code" href="classhippodraw_1_1XYPlot.html#a16e2ab72fa2989c0bc12e5a4fce6baf1">00074</a> <a class="code" href="classhippodraw_1_1XYPlot.html#a16e2ab72fa2989c0bc12e5a4fce6baf1" title="Returns true.">hasErrorDisplay</a> ()<span class="keyword"> const</span>
<a name="l00075"></a>00075 <span class="keyword"></span>{
<a name="l00076"></a>00076   <span class="keywordtype">bool</span> yes = <span class="keyword">true</span>;
<a name="l00077"></a>00077 
<a name="l00078"></a>00078   <span class="keywordflow">if</span> ( <a class="code" href="classhippodraw_1_1DataRep.html#a4a95e3eb102edf27f2493407c711908d" title="The representation used for drawing each data point in the view.">m_rep</a> -&gt; <a class="code" href="classhippodraw_1_1DataRep.html#a11c23a386abb9eb8a42f0c2c2835d640" title="Returns the name of the display.">name</a> () == <span class="stringliteral">&quot;Symbol&quot;</span> ) {
<a name="l00079"></a>00079     <span class="keyword">const</span> vector &lt; string &gt; &amp; bindings = <a class="code" href="classhippodraw_1_1DataRep.html#aa7c0d96e4919970f6e1823693f5cdc27" title="A projector used to transform data to projected values that will be plotted.">m_projector</a> -&gt; getAxisBindings ();
<a name="l00080"></a>00080     
<a name="l00081"></a>00081     yes = bindings[2] != <span class="stringliteral">&quot;nil&quot;</span> || bindings[3] != <span class="stringliteral">&quot;nil&quot;</span>;
<a name="l00082"></a>00082   }
<a name="l00083"></a>00083 
<a name="l00084"></a>00084   <span class="keywordflow">return</span> yes;
<a name="l00085"></a>00085 }
<a name="l00086"></a>00086 
<a name="l00087"></a>00087 
<a name="l00088"></a>00088 <span class="keywordtype">void</span>
<a name="l00089"></a>00089 <a class="code" href="classhippodraw_1_1XYPlot.html#a0a8e17ec166d91efc9581f25423bd73e" title="Sets the axis bindings.">XYPlot::</a>
<a name="l00090"></a><a class="code" href="classhippodraw_1_1XYPlot.html#a0a8e17ec166d91efc9581f25423bd73e">00090</a> <a class="code" href="classhippodraw_1_1XYPlot.html#a0a8e17ec166d91efc9581f25423bd73e" title="Sets the axis bindings.">setAxisBinding</a> ( <span class="keyword">const</span> std::string &amp; axis, <span class="keyword">const</span> std::string &amp; label )
<a name="l00091"></a>00091 {
<a name="l00092"></a>00092   <a class="code" href="classhippodraw_1_1XYPlot.html#a0a8e17ec166d91efc9581f25423bd73e" title="Sets the axis bindings.">DataRep::setAxisBinding</a> ( axis, label );
<a name="l00093"></a>00093 
<a name="l00094"></a>00094   <a class="code" href="classhippodraw_1_1NTupleProjector.html" title="An NTupleProjector is a projector that projects data from an DataSource object.">NTupleProjector</a> * projector 
<a name="l00095"></a>00095     = dynamic_cast &lt; <a class="code" href="classhippodraw_1_1NTupleProjector.html" title="An NTupleProjector is a projector that projects data from an DataSource object.">NTupleProjector</a> * &gt; ( <a class="code" href="classhippodraw_1_1DataRep.html#aa7c0d96e4919970f6e1823693f5cdc27" title="A projector used to transform data to projected values that will be plotted.">m_projector</a> );
<a name="l00096"></a>00096   <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> index = projector -&gt; indexOfBindingOption ( axis );
<a name="l00097"></a>00097 
<a name="l00098"></a>00098   <span class="keywordtype">bool</span> yes = label != <span class="stringliteral">&quot;nil&quot;</span>;
<a name="l00099"></a>00099   <span class="keywordflow">if</span> ( index == 2 ) {
<a name="l00100"></a>00100     <a class="code" href="classhippodraw_1_1DataRep.html#a41def2e9cbc6b5be5674c5666e8d7593" title="Sets the display of error bar, if applicable, on the specified axis.">setErrorDisplay</a> ( <a class="code" href="namespacehippodraw_1_1Axes.html#a1d1cfd8ffb84e947f82999c682b666a7a58833a3110c570fb05130d40c365d1e4" title="X axis.">Axes::X</a>, yes );
<a name="l00101"></a>00101   }
<a name="l00102"></a>00102 
<a name="l00103"></a>00103   <span class="keywordflow">if</span> ( index == 3 ) {
<a name="l00104"></a>00104     <a class="code" href="classhippodraw_1_1DataRep.html#a41def2e9cbc6b5be5674c5666e8d7593" title="Sets the display of error bar, if applicable, on the specified axis.">setErrorDisplay</a> ( <a class="code" href="namespacehippodraw_1_1Axes.html#a1d1cfd8ffb84e947f82999c682b666a7a5596231eabd6cf29050967d5ac83ad84" title="Y axis.">Axes::Y</a>, yes );
<a name="l00105"></a>00105   }
<a name="l00106"></a>00106 }
<a name="l00107"></a>00107 
<a name="l00108"></a>00108 <span class="keywordtype">void</span>
<a name="l00109"></a>00109 <a class="code" href="classhippodraw_1_1XYPlot.html#a8dc204ef345614efff40d62a66d3d255" title="Sets the axis bindings.">XYPlot::</a>
<a name="l00110"></a><a class="code" href="classhippodraw_1_1XYPlot.html#a8dc204ef345614efff40d62a66d3d255">00110</a> <a class="code" href="classhippodraw_1_1XYPlot.html#a8dc204ef345614efff40d62a66d3d255" title="Sets the axis bindings.">setAxisBindings</a> ( <span class="keyword">const</span> std::vector &lt; std::string &gt; &amp; new_bindings )
<a name="l00111"></a>00111 {
<a name="l00112"></a>00112   <a class="code" href="classhippodraw_1_1XYPlot.html#a8dc204ef345614efff40d62a66d3d255" title="Sets the axis bindings.">DataRep::setAxisBindings</a> ( new_bindings );
<a name="l00113"></a>00113 
<a name="l00114"></a>00114   <span class="keyword">const</span> vector &lt; string &gt; &amp; bindings = <a class="code" href="classhippodraw_1_1DataRep.html#aa7c0d96e4919970f6e1823693f5cdc27" title="A projector used to transform data to projected values that will be plotted.">m_projector</a> -&gt;<a class="code" href="classhippodraw_1_1ProjectorBase.html#af52b4a5d36499adfc001914d532746b1" title="Returns the axis bindings.">getAxisBindings</a> ();
<a name="l00115"></a>00115   <span class="keywordtype">bool</span> yes = bindings[2] != <span class="stringliteral">&quot;nil&quot;</span>;
<a name="l00116"></a>00116   <a class="code" href="classhippodraw_1_1DataRep.html#a41def2e9cbc6b5be5674c5666e8d7593" title="Sets the display of error bar, if applicable, on the specified axis.">setErrorDisplay</a> ( <a class="code" href="namespacehippodraw_1_1Axes.html#a1d1cfd8ffb84e947f82999c682b666a7a58833a3110c570fb05130d40c365d1e4" title="X axis.">Axes::X</a>, yes );
<a name="l00117"></a>00117 
<a name="l00118"></a>00118   yes = bindings[3] != <span class="stringliteral">&quot;nil&quot;</span>;
<a name="l00119"></a>00119   <a class="code" href="classhippodraw_1_1DataRep.html#a41def2e9cbc6b5be5674c5666e8d7593" title="Sets the display of error bar, if applicable, on the specified axis.">setErrorDisplay</a> ( <a class="code" href="namespacehippodraw_1_1Axes.html#a1d1cfd8ffb84e947f82999c682b666a7a5596231eabd6cf29050967d5ac83ad84" title="Y axis.">Axes::Y</a>, yes );
<a name="l00120"></a>00120 }
<a name="l00121"></a>00121 
<a name="l00122"></a>00122 <span class="keywordtype">bool</span>
<a name="l00123"></a>00123 <a class="code" href="classhippodraw_1_1XYPlot.html#aa0c9706bc92a98daae1a677ea435a161" title="Returns true if the data representation has specified axis type axis.">XYPlot::</a>
<a name="l00124"></a><a class="code" href="classhippodraw_1_1XYPlot.html#aa0c9706bc92a98daae1a677ea435a161">00124</a> <a class="code" href="classhippodraw_1_1XYPlot.html#aa0c9706bc92a98daae1a677ea435a161" title="Returns true if the data representation has specified axis type axis.">hasAxis</a> ( <a class="code" href="namespacehippodraw_1_1Axes.html#a1d1cfd8ffb84e947f82999c682b666a7" title="Axes constants.">hippodraw::Axes::Type</a> axis )<span class="keyword"> const</span>
<a name="l00125"></a>00125 <span class="keyword"></span>{
<a name="l00126"></a>00126   <span class="keywordflow">return</span> axis == <a class="code" href="namespacehippodraw_1_1Axes.html#a1d1cfd8ffb84e947f82999c682b666a7a58833a3110c570fb05130d40c365d1e4" title="X axis.">Axes::X</a> || axis == <a class="code" href="namespacehippodraw_1_1Axes.html#a1d1cfd8ffb84e947f82999c682b666a7a5596231eabd6cf29050967d5ac83ad84" title="Y axis.">Axes::Y</a>;
<a name="l00127"></a>00127 }
<a name="l00128"></a>00128 
</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>