Sophie

Sophie

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

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>QtView.cxx</h1><a href="QtView_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">// inconsistent dll linkage</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="QtView_8h.html" title="hippodraw::QtView class interface">QtView.h</a>&quot;</span>
<a name="l00018"></a>00018 
<a name="l00019"></a>00019 <span class="preprocessor">#include &quot;<a class="code" href="DrawBorder_8h.html" title="DrawBorder class interface.">DrawBorder.h</a>&quot;</span>
<a name="l00020"></a>00020 
<a name="l00021"></a>00021 <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="l00022"></a>00022 
<a name="l00023"></a>00023 
<a name="l00024"></a>00024 <span class="preprocessor">#include &quot;qpainter.h&quot;</span>
<a name="l00025"></a>00025 <span class="preprocessor">#if QT_VERSION &lt; 0x040000</span>
<a name="l00026"></a>00026 <span class="preprocessor"></span><span class="preprocessor">#else</span>
<a name="l00027"></a>00027 <span class="preprocessor"></span><span class="preprocessor">#include &lt;QtGui/QPaintEngine&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;cassert&gt;</span>
<a name="l00031"></a>00031 <span class="preprocessor">#include &lt;iostream&gt;</span>
<a name="l00032"></a>00032 
<a name="l00033"></a>00033 <span class="keyword">using</span> std::vector;
<a name="l00034"></a>00034 
<a name="l00035"></a>00035 <span class="keyword">using namespace </span>hippodraw;
<a name="l00036"></a>00036 
<a name="l00037"></a><a class="code" href="classhippodraw_1_1QtView.html#a0991d8b34082aeb1959c4624b1e36040">00037</a> QtView::QtView ( <a class="code" href="classhippodraw_1_1PlotterBase.html" title="The base class for the PlotterBase hierarchy.">PlotterBase</a> * plotter )
<a name="l00038"></a>00038   : <a class="code" href="classhippodraw_1_1QtViewImp.html" title="The class of derived from ViewBase for drawing to the screen and PostScript generation...">QtViewImp</a> ( plotter ),
<a name="l00039"></a>00039 #if QT_VERSION &lt; 0x040000
<a name="l00040"></a>00040     <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qcanvasrectangle.html">QCanvasRectangle</a> ( 0 ),
<a name="l00041"></a>00041 #else
<a name="l00042"></a>00042     Q3CanvasRectangle ( 0 ),
<a name="l00043"></a>00043 #endif
<a name="l00044"></a>00044     m_filled ( false ),
<a name="l00045"></a>00045     m_crosshairs ( false )
<a name="l00046"></a>00046 {
<a name="l00047"></a>00047   assert ( plotter != 0 );
<a name="l00048"></a>00048   <a class="code" href="classhippodraw_1_1ViewBase.html#a1de80faff2428b8dc67995112931b636" title="The plotter object used by this view.">m_plotter</a> -&gt; addObserver ( <span class="keyword">this</span> );
<a name="l00049"></a>00049   setEnabled ( <span class="keyword">false</span> );
<a name="l00050"></a>00050 
<a name="l00051"></a>00051 }
<a name="l00052"></a>00052 
<a name="l00053"></a>00053 <a class="code" href="classhippodraw_1_1QtView.html#ae5ad991aca8c7d4bda093620b114cffd" title="The required virtual destructor.">QtView::</a>
<a name="l00054"></a><a class="code" href="classhippodraw_1_1QtView.html#ae5ad991aca8c7d4bda093620b114cffd">00054</a> <a class="code" href="classhippodraw_1_1QtView.html#ae5ad991aca8c7d4bda093620b114cffd" title="The required virtual destructor.">~QtView</a> ()
<a name="l00055"></a>00055 {
<a name="l00056"></a>00056   <span class="keywordflow">if</span> ( <a class="code" href="classhippodraw_1_1ViewBase.html#a1de80faff2428b8dc67995112931b636" title="The plotter object used by this view.">m_plotter</a> != 0 ) {
<a name="l00057"></a>00057     <a class="code" href="classhippodraw_1_1ViewBase.html#a1de80faff2428b8dc67995112931b636" title="The plotter object used by this view.">m_plotter</a> -&gt; removeObserver ( <span class="keyword">this</span> );
<a name="l00058"></a>00058   }
<a name="l00059"></a>00059   <span class="comment">// for SIP only</span>
<a name="l00060"></a>00060   <span class="comment">//  delete m_plotter;</span>
<a name="l00061"></a>00061 }
<a name="l00062"></a>00062 
<a name="l00065"></a>00065 <span class="keywordtype">void</span>
<a name="l00066"></a>00066 <a class="code" href="classhippodraw_1_1QtView.html#ab9c60fed84bdbfe64876b2c69b2cb291" title="Does the drawing with QPixmap cache instead of directly to paint device.">QtView::</a>
<a name="l00067"></a><a class="code" href="classhippodraw_1_1QtView.html#ab9c60fed84bdbfe64876b2c69b2cb291">00067</a> <a class="code" href="classhippodraw_1_1QtView.html#ab9c60fed84bdbfe64876b2c69b2cb291" title="Does the drawing with QPixmap cache instead of directly to paint device.">drawWithPixmap</a> ( <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qpainter.html">QPainter</a> &amp; painter )
<a name="l00068"></a>00068 
<a name="l00069"></a>00069 {
<a name="l00070"></a>00070   <span class="comment">// Before drawing set the aspect ratio.</span>
<a name="l00071"></a>00071   <span class="keyword">const</span> <a class="code" href="classhippodraw_1_1Rect.html" title="Class representing a rectangle.">Rect</a> rectOrg = <a class="code" href="classhippodraw_1_1QtView.html#a9b7c5f2dc9b2a9aff42c13200dae82aa" title="Overrides virtual function of ViewBase.">getDrawRect</a> ();
<a name="l00072"></a>00072 
<a name="l00073"></a>00073   <span class="keywordtype">int</span> x = static_cast &lt; <span class="keywordtype">int</span> &gt; ( rectOrg.<a class="code" href="classhippodraw_1_1Rect.html#af71e522ec6aa935c2618819b54f20e02" title="A shortcut to get origin.X.">getX</a> () );
<a name="l00074"></a>00074   <span class="keywordtype">int</span> y = static_cast &lt; <span class="keywordtype">int</span> &gt; ( rectOrg.<a class="code" href="classhippodraw_1_1Rect.html#acd84440598b1da2a23c326ce371db4e4" title="A shortcut to get origin.Y.">getY</a> () );
<a name="l00075"></a>00075 
<a name="l00076"></a>00076   
<a name="l00077"></a>00077   
<a name="l00078"></a>00078   <span class="comment">// Now work with the new rectangle</span>
<a name="l00079"></a>00079   <span class="keyword">const</span> <a class="code" href="classhippodraw_1_1Rect.html" title="Class representing a rectangle.">Rect</a> <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qcanvasrectangle.html#rect">rect</a> = <a class="code" href="classhippodraw_1_1QtView.html#a9b7c5f2dc9b2a9aff42c13200dae82aa" title="Overrides virtual function of ViewBase.">getDrawRect</a> ();
<a name="l00080"></a>00080   <span class="keywordtype">int</span> <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qcanvasrectangle.html#width">width</a> = static_cast &lt; <span class="keywordtype">int</span> &gt; ( rect.getWidth () );
<a name="l00081"></a>00081   <span class="keywordtype">int</span> <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qcanvasrectangle.html#height">height</a> = static_cast &lt; <span class="keywordtype">int</span> &gt; ( rect.getHeight () );
<a name="l00082"></a>00082   
<a name="l00083"></a>00083   <span class="keywordflow">if</span> ( <a class="code" href="classhippodraw_1_1QtView.html#a3012c259142e5c50c217c4de513fa637" title="A flag indicating if the buffer pixmap has been filled.">m_filled</a> == <span class="keyword">false</span> ||
<a name="l00084"></a>00084        isEnabled () == true ) {
<a name="l00085"></a>00085     <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qpainter.html">QPainter</a> offscrPainter;
<a name="l00086"></a>00086     <a class="code" href="classhippodraw_1_1QtView.html#aaa313d49762600362f42899fc260b541" title="Used by the double buffering done in method draw.">ensureOffScrSize</a> ( width, height );
<a name="l00087"></a>00087     <a class="code" href="classhippodraw_1_1QtView.html#a0038f4cb0abc9d4c6b6f69ebbc2f84a9" title="A QPixmap used for buffer the plot.">m_pixmap</a>.<a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qpixmap.html#fill">fill</a> ( );  <span class="comment">// with white</span>
<a name="l00088"></a>00088     offscrPainter.<a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qpainter.html#begin">begin</a> ( &amp; <a class="code" href="classhippodraw_1_1QtView.html#a0038f4cb0abc9d4c6b6f69ebbc2f84a9" title="A QPixmap used for buffer the plot.">m_pixmap</a> );
<a name="l00089"></a>00089     offscrPainter.<a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qpainter.html#translate">translate</a> ( -x, -y );
<a name="l00090"></a>00090     <a class="code" href="classhippodraw_1_1QtViewImp.html#a67b1b3cc5e4689425f4537bedb4ceb3f" title="The current Qt QPainter object.">m_painter</a> = &amp; offscrPainter;
<a name="l00091"></a>00091 
<a name="l00092"></a>00092     <a class="code" href="classhippodraw_1_1ViewBase.html#a7dd51b6bbe20a6d4fdd65068ef18bf54" title="Draws itself.">drawSelf</a> ();
<a name="l00093"></a>00093 
<a name="l00094"></a>00094     offscrPainter.<a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qpainter.html#end">end</a>();
<a name="l00095"></a>00095     <a class="code" href="classhippodraw_1_1QtView.html#a3012c259142e5c50c217c4de513fa637" title="A flag indicating if the buffer pixmap has been filled.">m_filled</a> = <span class="keyword">true</span>;
<a name="l00096"></a>00096     setEnabled ( <span class="keyword">false</span> );
<a name="l00097"></a>00097   }
<a name="l00098"></a>00098 
<a name="l00099"></a>00099   <a class="code" href="classhippodraw_1_1QtViewImp.html#a67b1b3cc5e4689425f4537bedb4ceb3f" title="The current Qt QPainter object.">m_painter</a> = &amp; painter;
<a name="l00100"></a>00100   painter.<a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qpainter.html#drawPixmap">drawPixmap</a> ( x, y, <a class="code" href="classhippodraw_1_1QtView.html#a0038f4cb0abc9d4c6b6f69ebbc2f84a9" title="A QPixmap used for buffer the plot.">m_pixmap</a>,
<a name="l00101"></a>00101                        0, 0, width, height );
<a name="l00102"></a>00102 }
<a name="l00103"></a>00103 
<a name="l00104"></a>00104 <span class="keywordtype">void</span>
<a name="l00105"></a>00105 <a class="code" href="classhippodraw_1_1QtView.html#a716a0b8641dc5fce63f4341adf871c96" title="Sets display status of cross-hairs.">QtView::</a>
<a name="l00106"></a><a class="code" href="classhippodraw_1_1QtView.html#a716a0b8641dc5fce63f4341adf871c96">00106</a> <a class="code" href="classhippodraw_1_1QtView.html#a716a0b8641dc5fce63f4341adf871c96" title="Sets display status of cross-hairs.">setShowCrossHairs</a> ( <span class="keywordtype">bool</span> yes )
<a name="l00107"></a>00107 {
<a name="l00108"></a>00108   <a class="code" href="classhippodraw_1_1QtView.html#a75b160b6bb7d5b55c9bf1c839c29a2bf" title="A flag indicating if cross-hairs should be drawn.">m_crosshairs</a> = yes;
<a name="l00109"></a>00109 }
<a name="l00110"></a>00110 
<a name="l00116"></a><a class="code" href="classhippodraw_1_1QtView.html#a85bf5f2fd170a0352fc7f81733a7f245">00116</a> <span class="keywordtype">void</span> <a class="code" href="classhippodraw_1_1QtView.html#a85bf5f2fd170a0352fc7f81733a7f245" title="Re-Implements the inherited function from QCanvasPoygonalItem.">QtView::draw</a> ( <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qpainter.html">QPainter</a> &amp; painter )
<a name="l00117"></a>00117 
<a name="l00118"></a>00118 {
<a name="l00119"></a>00119   <span class="keywordflow">if</span> ( <a class="code" href="classhippodraw_1_1ViewBase.html#a1de80faff2428b8dc67995112931b636" title="The plotter object used by this view.">m_plotter</a> == 0 ) <span class="keywordflow">return</span>;
<a name="l00120"></a>00120 
<a name="l00121"></a>00121   <a class="code" href="classhippodraw_1_1QtView.html#afe015d25f66d2eb4fcba514db4760933" title="A flag set true when drawing has stared.">m_is_drawing</a> = <span class="keyword">true</span>;
<a name="l00122"></a>00122   <span class="keyword">const</span> <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qcolor.html">QColor</a> color ( <span class="stringliteral">&quot;black&quot;</span> );
<a name="l00123"></a>00123   painter.<a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qpainter.html#setPen">setPen</a> ( color );
<a name="l00124"></a>00124 
<a name="l00125"></a>00125   <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qpaintdevice.html">QPaintDevice</a> * dev = painter.<a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qpainter.html#device">device</a> ();
<a name="l00126"></a>00126 <span class="preprocessor">#if QT_VERSION &lt; 0x040000</span>
<a name="l00127"></a>00127 <span class="preprocessor"></span>  <span class="keywordflow">if</span> ( <a class="code" href="classhippodraw_1_1ViewBase.html#a1de80faff2428b8dc67995112931b636" title="The plotter object used by this view.">m_plotter</a> -&gt; wantsPixmap () &amp;&amp; 
<a name="l00128"></a>00128        dev -&gt; isExtDev () == <span class="keyword">false</span> ) { <span class="comment">// not a printer</span>
<a name="l00129"></a>00129     <a class="code" href="classhippodraw_1_1QtView.html#ab9c60fed84bdbfe64876b2c69b2cb291" title="Does the drawing with QPixmap cache instead of directly to paint device.">drawWithPixmap</a> ( painter );
<a name="l00130"></a>00130   }
<a name="l00131"></a>00131 <span class="preprocessor">#else</span>
<a name="l00132"></a>00132 <span class="preprocessor"></span>  QPaintEngine * pe = dev -&gt; paintEngine ();
<a name="l00133"></a>00133   <a class="code" href="namespacehippodraw_1_1Axes.html#a1d1cfd8ffb84e947f82999c682b666a7" title="Axes constants.">QPaintEngine::Type</a> <a class="code" href="namespacenum__util.html#af7e893a8c6a5f6a426480fc85cda4fa1">type</a> = pe-&gt; <a class="code" href="namespacenum__util.html#af7e893a8c6a5f6a426480fc85cda4fa1">type</a> ();
<a name="l00134"></a>00134   <span class="keywordflow">if</span> ( <a class="code" href="classhippodraw_1_1ViewBase.html#a1de80faff2428b8dc67995112931b636" title="The plotter object used by this view.">m_plotter</a> -&gt; wantsPixmap () &amp;&amp; 
<a name="l00135"></a>00135        type != QPaintEngine::PostScript ) { 
<a name="l00136"></a>00136     <a class="code" href="classhippodraw_1_1QtView.html#ab9c60fed84bdbfe64876b2c69b2cb291" title="Does the drawing with QPixmap cache instead of directly to paint device.">drawWithPixmap</a> ( painter );
<a name="l00137"></a>00137   }
<a name="l00138"></a>00138 <span class="preprocessor">#endif</span>
<a name="l00139"></a>00139 <span class="preprocessor"></span>  <span class="keywordflow">else</span> {
<a name="l00140"></a>00140     <a class="code" href="classhippodraw_1_1QtViewImp.html#a67b1b3cc5e4689425f4537bedb4ceb3f" title="The current Qt QPainter object.">m_painter</a> = &amp; painter;
<a name="l00141"></a>00141     <a class="code" href="classhippodraw_1_1ViewBase.html#a7dd51b6bbe20a6d4fdd65068ef18bf54" title="Draws itself.">drawSelf</a> ();
<a name="l00142"></a>00142   }
<a name="l00143"></a>00143 
<a name="l00144"></a>00144   <span class="keywordflow">if</span> ( <a class="code" href="classhippodraw_1_1QtView.html#a75b160b6bb7d5b55c9bf1c839c29a2bf" title="A flag indicating if cross-hairs should be drawn.">m_crosshairs</a> ) {
<a name="l00145"></a>00145     <a class="code" href="classhippodraw_1_1ViewBase.html#a1de80faff2428b8dc67995112931b636" title="The plotter object used by this view.">m_plotter</a> -&gt; drawCrossHairs ( <span class="keyword">this</span> );
<a name="l00146"></a>00146   }
<a name="l00147"></a>00147 
<a name="l00148"></a>00148   <span class="keywordflow">if</span> ( isSelected () )
<a name="l00149"></a>00149     {
<a name="l00150"></a>00150       <a class="code" href="classhippodraw_1_1DrawBorder.html" title="A singleton class to draw the border with knobies around the selected display.">DrawBorder</a> * border = <a class="code" href="classhippodraw_1_1DrawBorder.html#a279f8a83d83deefd5175962d1d881e3a" title="Returns the pointer to the singleton instance.">DrawBorder::instance</a>();
<a name="l00151"></a>00151       border-&gt;<a class="code" href="classhippodraw_1_1DrawBorder.html#a76c921ff21c0093783ee86f2c1a2fd08" title="Sets the View object.">setView</a> (<span class="keyword">this</span>);
<a name="l00152"></a>00152       border-&gt;<a class="code" href="classhippodraw_1_1DrawBorder.html#a56c5cf8a568cff737ff95520cbe6b405" title="Does the actual drawing in the view.">draw</a>();
<a name="l00153"></a>00153     }
<a name="l00154"></a>00154   <a class="code" href="classhippodraw_1_1QtView.html#afe015d25f66d2eb4fcba514db4760933" title="A flag set true when drawing has stared.">m_is_drawing</a> = <span class="keyword">false</span>;
<a name="l00155"></a>00155 }
<a name="l00156"></a>00156 
<a name="l00158"></a><a class="code" href="classhippodraw_1_1QtView.html#a4cab9a8b8f282ebed56376730fb387a0">00158</a> <span class="keywordtype">void</span> <a class="code" href="classhippodraw_1_1QtView.html#a4cab9a8b8f282ebed56376730fb387a0" title="Overrides pure virtual function of QCanvasPolygonalItem.">QtView::drawShape</a> ( <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qpainter.html">QPainter</a> &amp; painter )
<a name="l00159"></a>00159 {
<a name="l00160"></a>00160   <a class="code" href="classhippodraw_1_1QtView.html#a85bf5f2fd170a0352fc7f81733a7f245" title="Re-Implements the inherited function from QCanvasPoygonalItem.">draw</a> ( painter );
<a name="l00161"></a>00161 }
<a name="l00162"></a>00162 
<a name="l00163"></a><a class="code" href="classhippodraw_1_1QtView.html#a9b7c5f2dc9b2a9aff42c13200dae82aa">00163</a> <a class="code" href="classhippodraw_1_1Rect.html" title="Class representing a rectangle.">Rect</a> <a class="code" href="classhippodraw_1_1QtView.html#a9b7c5f2dc9b2a9aff42c13200dae82aa" title="Overrides virtual function of ViewBase.">QtView::getDrawRect</a> ()<span class="keyword"> const</span>
<a name="l00164"></a>00164 <span class="keyword"></span>{
<a name="l00165"></a>00165   <span class="keywordflow">return</span> <a class="code" href="classhippodraw_1_1Rect.html" title="Class representing a rectangle.">Rect</a> ( x(), y(), <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qcanvasrectangle.html#width">width</a>(), <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qcanvasrectangle.html#height">height</a>() );
<a name="l00166"></a>00166 }
<a name="l00167"></a>00167 
<a name="l00168"></a>00168 <span class="keywordtype">void</span>
<a name="l00169"></a>00169 <a class="code" href="classhippodraw_1_1QtView.html#ae6b85d8f95c1889865463b18e33d08a5" title="Responds to Observable update message.">QtView::</a>
<a name="l00170"></a><a class="code" href="classhippodraw_1_1QtView.html#ae6b85d8f95c1889865463b18e33d08a5">00170</a> <a class="code" href="classhippodraw_1_1QtView.html#ae6b85d8f95c1889865463b18e33d08a5" title="Responds to Observable update message.">update</a> ( <span class="keyword">const</span> <a class="code" href="classhippodraw_1_1Observable.html" title="Part of an implementation of the Observable-Observer pattern based on the example...">Observable</a> * display )
<a name="l00171"></a>00171 {
<a name="l00172"></a>00172   <span class="keywordflow">if</span> ( <a class="code" href="classhippodraw_1_1QtView.html#afe015d25f66d2eb4fcba514db4760933" title="A flag set true when drawing has stared.">m_is_drawing</a> == <span class="keyword">true</span> ) <span class="keywordflow">return</span>;
<a name="l00173"></a>00173 
<a name="l00174"></a>00174   <span class="keywordflow">if</span> ( display != 0 ) { <span class="comment">// from Observable object</span>
<a name="l00175"></a>00175     <a class="code" href="classhippodraw_1_1QtView.html#a3012c259142e5c50c217c4de513fa637" title="A flag indicating if the buffer pixmap has been filled.">m_filled</a> = <span class="keyword">false</span>;
<a name="l00176"></a>00176   }
<a name="l00177"></a>00177 
<a name="l00178"></a>00178   <span class="comment">// Update the size of the draw rectangle first. ( For aspect ratio. )</span>
<a name="l00179"></a>00179   <a class="code" href="classhippodraw_1_1QtView.html#a99b750f9db95d9b46b2d5e8824d5a33f" title="Updates the drawing rectangle in the paint device space.">updateDrawRect</a>();
<a name="l00180"></a>00180 
<a name="l00181"></a>00181 <span class="preprocessor">#if QT_VERSION &lt; 0x040000</span>
<a name="l00182"></a>00182 <span class="preprocessor"></span>  <a class="code" href="classhippodraw_1_1QtView.html#ae6b85d8f95c1889865463b18e33d08a5" title="Responds to Observable update message.">QCanvasItem::update</a> ();
<a name="l00183"></a>00183 <span class="preprocessor">#else</span>
<a name="l00184"></a>00184 <span class="preprocessor"></span>  <a class="code" href="classhippodraw_1_1QtView.html#ae6b85d8f95c1889865463b18e33d08a5" title="Responds to Observable update message.">Q3CanvasItem::update</a> ();
<a name="l00185"></a>00185 <span class="preprocessor">#endif</span>
<a name="l00186"></a>00186 <span class="preprocessor"></span>}
<a name="l00187"></a>00187 
<a name="l00188"></a><a class="code" href="classhippodraw_1_1QtView.html#a99b750f9db95d9b46b2d5e8824d5a33f">00188</a> <span class="keywordtype">void</span> <a class="code" href="classhippodraw_1_1QtView.html#a99b750f9db95d9b46b2d5e8824d5a33f" title="Updates the drawing rectangle in the paint device space.">QtView::updateDrawRect</a> ()
<a name="l00189"></a>00189 {
<a name="l00190"></a>00190   <span class="keywordtype">double</span> aspect = <a class="code" href="classhippodraw_1_1ViewBase.html#a92b295524262e25d2f5ae55a22ac3c87" title="Get the aspect ratio.">getAspectRatio</a>();
<a name="l00191"></a>00191   <a class="code" href="classhippodraw_1_1Rect.html" title="Class representing a rectangle.">Rect</a> drawrect = <a class="code" href="classhippodraw_1_1QtView.html#a9b7c5f2dc9b2a9aff42c13200dae82aa" title="Overrides virtual function of ViewBase.">getDrawRect</a>();
<a name="l00192"></a>00192   <span class="keywordflow">if</span> ( aspect &gt; 0 ) {
<a name="l00193"></a>00193     <a class="code" href="classhippodraw_1_1QtView.html#a3b42b94073bbc2a8430cb8558a05ae73" title="Sets the drawing rectangle in the paint device space.">setDrawRect</a> ( drawrect.<a class="code" href="classhippodraw_1_1Rect.html#af71e522ec6aa935c2618819b54f20e02" title="A shortcut to get origin.X.">getX</a>(), drawrect.<a class="code" href="classhippodraw_1_1Rect.html#acd84440598b1da2a23c326ce371db4e4" title="A shortcut to get origin.Y.">getY</a>(), 
<a name="l00194"></a>00194                   drawrect.<a class="code" href="classhippodraw_1_1Rect.html#ab22b7a83bfd69953e9421f6941bc9304" title="A shortcut to get size.height.">getHeight</a>()*aspect, drawrect.<a class="code" href="classhippodraw_1_1Rect.html#ab22b7a83bfd69953e9421f6941bc9304" title="A shortcut to get size.height.">getHeight</a>() );
<a name="l00195"></a>00195   } <span class="keywordflow">else</span> {
<a name="l00196"></a>00196     <a class="code" href="classhippodraw_1_1QtView.html#a3b42b94073bbc2a8430cb8558a05ae73" title="Sets the drawing rectangle in the paint device space.">setDrawRect</a> ( drawrect );
<a name="l00197"></a>00197   }
<a name="l00198"></a>00198 }
<a name="l00199"></a>00199 
<a name="l00200"></a><a class="code" href="classhippodraw_1_1QtView.html#a3b42b94073bbc2a8430cb8558a05ae73">00200</a> <span class="keywordtype">void</span> <a class="code" href="classhippodraw_1_1QtView.html#a3b42b94073bbc2a8430cb8558a05ae73" title="Sets the drawing rectangle in the paint device space.">QtView::setDrawRect</a> ( <span class="keyword">const</span> <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qrect.html">QRect</a> &amp; rect )
<a name="l00201"></a>00201 {
<a name="l00202"></a>00202   <a class="code" href="classhippodraw_1_1QtView.html#a3b42b94073bbc2a8430cb8558a05ae73" title="Sets the drawing rectangle in the paint device space.">setDrawRect</a> ( rect.<a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qrect.html#x">x</a> (), rect.<a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qrect.html#y">y</a> (), rect.<a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qrect.html#width">width</a> (), rect. <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qcanvasrectangle.html#height">height</a> () );
<a name="l00203"></a>00203 }
<a name="l00204"></a>00204 
<a name="l00205"></a><a class="code" href="classhippodraw_1_1QtView.html#af449384aadfea8d1a7091572c16c9e37">00205</a> <span class="keywordtype">void</span> <a class="code" href="classhippodraw_1_1QtView.html#a3b42b94073bbc2a8430cb8558a05ae73" title="Sets the drawing rectangle in the paint device space.">QtView::setDrawRect</a> ( <a class="code" href="classhippodraw_1_1Rect.html" title="Class representing a rectangle.">Rect</a> &amp; rect )
<a name="l00206"></a>00206 {
<a name="l00207"></a>00207   <a class="code" href="classhippodraw_1_1QtView.html#a3b42b94073bbc2a8430cb8558a05ae73" title="Sets the drawing rectangle in the paint device space.">setDrawRect</a> ( rect.<a class="code" href="classhippodraw_1_1Rect.html#af71e522ec6aa935c2618819b54f20e02" title="A shortcut to get origin.X.">getX</a>(), rect.<a class="code" href="classhippodraw_1_1Rect.html#acd84440598b1da2a23c326ce371db4e4" title="A shortcut to get origin.Y.">getY</a>(), rect.<a class="code" href="classhippodraw_1_1Rect.html#a5410fe8e5b318eb82d84dcccf3634d8b" title="A shortcut to get size.width.">getWidth</a>(), rect.<a class="code" href="classhippodraw_1_1Rect.html#ab22b7a83bfd69953e9421f6941bc9304" title="A shortcut to get size.height.">getHeight</a>() );
<a name="l00208"></a>00208 }
<a name="l00209"></a>00209 
<a name="l00210"></a>00210   
<a name="l00211"></a>00211 
<a name="l00212"></a><a class="code" href="classhippodraw_1_1QtView.html#ad0c0ab625c1bd811a030e9b3c2acdfda">00212</a> <span class="keywordtype">void</span> <a class="code" href="classhippodraw_1_1QtView.html#a3b42b94073bbc2a8430cb8558a05ae73" title="Sets the drawing rectangle in the paint device space.">QtView::setDrawRect</a> ( <span class="keywordtype">float</span> x, <span class="keywordtype">float</span> y, <span class="keywordtype">float</span> w, <span class="keywordtype">float</span> h )
<a name="l00213"></a>00213 {
<a name="l00214"></a>00214     setX ( x );
<a name="l00215"></a>00215     setY ( y );
<a name="l00216"></a>00216 
<a name="l00217"></a>00217     <span class="keywordtype">int</span> iw = <span class="keyword">static_cast&lt;</span> <span class="keywordtype">int</span> <span class="keyword">&gt;</span> ( w );
<a name="l00218"></a>00218     <span class="keywordtype">int</span> ih = <span class="keyword">static_cast&lt;</span> <span class="keywordtype">int</span> <span class="keyword">&gt;</span> ( h );
<a name="l00219"></a>00219     <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qcanvasrectangle.html#setSize">setSize</a> ( iw, ih );
<a name="l00220"></a>00220 
<a name="l00221"></a>00221     <a class="code" href="classhippodraw_1_1DataView.html#a5958ddebacf2da2cfddeb0b6640677a7" title="Prepares the margin rectangle.">prepareMarginRect</a> ();
<a name="l00222"></a>00222     <span class="keywordtype">float</span> new_width = <a class="code" href="classhippodraw_1_1DataView.html#a5e8a764f031ecf7ec2a55dfa69a29a4c" title="The rectangle area in which the projected points are plotted.">m_margin_rect</a>.<a class="code" href="classhippodraw_1_1Rect.html#af71e522ec6aa935c2618819b54f20e02" title="A shortcut to get origin.X.">getX</a> () + <a class="code" href="classhippodraw_1_1DataView.html#a5e8a764f031ecf7ec2a55dfa69a29a4c" title="The rectangle area in which the projected points are plotted.">m_margin_rect</a>.<a class="code" href="classhippodraw_1_1Rect.html#a5410fe8e5b318eb82d84dcccf3634d8b" title="A shortcut to get size.width.">getWidth</a>() + 20.;
<a name="l00223"></a>00223     iw = static_cast &lt; <span class="keywordtype">int</span> &gt; ( new_width );
<a name="l00224"></a>00224 
<a name="l00225"></a>00225     <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qcanvasrectangle.html#setSize">setSize</a> ( iw, ih );
<a name="l00226"></a>00226 
<a name="l00227"></a>00227     <a class="code" href="classhippodraw_1_1QtView.html#a3012c259142e5c50c217c4de513fa637" title="A flag indicating if the buffer pixmap has been filled.">m_filled</a> = <span class="keyword">false</span>;
<a name="l00228"></a>00228 }
<a name="l00229"></a>00229 
<a name="l00230"></a><a class="code" href="classhippodraw_1_1QtView.html#afca6b3ed41824b26fdaf6e1b7581052d">00230</a> <span class="keywordtype">int</span> <a class="code" href="classhippodraw_1_1QtView.html#afca6b3ed41824b26fdaf6e1b7581052d" title="Converts the data space coordinate X to the view space coordinate X.">QtView::toViewX</a> ( <span class="keywordtype">double</span> datX )<span class="keyword"> const</span>
<a name="l00231"></a>00231 <span class="keyword"></span>{
<a name="l00232"></a>00232   <span class="keywordflow">if</span> (<a class="code" href="classhippodraw_1_1ViewBase.html#a1de80faff2428b8dc67995112931b636" title="The plotter object used by this view.">m_plotter</a> -&gt; isReverse())
<a name="l00233"></a>00233     <span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span> <span class="keywordtype">int</span> <span class="keyword">&gt;</span> ( x() + <a class="code" href="classhippodraw_1_1DataView.html#a15a36bdc2a0c9fa333d56100a755c6c5" title="Converts the user X coordinate into the inverted X coordinate.">userToInvertedMarginX</a> ( datX ) );
<a name="l00234"></a>00234   <span class="keywordflow">else</span>
<a name="l00235"></a>00235     <span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span> <span class="keywordtype">int</span> <span class="keyword">&gt;</span> ( x() + <a class="code" href="classhippodraw_1_1DataView.html#ab04d1171abbedff5fed56c7a20fccee2" title="Converts the user X coordinate into the margin X coordinate.">userToMarginX</a> (datX ) );
<a name="l00236"></a>00236 }
<a name="l00237"></a>00237 
<a name="l00238"></a><a class="code" href="classhippodraw_1_1QtView.html#a9726f4c2d6b718553349919aaa59ce17">00238</a> <span class="keywordtype">int</span> <a class="code" href="classhippodraw_1_1QtView.html#a9726f4c2d6b718553349919aaa59ce17" title="Converts the data space coordinate Y to the view space coordinate Y.">QtView::toViewY</a> ( <span class="keywordtype">double</span> datY )<span class="keyword"> const</span>
<a name="l00239"></a>00239 <span class="keyword"></span>{
<a name="l00240"></a>00240   <span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span> <span class="keywordtype">int</span> <span class="keyword">&gt;</span> ( y() + <a class="code" href="classhippodraw_1_1DataView.html#ae98a2eca3fda293f98fd2af1764e0d11" title="Converts the user Y coordinate into the top-left based margin Y coordinate.">userToInvertedMarginY</a> ( datY ) );
<a name="l00241"></a>00241 }
<a name="l00242"></a>00242 
<a name="l00243"></a>00243 <span class="keywordtype">void</span>
<a name="l00244"></a>00244 <a class="code" href="classhippodraw_1_1QtView.html#a59ce8eaae7105edf74adf7463f5df5ce" title="Fills the picked point vector.">QtView::</a>
<a name="l00245"></a><a class="code" href="classhippodraw_1_1QtView.html#a59ce8eaae7105edf74adf7463f5df5ce">00245</a> <a class="code" href="classhippodraw_1_1QtView.html#a59ce8eaae7105edf74adf7463f5df5ce" title="Fills the picked point vector.">fillPickedPoint</a> ( <span class="keywordtype">double</span> dx, <span class="keywordtype">double</span> dy,
<a name="l00246"></a>00246                   std::vector &lt; double &gt; &amp; picked )<span class="keyword"> const</span>
<a name="l00247"></a>00247 <span class="keyword"></span>{
<a name="l00248"></a>00248   <span class="keywordflow">if</span> ( <a class="code" href="classhippodraw_1_1ViewBase.html#a1de80faff2428b8dc67995112931b636" title="The plotter object used by this view.">m_plotter</a> != 0 ) {
<a name="l00249"></a>00249     <span class="keywordtype">double</span> xx;
<a name="l00250"></a>00250     <span class="keywordflow">if</span> (<a class="code" href="classhippodraw_1_1ViewBase.html#a1de80faff2428b8dc67995112931b636" title="The plotter object used by this view.">m_plotter</a> -&gt; isReverse())
<a name="l00251"></a>00251       xx = <a class="code" href="classhippodraw_1_1DataView.html#a9624b072ad0e9c025a7286b3a80f8874" title="Converts from view coordinate to data conordiate, take into account the inversion...">marginToInvertedUserX</a> ( dx - x() );
<a name="l00252"></a>00252     <span class="keywordflow">else</span>
<a name="l00253"></a>00253       xx = <a class="code" href="classhippodraw_1_1DataView.html#a89d3a971fe1c4fcbb4acadbc92a52247" title="Converts from view coordinate to data coordinate, without taking into account transforms...">marginToUserX</a> ( dx - x() );
<a name="l00254"></a>00254     <span class="keywordtype">double</span> yy = <a class="code" href="classhippodraw_1_1DataView.html#a48bdfcf650bd32575950147f16cde1c2" title="Converts from inverted view coordinate to data coordinate, without taking into account...">marginToInvertedUserY</a> ( dy - y() );
<a name="l00255"></a>00255 
<a name="l00256"></a>00256     <a class="code" href="classhippodraw_1_1ViewBase.html#a1de80faff2428b8dc67995112931b636" title="The plotter object used by this view.">m_plotter</a> -&gt; fillPickedPointFrom ( xx, yy, picked );
<a name="l00257"></a>00257   }
<a name="l00258"></a>00258 }
<a name="l00259"></a>00259 
<a name="l00260"></a><a class="code" href="classhippodraw_1_1QtView.html#aeafc551153eb91273c8ac06b1c172503">00260</a> <span class="keywordtype">int</span> <a class="code" href="classhippodraw_1_1QtView.html#aeafc551153eb91273c8ac06b1c172503" title="Converts coordinate from view space to canvas space.">QtView::toCanvasX</a> ( <span class="keywordtype">double</span> dx )<span class="keyword"> const</span>
<a name="l00261"></a>00261 <span class="keyword"></span>{
<a name="l00262"></a>00262   <span class="keywordflow">return</span> static_cast &lt; <span class="keywordtype">int</span> &gt; ( x() + dx );
<a name="l00263"></a>00263 }
<a name="l00264"></a>00264 
<a name="l00265"></a><a class="code" href="classhippodraw_1_1QtView.html#a3edf52b6c32b702cfec8679e1c1b4f80">00265</a> <span class="keywordtype">int</span> <a class="code" href="classhippodraw_1_1QtView.html#a3edf52b6c32b702cfec8679e1c1b4f80" title="Converts coordinate from view space to canvas space.">QtView::toCanvasY</a> ( <span class="keywordtype">double</span> dy )<span class="keyword"> const</span>
<a name="l00266"></a>00266 <span class="keyword"></span>{
<a name="l00267"></a>00267   <span class="keywordflow">return</span> static_cast &lt; <span class="keywordtype">int</span> &gt; ( y() + dy );
<a name="l00268"></a>00268 }
<a name="l00269"></a>00269 
<a name="l00270"></a>00270 <span class="keywordtype">void</span>
<a name="l00271"></a>00271 <a class="code" href="classhippodraw_1_1QtView.html" title="The class of derived from ViewBase and QCanvasRectangle for drawing on a QCanvas...">QtView</a>::
<a name="l00272"></a>00272 <span class="preprocessor">#if QT_VERSION &lt; 0x040000</span>
<a name="l00273"></a><a class="code" href="classhippodraw_1_1QtView.html#ac60facb2e161c3bb6d56078a9ac17f84">00273</a> <span class="preprocessor"></span>transformAndFill ( <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qpointarray.html">QPointArray</a> &amp; array,
<a name="l00274"></a>00274 #<span class="keywordflow">else</span>
<a name="l00275"></a>00275 transformAndFill ( QPolygon &amp; array,
<a name="l00276"></a>00276 #endif
<a name="l00277"></a>00277                    <span class="keyword">const</span> std::vector&lt; double &gt; &amp; x,
<a name="l00278"></a>00278                    <span class="keyword">const</span> std::vector&lt; double &gt; &amp; y,
<a name="l00279"></a>00279                    <span class="keywordtype">int</span> (<a class="code" href="classhippodraw_1_1QtView.html" title="The class of derived from ViewBase and QCanvasRectangle for drawing on a QCanvas...">QtView</a>::* xfunc) ( <span class="keywordtype">double</span> ) <span class="keyword">const</span>,
<a name="l00280"></a>00280                    <span class="keywordtype">int</span> (<a class="code" href="classhippodraw_1_1QtView.html" title="The class of derived from ViewBase and QCanvasRectangle for drawing on a QCanvas...">QtView</a>::* yfunc) ( <span class="keywordtype">double</span> ) <span class="keyword">const</span> )
<a name="l00281"></a>00281 {
<a name="l00282"></a>00282   <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="namespacenum__util.html#a137f48a49d12a7dae8ba7c86db2a0c01">size</a> = x.size();
<a name="l00283"></a>00283   assert ( size == y.size() );
<a name="l00284"></a>00284 
<a name="l00285"></a>00285   <span class="keywordflow">for</span> ( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = 0; i &lt; size; i++ ) {
<a name="l00286"></a>00286     <span class="keywordtype">int</span> ix = (this-&gt;*xfunc) ( x[i] );
<a name="l00287"></a>00287     <span class="keywordtype">int</span> iy = (this-&gt;*yfunc) ( y[i] );
<a name="l00288"></a>00288     array.setPoint ( i , ix, iy );
<a name="l00289"></a>00289   }
<a name="l00290"></a>00290 
<a name="l00291"></a>00291 }
<a name="l00292"></a>00292 
<a name="l00295"></a><a class="code" href="classhippodraw_1_1QtView.html#a449d64a4eb683be123dc5797d185bc4b">00295</a> <span class="keywordtype">void</span> <a class="code" href="classhippodraw_1_1QtView.html#a449d64a4eb683be123dc5797d185bc4b" title="Draws in the view using the specified method.">QtView::drawViewMethod</a> ( <span class="keyword">const</span> std::vector&lt; double &gt; &amp; x,
<a name="l00296"></a>00296                               <span class="keyword">const</span> std::vector&lt; double &gt; &amp; y,
<a name="l00297"></a>00297                               <span class="keywordtype">int</span>, <span class="comment">// style,</span>
<a name="l00298"></a>00298                               <span class="keywordtype">int</span> ) <span class="comment">//color )</span>
<a name="l00299"></a>00299 {
<a name="l00300"></a>00300   <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qcanvasrectangle.html#size">size</a> = x.size();
<a name="l00301"></a>00301   assert ( size == y.size() );
<a name="l00302"></a>00302 
<a name="l00303"></a>00303 <span class="preprocessor">#if QT_VERSION &lt; 0x040000</span>
<a name="l00304"></a>00304 <span class="preprocessor"></span>  <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qpointarray.html">QPointArray</a> array ( size );
<a name="l00305"></a>00305 <span class="preprocessor">#else</span>
<a name="l00306"></a>00306 <span class="preprocessor"></span>  QPolygon array ( size );
<a name="l00307"></a>00307 <span class="preprocessor">#endif</span>
<a name="l00308"></a>00308 <span class="preprocessor"></span>  <a class="code" href="classhippodraw_1_1QtView.html#ac60facb2e161c3bb6d56078a9ac17f84" title="Fills the array with QPoint objects whose coordinates are in the QPaintDevice space...">transformAndFill</a> ( array, x, y,
<a name="l00309"></a>00309                      &amp;<a class="code" href="classhippodraw_1_1QtView.html#aeafc551153eb91273c8ac06b1c172503" title="Converts coordinate from view space to canvas space.">QtView::toCanvasX</a>, &amp;<a class="code" href="classhippodraw_1_1QtView.html#a3edf52b6c32b702cfec8679e1c1b4f80" title="Converts coordinate from view space to canvas space.">QtView::toCanvasY</a> );
<a name="l00310"></a>00310 
<a name="l00311"></a>00311   <a class="code" href="classhippodraw_1_1QtViewImp.html#a67b1b3cc5e4689425f4537bedb4ceb3f" title="The current Qt QPainter object.">m_painter</a>-&gt;<a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qpainter.html#drawLineSegments">drawLineSegments</a> ( array );
<a name="l00312"></a>00312 
<a name="l00313"></a>00313 }
<a name="l00314"></a>00314 
<a name="l00317"></a><a class="code" href="classhippodraw_1_1QtView.html#ad9d26d93ced269a4fa744849162259b6">00317</a> <span class="keywordtype">void</span> <a class="code" href="classhippodraw_1_1QtView.html#ad9d26d93ced269a4fa744849162259b6" title="Draws in the view using the specified method.">QtView::drawMethod</a> ( <span class="keyword">const</span> std::vector &lt; double &gt; &amp; x,
<a name="l00318"></a>00318                           <span class="keyword">const</span> std::vector &lt; double &gt; &amp; y,
<a name="l00319"></a>00319                           <span class="keywordtype">int</span>, <span class="comment">// style,</span>
<a name="l00320"></a>00320                           <span class="keywordtype">int</span> ) <span class="comment">//color )</span>
<a name="l00321"></a>00321 {
<a name="l00322"></a>00322 
<a name="l00323"></a>00323   <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qcanvasrectangle.html#size">size</a> = x.size();
<a name="l00324"></a>00324   assert ( size == y.size() );
<a name="l00325"></a>00325 
<a name="l00326"></a>00326 <span class="preprocessor">#if QT_VERSION &lt; 0x040000</span>
<a name="l00327"></a>00327 <span class="preprocessor"></span>  <a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qpointarray.html">QPointArray</a> array ( size );
<a name="l00328"></a>00328 <span class="preprocessor">#else</span>
<a name="l00329"></a>00329 <span class="preprocessor"></span>  QPolygon array ( size );
<a name="l00330"></a>00330 <span class="preprocessor">#endif</span>
<a name="l00331"></a>00331 <span class="preprocessor"></span>
<a name="l00332"></a>00332   <a class="code" href="classhippodraw_1_1QtView.html#ac60facb2e161c3bb6d56078a9ac17f84" title="Fills the array with QPoint objects whose coordinates are in the QPaintDevice space...">transformAndFill</a> ( array, x, y,
<a name="l00333"></a>00333                      &amp;<a class="code" href="classhippodraw_1_1QtView.html#afca6b3ed41824b26fdaf6e1b7581052d" title="Converts the data space coordinate X to the view space coordinate X.">QtView::toViewX</a>, &amp;<a class="code" href="classhippodraw_1_1QtView.html#a9726f4c2d6b718553349919aaa59ce17" title="Converts the data space coordinate Y to the view space coordinate Y.">QtView::toViewY</a> );
<a name="l00334"></a>00334 
<a name="l00335"></a>00335   <a class="code" href="classhippodraw_1_1QtViewImp.html#a67b1b3cc5e4689425f4537bedb4ceb3f" title="The current Qt QPainter object.">m_painter</a>-&gt;<a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qpainter.html#drawPolyline">drawPolyline</a> ( array, 0, -1 );
<a name="l00336"></a>00336 }
<a name="l00337"></a>00337 
<a name="l00338"></a>00338 <span class="keywordtype">void</span>
<a name="l00339"></a>00339 <a class="code" href="classhippodraw_1_1QtView.html#aaa313d49762600362f42899fc260b541" title="Used by the double buffering done in method draw.">QtView::</a>
<a name="l00340"></a><a class="code" href="classhippodraw_1_1QtView.html#aaa313d49762600362f42899fc260b541">00340</a> <a class="code" href="classhippodraw_1_1QtView.html#aaa313d49762600362f42899fc260b541" title="Used by the double buffering done in method draw.">ensureOffScrSize</a> ( <span class="keywordtype">int</span> osw, <span class="keywordtype">int</span> osh )
<a name="l00341"></a>00341 {
<a name="l00342"></a>00342   <span class="keywordflow">if</span> ( osw &gt; <a class="code" href="classhippodraw_1_1QtView.html#a0038f4cb0abc9d4c6b6f69ebbc2f84a9" title="A QPixmap used for buffer the plot.">m_pixmap</a>.<a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qpixmap.html#width">width</a>() || osh &gt; <a class="code" href="classhippodraw_1_1QtView.html#a0038f4cb0abc9d4c6b6f69ebbc2f84a9" title="A QPixmap used for buffer the plot.">m_pixmap</a>.<a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qpixmap.html#height">height</a>() ) {
<a name="l00343"></a>00343         <a class="code" href="classhippodraw_1_1QtView.html#a0038f4cb0abc9d4c6b6f69ebbc2f84a9" title="A QPixmap used for buffer the plot.">m_pixmap</a>.<a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qpixmap.html#resize">resize</a>(QMAX(osw,<a class="code" href="classhippodraw_1_1QtView.html#a0038f4cb0abc9d4c6b6f69ebbc2f84a9" title="A QPixmap used for buffer the plot.">m_pixmap</a>.<a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qpixmap.html#width">width</a>()),
<a name="l00344"></a>00344                       QMAX(osh,<a class="code" href="classhippodraw_1_1QtView.html#a0038f4cb0abc9d4c6b6f69ebbc2f84a9" title="A QPixmap used for buffer the plot.">m_pixmap</a>.<a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qpixmap.html#height">height</a>()));
<a name="l00345"></a>00345   }
<a name="l00346"></a>00346   <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( <a class="code" href="classhippodraw_1_1QtView.html#a0038f4cb0abc9d4c6b6f69ebbc2f84a9" title="A QPixmap used for buffer the plot.">m_pixmap</a>.<a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qpixmap.html#width">width</a>() == 0 || <a class="code" href="classhippodraw_1_1QtView.html#a0038f4cb0abc9d4c6b6f69ebbc2f84a9" title="A QPixmap used for buffer the plot.">m_pixmap</a>.<a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qpixmap.html#height">height</a>() == 0 ) {
<a name="l00347"></a>00347         <a class="code" href="classhippodraw_1_1QtView.html#a0038f4cb0abc9d4c6b6f69ebbc2f84a9" title="A QPixmap used for buffer the plot.">m_pixmap</a>.<a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qpixmap.html#resize">resize</a>( QMAX( <a class="code" href="classhippodraw_1_1QtView.html#a0038f4cb0abc9d4c6b6f69ebbc2f84a9" title="A QPixmap used for buffer the plot.">m_pixmap</a>.<a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qpixmap.html#width">width</a>(), 1),
<a name="l00348"></a>00348                        QMAX( <a class="code" href="classhippodraw_1_1QtView.html#a0038f4cb0abc9d4c6b6f69ebbc2f84a9" title="A QPixmap used for buffer the plot.">m_pixmap</a>.<a class="codeRef" doxygen="qt.tag:http://doc.trolltech.com/3.3/" href="http://doc.trolltech.com/3.3/qpixmap.html#height">height</a>(), 1 ) );
<a name="l00349"></a>00349   }
<a name="l00350"></a>00350 }
<a name="l00351"></a>00351 
<a name="l00352"></a>00352 <span class="keywordtype">void</span>
<a name="l00353"></a>00353 <a class="code" href="classhippodraw_1_1QtView.html#ab407c092ad4fd9411422886b4582d020" title="Set the page width.">QtView::</a>
<a name="l00354"></a><a class="code" href="classhippodraw_1_1QtView.html#ab407c092ad4fd9411422886b4582d020">00354</a> <a class="code" href="classhippodraw_1_1QtView.html#ab407c092ad4fd9411422886b4582d020" title="Set the page width.">setPageWidth</a> ( <span class="keywordtype">int</span> upage_w )
<a name="l00355"></a>00355 {
<a name="l00356"></a>00356   <a class="code" href="classhippodraw_1_1QtView.html#a2ae437affd3dd927c47b108beed1a6db" title="Page width.">m_upage_w</a> = upage_w;
<a name="l00357"></a>00357 }
<a name="l00358"></a>00358 
<a name="l00359"></a>00359 
<a name="l00360"></a>00360 <span class="keywordtype">bool</span>
<a name="l00361"></a>00361 <a class="code" href="classhippodraw_1_1QtView.html#ad9269b6b5ecd951e1ba113f9f7274381">QtView::</a>
<a name="l00362"></a><a class="code" href="classhippodraw_1_1QtView.html#ad9269b6b5ecd951e1ba113f9f7274381">00362</a> <a class="code" href="classhippodraw_1_1QtView.html#ad9269b6b5ecd951e1ba113f9f7274381">isTextView</a>()<span class="keyword"> const</span>
<a name="l00363"></a>00363 <span class="keyword"></span>{
<a name="l00364"></a>00364   <span class="keywordflow">return</span> <a class="code" href="classhippodraw_1_1ViewBase.html#a1de80faff2428b8dc67995112931b636" title="The plotter object used by this view.">m_plotter</a>-&gt;<a class="code" href="classhippodraw_1_1PlotterBase.html#a30339ed3c1335dfc0ff96372e25304df" title="Return true if it&amp;#39;s a text plotter.">isTextPlotter</a>();
<a name="l00365"></a>00365 }
</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>