Sophie

Sophie

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

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_28fb57ed95c79fe5ed14c4f71fb4c2a2.html">qt</a>
  </div>
</div>
<div class="contents">
<h1>PickTable.cxx</h1><a href="PickTable_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 &quot;<a class="code" href="PickTable_8h.html" title="hippodraw::PickTable class interface">PickTable.h</a>&quot;</span>
<a name="l00013"></a>00013 
<a name="l00014"></a>00014 <span class="preprocessor">#include &quot;<a class="code" href="DisplayController_8h.html" title="DisplayController class interface declaration.">controllers/DisplayController.h</a>&quot;</span>
<a name="l00015"></a>00015 <span class="preprocessor">#include &quot;<a class="code" href="DataRep_8h.html" title="hippodraw::DataRep class interface.">datareps/DataRep.h</a>&quot;</span>
<a name="l00016"></a>00016 <span class="preprocessor">#include &quot;<a class="code" href="DataSourceController_8h.html" title="DataSourceController class interface.">datasrcs/DataSourceController.h</a>&quot;</span>
<a name="l00017"></a>00017 <span class="preprocessor">#include &quot;<a class="code" href="NTuple_8h.html" title="hippodraw::NTuple class interface.">datasrcs/NTuple.h</a>&quot;</span>
<a name="l00018"></a>00018 <span class="preprocessor">#include &quot;<a class="code" href="NTupleSorter_8h.html" title="NTupleSorter class interface.">datasrcs/NTupleSorter.h</a>&quot;</span>
<a name="l00019"></a>00019 <span class="preprocessor">#include &quot;<a class="code" href="SymbolType_8h.html" title="SymbolType enumeration.">graphics/SymbolType.h</a>&quot;</span>
<a name="l00020"></a>00020 <span class="preprocessor">#include &quot;<a class="code" href="PlotterBase_8h.html" title="hippodraw::PlotterBase class interface.">plotters/PlotterBase.h</a>&quot;</span>
<a name="l00021"></a>00021 
<a name="l00022"></a>00022 <span class="preprocessor">#if QT_VERSION &lt; 0x040000</span>
<a name="l00023"></a>00023 <span class="preprocessor"></span><span class="preprocessor">#include &lt;qheader.h&gt;</span>
<a name="l00024"></a>00024 <span class="preprocessor">#include &lt;qlistview.h&gt;</span>
<a name="l00025"></a>00025 <span class="preprocessor">#else</span>
<a name="l00026"></a>00026 <span class="preprocessor"></span><span class="preprocessor">#include &lt;q3header.h&gt;</span>
<a name="l00027"></a>00027 <span class="preprocessor">#include &lt;q3listview.h&gt;</span>
<a name="l00028"></a>00028 <span class="preprocessor">#endif</span>
<a name="l00029"></a>00029 <span class="preprocessor"></span>
<a name="l00030"></a>00030 <span class="preprocessor">#include &lt;qlineedit.h&gt;</span>
<a name="l00031"></a>00031 <span class="preprocessor">#include &lt;qpushbutton.h&gt;</span>
<a name="l00032"></a>00032 <span class="preprocessor">#include &lt;qlabel.h&gt;</span>
<a name="l00033"></a>00033 <span class="preprocessor">#include &lt;qcheckbox.h&gt;</span>
<a name="l00034"></a>00034 
<a name="l00035"></a>00035 <span class="keyword">using</span> std::string;
<a name="l00036"></a>00036 <span class="keyword">using</span> std::vector;
<a name="l00037"></a>00037 
<a name="l00038"></a>00038 <span class="keyword">using namespace </span>hippodraw;
<a name="l00039"></a>00039 
<a name="l00040"></a>00040 PickTable::
<a name="l00041"></a><a class="code" href="classhippodraw_1_1PickTable.html#af5c333e6b232c85704e1f896d433b3fc">00041</a> PickTable ( <a class="code" href="classhippodraw_1_1PlotterBase.html" title="The base class for the PlotterBase hierarchy.">PlotterBase</a> * plotter )
<a name="l00042"></a>00042 {
<a name="l00043"></a>00043   <a class="code" href="classhippodraw_1_1PickTable.html#af592292899662dd0b006461b098b620e" title="The target PlotterBase object.">m_target</a> = plotter;
<a name="l00044"></a>00044 
<a name="l00045"></a>00045   <a class="code" href="classhippodraw_1_1NTuple.html" title="A DataSource class implemented with std::vector&amp;lt;double&amp;gt; to store the column...">NTuple</a> * ntuple = plotter -&gt; createPickTuple ();
<a name="l00046"></a>00046   <a class="code" href="classhippodraw_1_1PickTable.html#a4f563e95f0a42309230cc953b2a6e956" title="The object that maintains the NTuple of picked data points.">m_sorter</a> = <span class="keyword">new</span> <a class="code" href="classhippodraw_1_1NTupleSorter.html" title="A helper class to sort and keep sorted an NTuple.">NTupleSorter</a> ( ntuple );
<a name="l00047"></a>00047 
<a name="l00048"></a>00048   <span class="keyword">const</span> <span class="keywordtype">string</span> &amp; name = ntuple -&gt; getName ();
<a name="l00049"></a>00049   <a class="code" href="classPickTableBase.html#ad3e69295952790beef96a1d5bb44b0c5">m_title</a>-&gt;<a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qlabel.html#setText">setText</a> ( name.c_str() );
<a name="l00050"></a>00050 
<a name="l00051"></a>00051   <span class="keyword">const</span> <a class="code" href="classhippodraw_1_1DataRep.html" title="The base class for data representations.">DataRep</a> * rep = plotter-&gt;<a class="code" href="classhippodraw_1_1PlotterBase.html#a4b915f5fbccdb544a5de6b3e72dbec84" title="Returns the specified DataRep or null pointer if it doesn&amp;#39;t exits.">getDataRep</a> ( 0 );
<a name="l00052"></a>00052   <span class="keyword">const</span> <span class="keywordtype">string</span> &amp; <a class="code" href="namespacenum__util.html#af7e893a8c6a5f6a426480fc85cda4fa1">type</a> = rep -&gt; name ();
<a name="l00053"></a>00053 
<a name="l00054"></a>00054   <span class="keywordtype">string</span> text = <span class="stringliteral">&quot;Plot type : &quot;</span>;
<a name="l00055"></a>00055   text += type.c_str();
<a name="l00056"></a>00056   <a class="code" href="classPickTableBase.html#a53db15e0f8931fc4bc72bc9ef4d76268">m_type</a>-&gt;<a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qlabel.html#setText">setText</a> ( text.c_str() );
<a name="l00057"></a>00057 
<a name="l00058"></a>00058   <span class="keyword">const</span> vector &lt; string &gt; &amp; labels = ntuple -&gt; getLabels ();
<a name="l00059"></a>00059   <a class="code" href="classPickTableBase.html#ae156d78c4be6983c3c9119d3fab17c4b">m_pick_table</a>-&gt;<a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qlistview.html#setColumnText">setColumnText</a> ( 1, labels[1].c_str() );
<a name="l00060"></a>00060   <a class="code" href="classPickTableBase.html#ae156d78c4be6983c3c9119d3fab17c4b">m_pick_table</a>-&gt;<a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qlistview.html#setColumnText">setColumnText</a> ( 2, labels[2].c_str() );
<a name="l00061"></a>00061   <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="namespacenum__util.html#a137f48a49d12a7dae8ba7c86db2a0c01">size</a> = ntuple -&gt; columns ();
<a name="l00062"></a>00062   <a class="code" href="classhippodraw_1_1PickTable.html#af27a091f84e50b8c3481c6a73c69c7ea" title="The number of columns of the pick table.">m_column</a> = size;
<a name="l00063"></a>00063   <span class="keywordflow">if</span> ( size == 3 ) {
<a name="l00064"></a>00064     <a class="code" href="classPickTableBase.html#ae156d78c4be6983c3c9119d3fab17c4b">m_pick_table</a> -&gt; removeColumn ( 3 );
<a name="l00065"></a>00065     <a class="code" href="classPickTableBase.html#a14cc19511d4396c7fe56b36f8074501f">zLineEdit</a> -&gt; setEnabled ( <span class="keyword">false</span> );
<a name="l00066"></a>00066     <a class="code" href="classPickTableBase.html#a8ede3cf3f8181ef1f9fe1e970e245cd4">wLineEdit</a> -&gt; setEnabled ( <span class="keyword">false</span> );
<a name="l00067"></a>00067   }
<a name="l00068"></a>00068   <span class="keywordflow">else</span> {
<a name="l00069"></a>00069     <a class="code" href="classPickTableBase.html#ae156d78c4be6983c3c9119d3fab17c4b">m_pick_table</a> -&gt; setColumnText ( 3, labels[3].c_str() );
<a name="l00070"></a>00070     <span class="keywordflow">if</span> ( size == 5 ) {
<a name="l00071"></a>00071       <span class="keyword">const</span> <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qstring.html">QString</a> &amp; str ( labels[4].c_str() );
<a name="l00072"></a>00072       <a class="code" href="classPickTableBase.html#ae156d78c4be6983c3c9119d3fab17c4b">m_pick_table</a> -&gt; addColumn ( str );
<a name="l00073"></a>00073     }
<a name="l00074"></a>00074     <span class="keywordflow">else</span> <a class="code" href="classPickTableBase.html#a8ede3cf3f8181ef1f9fe1e970e245cd4">wLineEdit</a> -&gt; setEnabled ( <span class="keyword">false</span> );
<a name="l00075"></a>00075   }
<a name="l00076"></a>00076 
<a name="l00077"></a>00077   <a class="code" href="classhippodraw_1_1DataSourceController.html#a4d152e42bfc604fb12ca5656a68017a9" title="Returns the pointer to the singleton instance.">DataSourceController::instance</a>()-&gt;<a class="code" href="classhippodraw_1_1DataSourceController.html#a36f566288e01236f92e4430a26c91283" title="Register a DataSource.">registerNTuple</a> ( ntuple );
<a name="l00078"></a>00078 
<a name="l00079"></a>00079 <span class="preprocessor">#if QT_VERSION &lt; 0x040000</span>
<a name="l00080"></a>00080 <span class="preprocessor"></span>  <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qheader.html">QHeader</a> * header = <a class="code" href="classPickTableBase.html#ae156d78c4be6983c3c9119d3fab17c4b">m_pick_table</a>-&gt;<a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qlistview.html#header">header</a>();
<a name="l00081"></a>00081 <span class="preprocessor">#else</span>
<a name="l00082"></a>00082 <span class="preprocessor"></span>  Q3Header * header = <a class="code" href="classPickTableBase.html#ae156d78c4be6983c3c9119d3fab17c4b">m_pick_table</a>-&gt;<a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qlistview.html#header">header</a>();
<a name="l00083"></a>00083 <span class="preprocessor">#endif</span>
<a name="l00084"></a>00084 <span class="preprocessor"></span>  connect ( header, SIGNAL ( clicked (<span class="keywordtype">int</span>) ), 
<a name="l00085"></a>00085             <span class="keyword">this</span>, SLOT( <a class="code" href="classhippodraw_1_1PickTable.html#a7be645228a4ebf3ea29c5365bb2aad9c" title="Sorts the table.">listSorted</a> ( <span class="keywordtype">int</span> ) ) );
<a name="l00086"></a>00086   <a class="code" href="classPickTableBase.html#ae156d78c4be6983c3c9119d3fab17c4b">m_pick_table</a>-&gt;<a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qlistview.html#setSorting">setSorting</a> ( -1 );
<a name="l00087"></a>00087   <a class="code" href="classPickTableBase.html#ae156d78c4be6983c3c9119d3fab17c4b">m_pick_table</a>-&gt;<a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qlistview.html#setShowSortIndicator">setShowSortIndicator</a> ( <span class="keyword">true</span> );
<a name="l00088"></a>00088   <a class="code" href="classPickTableBase.html#ab76649ab903a44ddc27cbb49c1e8592e">m_delete</a> -&gt; setEnabled ( <span class="keyword">false</span> );
<a name="l00089"></a>00089 
<a name="l00090"></a>00090   <span class="comment">// Picked points are show by default.</span>
<a name="l00091"></a>00091   <a class="code" href="classhippodraw_1_1PickTable.html#ab929947032bb7b113bee377e2cd6b265" title="Add DataRep object, called by constructor or show picked points check box.">addDataRep</a>();
<a name="l00092"></a>00092 }
<a name="l00093"></a>00093 
<a name="l00094"></a>00094 <span class="keywordtype">void</span>
<a name="l00095"></a>00095 <a class="code" href="classhippodraw_1_1PickTable.html#a7be645228a4ebf3ea29c5365bb2aad9c" title="Sorts the table.">PickTable::</a>
<a name="l00096"></a><a class="code" href="classhippodraw_1_1PickTable.html#a7be645228a4ebf3ea29c5365bb2aad9c">00096</a> <a class="code" href="classhippodraw_1_1PickTable.html#a7be645228a4ebf3ea29c5365bb2aad9c" title="Sorts the table.">listSorted</a> ( <span class="keywordtype">int</span> i )
<a name="l00097"></a>00097 {
<a name="l00098"></a>00098   <a class="code" href="classhippodraw_1_1PickTable.html#a4f563e95f0a42309230cc953b2a6e956" title="The object that maintains the NTuple of picked data points.">m_sorter</a> -&gt; setSorting ( i );
<a name="l00099"></a>00099   <a class="code" href="classhippodraw_1_1PickTable.html#a4f563e95f0a42309230cc953b2a6e956" title="The object that maintains the NTuple of picked data points.">m_sorter</a> -&gt; sort ( );
<a name="l00100"></a>00100 
<a name="l00101"></a>00101 <span class="preprocessor">#if QT_VERSION &lt; 0x040000</span>
<a name="l00102"></a>00102 <span class="preprocessor"></span>  <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qlistviewitem.html">QListViewItem</a> * item = <a class="code" href="classPickTableBase.html#ae156d78c4be6983c3c9119d3fab17c4b">m_pick_table</a> -&gt;<a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qlistview.html#selectedItem">selectedItem</a> ();
<a name="l00103"></a>00103 <span class="preprocessor">#else</span>
<a name="l00104"></a>00104 <span class="preprocessor"></span>  Q3ListViewItem * item = <a class="code" href="classPickTableBase.html#ae156d78c4be6983c3c9119d3fab17c4b">m_pick_table</a> -&gt;<a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qlistview.html#selectedItem">selectedItem</a> ();
<a name="l00105"></a>00105 <span class="preprocessor">#endif</span>
<a name="l00106"></a>00106 <span class="preprocessor"></span>  <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qstring.html">QString</a> text = item -&gt; text ( 0 );
<a name="l00107"></a>00107   <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> selected = text.<a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qstring.html#toUInt">toUInt</a> ();
<a name="l00108"></a>00108 
<a name="l00109"></a>00109   <a class="code" href="classhippodraw_1_1PickTable.html#a078915ceacc5b2c5ef6c2d9a278f761a" title="Refreshes the view of all the items.">refreshItems</a> ( selected );
<a name="l00110"></a>00110 }
<a name="l00111"></a>00111 
<a name="l00112"></a><a class="code" href="classhippodraw_1_1PickTable.html#ac8bb3912a3ce86b15842e79d0b421204">00112</a> <span class="keywordtype">void</span> <a class="code" href="classhippodraw_1_1PickTable.html#ac8bb3912a3ce86b15842e79d0b421204" title="Responds to the &amp;#39;clear&amp;#39; button click.">PickTable::clear</a>()
<a name="l00113"></a>00113 {
<a name="l00114"></a>00114   <a class="code" href="classPickTableBase.html#ae156d78c4be6983c3c9119d3fab17c4b">m_pick_table</a>-&gt;<a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qlistview.html#clear">clear</a>();
<a name="l00115"></a>00115   <a class="code" href="classhippodraw_1_1PickTable.html#a4f563e95f0a42309230cc953b2a6e956" title="The object that maintains the NTuple of picked data points.">m_sorter</a>-&gt;<a class="code" href="classhippodraw_1_1NTupleSorter.html#ac8bb3912a3ce86b15842e79d0b421204" title="Clears the NTuple.">clear</a>();
<a name="l00116"></a>00116 }
<a name="l00117"></a>00117 
<a name="l00118"></a>00118 <span class="keywordtype">void</span>
<a name="l00119"></a>00119 <a class="code" href="classhippodraw_1_1PickTable.html#a95ca11007e2d0855d391ec7c7b58121c" title="Adds a new point to the pick NTuple and the PickTable&amp;#39;s window.">PickTable::</a>
<a name="l00120"></a><a class="code" href="classhippodraw_1_1PickTable.html#a95ca11007e2d0855d391ec7c7b58121c">00120</a> <a class="code" href="classhippodraw_1_1PickTable.html#a95ca11007e2d0855d391ec7c7b58121c" title="Adds a new point to the pick NTuple and the PickTable&amp;#39;s window.">addItem</a> ( std::vector &lt; double &gt; &amp; v )
<a name="l00121"></a>00121 {
<a name="l00122"></a>00122   <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> row = <a class="code" href="classhippodraw_1_1PickTable.html#a4f563e95f0a42309230cc953b2a6e956" title="The object that maintains the NTuple of picked data points.">m_sorter</a> -&gt; rows ();
<a name="l00123"></a>00123   v[0] = row;
<a name="l00124"></a>00124   <a class="code" href="classhippodraw_1_1PickTable.html#a4f563e95f0a42309230cc953b2a6e956" title="The object that maintains the NTuple of picked data points.">m_sorter</a> -&gt; addRow ( v );
<a name="l00125"></a>00125 
<a name="l00126"></a>00126   <a class="code" href="classhippodraw_1_1PickTable.html#a078915ceacc5b2c5ef6c2d9a278f761a" title="Refreshes the view of all the items.">refreshItems</a> ( row );
<a name="l00127"></a>00127 }
<a name="l00128"></a>00128 
<a name="l00129"></a>00129 <span class="keywordtype">void</span>
<a name="l00130"></a>00130 <a class="code" href="classhippodraw_1_1PickTable.html#a078915ceacc5b2c5ef6c2d9a278f761a" title="Refreshes the view of all the items.">PickTable::</a>
<a name="l00131"></a><a class="code" href="classhippodraw_1_1PickTable.html#a078915ceacc5b2c5ef6c2d9a278f761a">00131</a> <a class="code" href="classhippodraw_1_1PickTable.html#a078915ceacc5b2c5ef6c2d9a278f761a" title="Refreshes the view of all the items.">refreshItems</a> ( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> select )
<a name="l00132"></a>00132 {
<a name="l00133"></a>00133   <a class="code" href="classPickTableBase.html#ae156d78c4be6983c3c9119d3fab17c4b">m_pick_table</a> -&gt; <a class="code" href="classhippodraw_1_1PickTable.html#ac8bb3912a3ce86b15842e79d0b421204" title="Responds to the &amp;#39;clear&amp;#39; button click.">clear</a>();
<a name="l00134"></a>00134 
<a name="l00135"></a>00135   <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> row = <a class="code" href="classhippodraw_1_1PickTable.html#a4f563e95f0a42309230cc953b2a6e956" title="The object that maintains the NTuple of picked data points.">m_sorter</a>-&gt;<a class="code" href="classhippodraw_1_1NTupleSorter.html#a2b76a8f13ad489df9fa8cc9452c9012b" title="Returns the number of rows of the NTuple.">rows</a> ();
<a name="l00136"></a>00136   <span class="keywordtype">bool</span> yes = row &gt; 0;
<a name="l00137"></a>00137   <a class="code" href="classPickTableBase.html#ab76649ab903a44ddc27cbb49c1e8592e">m_delete</a> -&gt; setEnabled ( yes );
<a name="l00138"></a>00138 
<a name="l00139"></a>00139   <span class="keywordflow">while</span> ( row-- != 0 ) {
<a name="l00140"></a>00140     <span class="keyword">const</span> vector &lt; double &gt; &amp; <a class="codeRef" doxygen="Minuit.tag:http://seal.web.cern.ch/seal/MathLibs/Minuit/html/" href="http://seal.web.cern.ch/seal/MathLibs/Minuit/html/classvec.html">vec</a> = <a class="code" href="classhippodraw_1_1PickTable.html#a4f563e95f0a42309230cc953b2a6e956" title="The object that maintains the NTuple of picked data points.">m_sorter</a>-&gt;<a class="code" href="classhippodraw_1_1NTupleSorter.html#ac295953ac88bc39038e4f22781577ec8" title="Returns a reference to the index row of the sorted NTuple.">getRow</a> ( row );
<a name="l00141"></a>00141     <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> current = static_cast &lt; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> &gt; ( vec[0] );
<a name="l00142"></a>00142 <span class="preprocessor">#if QT_VERSION &lt; 0x040000</span>
<a name="l00143"></a>00143 <span class="preprocessor"></span>    <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qlistviewitem.html">QListViewItem</a> * item = <span class="keyword">new</span> <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qlistviewitem.html">QListViewItem</a> ( <a class="code" href="classPickTableBase.html#ae156d78c4be6983c3c9119d3fab17c4b">m_pick_table</a> );
<a name="l00144"></a>00144 <span class="preprocessor">#else</span>
<a name="l00145"></a>00145 <span class="preprocessor"></span>    Q3ListViewItem * item = <span class="keyword">new</span> Q3ListViewItem ( <a class="code" href="classPickTableBase.html#ae156d78c4be6983c3c9119d3fab17c4b">m_pick_table</a> );
<a name="l00146"></a>00146 <span class="preprocessor">#endif</span>
<a name="l00147"></a>00147 <span class="preprocessor"></span>    <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="namespacenum__util.html#a137f48a49d12a7dae8ba7c86db2a0c01">size</a> = vec.size();
<a name="l00148"></a>00148 
<a name="l00149"></a>00149     <span class="keywordflow">for</span> ( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = 0; i &lt; size; i++ ) {
<a name="l00150"></a>00150       item -&gt; setText ( i, <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qstring.html">QString</a> ( <span class="stringliteral">&quot;%1&quot;</span> ).arg ( vec[i] ) );
<a name="l00151"></a>00151     }
<a name="l00152"></a>00152 
<a name="l00153"></a>00153     <a class="code" href="classPickTableBase.html#ae156d78c4be6983c3c9119d3fab17c4b">m_pick_table</a> -&gt; insertItem ( item );
<a name="l00154"></a>00154 
<a name="l00155"></a>00155     <span class="keywordflow">if</span> ( select == current ) {
<a name="l00156"></a>00156       <a class="code" href="classPickTableBase.html#ae156d78c4be6983c3c9119d3fab17c4b">m_pick_table</a> -&gt; setSelected ( item, <span class="keyword">true</span> );
<a name="l00157"></a>00157       <a class="code" href="classPickTableBase.html#ae156d78c4be6983c3c9119d3fab17c4b">m_pick_table</a> -&gt; ensureItemVisible ( item );
<a name="l00158"></a>00158     }
<a name="l00159"></a>00159   }
<a name="l00160"></a>00160 }
<a name="l00161"></a>00161 
<a name="l00162"></a>00162 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>
<a name="l00163"></a>00163 <a class="code" href="classhippodraw_1_1PickTable.html" title="A derived class of PickTableBase class which is generated by the Qt designer.">PickTable</a>::
<a name="l00164"></a>00164 <span class="preprocessor">#if QT_VERSION &lt; 0x040000</span>
<a name="l00165"></a><a class="code" href="classhippodraw_1_1PickTable.html#a1ffdd9bf1bbb89533305e8999e981006">00165</a> <span class="preprocessor"></span>indexOf ( <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qlistviewitem.html">QListViewItem</a> * target )
<a name="l00166"></a>00166 <span class="preprocessor">#else</span>
<a name="l00167"></a>00167 <span class="preprocessor"></span>indexOf ( Q3ListViewItem * target )
<a name="l00168"></a>00168 <span class="preprocessor">#endif</span>
<a name="l00169"></a>00169 <span class="preprocessor"></span>{
<a name="l00170"></a>00170   <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> index = 0;
<a name="l00171"></a>00171 <span class="preprocessor">#if QT_VERSION &lt; 0x040000</span>
<a name="l00172"></a>00172 <span class="preprocessor"></span>  <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qlistviewitem.html">QListViewItem</a> * item = m_pick_table -&gt; firstChild ();
<a name="l00173"></a>00173 <span class="preprocessor">#else</span>
<a name="l00174"></a>00174 <span class="preprocessor"></span>  Q3ListViewItem * item = m_pick_table -&gt; firstChild ();
<a name="l00175"></a>00175 <span class="preprocessor">#endif</span>
<a name="l00176"></a>00176 <span class="preprocessor"></span>  <span class="keywordflow">while</span> ( item != target ) {
<a name="l00177"></a>00177     index++;
<a name="l00178"></a>00178     item = item-&gt;nextSibling();
<a name="l00179"></a>00179     <span class="keywordflow">if</span> ( item == 0 ) <span class="keywordflow">break</span>;
<a name="l00180"></a>00180   }
<a name="l00181"></a>00181 
<a name="l00182"></a>00182   <span class="keywordflow">return</span> index;
<a name="l00183"></a>00183 }
<a name="l00184"></a>00184 
<a name="l00185"></a><a class="code" href="classhippodraw_1_1PickTable.html#a4cc155af425fe93e3889afb58d034277">00185</a> <span class="keywordtype">void</span> <a class="code" href="classhippodraw_1_1PickTable.html#a4cc155af425fe93e3889afb58d034277" title="Responds to the &amp;#39;Delete Selected Item&amp;#39; button click.">PickTable::deleteSelectedItem</a> ()
<a name="l00186"></a>00186 {
<a name="l00187"></a>00187 <span class="preprocessor">#if QT_VERSION &lt; 0x040000</span>
<a name="l00188"></a>00188 <span class="preprocessor"></span>  <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qlistviewitem.html">QListViewItem</a> * item = <a class="code" href="classPickTableBase.html#ae156d78c4be6983c3c9119d3fab17c4b">m_pick_table</a>-&gt;<a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qlistview.html#selectedItem">selectedItem</a> ();
<a name="l00189"></a>00189 <span class="preprocessor">#else</span>
<a name="l00190"></a>00190 <span class="preprocessor"></span>  Q3ListViewItem * item = <a class="code" href="classPickTableBase.html#ae156d78c4be6983c3c9119d3fab17c4b">m_pick_table</a>-&gt;<a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qlistview.html#selectedItem">selectedItem</a> ();
<a name="l00191"></a>00191 <span class="preprocessor">#endif</span>
<a name="l00192"></a>00192 <span class="preprocessor"></span>  <span class="keywordflow">if</span> ( item != 0 ) {
<a name="l00193"></a>00193     <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> index = <a class="code" href="classhippodraw_1_1PickTable.html#a1ffdd9bf1bbb89533305e8999e981006" title="Finds the index of the target QListViewItem.">indexOf</a> ( item );
<a name="l00194"></a>00194 
<a name="l00195"></a>00195     <a class="code" href="classhippodraw_1_1PickTable.html#a4f563e95f0a42309230cc953b2a6e956" title="The object that maintains the NTuple of picked data points.">m_sorter</a>-&gt;<a class="code" href="classhippodraw_1_1NTupleSorter.html#ad25d3586eb1053032c5096681d5d52ef" title="Erases a row from the NTuple.">eraseRow</a> ( index );
<a name="l00196"></a>00196 
<a name="l00197"></a>00197     <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> row = index == 0 ? 0 : index - 1;
<a name="l00198"></a>00198     <a class="code" href="classhippodraw_1_1PickTable.html#a078915ceacc5b2c5ef6c2d9a278f761a" title="Refreshes the view of all the items.">refreshItems</a> ( row );
<a name="l00199"></a>00199   }
<a name="l00200"></a>00200 }
<a name="l00201"></a>00201 
<a name="l00202"></a>00202 <span class="keywordtype">void</span>
<a name="l00203"></a>00203 <a class="code" href="classhippodraw_1_1PickTable.html#ab929947032bb7b113bee377e2cd6b265" title="Add DataRep object, called by constructor or show picked points check box.">PickTable::</a>
<a name="l00204"></a><a class="code" href="classhippodraw_1_1PickTable.html#ab929947032bb7b113bee377e2cd6b265">00204</a> <a class="code" href="classhippodraw_1_1PickTable.html#ab929947032bb7b113bee377e2cd6b265" title="Add DataRep object, called by constructor or show picked points check box.">addDataRep</a>()
<a name="l00205"></a>00205 {
<a name="l00206"></a>00206   <span class="keyword">const</span> <span class="keywordtype">string</span> plotTypeStr ( <span class="stringliteral">&quot;Scatter Plot&quot;</span> );  
<a name="l00207"></a>00207   <a class="code" href="classhippodraw_1_1NTuple.html" title="A DataSource class implemented with std::vector&amp;lt;double&amp;gt; to store the column...">NTuple</a> * ntuple = <a class="code" href="classhippodraw_1_1PickTable.html#a4f563e95f0a42309230cc953b2a6e956" title="The object that maintains the NTuple of picked data points.">m_sorter</a> -&gt; getNTuple ();
<a name="l00208"></a>00208   <span class="keyword">const</span> vector &lt; string &gt; &amp; labels = ntuple -&gt; getLabels ();
<a name="l00209"></a>00209   vector &lt; string &gt; bindings;
<a name="l00210"></a>00210   bindings.push_back ( labels[1] );
<a name="l00211"></a>00211   bindings.push_back ( labels[2] );
<a name="l00212"></a>00212   <span class="keywordflow">if</span> ( labels.size() == 4 ) {
<a name="l00213"></a>00213     <span class="keywordflow">if</span> ( labels[3] == <span class="stringliteral">&quot;Density&quot;</span> ) {
<a name="l00214"></a>00214       bindings[1] = <span class="stringliteral">&quot;Density&quot;</span>;
<a name="l00215"></a>00215     }
<a name="l00216"></a>00216   }
<a name="l00217"></a>00217 
<a name="l00218"></a>00218   <a class="code" href="classhippodraw_1_1DisplayController.html" title="A singleton class that is the interface between GUI and the displays.">DisplayController</a> * controller = <a class="code" href="classhippodraw_1_1DisplayController.html#aba45b6f55c38a5036c5ceb67c05ad94f" title="Returns the pointer to the singleton instance.">DisplayController::instance</a>();
<a name="l00219"></a>00219   <a class="code" href="classhippodraw_1_1DataRep.html" title="The base class for data representations.">DataRep</a> * rep 
<a name="l00220"></a>00220     = controller -&gt; <a class="code" href="classhippodraw_1_1PickTable.html#ab929947032bb7b113bee377e2cd6b265" title="Add DataRep object, called by constructor or show picked points check box.">addDataRep</a> ( <a class="code" href="classhippodraw_1_1PickTable.html#af592292899662dd0b006461b098b620e" title="The target PlotterBase object.">m_target</a>, plotTypeStr, 
<a name="l00221"></a>00221                                  ntuple, bindings );
<a name="l00222"></a>00222   <a class="code" href="classhippodraw_1_1PickTable.html#ace6603940f368848c0a15f3a2dd00e0e" title="The DataRep of picked points.">m_datarep</a> = rep;
<a name="l00223"></a>00223 
<a name="l00224"></a>00224   <span class="keyword">const</span> <a class="code" href="classhippodraw_1_1Color.html" title="A Color class for creating the color object following the standard RGB color space...">Color</a> red ( <a class="code" href="classhippodraw_1_1Color.html#a896c037a32087c5c20d97e64a1786880aace9033470c7bfe9523c814271251908">Color::red</a> );
<a name="l00225"></a>00225   rep -&gt; setRepColor ( red );
<a name="l00226"></a>00226   rep -&gt; setRepStyle ( <a class="code" href="namespacehippodraw_1_1Symbol.html#a1d1cfd8ffb84e947f82999c682b666a7aa79c827759ea48f0735386c4b1188911">Symbol::CIRCLE</a> );
<a name="l00227"></a>00227   rep -&gt; setRepSize ( 6.0 );
<a name="l00228"></a>00228 }
<a name="l00229"></a>00229 
<a name="l00230"></a>00230 <span class="keywordtype">void</span>
<a name="l00231"></a>00231 <a class="code" href="classhippodraw_1_1PickTable.html#a653e43e35be5eca4bb5a24af1790ca79" title="Responds to change of selection in the QListView.">PickTable::</a>
<a name="l00232"></a><a class="code" href="classhippodraw_1_1PickTable.html#a653e43e35be5eca4bb5a24af1790ca79">00232</a> <a class="code" href="classhippodraw_1_1PickTable.html#a653e43e35be5eca4bb5a24af1790ca79" title="Responds to change of selection in the QListView.">m_pick_table_selectionChanged</a> ()
<a name="l00233"></a>00233 {
<a name="l00234"></a>00234 <span class="preprocessor">#if QT_VERSION &lt; 0x040000</span>
<a name="l00235"></a>00235 <span class="preprocessor"></span>  <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qlistviewitem.html">QListViewItem</a> * item = <a class="code" href="classPickTableBase.html#ae156d78c4be6983c3c9119d3fab17c4b">m_pick_table</a> -&gt; selectedItem ();
<a name="l00236"></a>00236 <span class="preprocessor">#else</span>
<a name="l00237"></a>00237 <span class="preprocessor"></span>  Q3ListViewItem * item = <a class="code" href="classPickTableBase.html#ae156d78c4be6983c3c9119d3fab17c4b">m_pick_table</a> -&gt; selectedItem ();
<a name="l00238"></a>00238 <span class="preprocessor">#endif</span>
<a name="l00239"></a>00239 <span class="preprocessor"></span>  <span class="keywordtype">bool</span> yes = item != 0;
<a name="l00240"></a>00240 
<a name="l00241"></a>00241   <a class="code" href="classPickTableBase.html#ab76649ab903a44ddc27cbb49c1e8592e">m_delete</a> -&gt; setEnabled ( yes );
<a name="l00242"></a>00242 }
<a name="l00243"></a>00243 
<a name="l00244"></a>00244 <a class="code" href="classhippodraw_1_1NTuple.html" title="A DataSource class implemented with std::vector&amp;lt;double&amp;gt; to store the column...">NTuple</a> *
<a name="l00245"></a>00245 <a class="code" href="classhippodraw_1_1PickTable.html#a9103e68221f5039b4ed6ace9f5e4360c" title="Gets the pick table as a NTuple.">PickTable::</a>
<a name="l00246"></a><a class="code" href="classhippodraw_1_1PickTable.html#a9103e68221f5039b4ed6ace9f5e4360c">00246</a> <a class="code" href="classhippodraw_1_1PickTable.html#a9103e68221f5039b4ed6ace9f5e4360c" title="Gets the pick table as a NTuple.">getPickTable</a> ()<span class="keyword"> const</span>
<a name="l00247"></a>00247 <span class="keyword"></span>{
<a name="l00248"></a>00248   <a class="code" href="classhippodraw_1_1NTuple.html" title="A DataSource class implemented with std::vector&amp;lt;double&amp;gt; to store the column...">NTuple</a> * ntuple = <a class="code" href="classhippodraw_1_1PickTable.html#a4f563e95f0a42309230cc953b2a6e956" title="The object that maintains the NTuple of picked data points.">m_sorter</a> -&gt; getNTuple ();
<a name="l00249"></a>00249   <span class="keywordflow">return</span> ntuple;
<a name="l00250"></a>00250 }
<a name="l00251"></a>00251 
<a name="l00252"></a>00252 <span class="keywordtype">void</span>
<a name="l00253"></a>00253 <a class="code" href="classhippodraw_1_1PickTable.html#a5397224e5b464dce9c12075a44e16ac4" title="Responds to addEntry button.">PickTable::</a>
<a name="l00254"></a><a class="code" href="classhippodraw_1_1PickTable.html#a5397224e5b464dce9c12075a44e16ac4">00254</a> <a class="code" href="classhippodraw_1_1PickTable.html#a5397224e5b464dce9c12075a44e16ac4" title="Responds to addEntry button.">addEntry</a>()
<a name="l00255"></a>00255 {
<a name="l00256"></a>00256   vector &lt;double&gt; new_entry;
<a name="l00257"></a>00257   <span class="keywordtype">double</span> x=<a class="code" href="classPickTableBase.html#a03cf734f6377b88128b17ce07245e5c4">xLineEdit</a>-&gt;<a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qlineedit.html#text">text</a>().toDouble();
<a name="l00258"></a>00258   <span class="keywordtype">double</span> y=<a class="code" href="classPickTableBase.html#a8428233c73b5ac13850c7c055a1fcc6e">yLineEdit</a>-&gt;<a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qlineedit.html#text">text</a>().toDouble();
<a name="l00259"></a>00259   new_entry.push_back(3.0);
<a name="l00260"></a>00260   new_entry.push_back(x);
<a name="l00261"></a>00261   new_entry.push_back(y);
<a name="l00262"></a>00262   
<a name="l00263"></a>00263   <span class="keywordflow">if</span> ( <a class="code" href="classhippodraw_1_1PickTable.html#af27a091f84e50b8c3481c6a73c69c7ea" title="The number of columns of the pick table.">m_column</a> &gt; 3 ){
<a name="l00264"></a>00264     <span class="keywordtype">double</span> z=<a class="code" href="classPickTableBase.html#a14cc19511d4396c7fe56b36f8074501f">zLineEdit</a>-&gt;<a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qlineedit.html#text">text</a>().toDouble();
<a name="l00265"></a>00265     new_entry.push_back(z);
<a name="l00266"></a>00266   }
<a name="l00267"></a>00267   <span class="keywordflow">if</span> ( <a class="code" href="classhippodraw_1_1PickTable.html#af27a091f84e50b8c3481c6a73c69c7ea" title="The number of columns of the pick table.">m_column</a> == 5 ){
<a name="l00268"></a>00268     <span class="keywordtype">double</span> w=<a class="code" href="classPickTableBase.html#a8ede3cf3f8181ef1f9fe1e970e245cd4">wLineEdit</a>-&gt;<a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qlineedit.html#text">text</a>().toDouble();
<a name="l00269"></a>00269     new_entry.push_back(w);
<a name="l00270"></a>00270   }
<a name="l00271"></a>00271 
<a name="l00272"></a>00272   <a class="code" href="classhippodraw_1_1PickTable.html#a95ca11007e2d0855d391ec7c7b58121c" title="Adds a new point to the pick NTuple and the PickTable&amp;#39;s window.">addItem</a>(new_entry);
<a name="l00273"></a>00273 }
<a name="l00274"></a>00274 
<a name="l00275"></a>00275 <span class="keywordtype">void</span>
<a name="l00276"></a>00276 <a class="code" href="classhippodraw_1_1PickTable.html#a03bd8b1728f34d1ac294238ffe6236f2" title="Responds to the &amp;#39;Show picked points&amp;#39; check box click.">PickTable::</a>
<a name="l00277"></a><a class="code" href="classhippodraw_1_1PickTable.html#a03bd8b1728f34d1ac294238ffe6236f2">00277</a> <a class="code" href="classhippodraw_1_1PickTable.html#a03bd8b1728f34d1ac294238ffe6236f2" title="Responds to the &amp;#39;Show picked points&amp;#39; check box click.">pickedCheckBoxClicked</a>()
<a name="l00278"></a>00278 {
<a name="l00279"></a>00279   <span class="keywordtype">bool</span> <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qdialog.html#show">show</a> = <a class="code" href="classPickTableBase.html#a0bd4730e985fa825bc6f3100b9d1790c">m_pickedCheckBox</a>-&gt;<a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qcheckbox.html#isChecked">isChecked</a>();
<a name="l00280"></a>00280   <span class="keywordflow">if</span> (show) <a class="code" href="classhippodraw_1_1PickTable.html#ab929947032bb7b113bee377e2cd6b265" title="Add DataRep object, called by constructor or show picked points check box.">addDataRep</a>();
<a name="l00281"></a>00281   <span class="keywordflow">else</span> <a class="code" href="classhippodraw_1_1PickTable.html#af592292899662dd0b006461b098b620e" title="The target PlotterBase object.">m_target</a> -&gt; removeDataRep ( <a class="code" href="classhippodraw_1_1PickTable.html#ace6603940f368848c0a15f3a2dd00e0e" title="The DataRep of picked points.">m_datarep</a> );
<a name="l00282"></a>00282 }
</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>