<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>HippoDraw Class Library</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> <link href="tabs.css" rel="stylesheet" type="text/css"> <link rel="shortcut icon" href="hippoApp.ico"> </head><body> <!-- Generated by Doxygen 1.6.2 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> <li><a href="dirs.html"><span>Directories</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>File Members</span></a></li> </ul> </div> <div class="navpath"><a class="el" href="dir_28fb57ed95c79fe5ed14c4f71fb4c2a2.html">qt</a> </div> </div> <div class="contents"> <h1>QtGroupView.cxx</h1><a href="QtGroupView_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">#ifdef _MSC_VER</span> <a name="l00013"></a>00013 <span class="preprocessor"></span><span class="preprocessor">#include "msdevstudio/MSconfig.h"</span> <a name="l00014"></a>00014 <span class="preprocessor">#endif</span> <a name="l00015"></a>00015 <span class="preprocessor"></span> <a name="l00016"></a>00016 <span class="preprocessor">#include "<a class="code" href="QtGroupView_8h.html" title="hippodraw::QtGroupView class interface">QtGroupView.h</a>"</span> <a name="l00017"></a>00017 <span class="preprocessor">#include "<a class="code" href="DrawBorder_8h.html" title="DrawBorder class interface.">DrawBorder.h</a>"</span> <a name="l00018"></a>00018 <a name="l00019"></a>00019 <span class="preprocessor">#include "qpainter.h"</span> <a name="l00020"></a>00020 <span class="comment">//#if QT_VERSION < 0x040000</span> <a name="l00021"></a>00021 <span class="comment">//#else</span> <a name="l00022"></a>00022 <span class="comment">//#include <QPaintEngine></span> <a name="l00023"></a>00023 <span class="comment">//#endif</span> <a name="l00024"></a>00024 <a name="l00025"></a>00025 <span class="preprocessor">#include <cassert></span> <a name="l00026"></a>00026 <span class="preprocessor">#include <iostream></span> <a name="l00027"></a>00027 <a name="l00028"></a>00028 <a name="l00029"></a>00029 <span class="keyword">using</span> std::vector; <a name="l00030"></a>00030 <a name="l00031"></a>00031 <span class="keyword">using namespace </span>hippodraw; <a name="l00032"></a>00032 <a name="l00033"></a><a class="code" href="classhippodraw_1_1QtGroupView.html#a92e3f081c49c69f7efac46c0e1d7f0fc">00033</a> QtGroupView::QtGroupView ( ) <a name="l00034"></a>00034 :<a class="code" href="classhippodraw_1_1GroupViewBase.html" title="This is the abstract base class for a group view.">GroupViewBase</a> (), <a name="l00035"></a>00035 <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> (), <a name="l00036"></a>00036 #if QT_VERSION < 0x040000 <a name="l00037"></a>00037 <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="l00038"></a>00038 #else <a name="l00039"></a>00039 Q3CanvasRectangle ( 0 ) <a name="l00040"></a>00040 #endif <a name="l00041"></a>00041 { <a name="l00042"></a>00042 } <a name="l00043"></a>00043 <a name="l00044"></a>00044 <a name="l00045"></a><a class="code" href="classhippodraw_1_1QtGroupView.html#acbf4b5181300882cc83a617db0e69a95">00045</a> <a class="code" href="classhippodraw_1_1QtGroupView.html#a92e3f081c49c69f7efac46c0e1d7f0fc" title="The constructor.">QtGroupView::QtGroupView</a> ( <span class="keyword">const</span> std::vector < ViewBase * > & inViews ) <a name="l00046"></a>00046 :<a class="code" href="classhippodraw_1_1GroupViewBase.html" title="This is the abstract base class for a group view.">GroupViewBase</a> ( inViews ), <a name="l00047"></a>00047 <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> (), <a name="l00048"></a>00048 #if QT_VERSION < 0x040000 <a name="l00049"></a>00049 <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="l00050"></a>00050 #else <a name="l00051"></a>00051 Q3CanvasRectangle ( 0 ) <a name="l00052"></a>00052 #endif <a name="l00053"></a>00053 { <a name="l00054"></a>00054 } <a name="l00055"></a>00055 <a name="l00056"></a><a class="code" href="classhippodraw_1_1QtGroupView.html#a3376706e4cd22e417a2b50c174c1d2a1">00056</a> <a class="code" href="classhippodraw_1_1QtGroupView.html#a3376706e4cd22e417a2b50c174c1d2a1" title="Copy constructor.">QtGroupView::~QtGroupView</a> () <a name="l00057"></a>00057 { <a name="l00058"></a>00058 vector < ViewBase * >::const_iterator first = <a class="code" href="classhippodraw_1_1GroupViewBase.html#af0aad105d205d2c3806fa24214578512" title="A vector that keeps all view in the same group view.">mViews</a>.begin(); <a name="l00059"></a>00059 <span class="keywordflow">for</span> ( ; first != <a class="code" href="classhippodraw_1_1GroupViewBase.html#af0aad105d205d2c3806fa24214578512" title="A vector that keeps all view in the same group view.">mViews</a>.end(); ++first ) { <a name="l00060"></a>00060 <span class="comment">//QtView * qtview = dynamic_cast < QtView * > ( *first );</span> <a name="l00061"></a>00061 <span class="keyword">delete</span> (*first); <a name="l00062"></a>00062 } <a name="l00063"></a>00063 } <a name="l00064"></a>00064 <a name="l00065"></a>00065 <a name="l00066"></a><a class="code" href="classhippodraw_1_1QtGroupView.html#a79498840deb15b6e0be732661632ea6c">00066</a> <span class="keywordtype">void</span> <a class="code" href="classhippodraw_1_1QtGroupView.html#a79498840deb15b6e0be732661632ea6c" title="Sets the drawing rectangle in the paint device space.">QtGroupView::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="l00067"></a>00067 { <a name="l00068"></a>00068 <span class="comment">// setX() and setY() will call moveBy()</span> <a name="l00069"></a>00069 <span class="comment">// set this flag to true so that the overridden moveBy() will not</span> <a name="l00070"></a>00070 <span class="comment">// move the views.</span> <a name="l00071"></a>00071 <a class="code" href="classhippodraw_1_1QtGroupView.html#afe015d25f66d2eb4fcba514db4760933" title="A flag set true when drawing has stared.">m_is_drawing</a>=<span class="keyword">true</span>; <a name="l00072"></a>00072 <a name="l00073"></a>00073 setX ( x ); <a name="l00074"></a>00074 setY ( y ); <a name="l00075"></a>00075 <a name="l00076"></a>00076 <span class="keywordtype">int</span> iw = <span class="keyword">static_cast<</span> <span class="keywordtype">int</span> <span class="keyword">></span> ( w ); <a name="l00077"></a>00077 <span class="keywordtype">int</span> ih = <span class="keyword">static_cast<</span> <span class="keywordtype">int</span> <span class="keyword">></span> ( h ); <a name="l00078"></a>00078 <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="l00079"></a>00079 <a name="l00080"></a>00080 <a class="code" href="classhippodraw_1_1QtGroupView.html#afe015d25f66d2eb4fcba514db4760933" title="A flag set true when drawing has stared.">m_is_drawing</a>=<span class="keyword">false</span>; <a name="l00081"></a>00081 <a name="l00082"></a>00082 <span class="keywordflow">if</span> ( <a class="code" href="classhippodraw_1_1QtGroupView.html#a89a50d7d680aca24309df62699a27e97" title="A vector containing the percentage position information for every views.">m_position</a>.size() == 0 ) <span class="keywordflow">return</span>; <span class="comment">// first time to set draw rect.</span> <a name="l00083"></a>00083 <a name="l00084"></a>00084 <span class="comment">// set draw rectangle for every views.</span> <a name="l00085"></a>00085 vector < ViewBase * >::const_iterator first = <a class="code" href="classhippodraw_1_1GroupViewBase.html#af0aad105d205d2c3806fa24214578512" title="A vector that keeps all view in the same group view.">mViews</a>.begin(); <a name="l00086"></a>00086 <span class="keywordflow">for</span> ( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = 0; first != <a class="code" href="classhippodraw_1_1GroupViewBase.html#af0aad105d205d2c3806fa24214578512" title="A vector that keeps all view in the same group view.">mViews</a>.end(); ++first, i=i+4 ) { <a name="l00087"></a>00087 <a class="code" href="classhippodraw_1_1QtView.html" title="The class of derived from ViewBase and QCanvasRectangle for drawing on a QCanvas...">QtView</a> * qtview = dynamic_cast < <a class="code" href="classhippodraw_1_1QtView.html" title="The class of derived from ViewBase and QCanvasRectangle for drawing on a QCanvas...">QtView</a> * > ( *first ); <a name="l00088"></a>00088 <a name="l00089"></a>00089 qtview-><a class="code" href="classhippodraw_1_1QtView.html#a3b42b94073bbc2a8430cb8558a05ae73" title="Sets the drawing rectangle in the paint device space.">setDrawRect</a> ( x+w*<a class="code" href="classhippodraw_1_1QtGroupView.html#a89a50d7d680aca24309df62699a27e97" title="A vector containing the percentage position information for every views.">m_position</a>[i], <a name="l00090"></a>00090 y+h*<a class="code" href="classhippodraw_1_1QtGroupView.html#a89a50d7d680aca24309df62699a27e97" title="A vector containing the percentage position information for every views.">m_position</a>[i+1], <a name="l00091"></a>00091 w*<a class="code" href="classhippodraw_1_1QtGroupView.html#a89a50d7d680aca24309df62699a27e97" title="A vector containing the percentage position information for every views.">m_position</a>[i+2], <a name="l00092"></a>00092 h*<a class="code" href="classhippodraw_1_1QtGroupView.html#a89a50d7d680aca24309df62699a27e97" title="A vector containing the percentage position information for every views.">m_position</a>[i+3] ); <a name="l00093"></a>00093 } <a name="l00094"></a>00094 } <a name="l00095"></a>00095 <a name="l00096"></a><a class="code" href="classhippodraw_1_1QtGroupView.html#a3b42b94073bbc2a8430cb8558a05ae73">00096</a> <span class="keywordtype">void</span> <a class="code" href="classhippodraw_1_1QtGroupView.html#a79498840deb15b6e0be732661632ea6c" title="Sets the drawing rectangle in the paint device space.">QtGroupView::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> & rect ) <a name="l00097"></a>00097 { <a name="l00098"></a>00098 <a class="code" href="classhippodraw_1_1QtGroupView.html#a79498840deb15b6e0be732661632ea6c" 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="l00099"></a>00099 } <a name="l00100"></a>00100 <a name="l00101"></a><a class="code" href="classhippodraw_1_1QtGroupView.html#a9b7c5f2dc9b2a9aff42c13200dae82aa">00101</a> <a class="code" href="classhippodraw_1_1Rect.html" title="Class representing a rectangle.">Rect</a> <a class="code" href="classhippodraw_1_1QtGroupView.html#a9b7c5f2dc9b2a9aff42c13200dae82aa" title="Gets the drawing rectangle.">QtGroupView::getDrawRect</a> ()<span class="keyword"> const</span> <a name="l00102"></a>00102 <span class="keyword"></span>{ <a name="l00103"></a>00103 <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="l00104"></a>00104 } <a name="l00105"></a>00105 <a name="l00106"></a>00106 <a name="l00107"></a><a class="code" href="classhippodraw_1_1QtGroupView.html#a85bf5f2fd170a0352fc7f81733a7f245">00107</a> <span class="keywordtype">void</span> <a class="code" href="classhippodraw_1_1QtGroupView.html#a85bf5f2fd170a0352fc7f81733a7f245" title="Re-implement the draw() method in QCanvasItem.">QtGroupView::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> & painter ) <a name="l00108"></a>00108 <a name="l00109"></a>00109 { <a name="l00110"></a>00110 <span class="comment">// only draw the border</span> <a name="l00111"></a>00111 <a name="l00112"></a>00112 <a class="code" href="classhippodraw_1_1QtGroupView.html#afe015d25f66d2eb4fcba514db4760933" title="A flag set true when drawing has stared.">m_is_drawing</a> = <span class="keyword">true</span>; <a name="l00113"></a>00113 <a name="l00114"></a>00114 <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">"black"</span> ); <a name="l00115"></a>00115 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="l00116"></a>00116 <a class="code" href="classhippodraw_1_1QtViewImp.html#a67b1b3cc5e4689425f4537bedb4ceb3f" title="The current Qt QPainter object.">m_painter</a> = & painter; <a name="l00117"></a>00117 <a name="l00118"></a>00118 <span class="keywordflow">if</span> ( isSelected () ) <a name="l00119"></a>00119 { <a name="l00120"></a>00120 <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="l00121"></a>00121 border-><a class="code" href="classhippodraw_1_1DrawBorder.html#a76c921ff21c0093783ee86f2c1a2fd08" title="Sets the View object.">setView</a> (<span class="keyword">this</span>); <a name="l00122"></a>00122 border-><a class="code" href="classhippodraw_1_1DrawBorder.html#a56c5cf8a568cff737ff95520cbe6b405" title="Does the actual drawing in the view.">draw</a>(); <a name="l00123"></a>00123 } <a name="l00124"></a>00124 <a class="code" href="classhippodraw_1_1QtGroupView.html#afe015d25f66d2eb4fcba514db4760933" title="A flag set true when drawing has stared.">m_is_drawing</a> = <span class="keyword">false</span>; <a name="l00125"></a>00125 } <a name="l00126"></a>00126 <a name="l00127"></a>00127 <a name="l00128"></a>00128 <a name="l00129"></a>00129 <span class="comment">// Abstract methods from QtViewImp class.</span> <a name="l00130"></a>00130 <span class="keywordtype">void</span> <a name="l00131"></a>00131 <a class="code" href="classhippodraw_1_1QtGroupView.html#a59ce8eaae7105edf74adf7463f5df5ce" title="Fills the picked point vector.">QtGroupView::</a> <a name="l00132"></a><a class="code" href="classhippodraw_1_1QtGroupView.html#a59ce8eaae7105edf74adf7463f5df5ce">00132</a> <a class="code" href="classhippodraw_1_1QtGroupView.html#a59ce8eaae7105edf74adf7463f5df5ce" title="Fills the picked point vector.">fillPickedPoint</a> ( <span class="keywordtype">double</span> dx, <span class="keywordtype">double</span> dy, <a name="l00133"></a>00133 std::vector < double > & picked )<span class="keyword"> const</span> <a name="l00134"></a>00134 <span class="keyword"></span>{ <a name="l00135"></a>00135 } <a name="l00136"></a>00136 <a name="l00137"></a><a class="code" href="classhippodraw_1_1QtGroupView.html#aeafc551153eb91273c8ac06b1c172503">00137</a> <span class="keywordtype">int</span> <a class="code" href="classhippodraw_1_1QtGroupView.html#aeafc551153eb91273c8ac06b1c172503" title="Converts coordinate from view space to canvas space.">QtGroupView::toCanvasX</a> ( <span class="keywordtype">double</span> dx )<span class="keyword"> const</span> <a name="l00138"></a>00138 <span class="keyword"></span>{ <a name="l00139"></a>00139 <span class="keywordflow">return</span> static_cast < <span class="keywordtype">int</span> > ( x() + dx ); <a name="l00140"></a>00140 } <a name="l00141"></a>00141 <a name="l00142"></a><a class="code" href="classhippodraw_1_1QtGroupView.html#a3edf52b6c32b702cfec8679e1c1b4f80">00142</a> <span class="keywordtype">int</span> <a class="code" href="classhippodraw_1_1QtGroupView.html#a3edf52b6c32b702cfec8679e1c1b4f80" title="Converts coordinate from view space to canvas space.">QtGroupView::toCanvasY</a> ( <span class="keywordtype">double</span> dy )<span class="keyword"> const</span> <a name="l00143"></a>00143 <span class="keyword"></span>{ <a name="l00144"></a>00144 <span class="keywordflow">return</span> static_cast < <span class="keywordtype">int</span> > ( y() + dy ); <a name="l00145"></a>00145 } <a name="l00146"></a>00146 <a name="l00147"></a>00147 <a name="l00148"></a><a class="code" href="classhippodraw_1_1QtGroupView.html#afca6b3ed41824b26fdaf6e1b7581052d">00148</a> <span class="keywordtype">int</span> <a class="code" href="classhippodraw_1_1QtGroupView.html#afca6b3ed41824b26fdaf6e1b7581052d" title="Converts the data space coordinate X to the view space coordinate X.">QtGroupView::toViewX</a> ( <span class="keywordtype">double</span> datX )<span class="keyword"> const</span> <a name="l00149"></a>00149 <span class="keyword"></span>{ <a name="l00150"></a>00150 <span class="keywordflow">return</span> 0; <a name="l00151"></a>00151 <span class="comment">//return static_cast< int > ( x() + userToMarginX ( datX ) );</span> <a name="l00152"></a>00152 } <a name="l00153"></a>00153 <a name="l00154"></a><a class="code" href="classhippodraw_1_1QtGroupView.html#a9726f4c2d6b718553349919aaa59ce17">00154</a> <span class="keywordtype">int</span> <a class="code" href="classhippodraw_1_1QtGroupView.html#a9726f4c2d6b718553349919aaa59ce17" title="Converts the data space coordinate Y to the view space coordinate Y.">QtGroupView::toViewY</a> ( <span class="keywordtype">double</span> datY )<span class="keyword"> const</span> <a name="l00155"></a>00155 <span class="keyword"></span>{ <a name="l00156"></a>00156 <span class="keywordflow">return</span> 0; <a name="l00157"></a>00157 <span class="comment">//return static_cast< int > ( y() + userToInvertedMarginY ( datY ) );</span> <a name="l00158"></a>00158 } <a name="l00159"></a>00159 <a name="l00160"></a><a class="code" href="classhippodraw_1_1QtGroupView.html#ab705fc18af2e23ea66472608e1252f4e">00160</a> <span class="keywordtype">void</span> <a class="code" href="classhippodraw_1_1QtGroupView.html#ab705fc18af2e23ea66472608e1252f4e" title="Re-implement the moveBy() method so that all views in the group will move.">QtGroupView::moveBy</a> ( <span class="keywordtype">double</span> dx, <span class="keywordtype">double</span> dy ) <a name="l00161"></a>00161 { <a name="l00162"></a>00162 <span class="preprocessor">#if QT_VERSION < 0x040000</span> <a name="l00163"></a>00163 <span class="preprocessor"></span> <a class="code" href="classhippodraw_1_1QtGroupView.html#ab705fc18af2e23ea66472608e1252f4e" title="Re-implement the moveBy() method so that all views in the group will move.">QCanvasRectangle::moveBy</a> ( dx, dy ); <a name="l00164"></a>00164 <span class="preprocessor">#else</span> <a name="l00165"></a>00165 <span class="preprocessor"></span> <a class="code" href="classhippodraw_1_1QtGroupView.html#ab705fc18af2e23ea66472608e1252f4e" title="Re-implement the moveBy() method so that all views in the group will move.">Q3CanvasRectangle::moveBy</a> (dx, dy); <a name="l00166"></a>00166 <span class="preprocessor">#endif</span> <a name="l00167"></a>00167 <span class="preprocessor"></span> <a name="l00168"></a>00168 <span class="keywordflow">if</span> ( <a class="code" href="classhippodraw_1_1QtGroupView.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="l00169"></a>00169 <a name="l00170"></a>00170 vector < ViewBase * >::const_iterator first = <a class="code" href="classhippodraw_1_1GroupViewBase.html#af0aad105d205d2c3806fa24214578512" title="A vector that keeps all view in the same group view.">mViews</a>.begin(); <a name="l00171"></a>00171 <span class="keywordflow">for</span> ( ; first != <a class="code" href="classhippodraw_1_1GroupViewBase.html#af0aad105d205d2c3806fa24214578512" title="A vector that keeps all view in the same group view.">mViews</a>.end(); ++first ) { <a name="l00172"></a>00172 <a class="code" href="classhippodraw_1_1QtView.html" title="The class of derived from ViewBase and QCanvasRectangle for drawing on a QCanvas...">QtView</a> * qtview = dynamic_cast < <a class="code" href="classhippodraw_1_1QtView.html" title="The class of derived from ViewBase and QCanvasRectangle for drawing on a QCanvas...">QtView</a> * > ( *first ); <a name="l00173"></a>00173 qtview->moveBy ( dx, dy ); <a name="l00174"></a>00174 } <a name="l00175"></a>00175 } <a name="l00176"></a>00176 <a name="l00177"></a><a class="code" href="classhippodraw_1_1QtGroupView.html#a8f0d7820b69ca2511e58765a21787c79">00177</a> <span class="keywordtype">void</span> <a class="code" href="classhippodraw_1_1QtGroupView.html#a8f0d7820b69ca2511e58765a21787c79" title="Set the positions in percentage of every views.">QtGroupView::setPositions</a>() <a name="l00178"></a>00178 { <a name="l00179"></a>00179 <a name="l00180"></a>00180 <span class="comment">// Is it OK to convert int to double?</span> <a name="l00181"></a>00181 vector < ViewBase * >::const_iterator first = <a class="code" href="classhippodraw_1_1GroupViewBase.html#af0aad105d205d2c3806fa24214578512" title="A vector that keeps all view in the same group view.">mViews</a>.begin(); <a name="l00182"></a>00182 <span class="keywordflow">for</span> ( ; first != <a class="code" href="classhippodraw_1_1GroupViewBase.html#af0aad105d205d2c3806fa24214578512" title="A vector that keeps all view in the same group view.">mViews</a>.end(); ++first ) { <a name="l00183"></a>00183 <a class="code" href="classhippodraw_1_1QtView.html" title="The class of derived from ViewBase and QCanvasRectangle for drawing on a QCanvas...">QtView</a> * qtview = dynamic_cast < <a class="code" href="classhippodraw_1_1QtView.html" title="The class of derived from ViewBase and QCanvasRectangle for drawing on a QCanvas...">QtView</a> * > ( *first ); <a name="l00184"></a>00184 <a class="code" href="classhippodraw_1_1QtGroupView.html#a89a50d7d680aca24309df62699a27e97" title="A vector containing the percentage position information for every views.">m_position</a>.push_back( (qtview->x()-x())/<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 name="l00185"></a>00185 <a class="code" href="classhippodraw_1_1QtGroupView.html#a89a50d7d680aca24309df62699a27e97" title="A vector containing the percentage position information for every views.">m_position</a>.push_back( (qtview->y()-y())/<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="l00186"></a>00186 <a class="code" href="classhippodraw_1_1QtGroupView.html#a89a50d7d680aca24309df62699a27e97" title="A vector containing the percentage position information for every views.">m_position</a>.push_back( ((<span class="keywordtype">double</span>)(qtview-><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#width">width</a>() ); <a name="l00187"></a>00187 <a class="code" href="classhippodraw_1_1QtGroupView.html#a89a50d7d680aca24309df62699a27e97" title="A vector containing the percentage position information for every views.">m_position</a>.push_back( ((<span class="keywordtype">double</span>)(qtview-><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 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="l00188"></a>00188 } <a name="l00189"></a>00189 } <a name="l00190"></a>00190 </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>