Sophie

Sophie

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

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_6dcc65b7c74f97460af44109581e51d3.html">reps</a>
  </div>
</div>
<div class="contents">
<h1>FilledColumnPointRep.cxx</h1><a href="FilledColumnPointRep_8cxx.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 
<a name="l00012"></a>00012 <span class="comment">// For truncation warning</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="FilledColumnPointRep_8h.html" title="hippodraw::FilledColumnPointRep class interface">FilledColumnPointRep.h</a>&quot;</span>
<a name="l00018"></a>00018 
<a name="l00019"></a>00019 <span class="preprocessor">#include &quot;<a class="code" href="Range_8h.html" title="hippodraw::Range class interface">axes/Range.h</a>&quot;</span>
<a name="l00020"></a>00020 <span class="preprocessor">#include &quot;<a class="code" href="ViewBase_8h.html" title="hippodraw::ViewBase class interface">graphics/ViewBase.h</a>&quot;</span>
<a name="l00021"></a>00021 
<a name="l00022"></a>00022 <span class="keyword">using</span> std::vector;
<a name="l00023"></a>00023 
<a name="l00024"></a>00024 <span class="keyword">using namespace </span>hippodraw;
<a name="l00025"></a>00025 
<a name="l00026"></a>00026 FilledColumnPointRep::
<a name="l00027"></a><a class="code" href="classhippodraw_1_1FilledColumnPointRep.html#aff0167a06f910f06b834aca1b3c59d9b">00027</a> FilledColumnPointRep ()
<a name="l00028"></a>00028   : <a class="code" href="classhippodraw_1_1ColumnPointRep.html" title="A PointRep class that draws a column to represent the value.">ColumnPointRep</a> ( ),
<a name="l00029"></a>00029     m_fill_color ( <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 name="l00030"></a>00030 {
<a name="l00031"></a>00031   <a class="code" href="classhippodraw_1_1RepBase.html#adb41893ba19e889e56c559f25fc1a68a" title="The name of the representation.">m_name</a> = <span class="stringliteral">&quot;FilledColumn&quot;</span>;
<a name="l00032"></a>00032 }
<a name="l00033"></a>00033 
<a name="l00034"></a>00034 <a class="code" href="classhippodraw_1_1FilledColumnPointRep.html#aff0167a06f910f06b834aca1b3c59d9b" title="The default constructor.">FilledColumnPointRep::</a>
<a name="l00035"></a><a class="code" href="classhippodraw_1_1FilledColumnPointRep.html#ab66f38f956e4c9e7e56dc8b5a55fb1aa">00035</a> <a class="code" href="classhippodraw_1_1FilledColumnPointRep.html#aff0167a06f910f06b834aca1b3c59d9b" title="The default constructor.">FilledColumnPointRep</a> ( <span class="keyword">const</span> <a class="code" href="classhippodraw_1_1FilledColumnPointRep.html" title="A PointRep class that draws a filled column to represent the value.">FilledColumnPointRep</a> &amp; point_rep )
<a name="l00036"></a>00036   : <a class="code" href="classhippodraw_1_1ColumnPointRep.html" title="A PointRep class that draws a column to represent the value.">ColumnPointRep</a> ( point_rep ),
<a name="l00037"></a>00037     m_fill_color ( point_rep.m_fill_color )
<a name="l00038"></a>00038 {
<a name="l00039"></a>00039 }
<a name="l00040"></a>00040 
<a name="l00041"></a>00041 <a class="code" href="classhippodraw_1_1FilledColumnPointRep.html#ad457280a2c2092b3e63615494862ee21" title="The destructor.">FilledColumnPointRep::</a>
<a name="l00042"></a><a class="code" href="classhippodraw_1_1FilledColumnPointRep.html#ad457280a2c2092b3e63615494862ee21">00042</a> <a class="code" href="classhippodraw_1_1FilledColumnPointRep.html#ad457280a2c2092b3e63615494862ee21" title="The destructor.">~FilledColumnPointRep</a> ()
<a name="l00043"></a>00043 {
<a name="l00044"></a>00044   <span class="comment">// Does nothing</span>
<a name="l00045"></a>00045 }
<a name="l00046"></a>00046 
<a name="l00047"></a>00047 <a class="code" href="classhippodraw_1_1RepBase.html" title="The base class for the point representation hierarchy.">RepBase</a> *
<a name="l00048"></a>00048 <a class="code" href="classhippodraw_1_1FilledColumnPointRep.html#ab2b96fa7b2189b29a67f432912d081c2" title="The clone function returns an object of its own kind which is a copy of this object...">FilledColumnPointRep::</a>
<a name="l00049"></a><a class="code" href="classhippodraw_1_1FilledColumnPointRep.html#ab2b96fa7b2189b29a67f432912d081c2">00049</a> <a class="code" href="classhippodraw_1_1FilledColumnPointRep.html#ab2b96fa7b2189b29a67f432912d081c2" title="The clone function returns an object of its own kind which is a copy of this object...">clone</a> ()
<a name="l00050"></a>00050 {
<a name="l00051"></a>00051   <span class="keywordflow">return</span> <span class="keyword">new</span> <a class="code" href="classhippodraw_1_1FilledColumnPointRep.html#aff0167a06f910f06b834aca1b3c59d9b" title="The default constructor.">FilledColumnPointRep</a> ( *<span class="keyword">this</span> );
<a name="l00052"></a>00052 }
<a name="l00053"></a>00053 
<a name="l00054"></a>00054 
<a name="l00055"></a>00055 <span class="keywordtype">void</span>
<a name="l00056"></a>00056 <a class="code" href="classhippodraw_1_1FilledColumnPointRep.html#a518eaa08866d5abe9e686d1ccf476eec" title="Sets the color fill.">FilledColumnPointRep::</a>
<a name="l00057"></a><a class="code" href="classhippodraw_1_1FilledColumnPointRep.html#a518eaa08866d5abe9e686d1ccf476eec">00057</a> <a class="code" href="classhippodraw_1_1FilledColumnPointRep.html#a518eaa08866d5abe9e686d1ccf476eec" title="Sets the color fill.">setColor</a> ( <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> &amp; color )
<a name="l00058"></a>00058 {
<a name="l00059"></a>00059   <a class="code" href="classhippodraw_1_1FilledColumnPointRep.html#a5257704f6e938aa44d09f3371f893b63" title="The color to use for the fill.">m_fill_color</a> = color;
<a name="l00060"></a>00060 }
<a name="l00061"></a>00061 
<a name="l00062"></a>00062 <span class="keywordtype">void</span>
<a name="l00063"></a>00063 <a class="code" href="classhippodraw_1_1FilledColumnPointRep.html#af4a7cf429a4be9b3de0eb30e1a6d8a07" title="Does the drawing based on the accumulated polyline.">FilledColumnPointRep::</a>
<a name="l00064"></a><a class="code" href="classhippodraw_1_1FilledColumnPointRep.html#af4a7cf429a4be9b3de0eb30e1a6d8a07">00064</a> <a class="code" href="classhippodraw_1_1FilledColumnPointRep.html#af4a7cf429a4be9b3de0eb30e1a6d8a07" title="Does the drawing based on the accumulated polyline.">drawValues</a> ( <a class="code" href="classhippodraw_1_1ViewBase.html" title="The abstract base class for views.">ViewBase</a> * view )<span class="keyword"> const</span>
<a name="l00065"></a>00065 <span class="keyword"></span>{
<a name="l00066"></a>00066   <span class="keywordtype">int</span> red = <a class="code" href="classhippodraw_1_1FilledColumnPointRep.html#a5257704f6e938aa44d09f3371f893b63" title="The color to use for the fill.">m_fill_color</a>.<a class="code" href="classhippodraw_1_1Color.html#a554f0bc3f055386ee8d8af3bed2270e0">getRed</a> ();
<a name="l00067"></a>00067   <span class="keywordtype">int</span> green = <a class="code" href="classhippodraw_1_1FilledColumnPointRep.html#a5257704f6e938aa44d09f3371f893b63" title="The color to use for the fill.">m_fill_color</a>.<a class="code" href="classhippodraw_1_1Color.html#a2f7edccf0a09b1eb61bdca066be488ce">getGreen</a> ();
<a name="l00068"></a>00068   <span class="keywordtype">int</span> blue = <a class="code" href="classhippodraw_1_1FilledColumnPointRep.html#a5257704f6e938aa44d09f3371f893b63" title="The color to use for the fill.">m_fill_color</a>.<a class="code" href="classhippodraw_1_1Color.html#a6ef3a4782f8f919620728bc62e80f1e1">getBlue</a> ();
<a name="l00069"></a>00069 
<a name="l00070"></a>00070   <span class="keyword">const</span> <a class="code" href="classhippodraw_1_1Range.html" title="Expresses a range of values.">Range</a> &amp; range = view -&gt; getRange ( <a class="code" href="namespacehippodraw_1_1Axes.html#a1d1cfd8ffb84e947f82999c682b666a7a5596231eabd6cf29050967d5ac83ad84" title="Y axis.">Axes::Y</a> );
<a name="l00071"></a>00071 
<a name="l00072"></a>00072   <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classhippodraw_1_1RepBase.html#ae039d328384bad1eacf85c8fc593939d" title="Returns the size of the representation.">size</a> = <a class="code" href="classhippodraw_1_1ColumnPointRep.html#a7d3ac378fc5a1cde555c9a3fdac2523d" title="A cache of the points to be drawn along the X axis.">m_x</a>.size () -1;
<a name="l00073"></a>00073   <span class="keywordflow">for</span> ( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = 1; i &lt; size; i += 2 ) {
<a name="l00074"></a>00074     <span class="keywordtype">double</span> y2 = <a class="code" href="classhippodraw_1_1ColumnPointRep.html#a76b3ab311a8436e2124aff4ed63ffdd1" title="A cache of the points to be drawn along the Y axis.">m_y</a> [ i+1 ];
<a name="l00075"></a>00075     <span class="keywordtype">double</span> y1 = range.<a class="code" href="classhippodraw_1_1Range.html#a3865c37c86de4e4eafc43b6b40ef05b9" title="Returns the minimum of the range object.">low</a> ();
<a name="l00076"></a>00076     <span class="keywordtype">double</span> x1 = <a class="code" href="classhippodraw_1_1ColumnPointRep.html#a7d3ac378fc5a1cde555c9a3fdac2523d" title="A cache of the points to be drawn along the X axis.">m_x</a> [ i ];
<a name="l00077"></a>00077     <span class="keywordtype">double</span> x2 = <a class="code" href="classhippodraw_1_1ColumnPointRep.html#a7d3ac378fc5a1cde555c9a3fdac2523d" title="A cache of the points to be drawn along the X axis.">m_x</a> [ i+1 ];
<a name="l00078"></a>00078 
<a name="l00079"></a>00079       view -&gt; drawSquare ( x1, y1, x2, y2, red, green, blue );
<a name="l00080"></a>00080   }
<a name="l00081"></a>00081 
<a name="l00082"></a>00082   <a class="code" href="classhippodraw_1_1FilledColumnPointRep.html#af4a7cf429a4be9b3de0eb30e1a6d8a07" title="Does the drawing based on the accumulated polyline.">ColumnPointRep::drawValues</a> ( view );
<a name="l00083"></a>00083 }
</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>