Sophie

Sophie

distrib > Fedora > 16 > i386 > by-pkgid > 4bc66056a634db26a1f4d0845dc41ca6 > files > 11376

mrpt-doc-0.9.5-0.1.20110925svn2670.fc16.i686.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>mathplot.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<div align="left"><a href="http://www.mrpt.org/">Main MRPT website</a> &gt; <b>C++ reference</b> </div>
<div align="right">
<a href="index.html"><img border="0" src="mrpt_logo.png" alt="MRPT logo"></a>
</div>
<!-- Generated by Doxygen 1.7.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</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>
        <div id="MSearchBox" class="MSearchBoxInactive">
          <div class="left">
            <form id="FSearchBox" action="search.php" method="get">
              <img id="MSearchSelect" src="search/mag.png" alt=""/>
              <input type="text" id="MSearchField" name="query" value="Search" size="20" accesskey="S" 
                     onfocus="searchBox.OnSearchFieldFocus(true)" 
                     onblur="searchBox.OnSearchFieldFocus(false)"/>
            </form>
          </div><div class="right"></div>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<div class="title">mathplot.h</div>  </div>
</div>
<div class="contents">
<a href="mathplot_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/////////////////////////////////////////////////////////////////////////////</span>
<a name="l00002"></a>00002 <span class="comment"></span><span class="comment">// Name:            mathplot.cpp</span>
<a name="l00003"></a>00003 <span class="comment">// Purpose:         Framework for plotting in wxWindows</span>
<a name="l00004"></a>00004 <span class="comment">// Original Author: David Schalig</span>
<a name="l00005"></a>00005 <span class="comment">// Maintainer:      Davide Rondini</span>
<a name="l00006"></a>00006 <span class="comment">// Contributors:    Jose Luis Blanco, Val Greene</span>
<a name="l00007"></a>00007 <span class="comment">// Created:         21/07/2003</span>
<a name="l00008"></a>00008 <span class="comment">// Last edit:       22/02/2009</span>
<a name="l00009"></a>00009 <span class="comment">// Copyright:       (c) David Schalig, Davide Rondini</span>
<a name="l00010"></a>00010 <span class="comment">// Licence:         wxWindows licence</span><span class="comment"></span>
<a name="l00011"></a>00011 <span class="comment">/////////////////////////////////////////////////////////////////////////////</span>
<a name="l00012"></a>00012 <span class="comment"></span>
<a name="l00013"></a>00013 <span class="preprocessor">#ifndef _MP_MATHPLOT_H_</span>
<a name="l00014"></a>00014 <span class="preprocessor"></span><span class="preprocessor">#define _MP_MATHPLOT_H_</span>
<a name="l00015"></a>00015 <span class="preprocessor"></span>
<a name="l00016"></a>00016 <span class="comment">// JL: This is VERY ugly, but ask MS why we cannot export a DLL class with STL members !!</span>
<a name="l00017"></a>00017 <span class="preprocessor">#if defined(_MSC_VER)</span>
<a name="l00018"></a>00018 <span class="preprocessor"></span><span class="preprocessor">        #pragma warning(push)</span>
<a name="l00019"></a>00019 <span class="preprocessor"></span><span class="preprocessor">        #pragma warning(disable:4251)</span>
<a name="l00020"></a>00020 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00021"></a>00021 <span class="preprocessor"></span><span class="comment"></span>
<a name="l00022"></a>00022 <span class="comment">/** @file mathplot.h */</span><span class="comment"></span>
<a name="l00023"></a>00023 <span class="comment">/** @mainpage wxMathPlot</span>
<a name="l00024"></a>00024 <span class="comment">    wxMathPlot is a framework for mathematical graph plotting in wxWindows.</span>
<a name="l00025"></a>00025 <span class="comment"></span>
<a name="l00026"></a>00026 <span class="comment">    The framework is designed for convenience and ease of use.</span>
<a name="l00027"></a>00027 <span class="comment"></span>
<a name="l00028"></a>00028 <span class="comment">    @section screenshots Screenshots</span>
<a name="l00029"></a>00029 <span class="comment">    &lt;a href=&quot;http://wxmathplot.sourceforge.net/screenshot.shtml&quot; &gt;Go to the screenshots page.&lt;/a&gt;</span>
<a name="l00030"></a>00030 <span class="comment"></span>
<a name="l00031"></a>00031 <span class="comment">    @section overview Overview</span>
<a name="l00032"></a>00032 <span class="comment">    The heart of wxMathPlot is mpWindow, which is a 2D canvas for plot layers.</span>
<a name="l00033"></a>00033 <span class="comment">    mpWindow can be embedded as subwindow in a wxPane, a wxFrame, or any other wxWindow.</span>
<a name="l00034"></a>00034 <span class="comment">    mpWindow provides a zoomable and moveable view of the layers. The current view can</span>
<a name="l00035"></a>00035 <span class="comment">    be controlled with the mouse, the scrollbars, and a context menu.</span>
<a name="l00036"></a>00036 <span class="comment"></span>
<a name="l00037"></a>00037 <span class="comment">    Plot layers are implementations of the abstract base class mpLayer. Those can</span>
<a name="l00038"></a>00038 <span class="comment">    be function plots, scale rulers, or any other vector data visualisation. wxMathPlot provides two mpLayer implementations for plotting horizontal and vertical rulers: mpScaleX and mpScaleY.</span>
<a name="l00039"></a>00039 <span class="comment">    For convenient function plotting a series of classes derived from mpLayer are provided, like mpFX, mpProfile, mpLegend and so on. These base classes already come with plot code, user&#39;s own functions can be implemented by overriding just one member for retrieving a function value.</span>
<a name="l00040"></a>00040 <span class="comment"></span>
<a name="l00041"></a>00041 <span class="comment">    mpWindow has built-in support for mouse-based pan and zoom through intuitive combinations of buttons and the mouse wheel. It also incorporates an optional double buffering mechanism to avoid flicker. Plots can be easily sent to printer evices or exported in bitmap formats like PNG, BMP or JPEG.</span>
<a name="l00042"></a>00042 <span class="comment"></span>
<a name="l00043"></a>00043 <span class="comment">    @section coding Coding conventions</span>
<a name="l00044"></a>00044 <span class="comment">    wxMathPlot sticks to wxWindow&#39;s coding conventions. All entities defined by wxMathPlot have the prefix &lt;i&gt;mp&lt;/i&gt;.</span>
<a name="l00045"></a>00045 <span class="comment"></span>
<a name="l00046"></a>00046 <span class="comment">    @section author Author and license</span>
<a name="l00047"></a>00047 <span class="comment">    wxMathPlot is published under the terms of the wxWindow license.&lt;br&gt;</span>
<a name="l00048"></a>00048 <span class="comment">    The original author is David Schalig &lt;mrhill@users.sourceforge.net&gt;.&lt;br&gt;</span>
<a name="l00049"></a>00049 <span class="comment">    From June 2007 the project is maintained by Davide Rondini &lt;cdron77@users.sourceforge.net&gt;.&lt;br&gt;</span>
<a name="l00050"></a>00050 <span class="comment">    Authors can be contacted via the wxMathPlot&#39;s homepage at</span>
<a name="l00051"></a>00051 <span class="comment">    https://sourceforge.net/projects/wxmathplot&lt;br&gt;</span>
<a name="l00052"></a>00052 <span class="comment">    Contributors:&lt;br&gt;</span>
<a name="l00053"></a>00053 <span class="comment">    Jose Luis Blanco, Val Greene.&lt;br&gt;</span>
<a name="l00054"></a>00054 <span class="comment">*/</span>
<a name="l00055"></a>00055 
<a name="l00056"></a>00056 <span class="comment">//this definition uses windows dll to export function.</span>
<a name="l00057"></a>00057 <span class="comment">//WXDLLIMPEXP_MATHPLOT definition definition changed to WXDLLIMPEXP_MATHPLOT</span>
<a name="l00058"></a>00058 <span class="comment">//mathplot_EXPORTS will be defined by cmake</span>
<a name="l00059"></a>00059 <span class="comment">//#ifdef mathplot_EXPORTS</span>
<a name="l00060"></a>00060 <span class="comment">// #define WXDLLIMPEXP_MATHPLOT WXEXPORT</span>
<a name="l00061"></a>00061 <span class="comment">// #define WXDLLIMPEXP_DATA_MATHPLOT(type) WXEXPORT type</span>
<a name="l00062"></a>00062 <span class="comment">//#else // not making DLL</span>
<a name="l00063"></a>00063 <span class="comment">// #define WXDLLIMPEXP_MATHPLOT</span>
<a name="l00064"></a>00064 <span class="comment">// #define WXDLLIMPEXP_DATA_MATHPLOT(type) type</span>
<a name="l00065"></a>00065 <span class="comment">//#endif</span>
<a name="l00066"></a>00066 
<a name="l00067"></a>00067 <span class="comment">// Hack for MRPT: Link as part of mrpt-gui itself.</span>
<a name="l00068"></a>00068 <span class="preprocessor">#include &lt;<a class="code" href="gui_2include_2mrpt_2gui_2link__pragmas_8h.html">mrpt/gui/link_pragmas.h</a>&gt;</span>
<a name="l00069"></a><a class="code" href="mathplot_8h.html#a8ad8b0f95a03f1bc9ff4ed3947e96ea1">00069</a> <span class="preprocessor">#define WXDLLIMPEXP_MATHPLOT GUI_IMPEXP</span>
<a name="l00070"></a>00070 <span class="preprocessor"></span>
<a name="l00071"></a>00071 
<a name="l00072"></a>00072 <span class="preprocessor">#if defined(__GNUG__) &amp;&amp; !defined(__APPLE__)</span>
<a name="l00073"></a>00073 <span class="preprocessor"></span><span class="preprocessor">#pragma interface &quot;mathplot.h&quot;</span>
<a name="l00074"></a>00074 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00075"></a>00075 <span class="preprocessor"></span>
<a name="l00076"></a>00076 <span class="preprocessor">#include &lt;vector&gt;</span>
<a name="l00077"></a>00077 
<a name="l00078"></a>00078 <span class="comment">// #include &lt;wx/wx.h&gt;</span>
<a name="l00079"></a>00079 <span class="preprocessor">#include &lt;wx/defs.h&gt;</span>
<a name="l00080"></a>00080 <span class="preprocessor">#include &lt;wx/menu.h&gt;</span>
<a name="l00081"></a>00081 <span class="preprocessor">#include &lt;wx/scrolwin.h&gt;</span>
<a name="l00082"></a>00082 <span class="preprocessor">#include &lt;wx/event.h&gt;</span>
<a name="l00083"></a>00083 <span class="preprocessor">#include &lt;wx/dynarray.h&gt;</span>
<a name="l00084"></a>00084 <span class="preprocessor">#include &lt;wx/pen.h&gt;</span>
<a name="l00085"></a>00085 <span class="preprocessor">#include &lt;wx/dcmemory.h&gt;</span>
<a name="l00086"></a>00086 <span class="preprocessor">#include &lt;wx/string.h&gt;</span>
<a name="l00087"></a>00087 <span class="preprocessor">#include &lt;wx/print.h&gt;</span>
<a name="l00088"></a>00088 <span class="preprocessor">#include &lt;wx/image.h&gt;</span>
<a name="l00089"></a>00089 
<a name="l00090"></a>00090 
<a name="l00091"></a>00091 <span class="preprocessor">#include &lt;deque&gt;</span>
<a name="l00092"></a>00092 
<a name="l00093"></a>00093 <span class="comment">// For memory leak debug</span>
<a name="l00094"></a>00094 <span class="preprocessor">#ifdef _WINDOWS</span>
<a name="l00095"></a>00095 <span class="preprocessor"></span><span class="preprocessor">#ifdef _DEBUG</span>
<a name="l00096"></a>00096 <span class="preprocessor"></span><span class="preprocessor">#include &lt;crtdbg.h&gt;</span>
<a name="l00097"></a>00097 <span class="preprocessor">#define DEBUG_NEW new(_NORMAL_BLOCK ,__FILE__, __LINE__)</span>
<a name="l00098"></a>00098 <span class="preprocessor"></span><span class="preprocessor">#else</span>
<a name="l00099"></a>00099 <span class="preprocessor"></span><span class="preprocessor">#define DEBUG_NEW new</span>
<a name="l00100"></a>00100 <span class="preprocessor"></span><span class="preprocessor">#endif // _DEBUG</span>
<a name="l00101"></a>00101 <span class="preprocessor"></span><span class="preprocessor">#endif // _WINDOWS</span>
<a name="l00102"></a>00102 <span class="preprocessor"></span>
<a name="l00103"></a>00103 <span class="comment">// Separation for axes when set close to border</span>
<a name="l00104"></a><a class="code" href="mathplot_8h.html#ab376feaedc1a12aa6f8eaaca0d6d749c">00104</a> <span class="preprocessor">#define X_BORDER_SEPARATION 40</span>
<a name="l00105"></a><a class="code" href="mathplot_8h.html#ae83b098d89116adf3b7554bc3d4015fb">00105</a> <span class="preprocessor"></span><span class="preprocessor">#define Y_BORDER_SEPARATION 60</span>
<a name="l00106"></a>00106 <span class="preprocessor"></span>
<a name="l00107"></a>00107 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00108"></a>00108 <span class="comment">// classes</span>
<a name="l00109"></a>00109 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00110"></a>00110 
<a name="l00111"></a><a class="code" href="mathplot_8h.html#aac380c72405620f64e0fb8b27e6b51ad">00111</a> <span class="keyword">class </span><a class="code" href="mathplot_8h.html#a8ad8b0f95a03f1bc9ff4ed3947e96ea1">WXDLLIMPEXP_MATHPLOT</a> <a class="code" href="classmp_layer.html" title="Plot layer, abstract base class.">mpLayer</a>;
<a name="l00112"></a><a class="code" href="mathplot_8h.html#aafeb58945dcb20f526d5cf91debb53c7">00112</a> <span class="keyword">class </span><a class="code" href="mathplot_8h.html#a8ad8b0f95a03f1bc9ff4ed3947e96ea1">WXDLLIMPEXP_MATHPLOT</a> <a class="code" href="classmp_f_x.html" title="Abstract base class providing plot and labeling functionality for functions F:X-&gt;Y.">mpFX</a>;
<a name="l00113"></a><a class="code" href="mathplot_8h.html#a10ee4f54b59b869d596ae9f770eca3f9">00113</a> <span class="keyword">class </span><a class="code" href="mathplot_8h.html#a8ad8b0f95a03f1bc9ff4ed3947e96ea1">WXDLLIMPEXP_MATHPLOT</a> <a class="code" href="classmp_f_y.html" title="Abstract base class providing plot and labeling functionality for functions F:Y-&gt;X.">mpFY</a>;
<a name="l00114"></a><a class="code" href="mathplot_8h.html#a6cc685434475389bc57c7428afb9a31a">00114</a> <span class="keyword">class </span><a class="code" href="mathplot_8h.html#a8ad8b0f95a03f1bc9ff4ed3947e96ea1">WXDLLIMPEXP_MATHPLOT</a> <a class="code" href="classmp_f_x_y.html" title="Abstract base class providing plot and labeling functionality for a locus plot F:N-&gt;X,Y.">mpFXY</a>;
<a name="l00115"></a><a class="code" href="mathplot_8h.html#a3c6bff27059660d514285e5e2216a9dd">00115</a> <span class="keyword">class </span><a class="code" href="mathplot_8h.html#a8ad8b0f95a03f1bc9ff4ed3947e96ea1">WXDLLIMPEXP_MATHPLOT</a> <a class="code" href="classmp_f_x_y_vector.html" title="A class providing graphs functionality for a 2D plot (either continuous or a set of points)...">mpFXYVector</a>;
<a name="l00116"></a><a class="code" href="mathplot_8h.html#ab8ac3ad805df76a6399449f8c50adfff">00116</a> <span class="keyword">class </span><a class="code" href="mathplot_8h.html#a8ad8b0f95a03f1bc9ff4ed3947e96ea1">WXDLLIMPEXP_MATHPLOT</a> <a class="code" href="classmp_scale_x.html" title="Plot layer implementing a x-scale ruler.">mpScaleX</a>;
<a name="l00117"></a><a class="code" href="mathplot_8h.html#ac59f3a003a15824ae4ef9850e1ae5445">00117</a> <span class="keyword">class </span><a class="code" href="mathplot_8h.html#a8ad8b0f95a03f1bc9ff4ed3947e96ea1">WXDLLIMPEXP_MATHPLOT</a> <a class="code" href="classmp_scale_y.html" title="Plot layer implementing a y-scale ruler.">mpScaleY</a>;
<a name="l00118"></a><a class="code" href="mathplot_8h.html#a27017ce06c840ac145d37211b033381c">00118</a> <span class="keyword">class </span><a class="code" href="mathplot_8h.html#a8ad8b0f95a03f1bc9ff4ed3947e96ea1">WXDLLIMPEXP_MATHPLOT</a> <a class="code" href="classmp_window.html" title="Canvas for plotting mpLayer implementations.">mpWindow</a>;
<a name="l00119"></a><a class="code" href="mathplot_8h.html#a03a8837f2a0302e5001e8cde13facb80">00119</a> <span class="keyword">class </span><a class="code" href="mathplot_8h.html#a8ad8b0f95a03f1bc9ff4ed3947e96ea1">WXDLLIMPEXP_MATHPLOT</a> <a class="code" href="classmp_text.html" title="Plot layer implementing a text string.">mpText</a>;
<a name="l00120"></a><a class="code" href="mathplot_8h.html#a3647ad96c624dcaf67745e89af68f98b">00120</a> <span class="keyword">class </span><a class="code" href="mathplot_8h.html#a8ad8b0f95a03f1bc9ff4ed3947e96ea1">WXDLLIMPEXP_MATHPLOT</a> <a class="code" href="classmp_printout.html" title="Printout class used by mpWindow to draw in the objects to be printed.">mpPrintout</a>;
<a name="l00121"></a>00121 <span class="comment"></span>
<a name="l00122"></a>00122 <span class="comment">/** Command IDs used by mpWindow */</span>
<a name="l00123"></a>00123 <span class="keyword">enum</span>
<a name="l00124"></a>00124 {
<a name="l00125"></a><a class="code" href="mathplot_8h.html#ac205be2172292384dd687b5471a87edda35decaabaf1737fd593593e6c6f3c6ff">00125</a>     <a class="code" href="mathplot_8h.html#ac205be2172292384dd687b5471a87edda35decaabaf1737fd593593e6c6f3c6ff" title="Fit view to match bounding box of all layers.">mpID_FIT</a> = 2000,    <span class="comment">//!&lt; Fit view to match bounding box of all layers</span>
<a name="l00126"></a><a class="code" href="mathplot_8h.html#ac205be2172292384dd687b5471a87edda5843a704e816d0da2a4c104c164e67af">00126</a> <span class="comment"></span>    <a class="code" href="mathplot_8h.html#ac205be2172292384dd687b5471a87edda5843a704e816d0da2a4c104c164e67af" title="Zoom into view at clickposition / window center.">mpID_ZOOM_IN</a>,       <span class="comment">//!&lt; Zoom into view at clickposition / window center</span>
<a name="l00127"></a><a class="code" href="mathplot_8h.html#ac205be2172292384dd687b5471a87eddaf98ee9838d86ab1e4507955ff8b14140">00127</a> <span class="comment"></span>    <a class="code" href="mathplot_8h.html#ac205be2172292384dd687b5471a87eddaf98ee9838d86ab1e4507955ff8b14140" title="Zoom out.">mpID_ZOOM_OUT</a>,      <span class="comment">//!&lt; Zoom out</span>
<a name="l00128"></a><a class="code" href="mathplot_8h.html#ac205be2172292384dd687b5471a87edda7417468c66a1ed62b3a64f0da2f09770">00128</a> <span class="comment"></span>    <a class="code" href="mathplot_8h.html#ac205be2172292384dd687b5471a87edda7417468c66a1ed62b3a64f0da2f09770" title="Center view on click position.">mpID_CENTER</a>,        <span class="comment">//!&lt; Center view on click position</span>
<a name="l00129"></a><a class="code" href="mathplot_8h.html#ac205be2172292384dd687b5471a87edda4011f14a223cba5f6afb9ada21ad8434">00129</a> <span class="comment"></span>    <a class="code" href="mathplot_8h.html#ac205be2172292384dd687b5471a87edda4011f14a223cba5f6afb9ada21ad8434" title="Lock x/y scaling aspect.">mpID_LOCKASPECT</a>,    <span class="comment">//!&lt; Lock x/y scaling aspect</span>
<a name="l00130"></a><a class="code" href="mathplot_8h.html#ac205be2172292384dd687b5471a87eddacf20d4a074c63ed842af7c568bef72e5">00130</a> <span class="comment"></span>    <a class="code" href="mathplot_8h.html#ac205be2172292384dd687b5471a87eddacf20d4a074c63ed842af7c568bef72e5" title="Shows information about the mouse commands.">mpID_HELP_MOUSE</a>,    <span class="comment">//!&lt; Shows information about the mouse commands</span>
<a name="l00131"></a><a class="code" href="mathplot_8h.html#ac205be2172292384dd687b5471a87eddafc82300833270ff922163ad7d1af9f29">00131</a> <span class="comment"></span>    <a class="code" href="mathplot_8h.html#ac205be2172292384dd687b5471a87eddafc82300833270ff922163ad7d1af9f29" title="JL: Prints the graph.">mpID_PRINT</a>                  <span class="comment">//!&lt; JL: Prints the graph</span>
<a name="l00132"></a>00132 <span class="comment"></span>};
<a name="l00133"></a>00133 
<a name="l00134"></a>00134 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00135"></a>00135 <span class="comment">// mpLayer</span>
<a name="l00136"></a>00136 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00137"></a>00137 
<a name="l00138"></a><a class="code" href="mathplot_8h.html#a3e096aea2344c539195351495aed7e59">00138</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> <a class="code" href="mathplot_8h.html#a3e096aea2344c539195351495aed7e59">__mp_Layer_Type</a> {
<a name="l00139"></a><a class="code" href="mathplot_8h.html#a3e096aea2344c539195351495aed7e59acad450f658e3ba632cb231776cdc19d9">00139</a>     <a class="code" href="mathplot_8h.html#a3e096aea2344c539195351495aed7e59acad450f658e3ba632cb231776cdc19d9" title="Layer type undefined.">mpLAYER_UNDEF</a>,  <span class="comment">//!&lt; Layer type undefined</span>
<a name="l00140"></a><a class="code" href="mathplot_8h.html#a3e096aea2344c539195351495aed7e59accfd66b82a3cbe706ed508d823088d24">00140</a> <span class="comment"></span>    <a class="code" href="mathplot_8h.html#a3e096aea2344c539195351495aed7e59accfd66b82a3cbe706ed508d823088d24" title="Axis type layer.">mpLAYER_AXIS</a>,  <span class="comment">//!&lt; Axis type layer</span>
<a name="l00141"></a><a class="code" href="mathplot_8h.html#a3e096aea2344c539195351495aed7e59afffaffd7444293b2187476c6393cf1fc">00141</a> <span class="comment"></span>    <a class="code" href="mathplot_8h.html#a3e096aea2344c539195351495aed7e59afffaffd7444293b2187476c6393cf1fc" title="Plot type layer.">mpLAYER_PLOT</a>,  <span class="comment">//!&lt; Plot type layer</span>
<a name="l00142"></a><a class="code" href="mathplot_8h.html#a3e096aea2344c539195351495aed7e59a3a162b1a81877c4704425772ac123abe">00142</a> <span class="comment"></span>    <a class="code" href="mathplot_8h.html#a3e096aea2344c539195351495aed7e59a3a162b1a81877c4704425772ac123abe" title="Info box type layer.">mpLAYER_INFO</a>,   <span class="comment">//!&lt; Info box type layer</span>
<a name="l00143"></a><a class="code" href="mathplot_8h.html#a3e096aea2344c539195351495aed7e59a69f5473c74b89fe17ed5c29c6362e6b2">00143</a> <span class="comment"></span>    <a class="code" href="mathplot_8h.html#a3e096aea2344c539195351495aed7e59a69f5473c74b89fe17ed5c29c6362e6b2" title="Bitmap type layer.">mpLAYER_BITMAP</a> <span class="comment">//!&lt; Bitmap type layer</span>
<a name="l00144"></a>00144 <span class="comment"></span>} <a class="code" href="mathplot_8h.html#acf8b83e86e129762abc1b70e84db342c">mpLayerType</a>;
<a name="l00145"></a>00145 <span class="comment"></span>
<a name="l00146"></a>00146 <span class="comment">/** Plot layer, abstract base class.</span>
<a name="l00147"></a>00147 <span class="comment">    Any number of mpLayer implementations can be attached to mpWindow.</span>
<a name="l00148"></a>00148 <span class="comment">    Examples for mpLayer implementations are function graphs, or scale rulers.</span>
<a name="l00149"></a>00149 <span class="comment"></span>
<a name="l00150"></a>00150 <span class="comment">    For convenience mpLayer defines a name, a font (wxFont), a pen (wxPen),</span>
<a name="l00151"></a>00151 <span class="comment">    and a continuity property (bool) as class members.</span>
<a name="l00152"></a>00152 <span class="comment">    The default values at constructor are the default font, a black pen, and</span>
<a name="l00153"></a>00153 <span class="comment">     continuity set to false (draw separate points).</span>
<a name="l00154"></a>00154 <span class="comment">    These may or may not be used by implementations.</span>
<a name="l00155"></a>00155 <span class="comment">*/</span>
<a name="l00156"></a>00156 <span class="keyword">class </span><a class="code" href="mathplot_8h.html#a8ad8b0f95a03f1bc9ff4ed3947e96ea1">WXDLLIMPEXP_MATHPLOT</a> <a class="code" href="classmp_layer.html" title="Plot layer, abstract base class.">mpLayer</a> : <span class="keyword">public</span> wxObject
<a name="l00157"></a>00157 {
<a name="l00158"></a>00158 <span class="keyword">public</span>:
<a name="l00159"></a>00159     <a class="code" href="mathplot_8h.html#aac380c72405620f64e0fb8b27e6b51ad">mpLayer</a>();
<a name="l00160"></a>00160 
<a name="l00161"></a><a class="code" href="classmp_layer.html#a4f63b285ccb8ec8642fab416f265272e">00161</a>     <span class="keyword">virtual</span> <a class="code" href="classmp_layer.html#a4f63b285ccb8ec8642fab416f265272e">~mpLayer</a>() {};
<a name="l00162"></a>00162 <span class="comment"></span>
<a name="l00163"></a>00163 <span class="comment">    /** Check whether this layer has a bounding box.</span>
<a name="l00164"></a>00164 <span class="comment">        The default implementation returns \a TRUE. Override and return</span>
<a name="l00165"></a>00165 <span class="comment">        FALSE if your mpLayer implementation should be ignored by the calculation</span>
<a name="l00166"></a>00166 <span class="comment">        of the global bounding box for all layers in a mpWindow.</span>
<a name="l00167"></a>00167 <span class="comment">        @retval TRUE Has bounding box</span>
<a name="l00168"></a>00168 <span class="comment">        @retval FALSE Has not bounding box</span>
<a name="l00169"></a>00169 <span class="comment">    */</span>
<a name="l00170"></a><a class="code" href="classmp_layer.html#accf17c5510e6d2fb21974b1cb8a0455e">00170</a>     <span class="keyword">virtual</span> <span class="keywordtype">bool</span>   <a class="code" href="classmp_layer.html#accf17c5510e6d2fb21974b1cb8a0455e" title="Check whether this layer has a bounding box.">HasBBox</a>() { <span class="keywordflow">return</span> TRUE; }
<a name="l00171"></a>00171 <span class="comment"></span>
<a name="l00172"></a>00172 <span class="comment">    /** Check whether the layer is an info box.</span>
<a name="l00173"></a>00173 <span class="comment">        The default implementation returns \a FALSE. It is overrided to \a TRUE for mpInfoLayer</span>
<a name="l00174"></a>00174 <span class="comment">        class and its derivative. It is necessary to define mouse actions behaviour over</span>
<a name="l00175"></a>00175 <span class="comment">        info boxes.</span>
<a name="l00176"></a>00176 <span class="comment">        @return whether the layer is an info boxes</span>
<a name="l00177"></a>00177 <span class="comment">        @sa mpInfoLayer::IsInfo */</span>
<a name="l00178"></a><a class="code" href="classmp_layer.html#a10235d5fa7f3a61bb63dd307a6caf0df">00178</a>     <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classmp_layer.html#a10235d5fa7f3a61bb63dd307a6caf0df" title="Check whether the layer is an info box.">IsInfo</a>() { <span class="keywordflow">return</span> <span class="keyword">false</span>; };
<a name="l00179"></a>00179 <span class="comment"></span>
<a name="l00180"></a>00180 <span class="comment">    /** Get inclusive left border of bounding box.</span>
<a name="l00181"></a>00181 <span class="comment">        @return Value</span>
<a name="l00182"></a>00182 <span class="comment">    */</span>
<a name="l00183"></a><a class="code" href="classmp_layer.html#adf8df2da43c1dc3f0e382f0ae3698b5a">00183</a>     <span class="keyword">virtual</span> <span class="keywordtype">double</span> <a class="code" href="classmp_layer.html#adf8df2da43c1dc3f0e382f0ae3698b5a" title="Get inclusive left border of bounding box.">GetMinX</a>() { <span class="keywordflow">return</span> -1.0; }
<a name="l00184"></a>00184 <span class="comment"></span>
<a name="l00185"></a>00185 <span class="comment">    /** Get inclusive right border of bounding box.</span>
<a name="l00186"></a>00186 <span class="comment">        @return Value</span>
<a name="l00187"></a>00187 <span class="comment">    */</span>
<a name="l00188"></a><a class="code" href="classmp_layer.html#ad3f65fde6150433717e3d2eb387ab88f">00188</a>     <span class="keyword">virtual</span> <span class="keywordtype">double</span> <a class="code" href="classmp_layer.html#ad3f65fde6150433717e3d2eb387ab88f" title="Get inclusive right border of bounding box.">GetMaxX</a>() { <span class="keywordflow">return</span>  1.0; }
<a name="l00189"></a>00189 <span class="comment"></span>
<a name="l00190"></a>00190 <span class="comment">    /** Get inclusive bottom border of bounding box.</span>
<a name="l00191"></a>00191 <span class="comment">        @return Value</span>
<a name="l00192"></a>00192 <span class="comment">    */</span>
<a name="l00193"></a><a class="code" href="classmp_layer.html#ae3dbe3838f6494bb1395f486e2c766af">00193</a>     <span class="keyword">virtual</span> <span class="keywordtype">double</span> <a class="code" href="classmp_layer.html#ae3dbe3838f6494bb1395f486e2c766af" title="Get inclusive bottom border of bounding box.">GetMinY</a>() { <span class="keywordflow">return</span> -1.0; }
<a name="l00194"></a>00194 <span class="comment"></span>
<a name="l00195"></a>00195 <span class="comment">    /** Get inclusive top border of bounding box.</span>
<a name="l00196"></a>00196 <span class="comment">        @return Value</span>
<a name="l00197"></a>00197 <span class="comment">    */</span>
<a name="l00198"></a><a class="code" href="classmp_layer.html#ae30ffdb060c11c9a88be5a3cd718f750">00198</a>     <span class="keyword">virtual</span> <span class="keywordtype">double</span> <a class="code" href="classmp_layer.html#ae30ffdb060c11c9a88be5a3cd718f750" title="Get inclusive top border of bounding box.">GetMaxY</a>() { <span class="keywordflow">return</span>  1.0; }
<a name="l00199"></a>00199 <span class="comment"></span>
<a name="l00200"></a>00200 <span class="comment">    /** Plot given view of layer to the given device context.</span>
<a name="l00201"></a>00201 <span class="comment">        An implementation of this function has to transform layer coordinates to</span>
<a name="l00202"></a>00202 <span class="comment">        wxDC coordinates based on the view parameters retrievable from the mpWindow</span>
<a name="l00203"></a>00203 <span class="comment">        passed in \a w.</span>
<a name="l00204"></a>00204 <span class="comment">        Note that the public methods of mpWindow: x2p,y2p and p2x,p2y are already provided</span>
<a name="l00205"></a>00205 <span class="comment">        which transform layer coordinates to DC pixel coordinates, and &lt;b&gt;user code should rely</span>
<a name="l00206"></a>00206 <span class="comment">        on them&lt;/b&gt; for portability and future changes to be applied transparently, instead of</span>
<a name="l00207"></a>00207 <span class="comment">        implementing the following formulas manually.</span>
<a name="l00208"></a>00208 <span class="comment"></span>
<a name="l00209"></a>00209 <span class="comment">        The passed device context \a dc has its coordinate origin set to the top-left corner</span>
<a name="l00210"></a>00210 <span class="comment">        of the visible area (the default). The coordinate orientation is as shown in the</span>
<a name="l00211"></a>00211 <span class="comment">        following picture:</span>
<a name="l00212"></a>00212 <span class="comment">        &lt;pre&gt;</span>
<a name="l00213"></a>00213 <span class="comment">        (wxDC origin 0,0)</span>
<a name="l00214"></a>00214 <span class="comment">               x-------------&gt; ascending X ----------------+</span>
<a name="l00215"></a>00215 <span class="comment">               |                                           |</span>
<a name="l00216"></a>00216 <span class="comment">               |                                           |</span>
<a name="l00217"></a>00217 <span class="comment">               V ascending Y                               |</span>
<a name="l00218"></a>00218 <span class="comment">                   |                                           |</span>
<a name="l00219"></a>00219 <span class="comment">                   |                                           |</span>
<a name="l00220"></a>00220 <span class="comment">                   |                                           |</span>
<a name="l00221"></a>00221 <span class="comment">                   +-------------------------------------------+  &lt;-- right-bottom corner of the mpWindow visible area.</span>
<a name="l00222"></a>00222 <span class="comment">        &lt;/pre&gt;</span>
<a name="l00223"></a>00223 <span class="comment">        Note that Y ascends in downward direction, whereas the usual vertical orientation</span>
<a name="l00224"></a>00224 <span class="comment">        for mathematical plots is vice versa. Thus Y-orientation will be swapped usually,</span>
<a name="l00225"></a>00225 <span class="comment">        when transforming between wxDC and mpLayer coordinates. This change of coordinates</span>
<a name="l00226"></a>00226 <span class="comment">        is taken into account in the methods p2x,p2y,x2p,y2p.</span>
<a name="l00227"></a>00227 <span class="comment"></span>
<a name="l00228"></a>00228 <span class="comment">        &lt;b&gt; Rules for transformation between mpLayer and wxDC coordinates &lt;/b&gt;</span>
<a name="l00229"></a>00229 <span class="comment">        @code</span>
<a name="l00230"></a>00230 <span class="comment">        dc_X = (layer_X - mpWindow::GetPosX()) * mpWindow::GetScaleX()</span>
<a name="l00231"></a>00231 <span class="comment">        dc_Y = (mpWindow::GetPosY() - layer_Y) * mpWindow::GetScaleY() // swapping Y-orientation</span>
<a name="l00232"></a>00232 <span class="comment"></span>
<a name="l00233"></a>00233 <span class="comment">        layer_X = (dc_X / mpWindow::GetScaleX()) + mpWindow::GetPosX() // scale guaranteed to be not 0</span>
<a name="l00234"></a>00234 <span class="comment">        layer_Y = mpWindow::GetPosY() - (dc_Y / mpWindow::GetScaleY()) // swapping Y-orientation</span>
<a name="l00235"></a>00235 <span class="comment">        @endcode</span>
<a name="l00236"></a>00236 <span class="comment"></span>
<a name="l00237"></a>00237 <span class="comment">        @param dc Device context to plot to.</span>
<a name="l00238"></a>00238 <span class="comment">        @param w  View to plot. The visible area can be retrieved from this object.</span>
<a name="l00239"></a>00239 <span class="comment">        @sa mpWindow::p2x,mpWindow::p2y,mpWindow::x2p,mpWindow::y2p</span>
<a name="l00240"></a>00240 <span class="comment">    */</span>
<a name="l00241"></a>00241     <span class="keyword">virtual</span> <span class="keywordtype">void</span>   Plot(wxDC &amp; dc, <a class="code" href="classmp_window.html" title="Canvas for plotting mpLayer implementations.">mpWindow</a> &amp; w) = 0;
<a name="l00242"></a>00242 <span class="comment"></span>
<a name="l00243"></a>00243 <span class="comment">    /** Get layer name.</span>
<a name="l00244"></a>00244 <span class="comment">        @return Name</span>
<a name="l00245"></a>00245 <span class="comment">    */</span>
<a name="l00246"></a><a class="code" href="classmp_layer.html#a463e8f75a2c19fb710078d436ee94f5d">00246</a>     wxString       <a class="code" href="classmp_layer.html#a463e8f75a2c19fb710078d436ee94f5d" title="Get layer name.">GetName</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_name; }
<a name="l00247"></a>00247 <span class="comment"></span>
<a name="l00248"></a>00248 <span class="comment">    /** Get font set for this layer.</span>
<a name="l00249"></a>00249 <span class="comment">        @return Font</span>
<a name="l00250"></a>00250 <span class="comment">    */</span>
<a name="l00251"></a><a class="code" href="classmp_layer.html#af13bd4b41d687aca653b85132a08f101">00251</a>     <span class="keyword">const</span> wxFont&amp;  <a class="code" href="classmp_layer.html#af13bd4b41d687aca653b85132a08f101" title="Get font set for this layer.">GetFont</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_font; }
<a name="l00252"></a>00252 <span class="comment"></span>
<a name="l00253"></a>00253 <span class="comment">    /** Get pen set for this layer.</span>
<a name="l00254"></a>00254 <span class="comment">        @return Pen</span>
<a name="l00255"></a>00255 <span class="comment">    */</span>
<a name="l00256"></a><a class="code" href="classmp_layer.html#ae9520bcefffcc18a948fac21d817a391">00256</a>     <span class="keyword">const</span> wxPen&amp;   <a class="code" href="classmp_layer.html#ae9520bcefffcc18a948fac21d817a391" title="Get pen set for this layer.">GetPen</a>()<span class="keyword">  const </span>{ <span class="keywordflow">return</span> m_pen;  }
<a name="l00257"></a>00257 <span class="comment"></span>
<a name="l00258"></a>00258 <span class="comment">    /** Set the &#39;continuity&#39; property of the layer (true:draws a continuous line, false:draws separate points).</span>
<a name="l00259"></a>00259 <span class="comment">      * @sa GetContinuity</span>
<a name="l00260"></a>00260 <span class="comment">      */</span>
<a name="l00261"></a><a class="code" href="classmp_layer.html#a7f07b31cca9bc30591f98fa739a9c3df">00261</a>     <span class="keywordtype">void</span> <a class="code" href="classmp_layer.html#a7f07b31cca9bc30591f98fa739a9c3df" title="Set the &#39;continuity&#39; property of the layer (true:draws a continuous line, false:draws separate points...">SetContinuity</a>(<span class="keywordtype">bool</span> continuity) {m_continuous = continuity;}
<a name="l00262"></a>00262 <span class="comment"></span>
<a name="l00263"></a>00263 <span class="comment">    /** Gets the &#39;continuity&#39; property of the layer.</span>
<a name="l00264"></a>00264 <span class="comment">      * @sa SetContinuity</span>
<a name="l00265"></a>00265 <span class="comment">      */</span>
<a name="l00266"></a><a class="code" href="classmp_layer.html#adeab23218fa3f473429ccbd7b40a3f1d">00266</a>     <span class="keywordtype">bool</span> <a class="code" href="classmp_layer.html#adeab23218fa3f473429ccbd7b40a3f1d" title="Gets the &#39;continuity&#39; property of the layer.">GetContinuity</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> m_continuous;}
<a name="l00267"></a>00267 <span class="comment"></span>
<a name="l00268"></a>00268 <span class="comment">    /** Shows or hides the text label with the name of the layer (default is visible).</span>
<a name="l00269"></a>00269 <span class="comment">      */</span>
<a name="l00270"></a><a class="code" href="classmp_layer.html#a83d3d0e46f840b23eb23630bccf1a3dc">00270</a>     <span class="keywordtype">void</span> <a class="code" href="classmp_layer.html#a83d3d0e46f840b23eb23630bccf1a3dc" title="Shows or hides the text label with the name of the layer (default is visible).">ShowName</a>(<span class="keywordtype">bool</span> show) { m_showName = show; };
<a name="l00271"></a>00271 <span class="comment"></span>
<a name="l00272"></a>00272 <span class="comment">    /** Set layer name</span>
<a name="l00273"></a>00273 <span class="comment">        @param name Name, will be copied to internal class member</span>
<a name="l00274"></a>00274 <span class="comment">    */</span>
<a name="l00275"></a><a class="code" href="classmp_layer.html#adfeb5ca318a709902e485969f7964caa">00275</a>     <span class="keywordtype">void</span> <a class="code" href="classmp_layer.html#adfeb5ca318a709902e485969f7964caa" title="Set layer name.">SetName</a>(wxString name) { m_name = name; }
<a name="l00276"></a>00276 <span class="comment"></span>
<a name="l00277"></a>00277 <span class="comment">    /** Set layer font</span>
<a name="l00278"></a>00278 <span class="comment">        @param font Font, will be copied to internal class member</span>
<a name="l00279"></a>00279 <span class="comment">    */</span>
<a name="l00280"></a><a class="code" href="classmp_layer.html#a83ea2ceefa0c955e18a2972a066d4f7f">00280</a>     <span class="keywordtype">void</span> <a class="code" href="classmp_layer.html#a83ea2ceefa0c955e18a2972a066d4f7f" title="Set layer font.">SetFont</a>(wxFont&amp; font)  { m_font = font; }
<a name="l00281"></a>00281 <span class="comment"></span>
<a name="l00282"></a>00282 <span class="comment">    /** Set layer pen</span>
<a name="l00283"></a>00283 <span class="comment">        @param pen Pen, will be copied to internal class member</span>
<a name="l00284"></a>00284 <span class="comment">    */</span>
<a name="l00285"></a><a class="code" href="classmp_layer.html#a62bf0a870e470d274dd373bd5f87f94b">00285</a>     <span class="keywordtype">void</span> <a class="code" href="classmp_layer.html#a62bf0a870e470d274dd373bd5f87f94b" title="Set layer pen.">SetPen</a>(wxPen pen)     { m_pen  = pen;  }
<a name="l00286"></a>00286 <span class="comment"></span>
<a name="l00287"></a>00287 <span class="comment">    /** Set Draw mode: inside or outside margins. Default is outside, which allows the layer to draw up to the mpWindow border.</span>
<a name="l00288"></a>00288 <span class="comment">        @param drawModeOutside The draw mode to be set */</span>
<a name="l00289"></a><a class="code" href="classmp_layer.html#afc08c8f852363550e5714959d71806a7">00289</a>     <span class="keywordtype">void</span> <a class="code" href="classmp_layer.html#afc08c8f852363550e5714959d71806a7" title="Set Draw mode: inside or outside margins.">SetDrawOutsideMargins</a>(<span class="keywordtype">bool</span> drawModeOutside) { m_drawOutsideMargins = drawModeOutside; };
<a name="l00290"></a>00290 <span class="comment"></span>
<a name="l00291"></a>00291 <span class="comment">    /** Get Draw mode: inside or outside margins.</span>
<a name="l00292"></a>00292 <span class="comment">        @return The draw mode */</span>
<a name="l00293"></a><a class="code" href="classmp_layer.html#a68faceee0b732f4271e9a9320a218d1d">00293</a>     <span class="keywordtype">bool</span> <a class="code" href="classmp_layer.html#a68faceee0b732f4271e9a9320a218d1d" title="Get Draw mode: inside or outside margins.">GetDrawOutsideMargins</a>() { <span class="keywordflow">return</span> m_drawOutsideMargins; };
<a name="l00294"></a>00294 <span class="comment"></span>
<a name="l00295"></a>00295 <span class="comment">    /** Get a small square bitmap filled with the colour of the pen used in the layer. Useful to create legends or similar reference to the layers.</span>
<a name="l00296"></a>00296 <span class="comment">        @param side side length in pixels</span>
<a name="l00297"></a>00297 <span class="comment">        @return a wxBitmap filled with layer&#39;s colour */</span>
<a name="l00298"></a>00298     wxBitmap GetColourSquare(<span class="keywordtype">int</span> side = 16);
<a name="l00299"></a>00299 <span class="comment"></span>
<a name="l00300"></a>00300 <span class="comment">    /** Get layer type: a Layer can be of different types: plot lines, axis, info boxes, etc, this method returns the right value.</span>
<a name="l00301"></a>00301 <span class="comment">        @return An integer indicating layer type */</span>
<a name="l00302"></a><a class="code" href="classmp_layer.html#aebff4fbed09cc38e04f758c5e6f03a15">00302</a>     <a class="code" href="mathplot_8h.html#acf8b83e86e129762abc1b70e84db342c">mpLayerType</a> <a class="code" href="classmp_layer.html#aebff4fbed09cc38e04f758c5e6f03a15" title="Get layer type: a Layer can be of different types: plot lines, axis, info boxes, etc, this method returns the right value.">GetLayerType</a>() { <span class="keywordflow">return</span> m_type; };
<a name="l00303"></a>00303 <span class="comment"></span>
<a name="l00304"></a>00304 <span class="comment">    /** Checks whether the layer is visible or not.</span>
<a name="l00305"></a>00305 <span class="comment">        @return \a true if visible */</span>
<a name="l00306"></a><a class="code" href="classmp_layer.html#a22f21390e1bad50af27487c8b48dd494">00306</a>     <span class="keywordtype">bool</span> <a class="code" href="classmp_layer.html#a22f21390e1bad50af27487c8b48dd494" title="Checks whether the layer is visible or not.">IsVisible</a>() {<span class="keywordflow">return</span> m_visible; };
<a name="l00307"></a>00307 <span class="comment"></span>
<a name="l00308"></a>00308 <span class="comment">    /** Sets layer visibility.</span>
<a name="l00309"></a>00309 <span class="comment">        @param show visibility bool. */</span>
<a name="l00310"></a><a class="code" href="classmp_layer.html#ab972a81522238b708573cd0b2bbc2578">00310</a>     <span class="keywordtype">void</span> <a class="code" href="classmp_layer.html#ab972a81522238b708573cd0b2bbc2578" title="Sets layer visibility.">SetVisible</a>(<span class="keywordtype">bool</span> show) { m_visible = show; };
<a name="l00311"></a>00311 <span class="comment"></span>
<a name="l00312"></a>00312 <span class="comment">        /** Get brush set for this layer.</span>
<a name="l00313"></a>00313 <span class="comment">                @return brush. */</span>
<a name="l00314"></a><a class="code" href="classmp_layer.html#ac27b14f700e6193a936834e3994813c3">00314</a>         <span class="keyword">const</span> wxBrush&amp;   <a class="code" href="classmp_layer.html#ac27b14f700e6193a936834e3994813c3" title="Get brush set for this layer.">GetBrush</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_brush; };
<a name="l00315"></a>00315 <span class="comment"></span>
<a name="l00316"></a>00316 <span class="comment">        /** Set layer brush</span>
<a name="l00317"></a>00317 <span class="comment">                @param brush brush, will be copied to internal class member     */</span>
<a name="l00318"></a><a class="code" href="classmp_layer.html#abc07f029f172cab8ab80e0bc9b036dfb">00318</a>         <span class="keywordtype">void</span> <a class="code" href="classmp_layer.html#abc07f029f172cab8ab80e0bc9b036dfb" title="Set layer brush.">SetBrush</a>(wxBrush brush) { m_brush = brush; };
<a name="l00319"></a>00319 
<a name="l00320"></a>00320 <span class="keyword">protected</span>:
<a name="l00321"></a>00321     wxFont   m_font;    <span class="comment">//!&lt; Layer&#39;s font</span>
<a name="l00322"></a><a class="code" href="classmp_layer.html#ad24283efc41df6b8f0d80030f0e6a56d">00322</a> <span class="comment"></span>    wxPen    <a class="code" href="classmp_layer.html#ad24283efc41df6b8f0d80030f0e6a56d" title="Layer&#39;s pen.">m_pen</a>;     <span class="comment">//!&lt; Layer&#39;s pen</span>
<a name="l00323"></a><a class="code" href="classmp_layer.html#ac3d0ae222700628378471709bc62f76c">00323</a> <span class="comment"></span>        wxBrush  <a class="code" href="classmp_layer.html#ac3d0ae222700628378471709bc62f76c" title="Layer&#39;s brush.">m_brush</a>;       <span class="comment">//!&lt; Layer&#39;s brush</span>
<a name="l00324"></a><a class="code" href="classmp_layer.html#ac0894b3ff9ce5a82524256497599636c">00324</a> <span class="comment"></span>    wxString <a class="code" href="classmp_layer.html#ac0894b3ff9ce5a82524256497599636c" title="Layer&#39;s name.">m_name</a>;    <span class="comment">//!&lt; Layer&#39;s name</span>
<a name="l00325"></a><a class="code" href="classmp_layer.html#a59361dc98bdf0cdb1f279f5d86b6b9f5">00325</a> <span class="comment"></span>    <span class="keywordtype">bool</span>     <a class="code" href="classmp_layer.html#a59361dc98bdf0cdb1f279f5d86b6b9f5" title="Specify if the layer will be plotted as a continuous line or a set of points.">m_continuous</a>; <span class="comment">//!&lt; Specify if the layer will be plotted as a continuous line or a set of points.</span>
<a name="l00326"></a><a class="code" href="classmp_layer.html#a634c0423aad7ce8b908b9122952e5d5d">00326</a> <span class="comment"></span>    <span class="keywordtype">bool</span>     <a class="code" href="classmp_layer.html#a634c0423aad7ce8b908b9122952e5d5d" title="States whether the name of the layer must be shown (default is true).">m_showName</a>;  <span class="comment">//!&lt; States whether the name of the layer must be shown (default is true).</span>
<a name="l00327"></a><a class="code" href="classmp_layer.html#a2254c13cc469d401eaa0833a3d4a4034">00327</a> <span class="comment"></span>    <span class="keywordtype">bool</span>     <a class="code" href="classmp_layer.html#a2254c13cc469d401eaa0833a3d4a4034" title="select if the layer should draw only inside margins or over all DC">m_drawOutsideMargins</a>; <span class="comment">//!&lt; select if the layer should draw only inside margins or over all DC</span>
<a name="l00328"></a><a class="code" href="classmp_layer.html#ab84741fba387364a0508e957b2350f57">00328</a> <span class="comment"></span>    <a class="code" href="mathplot_8h.html#acf8b83e86e129762abc1b70e84db342c">mpLayerType</a> <a class="code" href="classmp_layer.html#ab84741fba387364a0508e957b2350f57" title="Define layer type, which is assigned by constructor.">m_type</a>; <span class="comment">//!&lt; Define layer type, which is assigned by constructor</span>
<a name="l00329"></a><a class="code" href="classmp_layer.html#a6388b1d9d1480546c27d00eb989fe818">00329</a> <span class="comment"></span>        <span class="keywordtype">bool</span>    <a class="code" href="classmp_layer.html#a6388b1d9d1480546c27d00eb989fe818" title="Toggles layer visibility.">m_visible</a>;      <span class="comment">//!&lt; Toggles layer visibility</span>
<a name="l00330"></a>00330 <span class="comment"></span>    DECLARE_DYNAMIC_CLASS(<a class="code" href="classmp_layer.html" title="Plot layer, abstract base class.">mpLayer</a>)
<a name="l00331"></a>00331 };
<a name="l00332"></a>00332 
<a name="l00333"></a>00333 
<a name="l00334"></a>00334 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00335"></a>00335 <span class="comment">// mpInfoLayer</span>
<a name="l00336"></a>00336 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00337"></a>00337 <span class="comment"></span>
<a name="l00338"></a>00338 <span class="comment">/** @class mpInfoLayer</span>
<a name="l00339"></a>00339 <span class="comment">    @brief Base class to create small rectangular info boxes</span>
<a name="l00340"></a>00340 <span class="comment">    mpInfoLayer is the base class to create a small rectangular info box in transparent overlay over plot layers. It is used to implement objects like legends.</span>
<a name="l00341"></a>00341 <span class="comment">*/</span>
<a name="l00342"></a>00342 <span class="keyword">class </span><a class="code" href="mathplot_8h.html#a8ad8b0f95a03f1bc9ff4ed3947e96ea1">WXDLLIMPEXP_MATHPLOT</a> <a class="code" href="classmp_info_layer.html" title="Base class to create small rectangular info boxes mpInfoLayer is the base class to create a small rec...">mpInfoLayer</a> : <span class="keyword">public</span> <a class="code" href="classmp_layer.html" title="Plot layer, abstract base class.">mpLayer</a>
<a name="l00343"></a>00343 {
<a name="l00344"></a>00344 <span class="keyword">public</span>:<span class="comment"></span>
<a name="l00345"></a>00345 <span class="comment">    /** Default constructor. */</span>
<a name="l00346"></a>00346     <a class="code" href="classmp_info_layer.html" title="Base class to create small rectangular info boxes mpInfoLayer is the base class to create a small rec...">mpInfoLayer</a>();
<a name="l00347"></a>00347 <span class="comment"></span>
<a name="l00348"></a>00348 <span class="comment">    /** Complete constructor.</span>
<a name="l00349"></a>00349 <span class="comment">        @param rect Sets the initial size rectangle of the layer.</span>
<a name="l00350"></a>00350 <span class="comment">        @param brush pointer to a fill brush. Default is transparent */</span>
<a name="l00351"></a>00351     <a class="code" href="classmp_info_layer.html" title="Base class to create small rectangular info boxes mpInfoLayer is the base class to create a small rec...">mpInfoLayer</a>(wxRect rect, <span class="keyword">const</span> wxBrush* brush = wxTRANSPARENT_BRUSH);
<a name="l00352"></a>00352 <span class="comment"></span>
<a name="l00353"></a>00353 <span class="comment">    /** Destructor */</span>
<a name="l00354"></a>00354     <span class="keyword">virtual</span> ~<a class="code" href="classmp_info_layer.html" title="Base class to create small rectangular info boxes mpInfoLayer is the base class to create a small rec...">mpInfoLayer</a>();
<a name="l00355"></a>00355 <span class="comment"></span>
<a name="l00356"></a>00356 <span class="comment">    /** Updates the content of the info box. Should be overidden by derived classes.</span>
<a name="l00357"></a>00357 <span class="comment">        Update may behave in different ways according to the type of event which called it.</span>
<a name="l00358"></a>00358 <span class="comment">        @param w parent mpWindow from which to obtain informations</span>
<a name="l00359"></a>00359 <span class="comment">        @param event The event which called the update. */</span>
<a name="l00360"></a>00360     <span class="keyword">virtual</span> <span class="keywordtype">void</span> UpdateInfo(<a class="code" href="classmp_window.html" title="Canvas for plotting mpLayer implementations.">mpWindow</a>&amp; w, wxEvent&amp; event);
<a name="l00361"></a>00361 <span class="comment"></span>
<a name="l00362"></a>00362 <span class="comment">    /** mpInfoLayer has not bounding box. @sa mpLayer::HasBBox</span>
<a name="l00363"></a>00363 <span class="comment">        @return always \a FALSE */</span>
<a name="l00364"></a><a class="code" href="classmp_info_layer.html#a54711e4b80bb20b5cd80aab0e0a34f8e">00364</a>     <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classmp_info_layer.html#a54711e4b80bb20b5cd80aab0e0a34f8e" title="mpInfoLayer has not bounding box.">HasBBox</a>() { <span class="keywordflow">return</span> <span class="keyword">false</span>; };
<a name="l00365"></a>00365 <span class="comment"></span>
<a name="l00366"></a>00366 <span class="comment">    /** Plot method. Can be overidden by derived classes.</span>
<a name="l00367"></a>00367 <span class="comment">        @param dc the device content where to plot</span>
<a name="l00368"></a>00368 <span class="comment">        @param w the window to plot</span>
<a name="l00369"></a>00369 <span class="comment">        @sa mpLayer::Plot */</span>
<a name="l00370"></a>00370     <span class="keyword">virtual</span> <span class="keywordtype">void</span>   <a class="code" href="classmp_layer.html#a0c62e377dbdba1956b02bda3a5ac88b4" title="Plot given view of layer to the given device context.">Plot</a>(wxDC &amp; dc, <a class="code" href="classmp_window.html" title="Canvas for plotting mpLayer implementations.">mpWindow</a> &amp; w);
<a name="l00371"></a>00371 <span class="comment"></span>
<a name="l00372"></a>00372 <span class="comment">    /** Specifies that this is an Info box layer.</span>
<a name="l00373"></a>00373 <span class="comment">        @return always \a TRUE</span>
<a name="l00374"></a>00374 <span class="comment">        @sa mpLayer::IsInfo */</span>
<a name="l00375"></a><a class="code" href="classmp_info_layer.html#a58e554ec2cf13f4ed73e75bd79c221e2">00375</a>     <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classmp_info_layer.html#a58e554ec2cf13f4ed73e75bd79c221e2" title="Specifies that this is an Info box layer.">IsInfo</a>() { <span class="keywordflow">return</span> <span class="keyword">true</span>; };
<a name="l00376"></a>00376 <span class="comment"></span>
<a name="l00377"></a>00377 <span class="comment">    /** Checks whether a point is inside the info box rectangle.</span>
<a name="l00378"></a>00378 <span class="comment">        @param point The point to be checked</span>
<a name="l00379"></a>00379 <span class="comment">        @return \a true if the point is inside the bounding box */</span>
<a name="l00380"></a>00380     <span class="keyword">virtual</span> <span class="keywordtype">bool</span> Inside(wxPoint&amp; point);
<a name="l00381"></a>00381 <span class="comment"></span>
<a name="l00382"></a>00382 <span class="comment">    /** Moves the layer rectangle of given pixel deltas.</span>
<a name="l00383"></a>00383 <span class="comment">        @param delta The wxPoint container for delta coordinates along x and y. Units are in pixels. */</span>
<a name="l00384"></a>00384     <span class="keyword">virtual</span> <span class="keywordtype">void</span> Move(wxPoint delta);
<a name="l00385"></a>00385 <span class="comment"></span>
<a name="l00386"></a>00386 <span class="comment">    /** Updates the rectangle reference point. Used by internal methods of mpWindow to correctly move mpInfoLayers. */</span>
<a name="l00387"></a>00387     <span class="keyword">virtual</span> <span class="keywordtype">void</span> UpdateReference();
<a name="l00388"></a>00388 <span class="comment"></span>
<a name="l00389"></a>00389 <span class="comment">    /** Returns the position of the upper left corner of the box (in pixels)</span>
<a name="l00390"></a>00390 <span class="comment">        @return The rectangle position */</span>
<a name="l00391"></a>00391     wxPoint GetPosition();
<a name="l00392"></a>00392 <span class="comment"></span>
<a name="l00393"></a>00393 <span class="comment">    /** Returns the size of the box (in pixels)</span>
<a name="l00394"></a>00394 <span class="comment">        @return The rectangle size */</span>
<a name="l00395"></a>00395     wxSize GetSize();
<a name="l00396"></a>00396 <span class="comment"></span>
<a name="l00397"></a>00397 <span class="comment">        /** Returns the current rectangle coordinates.</span>
<a name="l00398"></a>00398 <span class="comment">            @return The info layer rectangle */</span>
<a name="l00399"></a><a class="code" href="classmp_info_layer.html#a607ac77f719d43452db8956bad419b6d">00399</a>         <span class="keyword">const</span> wxRect&amp; GetRectangle() { <span class="keywordflow">return</span> m_dim; };
<a name="l00400"></a>00400 
<a name="l00401"></a>00401 <span class="keyword">protected</span>:
<a name="l00402"></a>00402     wxRect m_dim;           <span class="comment">//!&lt; The bounding rectangle of the box. It may be resized dynamically by the Plot method.</span>
<a name="l00403"></a><a class="code" href="classmp_info_layer.html#a42beeefd80979bb5abf1cb36f40f459a">00403</a> <span class="comment"></span>    wxPoint <a class="code" href="classmp_info_layer.html#a42beeefd80979bb5abf1cb36f40f459a" title="Holds the reference point for movements.">m_reference</a>;    <span class="comment">//!&lt; Holds the reference point for movements</span>
<a name="l00404"></a><a class="code" href="classmp_info_layer.html#af3366ac05d6f5f15831f380bdcf29ea2">00404</a> <span class="comment"></span>    wxBrush <a class="code" href="classmp_info_layer.html#af3366ac05d6f5f15831f380bdcf29ea2" title="The brush to be used for the background.">m_brush</a>;        <span class="comment">//!&lt; The brush to be used for the background</span>
<a name="l00405"></a><a class="code" href="classmp_info_layer.html#a692d54d636387abc00406de46c744ae3">00405</a> <span class="comment"></span>    <span class="keywordtype">int</span> m_winX, <a class="code" href="classmp_info_layer.html#a692d54d636387abc00406de46c744ae3" title="Holds the mpWindow size. Used to rescale position when window is resized.">m_winY</a>;     <span class="comment">//!&lt; Holds the mpWindow size. Used to rescale position when window is resized.</span>
<a name="l00406"></a>00406 <span class="comment"></span>
<a name="l00407"></a>00407     DECLARE_DYNAMIC_CLASS(<a class="code" href="classmp_info_layer.html" title="Base class to create small rectangular info boxes mpInfoLayer is the base class to create a small rec...">mpInfoLayer</a>)
<a name="l00408"></a>00408 };
<a name="l00409"></a>00409 <span class="comment"></span>
<a name="l00410"></a>00410 <span class="comment">/** @class mpInfoCoords</span>
<a name="l00411"></a>00411 <span class="comment">    @brief Implements an overlay box which shows the mouse coordinates in plot units.</span>
<a name="l00412"></a>00412 <span class="comment">    When an mpInfoCoords layer is activated, when mouse is moved over the mpWindow, its coordinates (in mpWindow units, not pixels) are continuously reported inside the layer box. */</span>
<a name="l00413"></a>00413 <span class="keyword">class </span><a class="code" href="mathplot_8h.html#a8ad8b0f95a03f1bc9ff4ed3947e96ea1">WXDLLIMPEXP_MATHPLOT</a> <a class="code" href="classmp_info_coords.html" title="Implements an overlay box which shows the mouse coordinates in plot units.">mpInfoCoords</a> : <span class="keyword">public</span> <a class="code" href="classmp_info_layer.html" title="Base class to create small rectangular info boxes mpInfoLayer is the base class to create a small rec...">mpInfoLayer</a>
<a name="l00414"></a>00414 {
<a name="l00415"></a>00415 <span class="keyword">public</span>:<span class="comment"></span>
<a name="l00416"></a>00416 <span class="comment">    /** Default constructor */</span>
<a name="l00417"></a>00417     <a class="code" href="classmp_info_coords.html" title="Implements an overlay box which shows the mouse coordinates in plot units.">mpInfoCoords</a>();<span class="comment"></span>
<a name="l00418"></a>00418 <span class="comment">    /** Complete constructor, setting initial rectangle and background brush.</span>
<a name="l00419"></a>00419 <span class="comment">        @param rect The initial bounding rectangle.</span>
<a name="l00420"></a>00420 <span class="comment">        @param brush The wxBrush to be used for box background: default is transparent */</span>
<a name="l00421"></a>00421     <a class="code" href="classmp_info_coords.html" title="Implements an overlay box which shows the mouse coordinates in plot units.">mpInfoCoords</a>(wxRect rect, <span class="keyword">const</span> wxBrush* brush = wxTRANSPARENT_BRUSH);
<a name="l00422"></a>00422 <span class="comment"></span>
<a name="l00423"></a>00423 <span class="comment">    /** Default destructor */</span>
<a name="l00424"></a>00424     ~<a class="code" href="classmp_info_coords.html" title="Implements an overlay box which shows the mouse coordinates in plot units.">mpInfoCoords</a>();
<a name="l00425"></a>00425 <span class="comment"></span>
<a name="l00426"></a>00426 <span class="comment">    /** Updates the content of the info box. It is used to update coordinates.</span>
<a name="l00427"></a>00427 <span class="comment">        @param w parent mpWindow from which to obtain information</span>
<a name="l00428"></a>00428 <span class="comment">        @param event The event which called the update. */</span>
<a name="l00429"></a>00429     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classmp_info_layer.html#a47f7ab1cb0ea49e83ce6e6df518011d3" title="Updates the content of the info box.">UpdateInfo</a>(<a class="code" href="classmp_window.html" title="Canvas for plotting mpLayer implementations.">mpWindow</a>&amp; w, wxEvent&amp; event);
<a name="l00430"></a>00430 <span class="comment"></span>
<a name="l00431"></a>00431 <span class="comment">    /** Plot method.</span>
<a name="l00432"></a>00432 <span class="comment">        @param dc the device content where to plot</span>
<a name="l00433"></a>00433 <span class="comment">        @param w the window to plot</span>
<a name="l00434"></a>00434 <span class="comment">        @sa mpLayer::Plot */</span>
<a name="l00435"></a>00435     <span class="keyword">virtual</span> <span class="keywordtype">void</span>   <a class="code" href="classmp_info_layer.html#a8153371e97c6073cc4a2df9ccf2e16f5" title="Plot method.">Plot</a>(wxDC &amp; dc, <a class="code" href="classmp_window.html" title="Canvas for plotting mpLayer implementations.">mpWindow</a> &amp; w);
<a name="l00436"></a>00436 
<a name="l00437"></a>00437 <span class="keyword">protected</span>:
<a name="l00438"></a><a class="code" href="classmp_info_coords.html#a8b190df77127f7c9355e71dc3d836080">00438</a>     wxString <a class="code" href="classmp_info_coords.html#a8b190df77127f7c9355e71dc3d836080" title="string holding the coordinates to be drawn.">m_content</a>; <span class="comment">//!&lt; string holding the coordinates to be drawn.</span>
<a name="l00439"></a>00439 <span class="comment"></span>};
<a name="l00440"></a>00440 <span class="comment"></span>
<a name="l00441"></a>00441 <span class="comment">/** @class mpInfoLegend</span>
<a name="l00442"></a>00442 <span class="comment">    @brief Implements the legend to be added to the plot</span>
<a name="l00443"></a>00443 <span class="comment">    This layer allows you to add a legend to describe the plots in the window. The legend uses the layer name as a label, and displays only layers of type mpLAYER_PLOT. */</span>
<a name="l00444"></a>00444 <span class="keyword">class </span><a class="code" href="mathplot_8h.html#a8ad8b0f95a03f1bc9ff4ed3947e96ea1">WXDLLIMPEXP_MATHPLOT</a> <a class="code" href="classmp_info_legend.html" title="Implements the legend to be added to the plot This layer allows you to add a legend to describe the p...">mpInfoLegend</a> : <span class="keyword">public</span> <a class="code" href="classmp_info_layer.html" title="Base class to create small rectangular info boxes mpInfoLayer is the base class to create a small rec...">mpInfoLayer</a>
<a name="l00445"></a>00445 {
<a name="l00446"></a>00446 <span class="keyword">public</span>:<span class="comment"></span>
<a name="l00447"></a>00447 <span class="comment">    /** Default constructor */</span>
<a name="l00448"></a>00448     <a class="code" href="classmp_info_legend.html" title="Implements the legend to be added to the plot This layer allows you to add a legend to describe the p...">mpInfoLegend</a>();
<a name="l00449"></a>00449 <span class="comment"></span>
<a name="l00450"></a>00450 <span class="comment">    /** Complete constructor, setting initial rectangle and background brush.</span>
<a name="l00451"></a>00451 <span class="comment">        @param rect The initial bounding rectangle.</span>
<a name="l00452"></a>00452 <span class="comment">        @param brush The wxBrush to be used for box background: default is transparent</span>
<a name="l00453"></a>00453 <span class="comment">        @sa mpInfoLayer::mpInfoLayer */</span>
<a name="l00454"></a>00454     <a class="code" href="classmp_info_legend.html" title="Implements the legend to be added to the plot This layer allows you to add a legend to describe the p...">mpInfoLegend</a>(wxRect rect, <span class="keyword">const</span> wxBrush* brush = wxTRANSPARENT_BRUSH);
<a name="l00455"></a>00455 <span class="comment"></span>
<a name="l00456"></a>00456 <span class="comment">    /**  Default destructor */</span>
<a name="l00457"></a>00457     ~<a class="code" href="classmp_info_legend.html" title="Implements the legend to be added to the plot This layer allows you to add a legend to describe the p...">mpInfoLegend</a>();
<a name="l00458"></a>00458 <span class="comment"></span>
<a name="l00459"></a>00459 <span class="comment">    /** Updates the content of the info box. Unused in this class.</span>
<a name="l00460"></a>00460 <span class="comment">        @param w parent mpWindow from which to obtain information</span>
<a name="l00461"></a>00461 <span class="comment">        @param event The event which called the update. */</span>
<a name="l00462"></a>00462     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classmp_info_layer.html#a47f7ab1cb0ea49e83ce6e6df518011d3" title="Updates the content of the info box.">UpdateInfo</a>(<a class="code" href="classmp_window.html" title="Canvas for plotting mpLayer implementations.">mpWindow</a>&amp; w, wxEvent&amp; event);
<a name="l00463"></a>00463 <span class="comment"></span>
<a name="l00464"></a>00464 <span class="comment">    /** Plot method.</span>
<a name="l00465"></a>00465 <span class="comment">        @param dc the device content where to plot</span>
<a name="l00466"></a>00466 <span class="comment">        @param w the window to plot</span>
<a name="l00467"></a>00467 <span class="comment">        @sa mpLayer::Plot */</span>
<a name="l00468"></a>00468     <span class="keyword">virtual</span> <span class="keywordtype">void</span>   <a class="code" href="classmp_info_layer.html#a8153371e97c6073cc4a2df9ccf2e16f5" title="Plot method.">Plot</a>(wxDC &amp; dc, <a class="code" href="classmp_window.html" title="Canvas for plotting mpLayer implementations.">mpWindow</a> &amp; w);
<a name="l00469"></a>00469 
<a name="l00470"></a>00470 <span class="keyword">protected</span>:
<a name="l00471"></a>00471 
<a name="l00472"></a>00472 };
<a name="l00473"></a>00473 
<a name="l00474"></a>00474 
<a name="l00475"></a>00475 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00476"></a>00476 <span class="comment">// mpLayer implementations - functions</span>
<a name="l00477"></a>00477 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00478"></a>00478 <span class="comment"></span>
<a name="l00479"></a>00479 <span class="comment">/** @name Label alignment constants</span>
<a name="l00480"></a>00480 <span class="comment">@{*/</span>
<a name="l00481"></a>00481 <span class="comment"></span>
<a name="l00482"></a>00482 <span class="comment">/** @internal */</span>
<a name="l00483"></a><a class="code" href="mathplot_8h.html#ac390620c72a145d6ac2edc8dc2338a0c">00483</a> <span class="preprocessor">#define mpALIGNMASK    0x03</span>
<a name="l00484"></a>00484 <span class="preprocessor"></span><span class="comment">/** Aligns label to the right. For use with mpFX. */</span>
<a name="l00485"></a><a class="code" href="mathplot_8h.html#a4d8a5e0e914dd21f17152101449eac4e">00485</a> <span class="preprocessor">#define mpALIGN_RIGHT  0x00</span>
<a name="l00486"></a>00486 <span class="preprocessor"></span><span class="comment">/** Aligns label to the center. For use with mpFX and mpFY. */</span>
<a name="l00487"></a><a class="code" href="mathplot_8h.html#a7a2ab21a4670db2c4ba4ef1c1f8e8252">00487</a> <span class="preprocessor">#define mpALIGN_CENTER 0x01</span>
<a name="l00488"></a>00488 <span class="preprocessor"></span><span class="comment">/** Aligns label to the left. For use with mpFX. */</span>
<a name="l00489"></a><a class="code" href="mathplot_8h.html#a7ece2941b6481df253907b3779fcb46d">00489</a> <span class="preprocessor">#define mpALIGN_LEFT   0x02</span>
<a name="l00490"></a>00490 <span class="preprocessor"></span><span class="comment">/** Aligns label to the top. For use with mpFY. */</span>
<a name="l00491"></a><a class="code" href="mathplot_8h.html#a8abb8d8e422872f917fe19be8b21e734">00491</a> <span class="preprocessor">#define mpALIGN_TOP    mpALIGN_RIGHT</span>
<a name="l00492"></a>00492 <span class="preprocessor"></span><span class="comment">/** Aligns label to the bottom. For use with mpFY. */</span>
<a name="l00493"></a><a class="code" href="mathplot_8h.html#af43841cf0830d799dfb1c2a2464e670d">00493</a> <span class="preprocessor">#define mpALIGN_BOTTOM mpALIGN_LEFT</span>
<a name="l00494"></a>00494 <span class="preprocessor"></span><span class="comment">/** Aligns X axis to bottom border. For mpScaleX */</span>
<a name="l00495"></a><a class="code" href="mathplot_8h.html#afbc78fecb180bea9c7c5b646af61a467">00495</a> <span class="preprocessor">#define mpALIGN_BORDER_BOTTOM  0x04</span>
<a name="l00496"></a>00496 <span class="preprocessor"></span><span class="comment">/** Aligns X axis to top border. For mpScaleX */</span>
<a name="l00497"></a><a class="code" href="mathplot_8h.html#a78d4405bf5557bc6bc5a26f3e1c9831f">00497</a> <span class="preprocessor">#define mpALIGN_BORDER_TOP  0x05</span>
<a name="l00498"></a>00498 <span class="preprocessor"></span><span class="comment">/** Set label for X axis in normal mode */</span>
<a name="l00499"></a><a class="code" href="mathplot_8h.html#aeb1b2013394726b9bb4c5f89bf1f6246">00499</a> <span class="preprocessor">#define mpX_NORMAL  0x00</span>
<a name="l00500"></a>00500 <span class="preprocessor"></span><span class="comment">/** Set label for X axis in time mode: the value is represented as minutes:seconds.milliseconds if time is less than 2 minutes, hours:minutes:seconds otherwise. */</span>
<a name="l00501"></a><a class="code" href="mathplot_8h.html#a0e12483886e9351e537f8919765c77a0">00501</a> <span class="preprocessor">#define mpX_TIME  0x01</span>
<a name="l00502"></a>00502 <span class="preprocessor"></span><span class="comment">/** Set label for X axis in hours mode: the value is always represented as hours:minutes:seconds. */</span>
<a name="l00503"></a><a class="code" href="mathplot_8h.html#ac059dc279587c8c3d76cc57d62e83101">00503</a> <span class="preprocessor">#define mpX_HOURS 0x02</span>
<a name="l00504"></a>00504 <span class="preprocessor"></span><span class="comment">/** Set label for X axis in date mode: the value is always represented as yyyy-mm-dd. */</span>
<a name="l00505"></a><a class="code" href="mathplot_8h.html#a8ea822b8c910f9d7656288b230f3c0a0">00505</a> <span class="preprocessor">#define mpX_DATE 0x03</span>
<a name="l00506"></a>00506 <span class="preprocessor"></span><span class="comment">/** Set label for X axis in datetime mode: the value is always represented as yyyy-mm-ddThh:mm:ss. */</span>
<a name="l00507"></a><a class="code" href="mathplot_8h.html#a63eaef7e390b92fcd055175e24a8a00e">00507</a> <span class="preprocessor">#define mpX_DATETIME 0x04</span>
<a name="l00508"></a>00508 <span class="preprocessor"></span><span class="comment">/** Aligns Y axis to left border. For mpScaleY */</span>
<a name="l00509"></a><a class="code" href="mathplot_8h.html#a9df8cbe28e658a28c73feda0f13a5631">00509</a> <span class="preprocessor">#define mpALIGN_BORDER_LEFT mpALIGN_BORDER_BOTTOM</span>
<a name="l00510"></a>00510 <span class="preprocessor"></span><span class="comment">/** Aligns Y axis to right border. For mpScaleY */</span>
<a name="l00511"></a><a class="code" href="mathplot_8h.html#a053a412886ee8c91ac8225cf7188c2da">00511</a> <span class="preprocessor">#define mpALIGN_BORDER_RIGHT mpALIGN_BORDER_TOP</span>
<a name="l00512"></a>00512 <span class="preprocessor"></span><span class="comment">/** Aligns label to north-east. For use with mpFXY. */</span>
<a name="l00513"></a><a class="code" href="mathplot_8h.html#aefebdec22b0dadaa9bc5bbe0b18bc097">00513</a> <span class="preprocessor">#define mpALIGN_NE     0x00</span>
<a name="l00514"></a>00514 <span class="preprocessor"></span><span class="comment">/** Aligns label to north-west. For use with mpFXY. */</span>
<a name="l00515"></a><a class="code" href="mathplot_8h.html#a4fbe5732cf8c7dea25b7e003d0ce7997">00515</a> <span class="preprocessor">#define mpALIGN_NW     0x01</span>
<a name="l00516"></a>00516 <span class="preprocessor"></span><span class="comment">/** Aligns label to south-west. For use with mpFXY. */</span>
<a name="l00517"></a><a class="code" href="mathplot_8h.html#a64a1a80f27b52a442b809d01deb8ba6b">00517</a> <span class="preprocessor">#define mpALIGN_SW     0x02</span>
<a name="l00518"></a>00518 <span class="preprocessor"></span><span class="comment">/** Aligns label to south-east. For use with mpFXY. */</span>
<a name="l00519"></a><a class="code" href="mathplot_8h.html#adce1c76657684412bdd157eeea813a74">00519</a> <span class="preprocessor">#define mpALIGN_SE     0x03</span>
<a name="l00520"></a>00520 <span class="preprocessor"></span><span class="comment"></span>
<a name="l00521"></a>00521 <span class="comment">/*@}*/</span>
<a name="l00522"></a>00522 <span class="comment"></span>
<a name="l00523"></a>00523 <span class="comment">/** @name mpLayer implementations - functions</span>
<a name="l00524"></a>00524 <span class="comment">@{*/</span>
<a name="l00525"></a>00525 <span class="comment"></span>
<a name="l00526"></a>00526 <span class="comment">/** Abstract base class providing plot and labeling functionality for functions F:X-&gt;Y.</span>
<a name="l00527"></a>00527 <span class="comment">    Override mpFX::GetY to implement a function.</span>
<a name="l00528"></a>00528 <span class="comment">    Optionally implement a constructor and pass a name (label) and a label alignment</span>
<a name="l00529"></a>00529 <span class="comment">    to the constructor mpFX::mpFX. If the layer name is empty, no label will be plotted.</span>
<a name="l00530"></a>00530 <span class="comment">*/</span>
<a name="l00531"></a>00531 <span class="keyword">class </span><a class="code" href="mathplot_8h.html#a8ad8b0f95a03f1bc9ff4ed3947e96ea1">WXDLLIMPEXP_MATHPLOT</a> <a class="code" href="classmp_f_x.html" title="Abstract base class providing plot and labeling functionality for functions F:X-&gt;Y.">mpFX</a> : <span class="keyword">public</span> <a class="code" href="classmp_layer.html" title="Plot layer, abstract base class.">mpLayer</a>
<a name="l00532"></a>00532 {
<a name="l00533"></a>00533 <span class="keyword">public</span>:<span class="comment"></span>
<a name="l00534"></a>00534 <span class="comment">    /** @param name  Label</span>
<a name="l00535"></a>00535 <span class="comment">        @param flags Label alignment, pass one of #mpALIGN_RIGHT, #mpALIGN_CENTER, #mpALIGN_LEFT.</span>
<a name="l00536"></a>00536 <span class="comment">    */</span>
<a name="l00537"></a>00537     <a class="code" href="mathplot_8h.html#aafeb58945dcb20f526d5cf91debb53c7">mpFX</a>(wxString name = wxEmptyString, <span class="keywordtype">int</span> flags = <a class="code" href="mathplot_8h.html#a4d8a5e0e914dd21f17152101449eac4e" title="Aligns label to the right.">mpALIGN_RIGHT</a>);
<a name="l00538"></a>00538 <span class="comment"></span>
<a name="l00539"></a>00539 <span class="comment">    /** Get function value for argument.</span>
<a name="l00540"></a>00540 <span class="comment">        Override this function in your implementation.</span>
<a name="l00541"></a>00541 <span class="comment">        @param x Argument</span>
<a name="l00542"></a>00542 <span class="comment">        @return Function value</span>
<a name="l00543"></a>00543 <span class="comment">    */</span>
<a name="l00544"></a>00544     <span class="keyword">virtual</span> <span class="keywordtype">double</span> GetY( <span class="keywordtype">double</span> x ) = 0;
<a name="l00545"></a>00545 <span class="comment"></span>
<a name="l00546"></a>00546 <span class="comment">    /** Layer plot handler.</span>
<a name="l00547"></a>00547 <span class="comment">        This implementation will plot the function in the visible area and</span>
<a name="l00548"></a>00548 <span class="comment">        put a label according to the aligment specified.</span>
<a name="l00549"></a>00549 <span class="comment">    */</span>
<a name="l00550"></a>00550     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classmp_layer.html#a0c62e377dbdba1956b02bda3a5ac88b4" title="Plot given view of layer to the given device context.">Plot</a>(wxDC &amp; dc, <a class="code" href="classmp_window.html" title="Canvas for plotting mpLayer implementations.">mpWindow</a> &amp; w);
<a name="l00551"></a>00551 
<a name="l00552"></a>00552 <span class="keyword">protected</span>:
<a name="l00553"></a><a class="code" href="classmp_f_x.html#aeb3887a9c5fe1c006b04fefb50e8aac3">00553</a>     <span class="keywordtype">int</span> <a class="code" href="classmp_f_x.html#aeb3887a9c5fe1c006b04fefb50e8aac3" title="Holds label alignment.">m_flags</a>; <span class="comment">//!&lt; Holds label alignment</span>
<a name="l00554"></a>00554 <span class="comment"></span>
<a name="l00555"></a>00555     DECLARE_DYNAMIC_CLASS(<a class="code" href="classmp_f_x.html" title="Abstract base class providing plot and labeling functionality for functions F:X-&gt;Y.">mpFX</a>)
<a name="l00556"></a>00556 };
<a name="l00557"></a>00557 <span class="comment"></span>
<a name="l00558"></a>00558 <span class="comment">/** Abstract base class providing plot and labeling functionality for functions F:Y-&gt;X.</span>
<a name="l00559"></a>00559 <span class="comment">    Override mpFY::GetX to implement a function.</span>
<a name="l00560"></a>00560 <span class="comment">    Optionally implement a constructor and pass a name (label) and a label alignment</span>
<a name="l00561"></a>00561 <span class="comment">    to the constructor mpFY::mpFY. If the layer name is empty, no label will be plotted.</span>
<a name="l00562"></a>00562 <span class="comment">*/</span>
<a name="l00563"></a>00563 <span class="keyword">class </span><a class="code" href="mathplot_8h.html#a8ad8b0f95a03f1bc9ff4ed3947e96ea1">WXDLLIMPEXP_MATHPLOT</a> <a class="code" href="classmp_f_y.html" title="Abstract base class providing plot and labeling functionality for functions F:Y-&gt;X.">mpFY</a> : <span class="keyword">public</span> <a class="code" href="classmp_layer.html" title="Plot layer, abstract base class.">mpLayer</a>
<a name="l00564"></a>00564 {
<a name="l00565"></a>00565 <span class="keyword">public</span>:<span class="comment"></span>
<a name="l00566"></a>00566 <span class="comment">    /** @param name  Label</span>
<a name="l00567"></a>00567 <span class="comment">        @param flags Label alignment, pass one of #mpALIGN_BOTTOM, #mpALIGN_CENTER, #mpALIGN_TOP.</span>
<a name="l00568"></a>00568 <span class="comment">    */</span>
<a name="l00569"></a>00569     <a class="code" href="mathplot_8h.html#a10ee4f54b59b869d596ae9f770eca3f9">mpFY</a>(wxString name = wxEmptyString, <span class="keywordtype">int</span> flags = <a class="code" href="mathplot_8h.html#a8abb8d8e422872f917fe19be8b21e734" title="Aligns label to the top.">mpALIGN_TOP</a>);
<a name="l00570"></a>00570 <span class="comment"></span>
<a name="l00571"></a>00571 <span class="comment">    /** Get function value for argument.</span>
<a name="l00572"></a>00572 <span class="comment">        Override this function in your implementation.</span>
<a name="l00573"></a>00573 <span class="comment">        @param y Argument</span>
<a name="l00574"></a>00574 <span class="comment">        @return Function value</span>
<a name="l00575"></a>00575 <span class="comment">    */</span>
<a name="l00576"></a>00576     <span class="keyword">virtual</span> <span class="keywordtype">double</span> GetX( <span class="keywordtype">double</span> <a class="code" href="namespace_eigen_1_1internal.html#a3d7a581aeb951248dc6fe114e9e05f07">y</a> ) = 0;
<a name="l00577"></a>00577 <span class="comment"></span>
<a name="l00578"></a>00578 <span class="comment">    /** Layer plot handler.</span>
<a name="l00579"></a>00579 <span class="comment">        This implementation will plot the function in the visible area and</span>
<a name="l00580"></a>00580 <span class="comment">        put a label according to the aligment specified.</span>
<a name="l00581"></a>00581 <span class="comment">    */</span>
<a name="l00582"></a>00582     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classmp_layer.html#a0c62e377dbdba1956b02bda3a5ac88b4" title="Plot given view of layer to the given device context.">Plot</a>(wxDC &amp; dc, <a class="code" href="classmp_window.html" title="Canvas for plotting mpLayer implementations.">mpWindow</a> &amp; w);
<a name="l00583"></a>00583 
<a name="l00584"></a>00584 <span class="keyword">protected</span>:
<a name="l00585"></a><a class="code" href="classmp_f_y.html#a785a6960de3eccb3b16063774cb480c1">00585</a>     <span class="keywordtype">int</span> <a class="code" href="classmp_f_y.html#a785a6960de3eccb3b16063774cb480c1" title="Holds label alignment.">m_flags</a>; <span class="comment">//!&lt; Holds label alignment</span>
<a name="l00586"></a>00586 <span class="comment"></span>
<a name="l00587"></a>00587     DECLARE_DYNAMIC_CLASS(<a class="code" href="classmp_f_y.html" title="Abstract base class providing plot and labeling functionality for functions F:Y-&gt;X.">mpFY</a>)
<a name="l00588"></a>00588 };
<a name="l00589"></a>00589 <span class="comment"></span>
<a name="l00590"></a>00590 <span class="comment">/** Abstract base class providing plot and labeling functionality for a locus plot F:N-&gt;X,Y.</span>
<a name="l00591"></a>00591 <span class="comment">    Locus argument N is assumed to be in range 0 .. MAX_N, and implicitly derived by enumerating</span>
<a name="l00592"></a>00592 <span class="comment">    all locus values. Override mpFXY::Rewind and mpFXY::GetNextXY to implement a locus.</span>
<a name="l00593"></a>00593 <span class="comment">    Optionally implement a constructor and pass a name (label) and a label alignment</span>
<a name="l00594"></a>00594 <span class="comment">    to the constructor mpFXY::mpFXY. If the layer name is empty, no label will be plotted.</span>
<a name="l00595"></a>00595 <span class="comment">*/</span>
<a name="l00596"></a>00596 <span class="keyword">class </span><a class="code" href="mathplot_8h.html#a8ad8b0f95a03f1bc9ff4ed3947e96ea1">WXDLLIMPEXP_MATHPLOT</a> <a class="code" href="classmp_f_x_y.html" title="Abstract base class providing plot and labeling functionality for a locus plot F:N-&gt;X,Y.">mpFXY</a> : <span class="keyword">public</span> <a class="code" href="classmp_layer.html" title="Plot layer, abstract base class.">mpLayer</a>
<a name="l00597"></a>00597 {
<a name="l00598"></a>00598 <span class="keyword">public</span>:<span class="comment"></span>
<a name="l00599"></a>00599 <span class="comment">    /** @param name  Label</span>
<a name="l00600"></a>00600 <span class="comment">        @param flags Label alignment, pass one of #mpALIGN_NE, #mpALIGN_NW, #mpALIGN_SW, #mpALIGN_SE.</span>
<a name="l00601"></a>00601 <span class="comment">    */</span>
<a name="l00602"></a>00602     <a class="code" href="mathplot_8h.html#a6cc685434475389bc57c7428afb9a31a">mpFXY</a>(wxString name = wxEmptyString, <span class="keywordtype">int</span> flags = <a class="code" href="mathplot_8h.html#aefebdec22b0dadaa9bc5bbe0b18bc097" title="Aligns label to north-east.">mpALIGN_NE</a>);
<a name="l00603"></a>00603 <span class="comment"></span>
<a name="l00604"></a>00604 <span class="comment">    /** Rewind value enumeration with mpFXY::GetNextXY.</span>
<a name="l00605"></a>00605 <span class="comment">        Override this function in your implementation.</span>
<a name="l00606"></a>00606 <span class="comment">    */</span>
<a name="l00607"></a>00607     <span class="keyword">virtual</span> <span class="keywordtype">void</span> Rewind() = 0;
<a name="l00608"></a>00608 <span class="comment"></span>
<a name="l00609"></a>00609 <span class="comment">    /** Get locus value for next N.</span>
<a name="l00610"></a>00610 <span class="comment">        Override this function in your implementation.</span>
<a name="l00611"></a>00611 <span class="comment">        @param x Returns X value</span>
<a name="l00612"></a>00612 <span class="comment">        @param y Returns Y value</span>
<a name="l00613"></a>00613 <span class="comment">    */</span>
<a name="l00614"></a>00614     <span class="keyword">virtual</span> <span class="keywordtype">bool</span> GetNextXY(<span class="keywordtype">double</span> &amp; x, <span class="keywordtype">double</span> &amp; <a class="code" href="namespace_eigen_1_1internal.html#a3d7a581aeb951248dc6fe114e9e05f07">y</a>) = 0;
<a name="l00615"></a>00615 <span class="comment"></span>
<a name="l00616"></a>00616 <span class="comment">    /** Layer plot handler.</span>
<a name="l00617"></a>00617 <span class="comment">        This implementation will plot the locus in the visible area and</span>
<a name="l00618"></a>00618 <span class="comment">        put a label according to the alignment specified.</span>
<a name="l00619"></a>00619 <span class="comment">    */</span>
<a name="l00620"></a>00620     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classmp_layer.html#a0c62e377dbdba1956b02bda3a5ac88b4" title="Plot given view of layer to the given device context.">Plot</a>(wxDC &amp; dc, <a class="code" href="classmp_window.html" title="Canvas for plotting mpLayer implementations.">mpWindow</a> &amp; w);
<a name="l00621"></a>00621 
<a name="l00622"></a>00622 
<a name="l00623"></a>00623 <span class="keyword">protected</span>:
<a name="l00624"></a><a class="code" href="classmp_f_x_y.html#a5a18bca45b091ff3b03eafc023d5509f">00624</a>     <span class="keywordtype">int</span> <a class="code" href="classmp_f_x_y.html#a5a18bca45b091ff3b03eafc023d5509f" title="Holds label alignment.">m_flags</a>; <span class="comment">//!&lt; Holds label alignment</span>
<a name="l00625"></a>00625 <span class="comment"></span>
<a name="l00626"></a>00626         <span class="comment">// Data to calculate label positioning</span>
<a name="l00627"></a><a class="code" href="classmp_f_x_y.html#ae6ceb303e254f75957946dfd42e89b2e">00627</a>         wxCoord maxDrawX, minDrawX, maxDrawY, <a class="code" href="classmp_f_x_y.html#ae6ceb303e254f75957946dfd42e89b2e">minDrawY</a>;
<a name="l00628"></a>00628         <span class="comment">//int drawnPoints;</span>
<a name="l00629"></a>00629 <span class="comment"></span>
<a name="l00630"></a>00630 <span class="comment">    /** Update label positioning data</span>
<a name="l00631"></a>00631 <span class="comment">            @param xnew New x coordinate</span>
<a name="l00632"></a>00632 <span class="comment">                @param ynew New y coordinate</span>
<a name="l00633"></a>00633 <span class="comment">        */</span>
<a name="l00634"></a>00634         <span class="keywordtype">void</span> UpdateViewBoundary(wxCoord xnew, wxCoord ynew);
<a name="l00635"></a>00635 
<a name="l00636"></a>00636     DECLARE_DYNAMIC_CLASS(<a class="code" href="classmp_f_x_y.html" title="Abstract base class providing plot and labeling functionality for a locus plot F:N-&gt;X,Y.">mpFXY</a>)
<a name="l00637"></a>00637 };
<a name="l00638"></a>00638 <span class="comment"></span>
<a name="l00639"></a>00639 <span class="comment">/** Abstract base class providing plot and labeling functionality for functions F:Y-&gt;X.</span>
<a name="l00640"></a>00640 <span class="comment">    Override mpProfile::GetX to implement a function.</span>
<a name="l00641"></a>00641 <span class="comment">    This class is similar to mpFY, but the Plot method is different. The plot is in fact represented by lines instead of points, which gives best rendering of rapidly-varying functions, and in general, data which are not so close one to another.</span>
<a name="l00642"></a>00642 <span class="comment">    Optionally implement a constructor and pass a name (label) and a label alignment</span>
<a name="l00643"></a>00643 <span class="comment">    to the constructor mpProfile::mpProfile. If the layer name is empty, no label will be plotted.</span>
<a name="l00644"></a>00644 <span class="comment">*/</span>
<a name="l00645"></a>00645 <span class="keyword">class </span><a class="code" href="mathplot_8h.html#a8ad8b0f95a03f1bc9ff4ed3947e96ea1">WXDLLIMPEXP_MATHPLOT</a> <a class="code" href="classmp_profile.html" title="Abstract base class providing plot and labeling functionality for functions F:Y-&gt;X.">mpProfile</a> : <span class="keyword">public</span> <a class="code" href="classmp_layer.html" title="Plot layer, abstract base class.">mpLayer</a>
<a name="l00646"></a>00646 {
<a name="l00647"></a>00647 <span class="keyword">public</span>:<span class="comment"></span>
<a name="l00648"></a>00648 <span class="comment">    /** @param name  Label</span>
<a name="l00649"></a>00649 <span class="comment">        @param flags Label alignment, pass one of #mpALIGN_BOTTOM, #mpALIGN_CENTER, #mpALIGN_TOP.</span>
<a name="l00650"></a>00650 <span class="comment">    */</span>
<a name="l00651"></a>00651     <a class="code" href="classmp_profile.html" title="Abstract base class providing plot and labeling functionality for functions F:Y-&gt;X.">mpProfile</a>(wxString name = wxEmptyString, <span class="keywordtype">int</span> flags = <a class="code" href="mathplot_8h.html#a8abb8d8e422872f917fe19be8b21e734" title="Aligns label to the top.">mpALIGN_TOP</a>);
<a name="l00652"></a>00652 <span class="comment"></span>
<a name="l00653"></a>00653 <span class="comment">    /** Get function value for argument.</span>
<a name="l00654"></a>00654 <span class="comment">        Override this function in your implementation.</span>
<a name="l00655"></a>00655 <span class="comment">        @param x Argument</span>
<a name="l00656"></a>00656 <span class="comment">        @return Function value</span>
<a name="l00657"></a>00657 <span class="comment">    */</span>
<a name="l00658"></a>00658     <span class="keyword">virtual</span> <span class="keywordtype">double</span> GetY( <span class="keywordtype">double</span> x ) = 0;
<a name="l00659"></a>00659 <span class="comment"></span>
<a name="l00660"></a>00660 <span class="comment">    /** Layer plot handler.</span>
<a name="l00661"></a>00661 <span class="comment">        This implementation will plot the function in the visible area and</span>
<a name="l00662"></a>00662 <span class="comment">        put a label according to the aligment specified.</span>
<a name="l00663"></a>00663 <span class="comment">    */</span>
<a name="l00664"></a>00664     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classmp_layer.html#a0c62e377dbdba1956b02bda3a5ac88b4" title="Plot given view of layer to the given device context.">Plot</a>(wxDC &amp; dc, <a class="code" href="classmp_window.html" title="Canvas for plotting mpLayer implementations.">mpWindow</a> &amp; w);
<a name="l00665"></a>00665 
<a name="l00666"></a>00666 <span class="keyword">protected</span>:
<a name="l00667"></a><a class="code" href="classmp_profile.html#a329d62f80a417f4bd27d02e10fe5d5e5">00667</a>     <span class="keywordtype">int</span> <a class="code" href="classmp_profile.html#a329d62f80a417f4bd27d02e10fe5d5e5" title="Holds label alignment.">m_flags</a>; <span class="comment">//!&lt; Holds label alignment</span>
<a name="l00668"></a>00668 <span class="comment"></span>
<a name="l00669"></a>00669     DECLARE_DYNAMIC_CLASS(<a class="code" href="classmp_profile.html" title="Abstract base class providing plot and labeling functionality for functions F:Y-&gt;X.">mpProfile</a>)
<a name="l00670"></a>00670 };
<a name="l00671"></a>00671 <span class="comment"></span>
<a name="l00672"></a>00672 <span class="comment">/*@}*/</span>
<a name="l00673"></a>00673 
<a name="l00674"></a>00674 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00675"></a>00675 <span class="comment">// mpLayer implementations - furniture (scales, ...)</span>
<a name="l00676"></a>00676 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00677"></a>00677 <span class="comment"></span>
<a name="l00678"></a>00678 <span class="comment">/** @name mpLayer implementations - furniture (scales, ...)</span>
<a name="l00679"></a>00679 <span class="comment">@{*/</span>
<a name="l00680"></a>00680 <span class="comment"></span>
<a name="l00681"></a>00681 <span class="comment">/** Plot layer implementing a x-scale ruler.</span>
<a name="l00682"></a>00682 <span class="comment">    The ruler is fixed at Y=0 in the coordinate system. A label is plotted at</span>
<a name="l00683"></a>00683 <span class="comment">    the bottom-right hand of the ruler. The scale numbering automatically</span>
<a name="l00684"></a>00684 <span class="comment">    adjusts to view and zoom factor.</span>
<a name="l00685"></a>00685 <span class="comment">*/</span>
<a name="l00686"></a>00686 <span class="keyword">class </span><a class="code" href="mathplot_8h.html#a8ad8b0f95a03f1bc9ff4ed3947e96ea1">WXDLLIMPEXP_MATHPLOT</a> <a class="code" href="classmp_scale_x.html" title="Plot layer implementing a x-scale ruler.">mpScaleX</a> : <span class="keyword">public</span> <a class="code" href="classmp_layer.html" title="Plot layer, abstract base class.">mpLayer</a>
<a name="l00687"></a>00687 {
<a name="l00688"></a>00688 <span class="keyword">public</span>:<span class="comment"></span>
<a name="l00689"></a>00689 <span class="comment">    /** Full constructor.</span>
<a name="l00690"></a>00690 <span class="comment">                @param name Label to plot by the ruler</span>
<a name="l00691"></a>00691 <span class="comment">                @param flags Set the position of the scale with respect to the window.</span>
<a name="l00692"></a>00692 <span class="comment">                @param ticks Select ticks or grid. Give TRUE (default) for drawing axis ticks, FALSE for drawing the grid.</span>
<a name="l00693"></a>00693 <span class="comment">                @param type mpX_NORMAL for normal labels, mpX_TIME for time axis in hours, minutes, seconds. */</span>
<a name="l00694"></a>00694     <a class="code" href="mathplot_8h.html#ab8ac3ad805df76a6399449f8c50adfff">mpScaleX</a>(wxString name = wxT(<span class="stringliteral">&quot;X&quot;</span>), <span class="keywordtype">int</span> flags = <a class="code" href="mathplot_8h.html#a7a2ab21a4670db2c4ba4ef1c1f8e8252" title="Aligns label to the center.">mpALIGN_CENTER</a>, <span class="keywordtype">bool</span> ticks = <span class="keyword">true</span>, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> type = <a class="code" href="mathplot_8h.html#aeb1b2013394726b9bb4c5f89bf1f6246" title="Set label for X axis in normal mode.">mpX_NORMAL</a>);
<a name="l00695"></a>00695 <span class="comment"></span>
<a name="l00696"></a>00696 <span class="comment">    /** Layer plot handler.</span>
<a name="l00697"></a>00697 <span class="comment">        This implementation will plot the ruler adjusted to the visible area. */</span>
<a name="l00698"></a>00698     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classmp_layer.html#a0c62e377dbdba1956b02bda3a5ac88b4" title="Plot given view of layer to the given device context.">Plot</a>(wxDC &amp; dc, <a class="code" href="classmp_window.html" title="Canvas for plotting mpLayer implementations.">mpWindow</a> &amp; w);
<a name="l00699"></a>00699 <span class="comment"></span>
<a name="l00700"></a>00700 <span class="comment">    /** Check whether this layer has a bounding box.</span>
<a name="l00701"></a>00701 <span class="comment">        This implementation returns \a FALSE thus making the ruler invisible</span>
<a name="l00702"></a>00702 <span class="comment">        to the plot layer bounding box calculation by mpWindow. */</span>
<a name="l00703"></a><a class="code" href="classmp_scale_x.html#acffa30948812c2cdc3f94b4debb3cc9d">00703</a>     <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classmp_scale_x.html#acffa30948812c2cdc3f94b4debb3cc9d" title="Check whether this layer has a bounding box.">HasBBox</a>() { <span class="keywordflow">return</span> FALSE; }
<a name="l00704"></a>00704 <span class="comment"></span>
<a name="l00705"></a>00705 <span class="comment">    /** Set X axis alignment.</span>
<a name="l00706"></a>00706 <span class="comment">        @param align alignment (choose between mpALIGN_BORDER_BOTTOM, mpALIGN_BOTTOM, mpALIGN_CENTER, mpALIGN_TOP, mpALIGN_BORDER_TOP */</span>
<a name="l00707"></a><a class="code" href="classmp_scale_x.html#aa301098aec1bf7cb4d85e9e55c093e63">00707</a>     <span class="keywordtype">void</span> <a class="code" href="classmp_scale_x.html#aa301098aec1bf7cb4d85e9e55c093e63" title="Set X axis alignment.">SetAlign</a>(<span class="keywordtype">int</span> align) { m_flags = align; };
<a name="l00708"></a>00708 <span class="comment"></span>
<a name="l00709"></a>00709 <span class="comment">    /** Set X axis ticks or grid</span>
<a name="l00710"></a>00710 <span class="comment">        @param ticks TRUE to plot axis ticks, FALSE to plot grid. */</span>
<a name="l00711"></a><a class="code" href="classmp_scale_x.html#ac4f0e9caddc43a5333062e0904473f90">00711</a>     <span class="keywordtype">void</span> <a class="code" href="classmp_scale_x.html#ac4f0e9caddc43a5333062e0904473f90" title="Set X axis ticks or grid.">SetTicks</a>(<span class="keywordtype">bool</span> ticks) { m_ticks = ticks; };
<a name="l00712"></a>00712 <span class="comment"></span>
<a name="l00713"></a>00713 <span class="comment">    /** Get X axis ticks or grid</span>
<a name="l00714"></a>00714 <span class="comment">        @return TRUE if plot is drawing axis ticks, FALSE if the grid is active. */</span>
<a name="l00715"></a><a class="code" href="classmp_scale_x.html#abb218903171714a6f66352cf3136c0da">00715</a>     <span class="keywordtype">bool</span> <a class="code" href="classmp_scale_x.html#abb218903171714a6f66352cf3136c0da" title="Get X axis ticks or grid.">GetTicks</a>() { <span class="keywordflow">return</span> m_ticks; };
<a name="l00716"></a>00716 <span class="comment"></span>
<a name="l00717"></a>00717 <span class="comment">    /** Get X axis label view mode.</span>
<a name="l00718"></a>00718 <span class="comment">        @return mpX_NORMAL for normal labels, mpX_TIME for time axis in hours, minutes, seconds. */</span>
<a name="l00719"></a><a class="code" href="classmp_scale_x.html#a44cfedad91b9c61968428aa482093ffc">00719</a>     <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classmp_scale_x.html#a44cfedad91b9c61968428aa482093ffc" title="Get X axis label view mode.">GetLabelMode</a>() { <span class="keywordflow">return</span> m_labelType; };
<a name="l00720"></a>00720 <span class="comment"></span>
<a name="l00721"></a>00721 <span class="comment">    /** Set X axis label view mode.</span>
<a name="l00722"></a>00722 <span class="comment">        @param mode mpX_NORMAL for normal labels, mpX_TIME for time axis in hours, minutes, seconds. */</span>
<a name="l00723"></a><a class="code" href="classmp_scale_x.html#a2fe3d1bcab0a6f91bc60c231d80c7cd8">00723</a>     <span class="keywordtype">void</span> <a class="code" href="classmp_scale_x.html#a2fe3d1bcab0a6f91bc60c231d80c7cd8" title="Set X axis label view mode.">SetLabelMode</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> mode) { m_labelType = mode; };
<a name="l00724"></a>00724 <span class="comment"></span>
<a name="l00725"></a>00725 <span class="comment">        /** Set X axis Label format (used for mpX_NORMAL draw mode).</span>
<a name="l00726"></a>00726 <span class="comment">            @param format The format string */</span>
<a name="l00727"></a><a class="code" href="classmp_scale_x.html#ab99a6350528f75dddcf18c557caeff4c">00727</a>         <span class="keywordtype">void</span> <a class="code" href="classmp_scale_x.html#ab99a6350528f75dddcf18c557caeff4c" title="Set X axis Label format (used for mpX_NORMAL draw mode).">SetLabelFormat</a>(<span class="keyword">const</span> wxString&amp; <a class="code" href="namespacemrpt.html#a3a27af794b658df5491e2b7678f8ccb8" title="A std::string version of C sprintf.">format</a>) { m_labelFormat = <a class="code" href="namespacemrpt.html#a3a27af794b658df5491e2b7678f8ccb8" title="A std::string version of C sprintf.">format</a>; };
<a name="l00728"></a>00728 <span class="comment"></span>
<a name="l00729"></a>00729 <span class="comment">        /** Get X axis Label format (used for mpX_NORMAL draw mode).</span>
<a name="l00730"></a>00730 <span class="comment">        @return The format string */</span>
<a name="l00731"></a><a class="code" href="classmp_scale_x.html#a98d78c68cf01b75f60daf30c0eaf5832">00731</a>         <span class="keyword">const</span> wxString&amp; <a class="code" href="classmp_scale_x.html#a98d78c68cf01b75f60daf30c0eaf5832" title="Get X axis Label format (used for mpX_NORMAL draw mode).">SetLabelFormat</a>() { <span class="keywordflow">return</span> m_labelFormat; };
<a name="l00732"></a>00732 
<a name="l00733"></a>00733 <span class="keyword">protected</span>:
<a name="l00734"></a>00734     <span class="keywordtype">int</span> m_flags; <span class="comment">//!&lt; Flag for axis alignment</span>
<a name="l00735"></a><a class="code" href="classmp_scale_x.html#aaa4887e80777d517bec580ca982decb4">00735</a> <span class="comment"></span>    <span class="keywordtype">bool</span> <a class="code" href="classmp_scale_x.html#aaa4887e80777d517bec580ca982decb4" title="Flag to toggle between ticks or grid.">m_ticks</a>; <span class="comment">//!&lt; Flag to toggle between ticks or grid</span>
<a name="l00736"></a><a class="code" href="classmp_scale_x.html#a2ccef7a153bf12f103ac4c98e4a5237e">00736</a> <span class="comment"></span>    <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classmp_scale_x.html#a2ccef7a153bf12f103ac4c98e4a5237e" title="Select labels mode: mpX_NORMAL for normal labels, mpX_TIME for time axis in hours, minutes, seconds.">m_labelType</a>; <span class="comment">//!&lt; Select labels mode: mpX_NORMAL for normal labels, mpX_TIME for time axis in hours, minutes, seconds</span>
<a name="l00737"></a><a class="code" href="classmp_scale_x.html#a566c4e19d10c90e7b02ec0a04e8b0f8a">00737</a> <span class="comment"></span>        wxString <a class="code" href="classmp_scale_x.html#a566c4e19d10c90e7b02ec0a04e8b0f8a" title="Format string used to print labels.">m_labelFormat</a>; <span class="comment">//!&lt; Format string used to print labels</span>
<a name="l00738"></a>00738 <span class="comment"></span>
<a name="l00739"></a>00739     DECLARE_DYNAMIC_CLASS(<a class="code" href="classmp_scale_x.html" title="Plot layer implementing a x-scale ruler.">mpScaleX</a>)
<a name="l00740"></a>00740 };
<a name="l00741"></a>00741 <span class="comment"></span>
<a name="l00742"></a>00742 <span class="comment">/** Plot layer implementing a y-scale ruler.</span>
<a name="l00743"></a>00743 <span class="comment">    If align is set to mpALIGN_CENTER, the ruler is fixed at X=0 in the coordinate system. If the align is set to mpALIGN_TOP or mpALIGN_BOTTOM, the axis is always drawn respectively at top or bottom of the window. A label is plotted at</span>
<a name="l00744"></a>00744 <span class="comment">    the top-right hand of the ruler. The scale numbering automatically</span>
<a name="l00745"></a>00745 <span class="comment">    adjusts to view and zoom factor.</span>
<a name="l00746"></a>00746 <span class="comment">*/</span>
<a name="l00747"></a>00747 <span class="keyword">class </span><a class="code" href="mathplot_8h.html#a8ad8b0f95a03f1bc9ff4ed3947e96ea1">WXDLLIMPEXP_MATHPLOT</a> <a class="code" href="classmp_scale_y.html" title="Plot layer implementing a y-scale ruler.">mpScaleY</a> : <span class="keyword">public</span> <a class="code" href="classmp_layer.html" title="Plot layer, abstract base class.">mpLayer</a>
<a name="l00748"></a>00748 {
<a name="l00749"></a>00749 <span class="keyword">public</span>:<span class="comment"></span>
<a name="l00750"></a>00750 <span class="comment">    /** @param name Label to plot by the ruler</span>
<a name="l00751"></a>00751 <span class="comment">        @param flags Set position of the scale respect to the window.</span>
<a name="l00752"></a>00752 <span class="comment">        @param ticks Select ticks or grid. Give TRUE (default) for drawing axis ticks, FALSE for drawing the grid */</span>
<a name="l00753"></a>00753     <a class="code" href="mathplot_8h.html#ac59f3a003a15824ae4ef9850e1ae5445">mpScaleY</a>(wxString name = wxT(<span class="stringliteral">&quot;Y&quot;</span>), <span class="keywordtype">int</span> flags = <a class="code" href="mathplot_8h.html#a7a2ab21a4670db2c4ba4ef1c1f8e8252" title="Aligns label to the center.">mpALIGN_CENTER</a>, <span class="keywordtype">bool</span> ticks = <span class="keyword">true</span>);
<a name="l00754"></a>00754 <span class="comment"></span>
<a name="l00755"></a>00755 <span class="comment">    /** Layer plot handler.</span>
<a name="l00756"></a>00756 <span class="comment">        This implementation will plot the ruler adjusted to the visible area.</span>
<a name="l00757"></a>00757 <span class="comment">    */</span>
<a name="l00758"></a>00758     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classmp_layer.html#a0c62e377dbdba1956b02bda3a5ac88b4" title="Plot given view of layer to the given device context.">Plot</a>(wxDC &amp; dc, <a class="code" href="classmp_window.html" title="Canvas for plotting mpLayer implementations.">mpWindow</a> &amp; w);
<a name="l00759"></a>00759 <span class="comment"></span>
<a name="l00760"></a>00760 <span class="comment">    /** Check whether this layer has a bounding box.</span>
<a name="l00761"></a>00761 <span class="comment">        This implementation returns \a FALSE thus making the ruler invisible</span>
<a name="l00762"></a>00762 <span class="comment">        to the plot layer bounding box calculation by mpWindow.</span>
<a name="l00763"></a>00763 <span class="comment">    */</span>
<a name="l00764"></a><a class="code" href="classmp_scale_y.html#a85658ced4d699d319d4380054bb9f71f">00764</a>     <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classmp_scale_y.html#a85658ced4d699d319d4380054bb9f71f" title="Check whether this layer has a bounding box.">HasBBox</a>() { <span class="keywordflow">return</span> FALSE; }
<a name="l00765"></a>00765 <span class="comment"></span>
<a name="l00766"></a>00766 <span class="comment">    /** Set Y axis alignment.</span>
<a name="l00767"></a>00767 <span class="comment">        @param align alignment (choose between mpALIGN_BORDER_LEFT, mpALIGN_LEFT, mpALIGN_CENTER, mpALIGN_RIGHT, mpALIGN_BORDER_RIGHT) */</span>
<a name="l00768"></a><a class="code" href="classmp_scale_y.html#ae2a5cf7f3964022a2b8bec230e10833a">00768</a>     <span class="keywordtype">void</span> <a class="code" href="classmp_scale_y.html#ae2a5cf7f3964022a2b8bec230e10833a" title="Set Y axis alignment.">SetAlign</a>(<span class="keywordtype">int</span> align) { m_flags = align; };
<a name="l00769"></a>00769 <span class="comment"></span>
<a name="l00770"></a>00770 <span class="comment">    /** Set Y axis ticks or grid</span>
<a name="l00771"></a>00771 <span class="comment">        @param ticks TRUE to plot axis ticks, FALSE to plot grid. */</span>
<a name="l00772"></a><a class="code" href="classmp_scale_y.html#a105be352886e886adbf01652afb209b3">00772</a>     <span class="keywordtype">void</span> <a class="code" href="classmp_scale_y.html#a105be352886e886adbf01652afb209b3" title="Set Y axis ticks or grid.">SetTicks</a>(<span class="keywordtype">bool</span> ticks) { m_ticks = ticks; };
<a name="l00773"></a>00773 <span class="comment"></span>
<a name="l00774"></a>00774 <span class="comment">    /** Get Y axis ticks or grid</span>
<a name="l00775"></a>00775 <span class="comment">        @return TRUE if plot is drawing axis ticks, FALSE if the grid is active. */</span>
<a name="l00776"></a><a class="code" href="classmp_scale_y.html#aab450527efa50d7202acf0d710e9848e">00776</a>     <span class="keywordtype">bool</span> <a class="code" href="classmp_scale_y.html#aab450527efa50d7202acf0d710e9848e" title="Get Y axis ticks or grid.">GetTicks</a>() { <span class="keywordflow">return</span> m_ticks; };
<a name="l00777"></a>00777 <span class="comment"></span>
<a name="l00778"></a>00778 <span class="comment">        /** Set Y axis Label format.</span>
<a name="l00779"></a>00779 <span class="comment">        @param format The format string */</span>
<a name="l00780"></a><a class="code" href="classmp_scale_y.html#a8636f026ce3e7357173dc6faf6d93da9">00780</a>         <span class="keywordtype">void</span> <a class="code" href="classmp_scale_y.html#a8636f026ce3e7357173dc6faf6d93da9" title="Set Y axis Label format.">SetLabelFormat</a>(<span class="keyword">const</span> wxString&amp; <a class="code" href="namespacemrpt.html#a3a27af794b658df5491e2b7678f8ccb8" title="A std::string version of C sprintf.">format</a>) { m_labelFormat = <a class="code" href="namespacemrpt.html#a3a27af794b658df5491e2b7678f8ccb8" title="A std::string version of C sprintf.">format</a>; };
<a name="l00781"></a>00781 <span class="comment"></span>
<a name="l00782"></a>00782 <span class="comment">        /** Get Y axis Label format.</span>
<a name="l00783"></a>00783 <span class="comment">        @return The format string */</span>
<a name="l00784"></a><a class="code" href="classmp_scale_y.html#a04634e395a7e550893e43a949ce82809">00784</a>         <span class="keyword">const</span> wxString&amp; <a class="code" href="classmp_scale_y.html#a04634e395a7e550893e43a949ce82809" title="Get Y axis Label format.">SetLabelFormat</a>() { <span class="keywordflow">return</span> m_labelFormat; };
<a name="l00785"></a>00785 
<a name="l00786"></a>00786 <span class="keyword">protected</span>:
<a name="l00787"></a>00787     <span class="keywordtype">int</span> m_flags; <span class="comment">//!&lt; Flag for axis alignment</span>
<a name="l00788"></a><a class="code" href="classmp_scale_y.html#ac12fc8b3549073ef49e81561479ac9c4">00788</a> <span class="comment"></span>    <span class="keywordtype">bool</span> <a class="code" href="classmp_scale_y.html#ac12fc8b3549073ef49e81561479ac9c4" title="Flag to toggle between ticks or grid.">m_ticks</a>; <span class="comment">//!&lt; Flag to toggle between ticks or grid</span>
<a name="l00789"></a><a class="code" href="classmp_scale_y.html#a7ae36d012566018aced1634e99ba1fb4">00789</a> <span class="comment"></span>        wxString <a class="code" href="classmp_scale_y.html#a7ae36d012566018aced1634e99ba1fb4" title="Format string used to print labels.">m_labelFormat</a>; <span class="comment">//!&lt; Format string used to print labels</span>
<a name="l00790"></a>00790 <span class="comment"></span>
<a name="l00791"></a>00791     DECLARE_DYNAMIC_CLASS(<a class="code" href="classmp_scale_y.html" title="Plot layer implementing a y-scale ruler.">mpScaleY</a>)
<a name="l00792"></a>00792 };
<a name="l00793"></a>00793 
<a name="l00794"></a>00794 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00795"></a>00795 <span class="comment">// mpWindow</span>
<a name="l00796"></a>00796 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00797"></a>00797 <span class="comment"></span>
<a name="l00798"></a>00798 <span class="comment">/** @name Constants defining mouse modes for mpWindow</span>
<a name="l00799"></a>00799 <span class="comment">@{*/</span>
<a name="l00800"></a>00800 <span class="comment"></span>
<a name="l00801"></a>00801 <span class="comment">/** Mouse panning drags the view. Mouse mode for mpWindow. */</span>
<a name="l00802"></a><a class="code" href="mathplot_8h.html#adb9bfd486a7371a8d8e5cc2815e87f80">00802</a> <span class="preprocessor">#define mpMOUSEMODE_DRAG    0</span>
<a name="l00803"></a>00803 <span class="preprocessor"></span><span class="comment">/** Mouse panning creates a zoom box. Mouse mode for mpWindow. */</span>
<a name="l00804"></a><a class="code" href="mathplot_8h.html#a93a72fe051d4bd00563ccd900e2b6adc">00804</a> <span class="preprocessor">#define mpMOUSEMODE_ZOOMBOX 1</span>
<a name="l00805"></a>00805 <span class="preprocessor"></span><span class="comment"></span>
<a name="l00806"></a>00806 <span class="comment">/*@}*/</span><span class="comment"></span>
<a name="l00807"></a>00807 <span class="comment">/** Define the type for the list of layers inside mpWindow */</span>
<a name="l00808"></a>00808 <span class="comment">//WX_DECLARE_HASH_MAP( int, mpLayer*, wxIntegerHash, wxIntegerEqual, wxLayerList );</span>
<a name="l00809"></a><a class="code" href="mathplot_8h.html#a64d121561a6516c572409ecfef9ce714">00809</a> <span class="keyword">typedef</span> std::deque&lt;mpLayer*&gt; <a class="code" href="mathplot_8h.html#a64d121561a6516c572409ecfef9ce714" title="Define the type for the list of layers inside mpWindow.">wxLayerList</a>;
<a name="l00810"></a>00810 <span class="comment"></span>
<a name="l00811"></a>00811 <span class="comment">/** Canvas for plotting mpLayer implementations.</span>
<a name="l00812"></a>00812 <span class="comment"></span>
<a name="l00813"></a>00813 <span class="comment">    This class defines a zoomable and moveable 2D plot canvas. Any number</span>
<a name="l00814"></a>00814 <span class="comment">    of mpLayer implementations (scale rulers, function plots, ...) can be</span>
<a name="l00815"></a>00815 <span class="comment">    attached using mpWindow::AddLayer.</span>
<a name="l00816"></a>00816 <span class="comment"></span>
<a name="l00817"></a>00817 <span class="comment">    The canvas window provides a context menu with actions for navigating the view.</span>
<a name="l00818"></a>00818 <span class="comment">    The context menu can be retrieved with mpWindow::GetPopupMenu, e.g. for extending it</span>
<a name="l00819"></a>00819 <span class="comment">    externally.</span>
<a name="l00820"></a>00820 <span class="comment"></span>
<a name="l00821"></a>00821 <span class="comment">    Since wxMathPlot version 0.03, the mpWindow incorporates the following features:</span>
<a name="l00822"></a>00822 <span class="comment">        - DoubleBuffering (Default=disabled): Can be set with EnableDoubleBuffer</span>
<a name="l00823"></a>00823 <span class="comment">        - Mouse based pan/zoom (Default=enabled): Can be set with EnableMousePanZoom.</span>
<a name="l00824"></a>00824 <span class="comment"></span>
<a name="l00825"></a>00825 <span class="comment">    The mouse commands can be visualized by the user through the popup menu, and are:</span>
<a name="l00826"></a>00826 <span class="comment">        - Mouse Move+CTRL: Pan (Move)</span>
<a name="l00827"></a>00827 <span class="comment">        - Mouse Wheel: Vertical scroll</span>
<a name="l00828"></a>00828 <span class="comment">        - Mouse Wheel+SHIFT: Horizontal scroll</span>
<a name="l00829"></a>00829 <span class="comment">        - Mouse Wheel UP+CTRL: Zoom in</span>
<a name="l00830"></a>00830 <span class="comment">        - Mouse Wheel DOWN+CTRL: Zoom out</span>
<a name="l00831"></a>00831 <span class="comment"></span>
<a name="l00832"></a>00832 <span class="comment">*/</span>
<a name="l00833"></a>00833 <span class="keyword">class </span><a class="code" href="mathplot_8h.html#a8ad8b0f95a03f1bc9ff4ed3947e96ea1">WXDLLIMPEXP_MATHPLOT</a> <a class="code" href="classmp_window.html" title="Canvas for plotting mpLayer implementations.">mpWindow</a> : <span class="keyword">public</span> wxWindow
<a name="l00834"></a>00834 {
<a name="l00835"></a>00835 <span class="keyword">public</span>:
<a name="l00836"></a><a class="code" href="classmp_window.html#a876727896ae24d42a3a25e2751859d16">00836</a>     <a class="code" href="classmp_window.html#a876727896ae24d42a3a25e2751859d16">mpWindow</a>() {}
<a name="l00837"></a>00837     <a class="code" href="mathplot_8h.html#a27017ce06c840ac145d37211b033381c">mpWindow</a>( wxWindow *parent, wxWindowID <span class="keywordtype">id</span>,
<a name="l00838"></a>00838                      <span class="keyword">const</span> wxPoint &amp;pos = wxDefaultPosition,
<a name="l00839"></a>00839                      <span class="keyword">const</span> wxSize &amp;<a class="code" href="namespacemrpt_1_1math.html#a632ae0aecf78103f87f18f9ac33f7170">size</a> = wxDefaultSize,
<a name="l00840"></a>00840                      <span class="keywordtype">long</span> flags = 0);
<a name="l00841"></a>00841     ~<a class="code" href="classmp_window.html" title="Canvas for plotting mpLayer implementations.">mpWindow</a>();
<a name="l00842"></a>00842 <span class="comment"></span>
<a name="l00843"></a>00843 <span class="comment">    /** Get reference to context menu of the plot canvas.</span>
<a name="l00844"></a>00844 <span class="comment">        @return Pointer to menu. The menu can be modified.</span>
<a name="l00845"></a>00845 <span class="comment">    */</span>
<a name="l00846"></a><a class="code" href="classmp_window.html#a552cc32aa4f45c31cfa60ec0dba73ec8">00846</a>     wxMenu* <a class="code" href="classmp_window.html#a552cc32aa4f45c31cfa60ec0dba73ec8" title="Get reference to context menu of the plot canvas.">GetPopupMenu</a>() { <span class="keywordflow">return</span> &amp;m_popmenu; }
<a name="l00847"></a>00847 <span class="comment"></span>
<a name="l00848"></a>00848 <span class="comment">    /** Add a plot layer to the canvas.</span>
<a name="l00849"></a>00849 <span class="comment">        @param layer Pointer to layer. The mpLayer object will get under control of mpWindow,</span>
<a name="l00850"></a>00850 <span class="comment">                     i.e. it will be delete&#39;d on mpWindow destruction</span>
<a name="l00851"></a>00851 <span class="comment">        @param refreshDisplay States whether to refresh the display (UpdateAll) after adding the layer.</span>
<a name="l00852"></a>00852 <span class="comment">        @retval TRUE Success</span>
<a name="l00853"></a>00853 <span class="comment">        @retval FALSE Failure due to out of memory.</span>
<a name="l00854"></a>00854 <span class="comment">    */</span>
<a name="l00855"></a>00855     <span class="keywordtype">bool</span> AddLayer( <a class="code" href="classmp_layer.html" title="Plot layer, abstract base class.">mpLayer</a>* layer, <span class="keywordtype">bool</span> refreshDisplay = <span class="keyword">true</span>);
<a name="l00856"></a>00856 <span class="comment"></span>
<a name="l00857"></a>00857 <span class="comment">    /** Remove a plot layer from the canvas.</span>
<a name="l00858"></a>00858 <span class="comment">        @param layer Pointer to layer. The mpLayer object will be destructed using delete.</span>
<a name="l00859"></a>00859 <span class="comment">        @param alsoDeleteObject If set to true, the mpLayer object will be also &quot;deleted&quot;, not just removed from the internal list.</span>
<a name="l00860"></a>00860 <span class="comment">        @param refreshDisplay States whether to refresh the display (UpdateAll) after removing the layer.</span>
<a name="l00861"></a>00861 <span class="comment">        @return true if layer is deleted correctly</span>
<a name="l00862"></a>00862 <span class="comment"></span>
<a name="l00863"></a>00863 <span class="comment">        N.B. Only the layer reference in the mpWindow is deleted, the layer object still exists!</span>
<a name="l00864"></a>00864 <span class="comment">    */</span>
<a name="l00865"></a>00865     <span class="keywordtype">bool</span> DelLayer( <a class="code" href="classmp_layer.html" title="Plot layer, abstract base class.">mpLayer</a>* layer, <span class="keywordtype">bool</span> alsoDeleteObject = <span class="keyword">false</span>, <span class="keywordtype">bool</span> refreshDisplay = <span class="keyword">true</span>);
<a name="l00866"></a>00866 <span class="comment"></span>
<a name="l00867"></a>00867 <span class="comment">    /** Remove all layers from the plot.</span>
<a name="l00868"></a>00868 <span class="comment">        @param alsoDeleteObject If set to true, the mpLayer objects will be also &quot;deleted&quot;, not just removed from the internal list.</span>
<a name="l00869"></a>00869 <span class="comment">        @param refreshDisplay States whether to refresh the display (UpdateAll) after removing the layers.</span>
<a name="l00870"></a>00870 <span class="comment">    */</span>
<a name="l00871"></a>00871     <span class="keywordtype">void</span> DelAllLayers( <span class="keywordtype">bool</span> alsoDeleteObject, <span class="keywordtype">bool</span> refreshDisplay = <span class="keyword">true</span>);
<a name="l00872"></a>00872 
<a name="l00873"></a>00873 <span class="comment"></span>
<a name="l00874"></a>00874 <span class="comment">    /*! Get the layer in list position indicated.</span>
<a name="l00875"></a>00875 <span class="comment">        N.B. You &lt;i&gt;must&lt;/i&gt; know the index of the layer inside the list!</span>
<a name="l00876"></a>00876 <span class="comment">        @param position position of the layer in the layers list</span>
<a name="l00877"></a>00877 <span class="comment">        @return pointer to mpLayer</span>
<a name="l00878"></a>00878 <span class="comment">    */</span>
<a name="l00879"></a>00879     <a class="code" href="classmp_layer.html" title="Plot layer, abstract base class.">mpLayer</a>* GetLayer(<span class="keywordtype">int</span> position);
<a name="l00880"></a>00880 <span class="comment"></span>
<a name="l00881"></a>00881 <span class="comment">    /*! Get the layer by its name (case sensitive).</span>
<a name="l00882"></a>00882 <span class="comment">        @param name The name of the layer to retrieve</span>
<a name="l00883"></a>00883 <span class="comment">        @return A pointer to the mpLayer object, or NULL if not found.</span>
<a name="l00884"></a>00884 <span class="comment">    */</span>
<a name="l00885"></a>00885     <a class="code" href="classmp_layer.html" title="Plot layer, abstract base class.">mpLayer</a>* GetLayerByName( <span class="keyword">const</span> wxString &amp;name);
<a name="l00886"></a>00886 <span class="comment"></span>
<a name="l00887"></a>00887 <span class="comment">    /** Get current view&#39;s X scale.</span>
<a name="l00888"></a>00888 <span class="comment">        See @ref mpLayer::Plot &quot;rules for coordinate transformation&quot;</span>
<a name="l00889"></a>00889 <span class="comment">        @return Scale</span>
<a name="l00890"></a>00890 <span class="comment">    */</span>
<a name="l00891"></a><a class="code" href="classmp_window.html#aa0a7f292fff58d81f585b65e96faefd9">00891</a>     <span class="keywordtype">double</span> <a class="code" href="classmp_window.html#aa0a7f292fff58d81f585b65e96faefd9" title="Get current view&#39;s X scale.">GetXscl</a>() { <span class="keywordflow">return</span> m_scaleX; }
<a name="l00892"></a><a class="code" href="classmp_window.html#a93f38cbfe6cf77277975f48f0ebd6a54">00892</a>     <span class="keywordtype">double</span> <a class="code" href="classmp_window.html#a93f38cbfe6cf77277975f48f0ebd6a54">GetScaleX</a>(<span class="keywordtype">void</span>)<span class="keyword"> const</span>{ <span class="keywordflow">return</span> m_scaleX; }; <span class="comment">// Schaling&#39;s method: maybe another method esists with the same name</span>
<a name="l00893"></a>00893 <span class="comment"></span>
<a name="l00894"></a>00894 <span class="comment">    /** Get current view&#39;s Y scale.</span>
<a name="l00895"></a>00895 <span class="comment">        See @ref mpLayer::Plot &quot;rules for coordinate transformation&quot;</span>
<a name="l00896"></a>00896 <span class="comment">        @return Scale</span>
<a name="l00897"></a>00897 <span class="comment">    */</span>
<a name="l00898"></a><a class="code" href="classmp_window.html#ad1685cfaa04c9ddeac08d58d56a270cd">00898</a>     <span class="keywordtype">double</span> <a class="code" href="classmp_window.html#ad1685cfaa04c9ddeac08d58d56a270cd" title="Get current view&#39;s Y scale.">GetYscl</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_scaleY; }
<a name="l00899"></a><a class="code" href="classmp_window.html#a86a5a1331a8c0162c8ff9f4f40dea2ca">00899</a>     <span class="keywordtype">double</span> <a class="code" href="classmp_window.html#a86a5a1331a8c0162c8ff9f4f40dea2ca">GetScaleY</a>(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_scaleY; } <span class="comment">// Schaling&#39;s method: maybe another method exists with the same name</span>
<a name="l00900"></a>00900 <span class="comment"></span>
<a name="l00901"></a>00901 <span class="comment">    /** Get current view&#39;s X position.</span>
<a name="l00902"></a>00902 <span class="comment">        See @ref mpLayer::Plot &quot;rules for coordinate transformation&quot;</span>
<a name="l00903"></a>00903 <span class="comment">        @return X Position in layer coordinate system, that corresponds to the center point of the view.</span>
<a name="l00904"></a>00904 <span class="comment">    */</span>
<a name="l00905"></a><a class="code" href="classmp_window.html#a9d36747941ece7832ddfba1c6885d9e1">00905</a>     <span class="keywordtype">double</span> <a class="code" href="classmp_window.html#a9d36747941ece7832ddfba1c6885d9e1" title="Get current view&#39;s X position.">GetXpos</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_posX; }
<a name="l00906"></a><a class="code" href="classmp_window.html#ac8491b2a65b0e4db1d7998e24ffab880">00906</a>     <span class="keywordtype">double</span> <a class="code" href="classmp_window.html#ac8491b2a65b0e4db1d7998e24ffab880">GetPosX</a>(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_posX; }
<a name="l00907"></a>00907 <span class="comment"></span>
<a name="l00908"></a>00908 <span class="comment">    /** Get current view&#39;s Y position.</span>
<a name="l00909"></a>00909 <span class="comment">        See @ref mpLayer::Plot &quot;rules for coordinate transformation&quot;</span>
<a name="l00910"></a>00910 <span class="comment">        @return Y Position in layer coordinate system, that corresponds to the center point of the view.</span>
<a name="l00911"></a>00911 <span class="comment">    */</span>
<a name="l00912"></a><a class="code" href="classmp_window.html#a57c5a0f122f603a5f16bba9a7b1c87c0">00912</a>     <span class="keywordtype">double</span> <a class="code" href="classmp_window.html#a57c5a0f122f603a5f16bba9a7b1c87c0" title="Get current view&#39;s Y position.">GetYpos</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_posY; }
<a name="l00913"></a><a class="code" href="classmp_window.html#a8ab3f4f63394761baec8e07de7138226">00913</a>     <span class="keywordtype">double</span> <a class="code" href="classmp_window.html#a8ab3f4f63394761baec8e07de7138226">GetPosY</a>(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_posY; }
<a name="l00914"></a>00914 <span class="comment"></span>
<a name="l00915"></a>00915 <span class="comment">    /** Get current view&#39;s X dimension in device context units.</span>
<a name="l00916"></a>00916 <span class="comment">        Usually this is equal to wxDC::GetSize, but it might differ thus mpLayer</span>
<a name="l00917"></a>00917 <span class="comment">        implementations should rely on the value returned by the function.</span>
<a name="l00918"></a>00918 <span class="comment">        See @ref mpLayer::Plot &quot;rules for coordinate transformation&quot;</span>
<a name="l00919"></a>00919 <span class="comment">        @return X dimension.</span>
<a name="l00920"></a>00920 <span class="comment">    */</span>
<a name="l00921"></a><a class="code" href="classmp_window.html#a65ddddfa8a54c3029b922012b0e13fef">00921</a>     <span class="keywordtype">int</span> <a class="code" href="classmp_window.html#a65ddddfa8a54c3029b922012b0e13fef" title="Get current view&#39;s X dimension in device context units.">GetScrX</a>(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_scrX; }
<a name="l00922"></a><a class="code" href="classmp_window.html#a3aad23e9e56697454f1691417e77d332">00922</a>     <span class="keywordtype">int</span> <a class="code" href="classmp_window.html#a3aad23e9e56697454f1691417e77d332">GetXScreen</a>(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_scrX; }
<a name="l00923"></a>00923 <span class="comment"></span>
<a name="l00924"></a>00924 <span class="comment">    /** Get current view&#39;s Y dimension in device context units.</span>
<a name="l00925"></a>00925 <span class="comment">        Usually this is equal to wxDC::GetSize, but it might differ thus mpLayer</span>
<a name="l00926"></a>00926 <span class="comment">        implementations should rely on the value returned by the function.</span>
<a name="l00927"></a>00927 <span class="comment">        See @ref mpLayer::Plot &quot;rules for coordinate transformation&quot;</span>
<a name="l00928"></a>00928 <span class="comment">        @return Y dimension.</span>
<a name="l00929"></a>00929 <span class="comment">    */</span>
<a name="l00930"></a><a class="code" href="classmp_window.html#ae1899f12c2dfa2beb2445e6dc8d7adbe">00930</a>     <span class="keywordtype">int</span> <a class="code" href="classmp_window.html#ae1899f12c2dfa2beb2445e6dc8d7adbe" title="Get current view&#39;s Y dimension in device context units.">GetScrY</a>(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_scrY; }
<a name="l00931"></a><a class="code" href="classmp_window.html#a5709346832ea2bf04f2baaf5a8e4527f">00931</a>     <span class="keywordtype">int</span> <a class="code" href="classmp_window.html#a5709346832ea2bf04f2baaf5a8e4527f">GetYScreen</a>(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_scrY; }
<a name="l00932"></a>00932 <span class="comment"></span>
<a name="l00933"></a>00933 <span class="comment">    /** Set current view&#39;s X scale and refresh display.</span>
<a name="l00934"></a>00934 <span class="comment">        @param scaleX New scale, must not be 0.</span>
<a name="l00935"></a>00935 <span class="comment">    */</span>
<a name="l00936"></a>00936     <span class="keywordtype">void</span> SetScaleX(<span class="keywordtype">double</span> scaleX);
<a name="l00937"></a>00937 <span class="comment"></span>
<a name="l00938"></a>00938 <span class="comment">    /** Set current view&#39;s Y scale and refresh display.</span>
<a name="l00939"></a>00939 <span class="comment">        @param scaleY New scale, must not be 0.</span>
<a name="l00940"></a>00940 <span class="comment">    */</span>
<a name="l00941"></a><a class="code" href="classmp_window.html#a882ee9a7e17e1a0b31c053fe87fefb1d">00941</a>     <span class="keywordtype">void</span> <a class="code" href="classmp_window.html#a882ee9a7e17e1a0b31c053fe87fefb1d" title="Set current view&#39;s Y scale and refresh display.">SetScaleY</a>(<span class="keywordtype">double</span> scaleY) { <span class="keywordflow">if</span> (scaleY!=0) m_scaleY=scaleY; UpdateAll(); }
<a name="l00942"></a>00942 <span class="comment"></span>
<a name="l00943"></a>00943 <span class="comment">    /** Set current view&#39;s X position and refresh display.</span>
<a name="l00944"></a>00944 <span class="comment">        @param posX New position that corresponds to the center point of the view.</span>
<a name="l00945"></a>00945 <span class="comment">    */</span>
<a name="l00946"></a><a class="code" href="classmp_window.html#a68df8bf95981ec3516e6b200154ee565">00946</a>     <span class="keywordtype">void</span> <a class="code" href="classmp_window.html#a68df8bf95981ec3516e6b200154ee565" title="Set current view&#39;s X position and refresh display.">SetPosX</a>(<span class="keywordtype">double</span> posX) { m_posX=posX; UpdateAll(); }
<a name="l00947"></a>00947 <span class="comment"></span>
<a name="l00948"></a>00948 <span class="comment">    /** Set current view&#39;s Y position and refresh display.</span>
<a name="l00949"></a>00949 <span class="comment">        @param posY New position that corresponds to the center point of the view.</span>
<a name="l00950"></a>00950 <span class="comment">    */</span>
<a name="l00951"></a><a class="code" href="classmp_window.html#a7ff8fe8b130f5b36f542907dd150a0d5">00951</a>     <span class="keywordtype">void</span> <a class="code" href="classmp_window.html#a7ff8fe8b130f5b36f542907dd150a0d5" title="Set current view&#39;s Y position and refresh display.">SetPosY</a>(<span class="keywordtype">double</span> posY) { m_posY=posY; UpdateAll(); }
<a name="l00952"></a>00952 <span class="comment"></span>
<a name="l00953"></a>00953 <span class="comment">    /** Set current view&#39;s X and Y position and refresh display.</span>
<a name="l00954"></a>00954 <span class="comment">        @param posX New position that corresponds to the center point of the view.</span>
<a name="l00955"></a>00955 <span class="comment">        @param posY New position that corresponds to the center point of the view.</span>
<a name="l00956"></a>00956 <span class="comment">    */</span>
<a name="l00957"></a><a class="code" href="classmp_window.html#ae2b228347d8c1dbab14477a243f685c7">00957</a>     <span class="keywordtype">void</span> <a class="code" href="classmp_window.html#ae2b228347d8c1dbab14477a243f685c7" title="Set current view&#39;s X and Y position and refresh display.">SetPos</a>( <span class="keywordtype">double</span> posX, <span class="keywordtype">double</span> posY) { m_posX=posX; m_posY=posY; UpdateAll(); }
<a name="l00958"></a>00958 <span class="comment"></span>
<a name="l00959"></a>00959 <span class="comment">    /** Set current view&#39;s dimensions in device context units.</span>
<a name="l00960"></a>00960 <span class="comment">        Needed by plotting functions. It doesn&#39;t refresh display.</span>
<a name="l00961"></a>00961 <span class="comment">        @param scrX New position that corresponds to the center point of the view.</span>
<a name="l00962"></a>00962 <span class="comment">        @param scrY New position that corresponds to the center point of the view.</span>
<a name="l00963"></a>00963 <span class="comment">    */</span>
<a name="l00964"></a><a class="code" href="classmp_window.html#ac0ba9ef62acf57224c731f056420519b">00964</a>     <span class="keywordtype">void</span> <a class="code" href="classmp_window.html#ac0ba9ef62acf57224c731f056420519b" title="Set current view&#39;s dimensions in device context units.">SetScr</a>( <span class="keywordtype">int</span> scrX, <span class="keywordtype">int</span> scrY) { m_scrX=scrX; m_scrY=scrY; }
<a name="l00965"></a>00965 <span class="comment"></span>
<a name="l00966"></a>00966 <span class="comment">    /** Converts mpWindow (screen) pixel coordinates into graph (floating point) coordinates, using current mpWindow position and scale.</span>
<a name="l00967"></a>00967 <span class="comment">      * @sa p2y,x2p,y2p */</span>
<a name="l00968"></a>00968 <span class="comment">//     double p2x(wxCoord pixelCoordX, bool drawOutside = true ); // { return m_posX + pixelCoordX/m_scaleX; }</span>
<a name="l00969"></a><a class="code" href="classmp_window.html#a44afa869bc18f2c755b1726541a8ea9e">00969</a>     <span class="keyword">inline</span> <span class="keywordtype">double</span> <a class="code" href="classmp_window.html#a44afa869bc18f2c755b1726541a8ea9e" title="Converts mpWindow (screen) pixel coordinates into graph (floating point) coordinates, using current mpWindow position and scale.">p2x</a>(wxCoord pixelCoordX ) { <span class="keywordflow">return</span> m_posX + pixelCoordX/m_scaleX; }
<a name="l00970"></a>00970 <span class="comment"></span>
<a name="l00971"></a>00971 <span class="comment">    /** Converts mpWindow (screen) pixel coordinates into graph (floating point) coordinates, using current mpWindow position and scale.</span>
<a name="l00972"></a>00972 <span class="comment">      * @sa p2x,x2p,y2p */</span>
<a name="l00973"></a>00973 <span class="comment">//     double p2y(wxCoord pixelCoordY, bool drawOutside = true ); //{ return m_posY - pixelCoordY/m_scaleY; }</span>
<a name="l00974"></a><a class="code" href="classmp_window.html#a47ff4aa7f3fe582e6b6dc116fd119026">00974</a>     <span class="keyword">inline</span> <span class="keywordtype">double</span> <a class="code" href="classmp_window.html#a47ff4aa7f3fe582e6b6dc116fd119026" title="Converts mpWindow (screen) pixel coordinates into graph (floating point) coordinates, using current mpWindow position and scale.">p2y</a>(wxCoord pixelCoordY ) { <span class="keywordflow">return</span> m_posY - pixelCoordY/m_scaleY; }
<a name="l00975"></a>00975 <span class="comment"></span>
<a name="l00976"></a>00976 <span class="comment">    /** Converts graph (floating point) coordinates into mpWindow (screen) pixel coordinates, using current mpWindow position and scale.</span>
<a name="l00977"></a>00977 <span class="comment">      * @sa p2x,p2y,y2p */</span>
<a name="l00978"></a>00978 <span class="comment">//     wxCoord x2p(double x, bool drawOutside = true); // { return (wxCoord) ( (x-m_posX) * m_scaleX); }</span>
<a name="l00979"></a><a class="code" href="classmp_window.html#a514198490e6cead9df2f2f272c39e236">00979</a>     <span class="keyword">inline</span> wxCoord <a class="code" href="classmp_window.html#a514198490e6cead9df2f2f272c39e236" title="Converts graph (floating point) coordinates into mpWindow (screen) pixel coordinates, using current mpWindow position and scale.">x2p</a>(<span class="keywordtype">double</span> x) { <span class="keywordflow">return</span> (wxCoord) ( (x-m_posX) * m_scaleX); }
<a name="l00980"></a>00980 <span class="comment"></span>
<a name="l00981"></a>00981 <span class="comment">    /** Converts graph (floating point) coordinates into mpWindow (screen) pixel coordinates, using current mpWindow position and scale.</span>
<a name="l00982"></a>00982 <span class="comment">      * @sa p2x,p2y,x2p */</span>
<a name="l00983"></a>00983 <span class="comment">//     wxCoord y2p(double y, bool drawOutside = true); // { return (wxCoord) ( (m_posY-y) * m_scaleY); }</span>
<a name="l00984"></a><a class="code" href="classmp_window.html#a9b7aedd1ee155d2bdbde333f7039a658">00984</a>     <span class="keyword">inline</span> wxCoord <a class="code" href="classmp_window.html#a9b7aedd1ee155d2bdbde333f7039a658" title="Converts graph (floating point) coordinates into mpWindow (screen) pixel coordinates, using current mpWindow position and scale.">y2p</a>(<span class="keywordtype">double</span> <a class="code" href="namespace_eigen_1_1internal.html#a3d7a581aeb951248dc6fe114e9e05f07">y</a>) { <span class="keywordflow">return</span> (wxCoord) ( (m_posY-<a class="code" href="namespace_eigen_1_1internal.html#a3d7a581aeb951248dc6fe114e9e05f07">y</a>) * m_scaleY); }
<a name="l00985"></a>00985 
<a name="l00986"></a>00986 <span class="comment"></span>
<a name="l00987"></a>00987 <span class="comment">    /** Enable/disable the double-buffering of the window, eliminating the flicker (default=disabled).</span>
<a name="l00988"></a>00988 <span class="comment">     */</span>
<a name="l00989"></a><a class="code" href="classmp_window.html#aca0a3db9667bd98c5f893e40dc5756e1">00989</a>     <span class="keywordtype">void</span> <a class="code" href="classmp_window.html#aca0a3db9667bd98c5f893e40dc5756e1" title="Enable/disable the double-buffering of the window, eliminating the flicker (default=disabled).">EnableDoubleBuffer</a>( <span class="keywordtype">bool</span> enabled ) { m_enableDoubleBuffer = enabled; }
<a name="l00990"></a>00990 <span class="comment"></span>
<a name="l00991"></a>00991 <span class="comment">    /** Enable/disable the feature of pan/zoom with the mouse (default=enabled)</span>
<a name="l00992"></a>00992 <span class="comment">     */</span>
<a name="l00993"></a><a class="code" href="classmp_window.html#a1b7a78613ee9488a3bd790138d0ec05f">00993</a>     <span class="keywordtype">void</span> <a class="code" href="classmp_window.html#a1b7a78613ee9488a3bd790138d0ec05f" title="Enable/disable the feature of pan/zoom with the mouse (default=enabled)">EnableMousePanZoom</a>( <span class="keywordtype">bool</span> enabled ) { m_enableMouseNavigation = enabled; }
<a name="l00994"></a>00994 <span class="comment"></span>
<a name="l00995"></a>00995 <span class="comment">    /** Enable or disable X/Y scale aspect locking for the view.</span>
<a name="l00996"></a>00996 <span class="comment">        @note Explicit calls to mpWindow::SetScaleX and mpWindow::SetScaleY will set</span>
<a name="l00997"></a>00997 <span class="comment">              an unlocked aspect, but any other action changing the view scale will</span>
<a name="l00998"></a>00998 <span class="comment">              lock the aspect again.</span>
<a name="l00999"></a>00999 <span class="comment">    */</span>
<a name="l01000"></a>01000     <span class="keywordtype">void</span> LockAspect(<span class="keywordtype">bool</span> enable = TRUE);
<a name="l01001"></a>01001 <span class="comment"></span>
<a name="l01002"></a>01002 <span class="comment">    /** Checks whether the X/Y scale aspect is locked.</span>
<a name="l01003"></a>01003 <span class="comment">        @retval TRUE Locked</span>
<a name="l01004"></a>01004 <span class="comment">        @retval FALSE Unlocked</span>
<a name="l01005"></a>01005 <span class="comment">    */</span>
<a name="l01006"></a><a class="code" href="classmp_window.html#a624c8cd174dfc7678c838ee96c0d3c06">01006</a>     <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="classmp_window.html#a624c8cd174dfc7678c838ee96c0d3c06" title="Checks whether the X/Y scale aspect is locked.">IsAspectLocked</a>() { <span class="keywordflow">return</span> m_lockaspect; }
<a name="l01007"></a>01007 <span class="comment"></span>
<a name="l01008"></a>01008 <span class="comment">    /** Set view to fit global bounding box of all plot layers and refresh display.</span>
<a name="l01009"></a>01009 <span class="comment">        Scale and position will be set to show all attached mpLayers.</span>
<a name="l01010"></a>01010 <span class="comment">        The X/Y scale aspect lock is taken into account.</span>
<a name="l01011"></a>01011 <span class="comment">    */</span>
<a name="l01012"></a>01012     <span class="keywordtype">void</span> Fit();
<a name="l01013"></a>01013 <span class="comment"></span>
<a name="l01014"></a>01014 <span class="comment">    /** Set view to fit a given bounding box and refresh display.</span>
<a name="l01015"></a>01015 <span class="comment">        The X/Y scale aspect lock is taken into account.</span>
<a name="l01016"></a>01016 <span class="comment">        If provided, the parameters printSizeX and printSizeY are taken as the DC size, and the</span>
<a name="l01017"></a>01017 <span class="comment">        pixel scales are computed accordingly. Also, in this case the passed borders are not saved</span>
<a name="l01018"></a>01018 <span class="comment">        as the &quot;desired borders&quot;, since this use will be invoked only when printing.</span>
<a name="l01019"></a>01019 <span class="comment">    */</span>
<a name="l01020"></a>01020     <span class="keywordtype">void</span> Fit(<span class="keywordtype">double</span> xMin, <span class="keywordtype">double</span> xMax, <span class="keywordtype">double</span> yMin, <span class="keywordtype">double</span> yMax,wxCoord *printSizeX=NULL,wxCoord *printSizeY=NULL);
<a name="l01021"></a>01021 <span class="comment"></span>
<a name="l01022"></a>01022 <span class="comment">    /** Zoom into current view and refresh display</span>
<a name="l01023"></a>01023 <span class="comment">      * @param centerPoint The point (pixel coordinates) that will stay in the same position on the screen after the zoom (by default, the center of the mpWindow).</span>
<a name="l01024"></a>01024 <span class="comment">      */</span>
<a name="l01025"></a>01025     <span class="keywordtype">void</span> ZoomIn( <span class="keyword">const</span> wxPoint&amp; centerPoint = wxDefaultPosition );
<a name="l01026"></a>01026 <span class="comment"></span>
<a name="l01027"></a>01027 <span class="comment">    /** Zoom out current view and refresh display</span>
<a name="l01028"></a>01028 <span class="comment">      * @param centerPoint The point (pixel coordinates) that will stay in the same position on the screen after the zoom (by default, the center of the mpWindow).</span>
<a name="l01029"></a>01029 <span class="comment">      */</span>
<a name="l01030"></a>01030     <span class="keywordtype">void</span> ZoomOut( <span class="keyword">const</span> wxPoint&amp; centerPoint = wxDefaultPosition );
<a name="l01031"></a>01031 <span class="comment"></span>
<a name="l01032"></a>01032 <span class="comment">    /** Zoom in current view along X and refresh display */</span>
<a name="l01033"></a>01033     <span class="keywordtype">void</span> ZoomInX();<span class="comment"></span>
<a name="l01034"></a>01034 <span class="comment">    /** Zoom out current view along X and refresh display */</span>
<a name="l01035"></a>01035     <span class="keywordtype">void</span> ZoomOutX();<span class="comment"></span>
<a name="l01036"></a>01036 <span class="comment">    /** Zoom in current view along Y and refresh display */</span>
<a name="l01037"></a>01037     <span class="keywordtype">void</span> ZoomInY();<span class="comment"></span>
<a name="l01038"></a>01038 <span class="comment">    /** Zoom out current view along Y and refresh display */</span>
<a name="l01039"></a>01039     <span class="keywordtype">void</span> ZoomOutY();
<a name="l01040"></a>01040 <span class="comment"></span>
<a name="l01041"></a>01041 <span class="comment">    /** Zoom view fitting given coordinates to the window (p0 and p1 do not need to be in any specific order) */</span>
<a name="l01042"></a>01042     <span class="keywordtype">void</span> ZoomRect(wxPoint p0, wxPoint p1);
<a name="l01043"></a>01043 <span class="comment"></span>
<a name="l01044"></a>01044 <span class="comment">    /** Refresh display */</span>
<a name="l01045"></a>01045     <span class="keywordtype">void</span> UpdateAll();
<a name="l01046"></a>01046 
<a name="l01047"></a>01047     <span class="comment">// Added methods by Davide Rondini</span>
<a name="l01048"></a>01048 <span class="comment"></span>
<a name="l01049"></a>01049 <span class="comment">    /** Counts the number of plot layers, excluding axes or text: this is to count only the layers which have a bounding box.</span>
<a name="l01050"></a>01050 <span class="comment">        \return The number of profiles plotted.</span>
<a name="l01051"></a>01051 <span class="comment">    */</span>
<a name="l01052"></a>01052     <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> CountLayers();
<a name="l01053"></a>01053 <span class="comment"></span>
<a name="l01054"></a>01054 <span class="comment">    /** Counts the number of plot layers, whether or not they have a bounding box.</span>
<a name="l01055"></a>01055 <span class="comment">        \return The number of layers in the mpWindow. */</span>
<a name="l01056"></a><a class="code" href="classmp_window.html#a8b3ecc25a27f72b7d458bf38fd243268">01056</a>     <span class="keywordtype">size_t</span> <a class="code" href="classmp_window.html#a8b3ecc25a27f72b7d458bf38fd243268" title="Counts the number of plot layers, whether or not they have a bounding box.">CountAllLayers</a>() { <span class="keywordflow">return</span> m_layers.size(); };
<a name="l01057"></a>01057 <span class="comment"></span>
<a name="l01058"></a>01058 <span class="comment">    /** Draws the mpWindow on a page for printing</span>
<a name="l01059"></a>01059 <span class="comment">        \param print the mpPrintout where to print the graph */</span>
<a name="l01060"></a>01060     <span class="comment">//void PrintGraph(mpPrintout *print);</span>
<a name="l01061"></a>01061 
<a name="l01062"></a><a class="code" href="classmp_window.html#a6927bc2d67aaac9da800d5724cf742a8">01062</a>     <span class="keywordtype">void</span> ShowPrintDialog()
<a name="l01063"></a>01063     {
<a name="l01064"></a>01064         wxCommandEvent dum;
<a name="l01065"></a>01065         OnPrintMenu(dum);
<a name="l01066"></a>01066     }
<a name="l01067"></a>01067 
<a name="l01068"></a>01068 <span class="comment"></span>
<a name="l01069"></a>01069 <span class="comment">        /** Returns the left-border layer coordinate that the user wants the mpWindow to show (it may be not exactly the actual shown coordinate in the case of locked aspect ratio).</span>
<a name="l01070"></a>01070 <span class="comment">          * @sa Fit</span>
<a name="l01071"></a>01071 <span class="comment">          */</span>
<a name="l01072"></a><a class="code" href="classmp_window.html#a2f82167dbd640aed537ed1742c888d2a">01072</a>         <span class="keywordtype">double</span> <a class="code" href="classmp_window.html#a2f82167dbd640aed537ed1742c888d2a" title="Returns the left-border layer coordinate that the user wants the mpWindow to show (it may be not exac...">GetDesiredXmin</a>() {<span class="keywordflow">return</span> m_desiredXmin; }
<a name="l01073"></a>01073 <span class="comment"></span>
<a name="l01074"></a>01074 <span class="comment">        /** Returns the right-border layer coordinate that the user wants the mpWindow to show (it may be not exactly the actual shown coordinate in the case of locked aspect ratio).</span>
<a name="l01075"></a>01075 <span class="comment">          * @sa Fit</span>
<a name="l01076"></a>01076 <span class="comment">          */</span>
<a name="l01077"></a><a class="code" href="classmp_window.html#ae389d1e14f0bce4610d098c8a81d3cb2">01077</a>         <span class="keywordtype">double</span> <a class="code" href="classmp_window.html#ae389d1e14f0bce4610d098c8a81d3cb2" title="Returns the right-border layer coordinate that the user wants the mpWindow to show (it may be not exa...">GetDesiredXmax</a>() {<span class="keywordflow">return</span> m_desiredXmax; }
<a name="l01078"></a>01078 <span class="comment"></span>
<a name="l01079"></a>01079 <span class="comment">        /** Returns the bottom-border layer coordinate that the user wants the mpWindow to show (it may be not exactly the actual shown coordinate in the case of locked aspect ratio).</span>
<a name="l01080"></a>01080 <span class="comment">          * @sa Fit</span>
<a name="l01081"></a>01081 <span class="comment">          */</span>
<a name="l01082"></a><a class="code" href="classmp_window.html#addaed2bfdbe6ceedca938f2923a1a13e">01082</a>         <span class="keywordtype">double</span> <a class="code" href="classmp_window.html#addaed2bfdbe6ceedca938f2923a1a13e" title="Returns the bottom-border layer coordinate that the user wants the mpWindow to show (it may be not ex...">GetDesiredYmin</a>() {<span class="keywordflow">return</span> m_desiredYmin; }
<a name="l01083"></a>01083 <span class="comment"></span>
<a name="l01084"></a>01084 <span class="comment">        /** Returns the top layer-border coordinate that the user wants the mpWindow to show (it may be not exactly the actual shown coordinate in the case of locked aspect ratio).</span>
<a name="l01085"></a>01085 <span class="comment">          * @sa Fit</span>
<a name="l01086"></a>01086 <span class="comment">          */</span>
<a name="l01087"></a><a class="code" href="classmp_window.html#a9ea0bd6db5c0673e5c8655d9cc0f767f">01087</a>         <span class="keywordtype">double</span> <a class="code" href="classmp_window.html#a9ea0bd6db5c0673e5c8655d9cc0f767f" title="Returns the top layer-border coordinate that the user wants the mpWindow to show (it may be not exact...">GetDesiredYmax</a>() {<span class="keywordflow">return</span> m_desiredYmax; }
<a name="l01088"></a>01088 <span class="comment"></span>
<a name="l01089"></a>01089 <span class="comment">        /** Returns the bounding box coordinates</span>
<a name="l01090"></a>01090 <span class="comment">                @param bbox Pointer to a 6-element double array where to store bounding box coordinates. */</span>
<a name="l01091"></a>01091         <span class="keywordtype">void</span> GetBoundingBox(<span class="keywordtype">double</span>* bbox);
<a name="l01092"></a>01092 <span class="comment"></span>
<a name="l01093"></a>01093 <span class="comment">    /** Enable/disable scrollbars</span>
<a name="l01094"></a>01094 <span class="comment">      @param status Set to true to show scrollbars */</span>
<a name="l01095"></a>01095     <span class="keywordtype">void</span> SetMPScrollbars(<span class="keywordtype">bool</span> status);
<a name="l01096"></a>01096 <span class="comment"></span>
<a name="l01097"></a>01097 <span class="comment">    /** Get scrollbars status.</span>
<a name="l01098"></a>01098 <span class="comment">      @return true if scrollbars are visible */</span>
<a name="l01099"></a><a class="code" href="classmp_window.html#a6f52243479ca77580675dd1fa7949381">01099</a>     <span class="keywordtype">bool</span> <a class="code" href="classmp_window.html#a6f52243479ca77580675dd1fa7949381" title="Get scrollbars status.">GetMPScrollbars</a>() {<span class="keywordflow">return</span> m_enableScrollBars; };
<a name="l01100"></a>01100 <span class="comment"></span>
<a name="l01101"></a>01101 <span class="comment">    /** Draw the window on a wxBitmap, then save it to a file.</span>
<a name="l01102"></a>01102 <span class="comment">      @param filename File name where to save the screenshot</span>
<a name="l01103"></a>01103 <span class="comment">      @param type image type to be saved: see wxImage output file types for flags</span>
<a name="l01104"></a>01104 <span class="comment">          @param imageSize Set a size for the output image. Default is the same as the screen size</span>
<a name="l01105"></a>01105 <span class="comment">          @param fit Decide whether to fit the plot into the size*/</span>
<a name="l01106"></a>01106     <span class="keywordtype">bool</span> SaveScreenshot(<span class="keyword">const</span> wxString&amp; filename, <span class="keywordtype">int</span> type = wxBITMAP_TYPE_BMP, wxSize imageSize = wxDefaultSize, <span class="keywordtype">bool</span> fit = <span class="keyword">false</span>);
<a name="l01107"></a>01107 <span class="comment"></span>
<a name="l01108"></a>01108 <span class="comment">    /** This value sets the zoom steps whenever the user clicks &quot;Zoom in/out&quot; or performs zoom with the mouse wheel.</span>
<a name="l01109"></a>01109 <span class="comment">      *  It must be a number above unity. This number is used for zoom in, and its inverse for zoom out. Set to 1.5 by default. */</span>
<a name="l01110"></a><a class="code" href="classmp_window.html#acce3d5f69474e30021f705818a4d504e">01110</a>     <span class="keyword">static</span> <span class="keywordtype">double</span> <a class="code" href="classmp_window.html#acce3d5f69474e30021f705818a4d504e" title="This value sets the zoom steps whenever the user clicks &quot;Zoom in/out&quot; or performs zoom with the mouse...">zoomIncrementalFactor</a>;
<a name="l01111"></a>01111 <span class="comment"></span>
<a name="l01112"></a>01112 <span class="comment">    /** Set window margins, creating a blank area where some kinds of layers cannot draw. This is useful for example to draw axes outside the area where the plots are drawn.</span>
<a name="l01113"></a>01113 <span class="comment">        @param top Top border</span>
<a name="l01114"></a>01114 <span class="comment">        @param right Right border</span>
<a name="l01115"></a>01115 <span class="comment">        @param bottom Bottom border</span>
<a name="l01116"></a>01116 <span class="comment">        @param left Left border */</span>
<a name="l01117"></a>01117     <span class="keywordtype">void</span> SetMargins(<span class="keywordtype">int</span> top, <span class="keywordtype">int</span> right, <span class="keywordtype">int</span> bottom, <span class="keywordtype">int</span> left);
<a name="l01118"></a>01118 <span class="comment"></span>
<a name="l01119"></a>01119 <span class="comment">    /** Set the top margin. @param top Top Margin */</span>
<a name="l01120"></a><a class="code" href="classmp_window.html#a5d14fbe18d633439beb2d48749653941">01120</a>     <span class="keywordtype">void</span> <a class="code" href="classmp_window.html#a5d14fbe18d633439beb2d48749653941" title="Set the top margin.">SetMarginTop</a>(<span class="keywordtype">int</span> top) { m_marginTop = top; };<span class="comment"></span>
<a name="l01121"></a>01121 <span class="comment">    /** Set the right margin. @param right Right Margin */</span>
<a name="l01122"></a><a class="code" href="classmp_window.html#a4b93b976de346bded4ee861f3c008ff2">01122</a>     <span class="keywordtype">void</span> <a class="code" href="classmp_window.html#a4b93b976de346bded4ee861f3c008ff2" title="Set the right margin.">SetMarginRight</a>(<span class="keywordtype">int</span> right) { m_marginRight = right; };<span class="comment"></span>
<a name="l01123"></a>01123 <span class="comment">    /** Set the bottom margin. @param bottom Bottom Margin */</span>
<a name="l01124"></a><a class="code" href="classmp_window.html#a7bb14b97a77169baf26d558f5a718f09">01124</a>     <span class="keywordtype">void</span> <a class="code" href="classmp_window.html#a7bb14b97a77169baf26d558f5a718f09" title="Set the bottom margin.">SetMarginBottom</a>(<span class="keywordtype">int</span> bottom) { m_marginBottom = bottom; };<span class="comment"></span>
<a name="l01125"></a>01125 <span class="comment">    /** Set the left margin. @param left Left Margin */</span>
<a name="l01126"></a><a class="code" href="classmp_window.html#a1ea89241390c557c0b6e0c7c67dca48a">01126</a>     <span class="keywordtype">void</span> <a class="code" href="classmp_window.html#a1ea89241390c557c0b6e0c7c67dca48a" title="Set the left margin.">SetMarginLeft</a>(<span class="keywordtype">int</span> left) { m_marginLeft = left; };
<a name="l01127"></a>01127 <span class="comment"></span>
<a name="l01128"></a>01128 <span class="comment">    /** Get the top margin. @param top Top Margin */</span>
<a name="l01129"></a><a class="code" href="classmp_window.html#a2c3fb159c5379a73c6a4a1983bd20142">01129</a>     <span class="keywordtype">int</span> <a class="code" href="classmp_window.html#a2c3fb159c5379a73c6a4a1983bd20142" title="Get the top margin.">GetMarginTop</a>() { <span class="keywordflow">return</span> m_marginTop; };<span class="comment"></span>
<a name="l01130"></a>01130 <span class="comment">    /** Get the right margin. @param right Right Margin */</span>
<a name="l01131"></a><a class="code" href="classmp_window.html#a6ace6a120fb04306b165c8d20c102933">01131</a>     <span class="keywordtype">int</span> <a class="code" href="classmp_window.html#a6ace6a120fb04306b165c8d20c102933" title="Get the right margin.">GetMarginRight</a>() { <span class="keywordflow">return</span> m_marginRight; };<span class="comment"></span>
<a name="l01132"></a>01132 <span class="comment">    /** Get the bottom margin. @param bottom Bottom Margin */</span>
<a name="l01133"></a><a class="code" href="classmp_window.html#a77752fe24cfdc22f62497a89cfe0be93">01133</a>     <span class="keywordtype">int</span> <a class="code" href="classmp_window.html#a77752fe24cfdc22f62497a89cfe0be93" title="Get the bottom margin.">GetMarginBottom</a>() { <span class="keywordflow">return</span> m_marginBottom; };<span class="comment"></span>
<a name="l01134"></a>01134 <span class="comment">    /** Get the left margin. @param left Left Margin */</span>
<a name="l01135"></a><a class="code" href="classmp_window.html#a696caffaaa8ebdd27cd68b273e280ac5">01135</a>     <span class="keywordtype">int</span> <a class="code" href="classmp_window.html#a696caffaaa8ebdd27cd68b273e280ac5" title="Get the left margin.">GetMarginLeft</a>() { <span class="keywordflow">return</span> m_marginLeft; };
<a name="l01136"></a>01136 <span class="comment"></span>
<a name="l01137"></a>01137 <span class="comment">    /** Sets whether to show coordinate tooltip when mouse passes over the plot. \param value true for enable, false for disable */</span>
<a name="l01138"></a>01138     <span class="comment">// void EnableCoordTooltip(bool value = true);</span><span class="comment"></span>
<a name="l01139"></a>01139 <span class="comment">    /** Gets coordinate tooltip status. \return true for enable, false for disable */</span>
<a name="l01140"></a>01140     <span class="comment">// bool GetCoordTooltip() { return m_coordTooltip; };</span>
<a name="l01141"></a>01141 <span class="comment"></span>
<a name="l01142"></a>01142 <span class="comment">    /** Check if a given point is inside the area of a mpInfoLayer and eventually returns its pointer.</span>
<a name="l01143"></a>01143 <span class="comment">        @param point The position to be checked</span>
<a name="l01144"></a>01144 <span class="comment">        @return If an info layer is found, returns its pointer, NULL otherwise */</span>
<a name="l01145"></a>01145     <a class="code" href="classmp_info_layer.html" title="Base class to create small rectangular info boxes mpInfoLayer is the base class to create a small rec...">mpInfoLayer</a>* IsInsideInfoLayer(wxPoint&amp; point);
<a name="l01146"></a>01146 <span class="comment"></span>
<a name="l01147"></a>01147 <span class="comment">        /** Sets the visibility of a layer by its name.</span>
<a name="l01148"></a>01148 <span class="comment">                @param name The layer name to set visibility</span>
<a name="l01149"></a>01149 <span class="comment">                @param viewable the view status to be set */</span>
<a name="l01150"></a>01150         <span class="keywordtype">void</span> SetLayerVisible(<span class="keyword">const</span> wxString &amp;name, <span class="keywordtype">bool</span> viewable);
<a name="l01151"></a>01151 <span class="comment"></span>
<a name="l01152"></a>01152 <span class="comment">        /** Check whether a layer with given name is visible</span>
<a name="l01153"></a>01153 <span class="comment">                @param name The layer name</span>
<a name="l01154"></a>01154 <span class="comment">                @return layer visibility status */</span>
<a name="l01155"></a>01155         <span class="keywordtype">bool</span> IsLayerVisible(<span class="keyword">const</span> wxString &amp;name );
<a name="l01156"></a>01156 <span class="comment"></span>
<a name="l01157"></a>01157 <span class="comment">        /** Sets the visibility of a layer by its position in layer list.</span>
<a name="l01158"></a>01158 <span class="comment">                @param position The layer position in layer list</span>
<a name="l01159"></a>01159 <span class="comment">                @param viewable the view status to be set */</span>
<a name="l01160"></a>01160         <span class="keywordtype">void</span> SetLayerVisible(<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> position, <span class="keywordtype">bool</span> viewable);
<a name="l01161"></a>01161 <span class="comment"></span>
<a name="l01162"></a>01162 <span class="comment">        /** Check whether the layer at given position is visible</span>
<a name="l01163"></a>01163 <span class="comment">                @param position The layer position in layer list</span>
<a name="l01164"></a>01164 <span class="comment">                @return layer visibility status */</span>
<a name="l01165"></a>01165         <span class="keywordtype">bool</span> IsLayerVisible(<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> position );
<a name="l01166"></a>01166 <span class="comment"></span>
<a name="l01167"></a>01167 <span class="comment">        /** Set Color theme. Provide colours to set a new colour theme.</span>
<a name="l01168"></a>01168 <span class="comment">            @param bgColour Background colour</span>
<a name="l01169"></a>01169 <span class="comment">                @param drawColour The colour used to draw all elements in foreground, axes excluded</span>
<a name="l01170"></a>01170 <span class="comment">                @param axesColour The colour used to draw axes (but not their labels) */</span>
<a name="l01171"></a>01171         <span class="keywordtype">void</span> SetColourTheme(<span class="keyword">const</span> wxColour&amp; bgColour, <span class="keyword">const</span> wxColour&amp; drawColour, <span class="keyword">const</span> wxColour&amp; axesColour);
<a name="l01172"></a>01172 <span class="comment"></span>
<a name="l01173"></a>01173 <span class="comment">        /** Get axes draw colour</span>
<a name="l01174"></a>01174 <span class="comment">                @return reference to axis colour used in theme */</span>
<a name="l01175"></a><a class="code" href="classmp_window.html#a5889b7b7f1271183a1c0bdf31177227c">01175</a>         <span class="keyword">const</span> wxColour&amp; <a class="code" href="classmp_window.html#a5889b7b7f1271183a1c0bdf31177227c" title="Get axes draw colour.">GetAxesColour</a>() { <span class="keywordflow">return</span> m_axColour; };
<a name="l01176"></a>01176 
<a name="l01177"></a>01177 <span class="keyword">protected</span>:
<a name="l01178"></a>01178     <span class="keywordtype">void</span> OnPaint         (wxPaintEvent     &amp;event); <span class="comment">//!&lt; Paint handler, will plot all attached layers</span>
<a name="l01179"></a>01179 <span class="comment"></span>    <span class="keywordtype">void</span> OnSize          (wxSizeEvent      &amp;event); <span class="comment">//!&lt; Size handler, will update scroll bar sizes</span>
<a name="l01180"></a>01180 <span class="comment"></span>    <span class="comment">// void OnScroll2       (wxScrollWinEvent &amp;event); //!&lt; Scroll handler, will move canvas</span>
<a name="l01181"></a>01181     <span class="keywordtype">void</span> OnShowPopupMenu (wxMouseEvent     &amp;event); <span class="comment">//!&lt; Mouse handler, will show context menu</span>
<a name="l01182"></a>01182 <span class="comment"></span>    <span class="keywordtype">void</span> OnMouseRightDown(wxMouseEvent     &amp;event); <span class="comment">//!&lt; Mouse handler, for detecting when the user drags with the right button or just &quot;clicks&quot; for the menu</span>
<a name="l01183"></a>01183 <span class="comment"></span>    <span class="keywordtype">void</span> OnCenter        (wxCommandEvent   &amp;event); <span class="comment">//!&lt; Context menu handler</span>
<a name="l01184"></a>01184 <span class="comment"></span>    <span class="keywordtype">void</span> OnFit           (wxCommandEvent   &amp;event); <span class="comment">//!&lt; Context menu handler</span>
<a name="l01185"></a>01185 <span class="comment"></span>    <span class="keywordtype">void</span> OnZoomIn        (wxCommandEvent   &amp;event); <span class="comment">//!&lt; Context menu handler</span>
<a name="l01186"></a>01186 <span class="comment"></span>    <span class="keywordtype">void</span> OnZoomOut       (wxCommandEvent   &amp;event); <span class="comment">//!&lt; Context menu handler</span>
<a name="l01187"></a>01187 <span class="comment"></span>    <span class="keywordtype">void</span> OnLockAspect    (wxCommandEvent   &amp;event); <span class="comment">//!&lt; Context menu handler</span>
<a name="l01188"></a>01188 <span class="comment"></span>    <span class="keywordtype">void</span> OnMouseHelp     (wxCommandEvent   &amp;event); <span class="comment">//!&lt; Context menu handler</span>
<a name="l01189"></a>01189 <span class="comment"></span>    <span class="keywordtype">void</span> OnPrintMenu     (wxCommandEvent   &amp;event); <span class="comment">//!&lt; Context menu handler</span>
<a name="l01190"></a>01190 <span class="comment"></span>    <span class="keywordtype">void</span> OnMouseWheel    (wxMouseEvent     &amp;event); <span class="comment">//!&lt; Mouse handler for the wheel</span>
<a name="l01191"></a>01191 <span class="comment"></span>    <span class="keywordtype">void</span> OnMouseMove     (wxMouseEvent     &amp;event); <span class="comment">//!&lt; Mouse handler for mouse motion (for pan)</span>
<a name="l01192"></a>01192 <span class="comment"></span>    <span class="keywordtype">void</span> OnMouseLeftDown (wxMouseEvent     &amp;event); <span class="comment">//!&lt; Mouse left click (for rect zoom)</span>
<a name="l01193"></a>01193 <span class="comment"></span>    <span class="keywordtype">void</span> OnMouseLeftRelease (wxMouseEvent  &amp;event); <span class="comment">//!&lt; Mouse left click (for rect zoom)</span>
<a name="l01194"></a>01194 <span class="comment"></span>    <span class="keywordtype">void</span> OnScrollThumbTrack (wxScrollWinEvent &amp;event); <span class="comment">//!&lt; Scroll thumb on scroll bar moving</span>
<a name="l01195"></a>01195 <span class="comment"></span>    <span class="keywordtype">void</span> OnScrollPageUp     (wxScrollWinEvent &amp;event); <span class="comment">//!&lt; Scroll page up</span>
<a name="l01196"></a>01196 <span class="comment"></span>    <span class="keywordtype">void</span> OnScrollPageDown   (wxScrollWinEvent &amp;event); <span class="comment">//!&lt; Scroll page down</span>
<a name="l01197"></a>01197 <span class="comment"></span>    <span class="keywordtype">void</span> OnScrollLineUp     (wxScrollWinEvent &amp;event); <span class="comment">//!&lt; Scroll line up</span>
<a name="l01198"></a>01198 <span class="comment"></span>    <span class="keywordtype">void</span> OnScrollLineDown   (wxScrollWinEvent &amp;event); <span class="comment">//!&lt; Scroll line down</span>
<a name="l01199"></a>01199 <span class="comment"></span>    <span class="keywordtype">void</span> OnScrollTop        (wxScrollWinEvent &amp;event); <span class="comment">//!&lt; Scroll to top</span>
<a name="l01200"></a>01200 <span class="comment"></span>    <span class="keywordtype">void</span> OnScrollBottom     (wxScrollWinEvent &amp;event); <span class="comment">//!&lt; Scroll to bottom</span>
<a name="l01201"></a>01201 <span class="comment"></span>
<a name="l01202"></a>01202     <span class="keywordtype">void</span> DoScrollCalc    (<span class="keyword">const</span> <span class="keywordtype">int</span> position, <span class="keyword">const</span> <span class="keywordtype">int</span> orientation);
<a name="l01203"></a>01203 
<a name="l01204"></a>01204     <span class="keywordtype">void</span> DoZoomInXCalc   (<span class="keyword">const</span> <span class="keywordtype">int</span>         staticXpixel);
<a name="l01205"></a>01205     <span class="keywordtype">void</span> DoZoomInYCalc   (<span class="keyword">const</span> <span class="keywordtype">int</span>         staticYpixel);
<a name="l01206"></a>01206     <span class="keywordtype">void</span> DoZoomOutXCalc  (<span class="keyword">const</span> <span class="keywordtype">int</span>         staticXpixel);
<a name="l01207"></a>01207     <span class="keywordtype">void</span> DoZoomOutYCalc  (<span class="keyword">const</span> <span class="keywordtype">int</span>         staticYpixel);
<a name="l01208"></a>01208 <span class="comment"></span>
<a name="l01209"></a>01209 <span class="comment">    /** Recalculate global layer bounding box, and save it in m_minX,...</span>
<a name="l01210"></a>01210 <span class="comment">      * \return true if there is any valid BBox information.</span>
<a name="l01211"></a>01211 <span class="comment">      */</span>
<a name="l01212"></a>01212     <span class="keyword">virtual</span> <span class="keywordtype">bool</span> UpdateBBox();
<a name="l01213"></a>01213 
<a name="l01214"></a>01214     <span class="comment">//wxList m_layers;    //!&lt; List of attached plot layers</span>
<a name="l01215"></a><a class="code" href="classmp_window.html#a99c7c979e4f019f25ee50eb298b9362c">01215</a>     <a class="code" href="classstd_1_1deque.html">wxLayerList</a> <a class="code" href="classmp_window.html#a99c7c979e4f019f25ee50eb298b9362c" title="List of attached plot layers.">m_layers</a>; <span class="comment">//!&lt; List of attached plot layers</span>
<a name="l01216"></a><a class="code" href="classmp_window.html#a9c8523daf05a09fce5e521eee7929e09">01216</a> <span class="comment"></span>    wxMenu <a class="code" href="classmp_window.html#a9c8523daf05a09fce5e521eee7929e09" title="Canvas&#39; context menu.">m_popmenu</a>;   <span class="comment">//!&lt; Canvas&#39; context menu</span>
<a name="l01217"></a><a class="code" href="classmp_window.html#a635ea37b3591fc45f019e83ef4ad2235">01217</a> <span class="comment"></span>    <span class="keywordtype">bool</span>   <a class="code" href="classmp_window.html#a635ea37b3591fc45f019e83ef4ad2235" title="Scale aspect is locked or not.">m_lockaspect</a>;<span class="comment">//!&lt; Scale aspect is locked or not</span>
<a name="l01218"></a>01218 <span class="comment"></span>    <span class="comment">// bool   m_coordTooltip; //!&lt; Selects whether to show coordinate tooltip</span>
<a name="l01219"></a><a class="code" href="classmp_window.html#a51c0f254520b1f68d727455de026ae0a">01219</a>         wxColour <a class="code" href="classmp_window.html#a51c0f254520b1f68d727455de026ae0a" title="Background Colour.">m_bgColour</a>;    <span class="comment">//!&lt; Background Colour</span>
<a name="l01220"></a><a class="code" href="classmp_window.html#a8c5289dfab25a685051d6036cca80e4c">01220</a> <span class="comment"></span>        wxColour <a class="code" href="classmp_window.html#a8c5289dfab25a685051d6036cca80e4c" title="Foreground Colour.">m_fgColour</a>;    <span class="comment">//!&lt; Foreground Colour</span>
<a name="l01221"></a><a class="code" href="classmp_window.html#acaed674dd297977fbc2b9f85f493ec68">01221</a> <span class="comment"></span>        wxColour <a class="code" href="classmp_window.html#acaed674dd297977fbc2b9f85f493ec68" title="Axes Colour.">m_axColour</a>;    <span class="comment">//!&lt; Axes Colour</span>
<a name="l01222"></a>01222 <span class="comment"></span>
<a name="l01223"></a><a class="code" href="classmp_window.html#a913a1f2cbbd057f9cf7fb2f215e9d33a">01223</a>     <span class="keywordtype">double</span> <a class="code" href="classmp_window.html#a913a1f2cbbd057f9cf7fb2f215e9d33a" title="Global layer bounding box, left border incl.">m_minX</a>;      <span class="comment">//!&lt; Global layer bounding box, left border incl.</span>
<a name="l01224"></a><a class="code" href="classmp_window.html#a48e1d785b8de6662cf95d04ba39261a0">01224</a> <span class="comment"></span>    <span class="keywordtype">double</span> <a class="code" href="classmp_window.html#a48e1d785b8de6662cf95d04ba39261a0" title="Global layer bounding box, right border incl.">m_maxX</a>;      <span class="comment">//!&lt; Global layer bounding box, right border incl.</span>
<a name="l01225"></a><a class="code" href="classmp_window.html#a34ab0da510ee7744579278b08aae000e">01225</a> <span class="comment"></span>    <span class="keywordtype">double</span> <a class="code" href="classmp_window.html#a34ab0da510ee7744579278b08aae000e" title="Global layer bounding box, bottom border incl.">m_minY</a>;      <span class="comment">//!&lt; Global layer bounding box, bottom border incl.</span>
<a name="l01226"></a><a class="code" href="classmp_window.html#a0cbaef21280a869b22325216388834ef">01226</a> <span class="comment"></span>    <span class="keywordtype">double</span> <a class="code" href="classmp_window.html#a0cbaef21280a869b22325216388834ef" title="Global layer bounding box, top border incl.">m_maxY</a>;      <span class="comment">//!&lt; Global layer bounding box, top border incl.</span>
<a name="l01227"></a><a class="code" href="classmp_window.html#ad7d96b419c9cd6ef61d11e8e528510f2">01227</a> <span class="comment"></span>    <span class="keywordtype">double</span> <a class="code" href="classmp_window.html#ad7d96b419c9cd6ef61d11e8e528510f2" title="Current view&#39;s X scale.">m_scaleX</a>;    <span class="comment">//!&lt; Current view&#39;s X scale</span>
<a name="l01228"></a><a class="code" href="classmp_window.html#a775ebeb15c876067ea5bdb783473d8b3">01228</a> <span class="comment"></span>    <span class="keywordtype">double</span> <a class="code" href="classmp_window.html#a775ebeb15c876067ea5bdb783473d8b3" title="Current view&#39;s Y scale.">m_scaleY</a>;    <span class="comment">//!&lt; Current view&#39;s Y scale</span>
<a name="l01229"></a><a class="code" href="classmp_window.html#a5995e8f243fa4996b72552106e8caa57">01229</a> <span class="comment"></span>    <span class="keywordtype">double</span> <a class="code" href="classmp_window.html#a5995e8f243fa4996b72552106e8caa57" title="Current view&#39;s X position.">m_posX</a>;      <span class="comment">//!&lt; Current view&#39;s X position</span>
<a name="l01230"></a><a class="code" href="classmp_window.html#a11f845776d86a1e32f5396ad5ec1289f">01230</a> <span class="comment"></span>    <span class="keywordtype">double</span> <a class="code" href="classmp_window.html#a11f845776d86a1e32f5396ad5ec1289f" title="Current view&#39;s Y position.">m_posY</a>;      <span class="comment">//!&lt; Current view&#39;s Y position</span>
<a name="l01231"></a><a class="code" href="classmp_window.html#af914529b6b73a87042077f3be64b0389">01231</a> <span class="comment"></span>    <span class="keywordtype">int</span>    <a class="code" href="classmp_window.html#af914529b6b73a87042077f3be64b0389" title="Current view&#39;s X dimension.">m_scrX</a>;      <span class="comment">//!&lt; Current view&#39;s X dimension</span>
<a name="l01232"></a><a class="code" href="classmp_window.html#ae3ec62236d09949e07090e38702b26b2">01232</a> <span class="comment"></span>    <span class="keywordtype">int</span>    <a class="code" href="classmp_window.html#ae3ec62236d09949e07090e38702b26b2" title="Current view&#39;s Y dimension.">m_scrY</a>;      <span class="comment">//!&lt; Current view&#39;s Y dimension</span>
<a name="l01233"></a><a class="code" href="classmp_window.html#aa3bfe438e27aeda9fb4fed0b6bee4ec8">01233</a> <span class="comment"></span>    <span class="keywordtype">int</span>    <a class="code" href="classmp_window.html#aa3bfe438e27aeda9fb4fed0b6bee4ec8" title="Last mouse click X position, for centering and zooming the view.">m_clickedX</a>;  <span class="comment">//!&lt; Last mouse click X position, for centering and zooming the view</span>
<a name="l01234"></a><a class="code" href="classmp_window.html#a4fb4f7c4b8c7767c90c0235ecb105d09">01234</a> <span class="comment"></span>    <span class="keywordtype">int</span>    <a class="code" href="classmp_window.html#a4fb4f7c4b8c7767c90c0235ecb105d09" title="Last mouse click Y position, for centering and zooming the view.">m_clickedY</a>;  <span class="comment">//!&lt; Last mouse click Y position, for centering and zooming the view</span>
<a name="l01235"></a>01235 <span class="comment"></span><span class="comment"></span>
<a name="l01236"></a>01236 <span class="comment">    /** These are updated in Fit() only, and may be different from the real borders (layer coordinates) only if lock aspect ratio is true.</span>
<a name="l01237"></a>01237 <span class="comment">      */</span>
<a name="l01238"></a><a class="code" href="classmp_window.html#a00011879a92b754bf81a5adc8b3326be">01238</a>     <span class="keywordtype">double</span> m_desiredXmin,m_desiredXmax,<a class="code" href="classmp_window.html#a00011879a92b754bf81a5adc8b3326be">m_desiredYmin</a>,m_desiredYmax;
<a name="l01239"></a>01239 
<a name="l01240"></a><a class="code" href="classmp_window.html#a3487ddf698017a59c67911132e8ca5e8">01240</a>     <span class="keywordtype">int</span> <a class="code" href="classmp_window.html#a3487ddf698017a59c67911132e8ca5e8">m_marginTop</a>, m_marginRight, m_marginBottom, m_marginLeft;
<a name="l01241"></a>01241 
<a name="l01242"></a><a class="code" href="classmp_window.html#afc4c6c5d25a9d3ad4512d329e301fa63">01242</a>     <span class="keywordtype">int</span>         m_last_lx,<a class="code" href="classmp_window.html#afc4c6c5d25a9d3ad4512d329e301fa63" title="For double buffering.">m_last_ly</a>;   <span class="comment">//!&lt; For double buffering</span>
<a name="l01243"></a><a class="code" href="classmp_window.html#a481714a34c95c3ea8856d9b48847669e">01243</a> <span class="comment"></span>    wxMemoryDC  <a class="code" href="classmp_window.html#a481714a34c95c3ea8856d9b48847669e" title="For double buffering.">m_buff_dc</a>;             <span class="comment">//!&lt; For double buffering</span>
<a name="l01244"></a><a class="code" href="classmp_window.html#aa93d27b60fe93e33f00c9b4a598bff15">01244</a> <span class="comment"></span>    wxBitmap    *<a class="code" href="classmp_window.html#aa93d27b60fe93e33f00c9b4a598bff15" title="For double buffering.">m_buff_bmp</a>;            <span class="comment">//!&lt; For double buffering</span>
<a name="l01245"></a><a class="code" href="classmp_window.html#ad841f0174875fb95c0d139bec9a80d29">01245</a> <span class="comment"></span>    <span class="keywordtype">bool</span>        <a class="code" href="classmp_window.html#ad841f0174875fb95c0d139bec9a80d29" title="For double buffering.">m_enableDoubleBuffer</a>;  <span class="comment">//!&lt; For double buffering</span>
<a name="l01246"></a><a class="code" href="classmp_window.html#a15b6dc892fd81ed7bfa4087f4e8f1b14">01246</a> <span class="comment"></span>    <span class="keywordtype">bool</span>        <a class="code" href="classmp_window.html#a15b6dc892fd81ed7bfa4087f4e8f1b14" title="For pan/zoom with the mouse.">m_enableMouseNavigation</a>;  <span class="comment">//!&lt; For pan/zoom with the mouse.</span>
<a name="l01247"></a><a class="code" href="classmp_window.html#a14986555637dd220622fef27eab1ed5c">01247</a> <span class="comment"></span>    <span class="keywordtype">bool</span>        <a class="code" href="classmp_window.html#a14986555637dd220622fef27eab1ed5c">m_mouseMovedAfterRightClick</a>;
<a name="l01248"></a><a class="code" href="classmp_window.html#a03127ba380e267544f6aa283c02240c8">01248</a>     <span class="keywordtype">long</span>        m_mouseRClick_X,<a class="code" href="classmp_window.html#a03127ba380e267544f6aa283c02240c8" title="For the right button &quot;drag&quot; feature.">m_mouseRClick_Y</a>; <span class="comment">//!&lt; For the right button &quot;drag&quot; feature</span>
<a name="l01249"></a><a class="code" href="classmp_window.html#a895fa5157efa53d2f0e47d2e9306021f">01249</a> <span class="comment"></span>    <span class="keywordtype">int</span>         m_mouseLClick_X, <a class="code" href="classmp_window.html#a895fa5157efa53d2f0e47d2e9306021f" title="Starting coords for rectangular zoom selection.">m_mouseLClick_Y</a>; <span class="comment">//!&lt; Starting coords for rectangular zoom selection</span>
<a name="l01250"></a><a class="code" href="classmp_window.html#a675060e84911f19f3acd849e13479326">01250</a> <span class="comment"></span>    <span class="keywordtype">bool</span>        <a class="code" href="classmp_window.html#a675060e84911f19f3acd849e13479326">m_enableScrollBars</a>;
<a name="l01251"></a><a class="code" href="classmp_window.html#ac9bce6246dbb14858e565cb69f333941">01251</a>     <span class="keywordtype">int</span>         m_scrollX, <a class="code" href="classmp_window.html#ac9bce6246dbb14858e565cb69f333941">m_scrollY</a>;
<a name="l01252"></a><a class="code" href="classmp_window.html#a032dc9d7b29e6afc15eb8f0a84a18ff3">01252</a>     <a class="code" href="classmp_info_layer.html" title="Base class to create small rectangular info boxes mpInfoLayer is the base class to create a small rec...">mpInfoLayer</a>* <a class="code" href="classmp_window.html#a032dc9d7b29e6afc15eb8f0a84a18ff3" title="For moving info layers over the window area.">m_movingInfoLayer</a>;      <span class="comment">//!&lt; For moving info layers over the window area</span>
<a name="l01253"></a>01253 <span class="comment"></span>
<a name="l01254"></a>01254     DECLARE_DYNAMIC_CLASS(<a class="code" href="classmp_window.html" title="Canvas for plotting mpLayer implementations.">mpWindow</a>)
<a name="l01255"></a>01255     DECLARE_EVENT_TABLE()
<a name="l01256"></a>01256 };
<a name="l01257"></a>01257 
<a name="l01258"></a>01258 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01259"></a>01259 <span class="comment">// mpFXYVector - provided by Jose Luis Blanco</span>
<a name="l01260"></a>01260 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01261"></a>01261 <span class="comment"></span>
<a name="l01262"></a>01262 <span class="comment">/** A class providing graphs functionality for a 2D plot (either continuous or a set of points), from vectors of data.</span>
<a name="l01263"></a>01263 <span class="comment">     This class can be used directly, the user does not need to derive any new class. Simply pass the data as two vectors</span>
<a name="l01264"></a>01264 <span class="comment">     with the same length containing the X and Y coordinates to the method SetData.</span>
<a name="l01265"></a>01265 <span class="comment"></span>
<a name="l01266"></a>01266 <span class="comment">     To generate a graph with a set of points, call</span>
<a name="l01267"></a>01267 <span class="comment">     \code</span>
<a name="l01268"></a>01268 <span class="comment">     layerVar-&gt;SetContinuity(false)</span>
<a name="l01269"></a>01269 <span class="comment">     \endcode</span>
<a name="l01270"></a>01270 <span class="comment"></span>
<a name="l01271"></a>01271 <span class="comment">     or</span>
<a name="l01272"></a>01272 <span class="comment"></span>
<a name="l01273"></a>01273 <span class="comment">     \code</span>
<a name="l01274"></a>01274 <span class="comment">     layerVar-&gt;SetContinuity(true)</span>
<a name="l01275"></a>01275 <span class="comment">     \endcode</span>
<a name="l01276"></a>01276 <span class="comment"></span>
<a name="l01277"></a>01277 <span class="comment">     to render the sequence of coordinates as a continuous line.</span>
<a name="l01278"></a>01278 <span class="comment"></span>
<a name="l01279"></a>01279 <span class="comment">     (Added: Jose Luis Blanco, AGO-2007)</span>
<a name="l01280"></a>01280 <span class="comment">*/</span>
<a name="l01281"></a>01281 class <a class="code" href="mathplot_8h.html#a8ad8b0f95a03f1bc9ff4ed3947e96ea1">WXDLLIMPEXP_MATHPLOT</a> <a class="code" href="classmp_f_x_y_vector.html" title="A class providing graphs functionality for a 2D plot (either continuous or a set of points)...">mpFXYVector</a> : public <a class="code" href="classmp_f_x_y.html" title="Abstract base class providing plot and labeling functionality for a locus plot F:N-&gt;X,Y.">mpFXY</a>
<a name="l01282"></a>01282 {
<a name="l01283"></a>01283 <span class="keyword">public</span>:<span class="comment"></span>
<a name="l01284"></a>01284 <span class="comment">    /** @param name  Label</span>
<a name="l01285"></a>01285 <span class="comment">        @param flags Label alignment, pass one of #mpALIGN_NE, #mpALIGN_NW, #mpALIGN_SW, #mpALIGN_SE.</span>
<a name="l01286"></a>01286 <span class="comment">    */</span>
<a name="l01287"></a>01287     <a class="code" href="mathplot_8h.html#a3c6bff27059660d514285e5e2216a9dd">mpFXYVector</a>(wxString name = wxEmptyString, <span class="keywordtype">int</span> flags = <a class="code" href="mathplot_8h.html#aefebdec22b0dadaa9bc5bbe0b18bc097" title="Aligns label to north-east.">mpALIGN_NE</a>);
<a name="l01288"></a>01288 <span class="comment"></span>
<a name="l01289"></a>01289 <span class="comment">    /** Changes the internal data: the set of points to draw.</span>
<a name="l01290"></a>01290 <span class="comment">        Both vectors MUST be of the same length. This method DOES NOT refresh the mpWindow; do it manually.</span>
<a name="l01291"></a>01291 <span class="comment">      * @sa Clear</span>
<a name="l01292"></a>01292 <span class="comment">    */</span>
<a name="l01293"></a>01293     <span class="keywordtype">void</span> SetData( <span class="keyword">const</span> <a class="code" href="classstd_1_1vector.html">std::vector&lt;double&gt;</a> &amp;xs,<span class="keyword">const</span> <a class="code" href="classstd_1_1vector.html">std::vector&lt;double&gt;</a> &amp;ys);
<a name="l01294"></a>01294 <span class="comment"></span>
<a name="l01295"></a>01295 <span class="comment">    /** Changes the internal data: the set of points to draw.</span>
<a name="l01296"></a>01296 <span class="comment">        Both vectors MUST be of the same length. This method DOES NOT refresh the mpWindow; do it manually.</span>
<a name="l01297"></a>01297 <span class="comment">      * @sa Clear</span>
<a name="l01298"></a>01298 <span class="comment">    */</span>
<a name="l01299"></a>01299     <span class="keywordtype">void</span> SetData( <span class="keyword">const</span> <a class="code" href="classstd_1_1vector.html">std::vector&lt;float&gt;</a> &amp;xs,<span class="keyword">const</span> <a class="code" href="classstd_1_1vector.html">std::vector&lt;float&gt;</a> &amp;ys);
<a name="l01300"></a>01300 <span class="comment"></span>
<a name="l01301"></a>01301 <span class="comment">    /** Clears all the data, leaving the layer empty.</span>
<a name="l01302"></a>01302 <span class="comment">      * @sa SetData</span>
<a name="l01303"></a>01303 <span class="comment">      */</span>
<a name="l01304"></a>01304     <span class="keywordtype">void</span> Clear();
<a name="l01305"></a>01305 <span class="comment"></span>
<a name="l01306"></a>01306 <span class="comment">    /** Returns the number of data points currently hold in X &amp; Y.</span>
<a name="l01307"></a>01307 <span class="comment">      * @sa SetData</span>
<a name="l01308"></a>01308 <span class="comment">      */</span>
<a name="l01309"></a><a class="code" href="classmp_f_x_y_vector.html#a26a50f88254e3bf9039084c609819c30">01309</a>         <span class="keywordtype">size_t</span> GetDataLength()<span class="keyword"> const</span>
<a name="l01310"></a>01310 <span class="keyword">        </span>{
<a name="l01311"></a>01311                 <span class="keywordflow">return</span> m_xs.size();
<a name="l01312"></a>01312         }
<a name="l01313"></a>01313 <span class="comment"></span>
<a name="l01314"></a>01314 <span class="comment">        /** Append a new data point (x,y)</span>
<a name="l01315"></a>01315 <span class="comment">      * @sa SetData</span>
<a name="l01316"></a>01316 <span class="comment">      */</span>
<a name="l01317"></a>01317         <span class="keywordtype">void</span> AppendDataPoint(<span class="keywordtype">float</span> x, <span class="keywordtype">float</span> <a class="code" href="namespace_eigen_1_1internal.html#a3d7a581aeb951248dc6fe114e9e05f07">y</a>);
<a name="l01318"></a>01318 
<a name="l01319"></a>01319 <span class="keyword">protected</span>:<span class="comment"></span>
<a name="l01320"></a>01320 <span class="comment">    /** The internal copy of the set of data to draw.</span>
<a name="l01321"></a>01321 <span class="comment">      */</span>
<a name="l01322"></a><a class="code" href="classmp_f_x_y_vector.html#a4f19a60c9cfaebb10b247bb06ebc3a11">01322</a>     std::vector&lt;double&gt;  m_xs,<a class="code" href="classmp_f_x_y_vector.html#a4f19a60c9cfaebb10b247bb06ebc3a11">m_ys</a>;
<a name="l01323"></a>01323 <span class="comment"></span>
<a name="l01324"></a>01324 <span class="comment">    /** The internal counter for the &quot;GetNextXY&quot; interface</span>
<a name="l01325"></a>01325 <span class="comment">      */</span>
<a name="l01326"></a><a class="code" href="classmp_f_x_y_vector.html#afb7491292a612e00f62728cb4dd752e4">01326</a>     <span class="keywordtype">size_t</span>              <a class="code" href="classmp_f_x_y_vector.html#afb7491292a612e00f62728cb4dd752e4" title="The internal counter for the &quot;GetNextXY&quot; interface.">m_index</a>;
<a name="l01327"></a>01327 <span class="comment"></span>
<a name="l01328"></a>01328 <span class="comment">    /** Loaded at SetData</span>
<a name="l01329"></a>01329 <span class="comment">      */</span>
<a name="l01330"></a><a class="code" href="classmp_f_x_y_vector.html#aff47cd32e800bcd23f74e9f93e0b1fa2">01330</a>     <span class="keywordtype">double</span>              m_minX,m_maxX,<a class="code" href="classmp_f_x_y_vector.html#aff47cd32e800bcd23f74e9f93e0b1fa2">m_minY</a>,m_maxY;
<a name="l01331"></a>01331 <span class="comment"></span>
<a name="l01332"></a>01332 <span class="comment">    /** Rewind value enumeration with mpFXY::GetNextXY.</span>
<a name="l01333"></a>01333 <span class="comment">        Overridden in this implementation.</span>
<a name="l01334"></a>01334 <span class="comment">    */</span>
<a name="l01335"></a>01335     <span class="keywordtype">void</span> Rewind();
<a name="l01336"></a>01336 <span class="comment"></span>
<a name="l01337"></a>01337 <span class="comment">    /** Get locus value for next N.</span>
<a name="l01338"></a>01338 <span class="comment">        Overridden in this implementation.</span>
<a name="l01339"></a>01339 <span class="comment">        @param x Returns X value</span>
<a name="l01340"></a>01340 <span class="comment">        @param y Returns Y value</span>
<a name="l01341"></a>01341 <span class="comment">    */</span>
<a name="l01342"></a>01342     <span class="keywordtype">bool</span> GetNextXY(<span class="keywordtype">double</span> &amp; x, <span class="keywordtype">double</span> &amp; <a class="code" href="namespace_eigen_1_1internal.html#a3d7a581aeb951248dc6fe114e9e05f07">y</a>);
<a name="l01343"></a>01343 
<a name="l01344"></a>01344 <span class="keyword">public</span>:<span class="comment"></span>
<a name="l01345"></a>01345 <span class="comment">    /** Returns the actual minimum X data (loaded in SetData).</span>
<a name="l01346"></a>01346 <span class="comment">      */</span>
<a name="l01347"></a><a class="code" href="classmp_f_x_y_vector.html#a0efea77c24defb8c30fc1b6a868bd665">01347</a>     <span class="keywordtype">double</span> <a class="code" href="classmp_f_x_y_vector.html#a0efea77c24defb8c30fc1b6a868bd665" title="Returns the actual minimum X data (loaded in SetData).">GetMinX</a>() { <span class="keywordflow">return</span> m_minX; }
<a name="l01348"></a>01348 <span class="comment"></span>
<a name="l01349"></a>01349 <span class="comment">    /** Returns the actual minimum Y data (loaded in SetData).</span>
<a name="l01350"></a>01350 <span class="comment">      */</span>
<a name="l01351"></a><a class="code" href="classmp_f_x_y_vector.html#a16e6eaba8664ccc285c10f86fb941797">01351</a>     <span class="keywordtype">double</span> <a class="code" href="classmp_f_x_y_vector.html#a16e6eaba8664ccc285c10f86fb941797" title="Returns the actual minimum Y data (loaded in SetData).">GetMinY</a>() { <span class="keywordflow">return</span> m_minY; }
<a name="l01352"></a>01352 <span class="comment"></span>
<a name="l01353"></a>01353 <span class="comment">    /** Returns the actual maximum X data (loaded in SetData).</span>
<a name="l01354"></a>01354 <span class="comment">      */</span>
<a name="l01355"></a><a class="code" href="classmp_f_x_y_vector.html#a1f04de4dfc2f87c0b29f0afcf7132271">01355</a>     <span class="keywordtype">double</span> <a class="code" href="classmp_f_x_y_vector.html#a1f04de4dfc2f87c0b29f0afcf7132271" title="Returns the actual maximum X data (loaded in SetData).">GetMaxX</a>() { <span class="keywordflow">return</span> m_maxX; }
<a name="l01356"></a>01356 <span class="comment"></span>
<a name="l01357"></a>01357 <span class="comment">    /** Returns the actual maximum Y data (loaded in SetData).</span>
<a name="l01358"></a>01358 <span class="comment">      */</span>
<a name="l01359"></a><a class="code" href="classmp_f_x_y_vector.html#aeabbeed556f96689f79e451780636ac5">01359</a>     <span class="keywordtype">double</span> <a class="code" href="classmp_f_x_y_vector.html#aeabbeed556f96689f79e451780636ac5" title="Returns the actual maximum Y data (loaded in SetData).">GetMaxY</a>() { <span class="keywordflow">return</span> m_maxY; }
<a name="l01360"></a>01360 
<a name="l01361"></a>01361 <span class="keyword">protected</span>:
<a name="l01362"></a><a class="code" href="classmp_f_x_y_vector.html#ac7036cc274a56e2ed7da5da48dce9579">01362</a>     <span class="keywordtype">int</span>     <a class="code" href="classmp_f_x_y_vector.html#ac7036cc274a56e2ed7da5da48dce9579" title="Holds label alignment.">m_flags</a>; <span class="comment">//!&lt; Holds label alignment</span>
<a name="l01363"></a>01363 <span class="comment"></span>
<a name="l01364"></a>01364     DECLARE_DYNAMIC_CLASS(<a class="code" href="classmp_f_x_y_vector.html" title="A class providing graphs functionality for a 2D plot (either continuous or a set of points)...">mpFXYVector</a>)
<a name="l01365"></a>01365 };
<a name="l01366"></a>01366 
<a name="l01367"></a>01367 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01368"></a>01368 <span class="comment">// mpText - provided by Val Greene</span>
<a name="l01369"></a>01369 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01370"></a>01370 <span class="comment"></span>
<a name="l01371"></a>01371 <span class="comment">/** Plot layer implementing a text string.</span>
<a name="l01372"></a>01372 <span class="comment">The text is plotted using a percentage system 0-100%, so the actual</span>
<a name="l01373"></a>01373 <span class="comment">coordinates for the location are not required, and the text stays</span>
<a name="l01374"></a>01374 <span class="comment">on the plot reguardless of the other layers location and scaling</span>
<a name="l01375"></a>01375 <span class="comment">factors.</span>
<a name="l01376"></a>01376 <span class="comment">*/</span>
<a name="l01377"></a>01377 <span class="keyword">class </span><a class="code" href="mathplot_8h.html#a8ad8b0f95a03f1bc9ff4ed3947e96ea1">WXDLLIMPEXP_MATHPLOT</a> <a class="code" href="classmp_text.html" title="Plot layer implementing a text string.">mpText</a> : <span class="keyword">public</span> <a class="code" href="classmp_layer.html" title="Plot layer, abstract base class.">mpLayer</a>
<a name="l01378"></a>01378 {
<a name="l01379"></a>01379 <span class="keyword">public</span>:<span class="comment"></span>
<a name="l01380"></a>01380 <span class="comment">    /** @param name text to be drawn in the plot</span>
<a name="l01381"></a>01381 <span class="comment">        @param offsetx holds offset for the X location in percentage (0-100)</span>
<a name="l01382"></a>01382 <span class="comment">        @param offsety holds offset for the Y location in percentage (0-100) */</span>
<a name="l01383"></a>01383     <a class="code" href="mathplot_8h.html#a03a8837f2a0302e5001e8cde13facb80">mpText</a>(wxString name = wxT(<span class="stringliteral">&quot;Title&quot;</span>), <span class="keywordtype">int</span> offsetx = 5, <span class="keywordtype">int</span> offsety = 50);
<a name="l01384"></a>01384 <span class="comment"></span>
<a name="l01385"></a>01385 <span class="comment">    /** Text Layer plot handler.</span>
<a name="l01386"></a>01386 <span class="comment">        This implementation will plot text adjusted to the visible area. */</span>
<a name="l01387"></a>01387     <span class="keyword">virtual</span> <span class="keywordtype">void</span> Plot(wxDC &amp; dc, <a class="code" href="classmp_window.html" title="Canvas for plotting mpLayer implementations.">mpWindow</a> &amp; w);
<a name="l01388"></a>01388 <span class="comment"></span>
<a name="l01389"></a>01389 <span class="comment">    /** mpText should not be used for scaling decisions. */</span>
<a name="l01390"></a><a class="code" href="classmp_text.html#a140380deb1dfa7ef3ea2a6a4aa90f1dd">01390</a>     <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classmp_text.html#a140380deb1dfa7ef3ea2a6a4aa90f1dd" title="mpText should not be used for scaling decisions.">HasBBox</a>() { <span class="keywordflow">return</span> FALSE; }
<a name="l01391"></a>01391 
<a name="l01392"></a>01392 <span class="keyword">protected</span>:
<a name="l01393"></a><a class="code" href="classmp_text.html#a796230fb2e978f08bf0777bdbab0a620">01393</a>     <span class="keywordtype">int</span> <a class="code" href="classmp_text.html#a796230fb2e978f08bf0777bdbab0a620" title="Holds offset for X in percentage.">m_offsetx</a>; <span class="comment">//!&lt; Holds offset for X in percentage</span>
<a name="l01394"></a><a class="code" href="classmp_text.html#ad82866a9808e60cfc58ee754b678a043">01394</a> <span class="comment"></span>    <span class="keywordtype">int</span> <a class="code" href="classmp_text.html#ad82866a9808e60cfc58ee754b678a043" title="Holds offset for Y in percentage.">m_offsety</a>; <span class="comment">//!&lt; Holds offset for Y in percentage</span>
<a name="l01395"></a>01395 <span class="comment"></span>
<a name="l01396"></a>01396     DECLARE_DYNAMIC_CLASS(<a class="code" href="classmp_text.html" title="Plot layer implementing a text string.">mpText</a>)
<a name="l01397"></a>01397 };
<a name="l01398"></a>01398 
<a name="l01399"></a>01399 
<a name="l01400"></a>01400 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01401"></a>01401 <span class="comment">// mpPrintout - provided by Davide Rondini</span>
<a name="l01402"></a>01402 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01403"></a>01403 <span class="comment"></span>
<a name="l01404"></a>01404 <span class="comment">/** Printout class used by mpWindow to draw in the objects to be printed.</span>
<a name="l01405"></a>01405 <span class="comment">    The object itself can then used by the default wxWidgets printing system</span>
<a name="l01406"></a>01406 <span class="comment">    to print mppWindow objects.</span>
<a name="l01407"></a>01407 <span class="comment">*/</span>
<a name="l01408"></a>01408 <span class="keyword">class </span><a class="code" href="mathplot_8h.html#a8ad8b0f95a03f1bc9ff4ed3947e96ea1">WXDLLIMPEXP_MATHPLOT</a> <a class="code" href="classmp_printout.html" title="Printout class used by mpWindow to draw in the objects to be printed.">mpPrintout</a> : <span class="keyword">public</span> wxPrintout
<a name="l01409"></a>01409 {
<a name="l01410"></a>01410 <span class="keyword">public</span>:
<a name="l01411"></a>01411     <a class="code" href="mathplot_8h.html#a3647ad96c624dcaf67745e89af68f98b">mpPrintout</a>(<a class="code" href="classmp_window.html" title="Canvas for plotting mpLayer implementations.">mpWindow</a>* drawWindow, <span class="keyword">const</span> wxChar *title = _T(<span class="stringliteral">&quot;wxMathPlot print output&quot;</span>));
<a name="l01412"></a><a class="code" href="classmp_printout.html#a8aeb3be9384acb4ab6be8823a2f171ae">01412</a>     <span class="keyword">virtual</span> <a class="code" href="classmp_printout.html#a8aeb3be9384acb4ab6be8823a2f171ae">~mpPrintout</a>() {};
<a name="l01413"></a>01413 
<a name="l01414"></a><a class="code" href="classmp_printout.html#adf922ac719bdd97f4383e86e6eb088fb">01414</a>     <span class="keywordtype">void</span> <a class="code" href="classmp_printout.html#adf922ac719bdd97f4383e86e6eb088fb">SetDrawState</a>(<span class="keywordtype">bool</span> drawState) {drawn = drawState;};
<a name="l01415"></a>01415     <span class="keywordtype">bool</span> OnPrintPage(<span class="keywordtype">int</span> page);
<a name="l01416"></a>01416     <span class="keywordtype">bool</span> HasPage(<span class="keywordtype">int</span> page);
<a name="l01417"></a>01417 
<a name="l01418"></a>01418 <span class="keyword">private</span>:
<a name="l01419"></a><a class="code" href="classmp_printout.html#a2600da1a5c7e67ecfee5c1b95e9ce9cd">01419</a>     <span class="keywordtype">bool</span> <a class="code" href="classmp_printout.html#a2600da1a5c7e67ecfee5c1b95e9ce9cd">drawn</a>;
<a name="l01420"></a><a class="code" href="classmp_printout.html#a4856651404788adee64c2dd886e0b436">01420</a>     <a class="code" href="classmp_window.html" title="Canvas for plotting mpLayer implementations.">mpWindow</a> *<a class="code" href="classmp_printout.html#a4856651404788adee64c2dd886e0b436">plotWindow</a>;
<a name="l01421"></a>01421 };
<a name="l01422"></a>01422 
<a name="l01423"></a>01423 
<a name="l01424"></a>01424 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01425"></a>01425 <span class="comment">// mpMovableObject  - provided by Jose Luis Blanco</span>
<a name="l01426"></a>01426 <span class="comment">//-----------------------------------------------------------------------------</span><span class="comment"></span>
<a name="l01427"></a>01427 <span class="comment">/** This virtual class represents objects that can be moved to an arbitrary 2D location+rotation.</span>
<a name="l01428"></a>01428 <span class="comment">  *  The current transformation is set through SetCoordinateBase.</span>
<a name="l01429"></a>01429 <span class="comment">  *  To ease the implementation of descendent classes, mpMovableObject will</span>
<a name="l01430"></a>01430 <span class="comment">  *  be in charge of Bounding Box computation and layer rendering, assuming that</span>
<a name="l01431"></a>01431 <span class="comment">  *  the object updates its shape in m_shape_xs &amp; m_shape_ys.</span>
<a name="l01432"></a>01432 <span class="comment">  */</span>
<a name="l01433"></a>01433 <span class="keyword">class </span><a class="code" href="mathplot_8h.html#a8ad8b0f95a03f1bc9ff4ed3947e96ea1">WXDLLIMPEXP_MATHPLOT</a> <a class="code" href="classmp_movable_object.html" title="This virtual class represents objects that can be moved to an arbitrary 2D location+rotation.">mpMovableObject</a> : <span class="keyword">public</span> <a class="code" href="classmp_layer.html" title="Plot layer, abstract base class.">mpLayer</a>
<a name="l01434"></a>01434 {
<a name="l01435"></a>01435 <span class="keyword">public</span>:<span class="comment"></span>
<a name="l01436"></a>01436 <span class="comment">    /** Default constructor (sets location and rotation to (0,0,0))</span>
<a name="l01437"></a>01437 <span class="comment">      */</span>
<a name="l01438"></a><a class="code" href="classmp_movable_object.html#a41e3d0ee6b73e52d2b6239e6efb9a5a3">01438</a>     <a class="code" href="classmp_movable_object.html" title="This virtual class represents objects that can be moved to an arbitrary 2D location+rotation.">mpMovableObject</a>( ) :
<a name="l01439"></a>01439         m_reference_x(0),
<a name="l01440"></a>01440         m_reference_y(0),
<a name="l01441"></a>01441         m_reference_phi(0),
<a name="l01442"></a>01442         m_shape_xs(0),
<a name="l01443"></a>01443         m_shape_ys(0)
<a name="l01444"></a>01444     {
<a name="l01445"></a>01445         m_type = <a class="code" href="mathplot_8h.html#a3e096aea2344c539195351495aed7e59afffaffd7444293b2187476c6393cf1fc" title="Plot type layer.">mpLAYER_PLOT</a>;
<a name="l01446"></a>01446     }
<a name="l01447"></a>01447 
<a name="l01448"></a><a class="code" href="classmp_movable_object.html#a3f528cbe2aefb5006787689df2486cb5">01448</a>     <span class="keyword">virtual</span> <a class="code" href="classmp_movable_object.html#a3f528cbe2aefb5006787689df2486cb5">~mpMovableObject</a>() {};
<a name="l01449"></a>01449 <span class="comment"></span>
<a name="l01450"></a>01450 <span class="comment">    /** Get the current coordinate transformation.</span>
<a name="l01451"></a>01451 <span class="comment">      */</span>
<a name="l01452"></a><a class="code" href="classmp_movable_object.html#a9e1adc9c93b8ebe4fee78015b7fc3b5f">01452</a>     <span class="keywordtype">void</span> GetCoordinateBase( <span class="keywordtype">double</span> &amp;x, <span class="keywordtype">double</span> &amp;<a class="code" href="namespace_eigen_1_1internal.html#a3d7a581aeb951248dc6fe114e9e05f07">y</a>, <span class="keywordtype">double</span> &amp;phi )<span class="keyword"> const</span>
<a name="l01453"></a>01453 <span class="keyword">    </span>{
<a name="l01454"></a>01454         x = m_reference_x;
<a name="l01455"></a>01455         y = m_reference_y;
<a name="l01456"></a>01456         phi = m_reference_phi;
<a name="l01457"></a>01457     }
<a name="l01458"></a>01458 <span class="comment"></span>
<a name="l01459"></a>01459 <span class="comment">    /** Set the coordinate transformation (phi in radians, 0 means no rotation).</span>
<a name="l01460"></a>01460 <span class="comment">      */</span>
<a name="l01461"></a><a class="code" href="classmp_movable_object.html#a536b39dd8de3f0b1fa0f9d191ac1abd4">01461</a>     <span class="keywordtype">void</span> SetCoordinateBase( <span class="keywordtype">double</span> x, <span class="keywordtype">double</span> <a class="code" href="namespace_eigen_1_1internal.html#a3d7a581aeb951248dc6fe114e9e05f07">y</a>, <span class="keywordtype">double</span> phi = 0 )
<a name="l01462"></a>01462     {
<a name="l01463"></a>01463         m_reference_x = x;
<a name="l01464"></a>01464         m_reference_y = <a class="code" href="namespace_eigen_1_1internal.html#a3d7a581aeb951248dc6fe114e9e05f07">y</a>;
<a name="l01465"></a>01465         m_reference_phi = phi;
<a name="l01466"></a>01466         m_flags  = <a class="code" href="mathplot_8h.html#aefebdec22b0dadaa9bc5bbe0b18bc097" title="Aligns label to north-east.">mpALIGN_NE</a>;
<a name="l01467"></a>01467         ShapeUpdated();
<a name="l01468"></a>01468     }
<a name="l01469"></a>01469 
<a name="l01470"></a><a class="code" href="classmp_movable_object.html#aaab037c1c46ea2f73dfe9a279bbcc44b">01470</a>     <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classmp_movable_object.html#aaab037c1c46ea2f73dfe9a279bbcc44b" title="Check whether this layer has a bounding box.">HasBBox</a>() { <span class="keywordflow">return</span> m_trans_shape_xs.size()!=0; }
<a name="l01471"></a>01471 <span class="comment"></span>
<a name="l01472"></a>01472 <span class="comment">    /** Get inclusive left border of bounding box.</span>
<a name="l01473"></a>01473 <span class="comment">    */</span>
<a name="l01474"></a><a class="code" href="classmp_movable_object.html#a2547ff2de6ff9b9193d66b48dcde131e">01474</a>     <span class="keyword">virtual</span> <span class="keywordtype">double</span> <a class="code" href="classmp_movable_object.html#a2547ff2de6ff9b9193d66b48dcde131e" title="Get inclusive left border of bounding box.">GetMinX</a>() { <span class="keywordflow">return</span> m_bbox_min_x; }
<a name="l01475"></a>01475 <span class="comment"></span>
<a name="l01476"></a>01476 <span class="comment">    /** Get inclusive right border of bounding box.</span>
<a name="l01477"></a>01477 <span class="comment">    */</span>
<a name="l01478"></a><a class="code" href="classmp_movable_object.html#ac72a01f0fb133d40784e6e073d106ef4">01478</a>     <span class="keyword">virtual</span> <span class="keywordtype">double</span> <a class="code" href="classmp_movable_object.html#ac72a01f0fb133d40784e6e073d106ef4" title="Get inclusive right border of bounding box.">GetMaxX</a>() { <span class="keywordflow">return</span>  m_bbox_max_x; }
<a name="l01479"></a>01479 <span class="comment"></span>
<a name="l01480"></a>01480 <span class="comment">    /** Get inclusive bottom border of bounding box.</span>
<a name="l01481"></a>01481 <span class="comment">    */</span>
<a name="l01482"></a><a class="code" href="classmp_movable_object.html#a540e68e52321a089cec559b79bef167c">01482</a>     <span class="keyword">virtual</span> <span class="keywordtype">double</span> <a class="code" href="classmp_movable_object.html#a540e68e52321a089cec559b79bef167c" title="Get inclusive bottom border of bounding box.">GetMinY</a>() { <span class="keywordflow">return</span> m_bbox_min_y; }
<a name="l01483"></a>01483 <span class="comment"></span>
<a name="l01484"></a>01484 <span class="comment">    /** Get inclusive top border of bounding box.</span>
<a name="l01485"></a>01485 <span class="comment">    */</span>
<a name="l01486"></a><a class="code" href="classmp_movable_object.html#a5311360e42735073340d6b137330d361">01486</a>     <span class="keyword">virtual</span> <span class="keywordtype">double</span> <a class="code" href="classmp_movable_object.html#a5311360e42735073340d6b137330d361" title="Get inclusive top border of bounding box.">GetMaxY</a>() { <span class="keywordflow">return</span> m_bbox_max_y; }
<a name="l01487"></a>01487 
<a name="l01488"></a>01488     <span class="keyword">virtual</span> <span class="keywordtype">void</span>   Plot(wxDC &amp; dc, <a class="code" href="classmp_window.html" title="Canvas for plotting mpLayer implementations.">mpWindow</a> &amp; w);
<a name="l01489"></a>01489 <span class="comment"></span>
<a name="l01490"></a>01490 <span class="comment">    /** Set label axis alignment.</span>
<a name="l01491"></a>01491 <span class="comment">      *  @param align alignment (choose between mpALIGN_NE, mpALIGN_NW, mpALIGN_SW, mpALIGN_SE</span>
<a name="l01492"></a>01492 <span class="comment">      */</span>
<a name="l01493"></a><a class="code" href="classmp_movable_object.html#a072e60091d392ac19056dea8a634b32b">01493</a>     <span class="keywordtype">void</span> <a class="code" href="classmp_movable_object.html#a072e60091d392ac19056dea8a634b32b" title="Set label axis alignment.">SetAlign</a>(<span class="keywordtype">int</span> align) { m_flags = align; };
<a name="l01494"></a>01494 
<a name="l01495"></a>01495 <span class="keyword">protected</span>:
<a name="l01496"></a>01496     <span class="keywordtype">int</span> m_flags; <span class="comment">//!&lt; Holds label alignment</span>
<a name="l01497"></a>01497 <span class="comment"></span><span class="comment"></span>
<a name="l01498"></a>01498 <span class="comment">    /** The coordinates of the object (orientation &quot;phi&quot; is in radians).</span>
<a name="l01499"></a>01499 <span class="comment">      */</span>
<a name="l01500"></a><a class="code" href="classmp_movable_object.html#a88f46c90da8721ff99b18cabf611afdd">01500</a>     <span class="keywordtype">double</span> m_reference_x,<a class="code" href="classmp_movable_object.html#a88f46c90da8721ff99b18cabf611afdd">m_reference_y</a>,m_reference_phi;
<a name="l01501"></a>01501 <span class="comment"></span>
<a name="l01502"></a>01502 <span class="comment">    /** A method for 2D translation and rotation, using the current transformation stored in m_reference_x,m_reference_y,m_reference_phi.</span>
<a name="l01503"></a>01503 <span class="comment">      */</span>
<a name="l01504"></a>01504     <span class="keywordtype">void</span> TranslatePoint( <span class="keywordtype">double</span> x,<span class="keywordtype">double</span> <a class="code" href="namespace_eigen_1_1internal.html#a3d7a581aeb951248dc6fe114e9e05f07">y</a>, <span class="keywordtype">double</span> &amp;out_x, <span class="keywordtype">double</span> &amp;out_y );
<a name="l01505"></a>01505 <span class="comment"></span>
<a name="l01506"></a>01506 <span class="comment">    /** This contains the object points, in local coordinates (to be transformed by the current transformation).</span>
<a name="l01507"></a>01507 <span class="comment">      */</span>
<a name="l01508"></a><a class="code" href="classmp_movable_object.html#af4973f92cf8d90f66b2d954e58d84cb4">01508</a>     std::vector&lt;double&gt;  m_shape_xs,<a class="code" href="classmp_movable_object.html#af4973f92cf8d90f66b2d954e58d84cb4">m_shape_ys</a>;
<a name="l01509"></a>01509 <span class="comment"></span>
<a name="l01510"></a>01510 <span class="comment">    /** The buffer for the translated &amp; rotated points (to avoid recomputing them with each mpWindow refresh).</span>
<a name="l01511"></a>01511 <span class="comment">      *</span>
<a name="l01512"></a>01512 <span class="comment">      */</span>
<a name="l01513"></a><a class="code" href="classmp_movable_object.html#af712877d5535d8c97f5d562f551c186b">01513</a>     std::vector&lt;double&gt;  m_trans_shape_xs,<a class="code" href="classmp_movable_object.html#af712877d5535d8c97f5d562f551c186b">m_trans_shape_ys</a>;
<a name="l01514"></a>01514 <span class="comment"></span>
<a name="l01515"></a>01515 <span class="comment">    /** The precomputed bounding box:</span>
<a name="l01516"></a>01516 <span class="comment">      * @sa ShapeUpdated</span>
<a name="l01517"></a>01517 <span class="comment">      */</span>
<a name="l01518"></a><a class="code" href="classmp_movable_object.html#a284cacd5111e991854589d56b957667b">01518</a>     <span class="keywordtype">double</span>  m_bbox_min_x,m_bbox_max_x,<a class="code" href="classmp_movable_object.html#a284cacd5111e991854589d56b957667b">m_bbox_min_y</a>,m_bbox_max_y;
<a name="l01519"></a>01519 <span class="comment"></span>
<a name="l01520"></a>01520 <span class="comment">    /** Must be called by the descendent class after updating the shape (m_shape_xs/ys), or when the transformation changes.</span>
<a name="l01521"></a>01521 <span class="comment">      *  This method updates the buffers m_trans_shape_xs/ys, and the precomputed bounding box.</span>
<a name="l01522"></a>01522 <span class="comment">      */</span>
<a name="l01523"></a>01523     <span class="keywordtype">void</span> ShapeUpdated();
<a name="l01524"></a>01524 
<a name="l01525"></a>01525 };
<a name="l01526"></a>01526 
<a name="l01527"></a>01527 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01528"></a>01528 <span class="comment">// mpCovarianceEllipse  - provided by Jose Luis Blanco</span>
<a name="l01529"></a>01529 <span class="comment">//-----------------------------------------------------------------------------</span><span class="comment"></span>
<a name="l01530"></a>01530 <span class="comment">/** A 2D ellipse, described by a 2x2 covariance matrix.</span>
<a name="l01531"></a>01531 <span class="comment">  *  The relation between the multivariate Gaussian confidence interval and</span>
<a name="l01532"></a>01532 <span class="comment">  *   the &quot;quantiles&quot; in this class is:</span>
<a name="l01533"></a>01533 <span class="comment">  *     - 1 : 68.27% confidence interval</span>
<a name="l01534"></a>01534 <span class="comment">  *     - 2 : 95.45%</span>
<a name="l01535"></a>01535 <span class="comment">  *     - 3 : 99.73%</span>
<a name="l01536"></a>01536 <span class="comment">  *     - 4 : 99.994%</span>
<a name="l01537"></a>01537 <span class="comment">  * For example, see http://en.wikipedia.org/wiki/Normal_distribution#Standard_deviation_and_confidence_intervals</span>
<a name="l01538"></a>01538 <span class="comment">  *</span>
<a name="l01539"></a>01539 <span class="comment">  * The ellipse will be always centered at the origin. Use mpMovableObject::SetCoordinateBase to move it.</span>
<a name="l01540"></a>01540 <span class="comment">  */</span>
<a name="l01541"></a>01541 <span class="keyword">class </span><a class="code" href="mathplot_8h.html#a8ad8b0f95a03f1bc9ff4ed3947e96ea1">WXDLLIMPEXP_MATHPLOT</a> <a class="code" href="classmp_covariance_ellipse.html" title="A 2D ellipse, described by a 2x2 covariance matrix.">mpCovarianceEllipse</a> : <span class="keyword">public</span> <a class="code" href="classmp_movable_object.html" title="This virtual class represents objects that can be moved to an arbitrary 2D location+rotation.">mpMovableObject</a>
<a name="l01542"></a>01542 {
<a name="l01543"></a>01543 <span class="keyword">public</span>:<span class="comment"></span>
<a name="l01544"></a>01544 <span class="comment">    /** Default constructor.</span>
<a name="l01545"></a>01545 <span class="comment">      * Initializes to a unity diagonal covariance matrix, a 95% confidence interval (2 sigmas), 32 segments, and a continuous plot (m_continuous=true).</span>
<a name="l01546"></a>01546 <span class="comment">      */</span>
<a name="l01547"></a><a class="code" href="classmp_covariance_ellipse.html#ae4291cf1377ae20dd4614a8149010512">01547</a>     <a class="code" href="classmp_covariance_ellipse.html" title="A 2D ellipse, described by a 2x2 covariance matrix.">mpCovarianceEllipse</a>(
<a name="l01548"></a>01548         <span class="keywordtype">double</span> cov_00 = 1,
<a name="l01549"></a>01549         <span class="keywordtype">double</span> cov_11 = 1,
<a name="l01550"></a>01550         <span class="keywordtype">double</span> cov_01 = 0,
<a name="l01551"></a>01551         <span class="keywordtype">double</span> quantiles = 2,
<a name="l01552"></a>01552         <span class="keywordtype">int</span>    segments = 32,
<a name="l01553"></a>01553         <span class="keyword">const</span> wxString &amp; layerName = wxT(<span class="stringliteral">&quot;&quot;</span>) ) :
<a name="l01554"></a>01554             m_cov_00(cov_00),
<a name="l01555"></a>01555             m_cov_11(cov_11),
<a name="l01556"></a>01556             m_cov_01(cov_01),
<a name="l01557"></a>01557             m_quantiles(quantiles),
<a name="l01558"></a>01558             m_segments(segments)
<a name="l01559"></a>01559     {
<a name="l01560"></a>01560         m_continuous = <span class="keyword">true</span>;
<a name="l01561"></a>01561         m_name = layerName;
<a name="l01562"></a>01562         RecalculateShape();
<a name="l01563"></a>01563         m_type = <a class="code" href="mathplot_8h.html#a3e096aea2344c539195351495aed7e59afffaffd7444293b2187476c6393cf1fc" title="Plot type layer.">mpLAYER_PLOT</a>;
<a name="l01564"></a>01564     }
<a name="l01565"></a>01565 
<a name="l01566"></a><a class="code" href="classmp_covariance_ellipse.html#af4b162a12c28b2a97bd2d3d03da74eb6">01566</a>     <span class="keyword">virtual</span> <a class="code" href="classmp_covariance_ellipse.html#af4b162a12c28b2a97bd2d3d03da74eb6">~mpCovarianceEllipse</a>() {}
<a name="l01567"></a>01567 
<a name="l01568"></a><a class="code" href="classmp_covariance_ellipse.html#a038a7238449465ea72cf2670b4f14e5c">01568</a>     <span class="keywordtype">double</span> <a class="code" href="classmp_covariance_ellipse.html#a038a7238449465ea72cf2670b4f14e5c">GetQuantiles</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_quantiles; }
<a name="l01569"></a>01569 <span class="comment"></span>
<a name="l01570"></a>01570 <span class="comment">    /** Set how many &quot;quantiles&quot; to draw, that is, the confidence interval of the ellipse (see above).</span>
<a name="l01571"></a>01571 <span class="comment">      */</span>
<a name="l01572"></a><a class="code" href="classmp_covariance_ellipse.html#a7a5c0be7889c5a710e6d33a8f54bdc8b">01572</a>     <span class="keywordtype">void</span> SetQuantiles(<span class="keywordtype">double</span> q)
<a name="l01573"></a>01573     {
<a name="l01574"></a>01574         m_quantiles=q;
<a name="l01575"></a>01575         RecalculateShape();
<a name="l01576"></a>01576     }
<a name="l01577"></a>01577 
<a name="l01578"></a><a class="code" href="classmp_covariance_ellipse.html#a014543bf2b6a9512cc976c3e229f7c34">01578</a>     <span class="keywordtype">void</span> <a class="code" href="classmp_covariance_ellipse.html#a014543bf2b6a9512cc976c3e229f7c34">SetSegments</a>( <span class="keywordtype">int</span> segments ) { m_segments = segments; }
<a name="l01579"></a><a class="code" href="classmp_covariance_ellipse.html#a077b31031b14faee2dac33766ec472ad">01579</a>     <span class="keywordtype">int</span> <a class="code" href="classmp_covariance_ellipse.html#a077b31031b14faee2dac33766ec472ad">GetSegments</a>( )<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_segments; }
<a name="l01580"></a>01580 <span class="comment"></span>
<a name="l01581"></a>01581 <span class="comment">    /** Returns the elements of the current covariance matrix:</span>
<a name="l01582"></a>01582 <span class="comment">      */</span>
<a name="l01583"></a><a class="code" href="classmp_covariance_ellipse.html#a91b91251453e5fb6e50cd1c1f565caac">01583</a>     <span class="keywordtype">void</span> GetCovarianceMatrix( <span class="keywordtype">double</span> &amp;cov_00,<span class="keywordtype">double</span> &amp;cov_01,<span class="keywordtype">double</span> &amp;cov_11 )<span class="keyword"> const</span>
<a name="l01584"></a>01584 <span class="keyword">    </span>{
<a name="l01585"></a>01585         cov_00 = m_cov_00;
<a name="l01586"></a>01586         cov_01 = m_cov_01;
<a name="l01587"></a>01587         cov_11 = m_cov_11;
<a name="l01588"></a>01588     }
<a name="l01589"></a>01589 <span class="comment"></span>
<a name="l01590"></a>01590 <span class="comment">    /** Changes the covariance matrix:</span>
<a name="l01591"></a>01591 <span class="comment">      */</span>
<a name="l01592"></a><a class="code" href="classmp_covariance_ellipse.html#ab365219a552d12c06a242af35c1047eb">01592</a>     <span class="keywordtype">void</span> SetCovarianceMatrix( <span class="keywordtype">double</span> cov_00,<span class="keywordtype">double</span> cov_01,<span class="keywordtype">double</span> cov_11 )
<a name="l01593"></a>01593     {
<a name="l01594"></a>01594         m_cov_00 = cov_00;
<a name="l01595"></a>01595         m_cov_01 = cov_01;
<a name="l01596"></a>01596         m_cov_11 = cov_11;
<a name="l01597"></a>01597         RecalculateShape();
<a name="l01598"></a>01598     }
<a name="l01599"></a>01599 
<a name="l01600"></a>01600 <span class="keyword">protected</span>:<span class="comment"></span>
<a name="l01601"></a>01601 <span class="comment">    /** The elements of the matrix (only 3 since cov(0,1)=cov(1,0) in any positive definite matrix).</span>
<a name="l01602"></a>01602 <span class="comment">      */</span>
<a name="l01603"></a><a class="code" href="classmp_covariance_ellipse.html#a1629ced4ca2c63ff10fd487207d06f52">01603</a>     <span class="keywordtype">double</span> m_cov_00,<a class="code" href="classmp_covariance_ellipse.html#a1629ced4ca2c63ff10fd487207d06f52">m_cov_11</a>,m_cov_01;
<a name="l01604"></a><a class="code" href="classmp_covariance_ellipse.html#a58cf80f82ec4effb0c5978945fa9da1a">01604</a>     <span class="keywordtype">double</span> <a class="code" href="classmp_covariance_ellipse.html#a58cf80f82ec4effb0c5978945fa9da1a">m_quantiles</a>;
<a name="l01605"></a>01605 <span class="comment"></span>
<a name="l01606"></a>01606 <span class="comment">    /** The number of line segments that build up the ellipse.</span>
<a name="l01607"></a>01607 <span class="comment">      */</span>
<a name="l01608"></a><a class="code" href="classmp_covariance_ellipse.html#abcd2d8c396d49e4e1a34af62c9b91130">01608</a>     <span class="keywordtype">int</span> <a class="code" href="classmp_covariance_ellipse.html#abcd2d8c396d49e4e1a34af62c9b91130" title="The number of line segments that build up the ellipse.">m_segments</a>;
<a name="l01609"></a>01609 <span class="comment"></span>
<a name="l01610"></a>01610 <span class="comment">    /** Called to update the m_shape_xs, m_shape_ys vectors, whenever a parameter changes.</span>
<a name="l01611"></a>01611 <span class="comment">      */</span>
<a name="l01612"></a>01612     <span class="keywordtype">void</span> RecalculateShape();
<a name="l01613"></a>01613 };
<a name="l01614"></a>01614 
<a name="l01615"></a>01615 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01616"></a>01616 <span class="comment">// mpPolygon - provided by Jose Luis Blanco</span>
<a name="l01617"></a>01617 <span class="comment">//-----------------------------------------------------------------------------</span><span class="comment"></span>
<a name="l01618"></a>01618 <span class="comment">/** An arbitrary polygon, descendant of mpMovableObject.</span>
<a name="l01619"></a>01619 <span class="comment">  *  Use &quot;setPoints&quot; to set the list of N points. This class also can draw non-closed polygons by</span>
<a name="l01620"></a>01620 <span class="comment">  *   passing the appropriate parameters to &quot;setPoints&quot;. To draw a point-cloud, call &quot;SetContinuity(false)&quot;.</span>
<a name="l01621"></a>01621 <span class="comment">  */</span>
<a name="l01622"></a>01622 <span class="keyword">class </span><a class="code" href="mathplot_8h.html#a8ad8b0f95a03f1bc9ff4ed3947e96ea1">WXDLLIMPEXP_MATHPLOT</a> <a class="code" href="classmp_polygon.html" title="An arbitrary polygon, descendant of mpMovableObject.">mpPolygon</a> : <span class="keyword">public</span> <a class="code" href="classmp_movable_object.html" title="This virtual class represents objects that can be moved to an arbitrary 2D location+rotation.">mpMovableObject</a>
<a name="l01623"></a>01623 {
<a name="l01624"></a>01624 <span class="keyword">public</span>:<span class="comment"></span>
<a name="l01625"></a>01625 <span class="comment">    /** Default constructor.</span>
<a name="l01626"></a>01626 <span class="comment">      */</span>
<a name="l01627"></a><a class="code" href="classmp_polygon.html#a56015a5b4419ab332ac091e5fd57e759">01627</a>     <a class="code" href="classmp_polygon.html" title="An arbitrary polygon, descendant of mpMovableObject.">mpPolygon</a>( <span class="keyword">const</span> wxString &amp; layerName = wxT(<span class="stringliteral">&quot;&quot;</span>) )
<a name="l01628"></a>01628     {
<a name="l01629"></a>01629         m_continuous = <span class="keyword">true</span>;
<a name="l01630"></a>01630         m_name = layerName;
<a name="l01631"></a>01631     }
<a name="l01632"></a>01632 
<a name="l01633"></a><a class="code" href="classmp_polygon.html#add5667fff8e8065bdb1fe6028f55fcc8">01633</a>     <span class="keyword">virtual</span> <a class="code" href="classmp_polygon.html#add5667fff8e8065bdb1fe6028f55fcc8">~mpPolygon</a>() {}
<a name="l01634"></a>01634 <span class="comment"></span>
<a name="l01635"></a>01635 <span class="comment">    /** Set the points in the polygon.</span>
<a name="l01636"></a>01636 <span class="comment">      * @param points_xs  The X coordinates of the points.</span>
<a name="l01637"></a>01637 <span class="comment">      * @param points_ys  The Y coordinates of the points.</span>
<a name="l01638"></a>01638 <span class="comment">      * @param closedShape If set to true, an additional segment will be added from the last to the first point.</span>
<a name="l01639"></a>01639 <span class="comment">      */</span>
<a name="l01640"></a>01640     <span class="keywordtype">void</span> setPoints(
<a name="l01641"></a>01641         <span class="keyword">const</span> <a class="code" href="classstd_1_1vector.html">std::vector&lt;double&gt;</a>&amp;  points_xs,
<a name="l01642"></a>01642         <span class="keyword">const</span> <a class="code" href="classstd_1_1vector.html">std::vector&lt;double&gt;</a>&amp;  points_ys,
<a name="l01643"></a>01643         <span class="keywordtype">bool</span>                   closedShape=<span class="keyword">true</span> );
<a name="l01644"></a>01644 <span class="comment"></span>
<a name="l01645"></a>01645 <span class="comment">    /** Set the points in the polygon.</span>
<a name="l01646"></a>01646 <span class="comment">      * @param points_xs  The X coordinates of the points.</span>
<a name="l01647"></a>01647 <span class="comment">      * @param points_ys  The Y coordinates of the points.</span>
<a name="l01648"></a>01648 <span class="comment">      * @param closedShape If set to true, an additional segment will be added from the last to the first point.</span>
<a name="l01649"></a>01649 <span class="comment">      */</span>
<a name="l01650"></a>01650     <span class="keywordtype">void</span> setPoints(
<a name="l01651"></a>01651         <span class="keyword">const</span> <a class="code" href="classstd_1_1vector.html">std::vector&lt;float&gt;</a>&amp;  points_xs,
<a name="l01652"></a>01652         <span class="keyword">const</span> <a class="code" href="classstd_1_1vector.html">std::vector&lt;float&gt;</a>&amp;  points_ys,
<a name="l01653"></a>01653         <span class="keywordtype">bool</span>                   closedShape=<span class="keyword">true</span> );
<a name="l01654"></a>01654 
<a name="l01655"></a>01655 
<a name="l01656"></a>01656 
<a name="l01657"></a>01657 };
<a name="l01658"></a>01658 
<a name="l01659"></a>01659 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l01660"></a>01660 <span class="comment">// mpMovableObject  - provided by Jose Luis Blanco</span>
<a name="l01661"></a>01661 <span class="comment">//-----------------------------------------------------------------------------</span><span class="comment"></span>
<a name="l01662"></a>01662 <span class="comment">/** This virtual class represents objects that can be moved to an arbitrary 2D location+rotation.</span>
<a name="l01663"></a>01663 <span class="comment">  *  The current transformation is set through SetCoordinateBase.</span>
<a name="l01664"></a>01664 <span class="comment">  *  To ease the implementation of descendent classes, mpMovableObject will</span>
<a name="l01665"></a>01665 <span class="comment">  *  be in charge of Bounding Box computation and layer render, assuming that</span>
<a name="l01666"></a>01666 <span class="comment">  *  the object updates its shape in m_shape_xs &amp; m_shape_ys.</span>
<a name="l01667"></a>01667 <span class="comment">  */</span>
<a name="l01668"></a>01668 <span class="keyword">class </span><a class="code" href="mathplot_8h.html#a8ad8b0f95a03f1bc9ff4ed3947e96ea1">WXDLLIMPEXP_MATHPLOT</a> <a class="code" href="classmp_bitmap_layer.html" title="This virtual class represents objects that can be moved to an arbitrary 2D location+rotation.">mpBitmapLayer</a> : <span class="keyword">public</span> <a class="code" href="classmp_layer.html" title="Plot layer, abstract base class.">mpLayer</a>
<a name="l01669"></a>01669 {
<a name="l01670"></a>01670 <span class="keyword">public</span>:<span class="comment"></span>
<a name="l01671"></a>01671 <span class="comment">    /** Default constructor.</span>
<a name="l01672"></a>01672 <span class="comment">      */</span>
<a name="l01673"></a><a class="code" href="classmp_bitmap_layer.html#a9d27f419f5e449b1e87a15405229d473">01673</a>     <a class="code" href="classmp_bitmap_layer.html" title="This virtual class represents objects that can be moved to an arbitrary 2D location+rotation.">mpBitmapLayer</a>( )
<a name="l01674"></a>01674     {
<a name="l01675"></a>01675         m_min_x = m_max_x =
<a name="l01676"></a>01676         m_min_y = m_max_y = 0;
<a name="l01677"></a>01677         m_validImg = <span class="keyword">false</span>;
<a name="l01678"></a>01678         m_type = <a class="code" href="mathplot_8h.html#a3e096aea2344c539195351495aed7e59a69f5473c74b89fe17ed5c29c6362e6b2" title="Bitmap type layer.">mpLAYER_BITMAP</a>;
<a name="l01679"></a>01679     }
<a name="l01680"></a>01680 
<a name="l01681"></a><a class="code" href="classmp_bitmap_layer.html#a912ae11cb82f37ea83ea269c3177f153">01681</a>     <span class="keyword">virtual</span> <a class="code" href="classmp_bitmap_layer.html#a912ae11cb82f37ea83ea269c3177f153">~mpBitmapLayer</a>() {};
<a name="l01682"></a>01682 <span class="comment"></span>
<a name="l01683"></a>01683 <span class="comment">    /** Returns a copy of the current bitmap assigned to the layer.</span>
<a name="l01684"></a>01684 <span class="comment">      */</span>
<a name="l01685"></a>01685     <span class="keywordtype">void</span> GetBitmapCopy( wxImage &amp;outBmp ) <span class="keyword">const</span>;
<a name="l01686"></a>01686 <span class="comment"></span>
<a name="l01687"></a>01687 <span class="comment">    /** Change the bitmap associated with the layer (to update the screen, refresh the mpWindow).</span>
<a name="l01688"></a>01688 <span class="comment">      *  @param inBmp The bitmap to associate. A copy is made, thus it can be released after calling this.</span>
<a name="l01689"></a>01689 <span class="comment">      *  @param x The left corner X coordinate (in plot units).</span>
<a name="l01690"></a>01690 <span class="comment">      *  @param y The top corner Y coordinate (in plot units).</span>
<a name="l01691"></a>01691 <span class="comment">      *  @param lx The width in plot units.</span>
<a name="l01692"></a>01692 <span class="comment">      *  @param ly The height in plot units.</span>
<a name="l01693"></a>01693 <span class="comment">      */</span>
<a name="l01694"></a>01694     <span class="keywordtype">void</span> SetBitmap( <span class="keyword">const</span> wxImage &amp;inBmp, <span class="keywordtype">double</span> x, <span class="keywordtype">double</span> <a class="code" href="namespace_eigen_1_1internal.html#a3d7a581aeb951248dc6fe114e9e05f07">y</a>, <span class="keywordtype">double</span> lx, <span class="keywordtype">double</span> ly );
<a name="l01695"></a>01695 
<a name="l01696"></a><a class="code" href="classmp_bitmap_layer.html#ab49c42d6266878610331ece65c0f2245">01696</a>     <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classmp_bitmap_layer.html#ab49c42d6266878610331ece65c0f2245" title="Check whether this layer has a bounding box.">HasBBox</a>() { <span class="keywordflow">return</span> <span class="keyword">true</span>; }
<a name="l01697"></a>01697 <span class="comment"></span>
<a name="l01698"></a>01698 <span class="comment">    /** Get inclusive left border of bounding box.</span>
<a name="l01699"></a>01699 <span class="comment">    */</span>
<a name="l01700"></a><a class="code" href="classmp_bitmap_layer.html#a9d75d9e2046dd95f17487647c8c20472">01700</a>     <span class="keyword">virtual</span> <span class="keywordtype">double</span> <a class="code" href="classmp_bitmap_layer.html#a9d75d9e2046dd95f17487647c8c20472" title="Get inclusive left border of bounding box.">GetMinX</a>() { <span class="keywordflow">return</span> m_min_x; }
<a name="l01701"></a>01701 <span class="comment"></span>
<a name="l01702"></a>01702 <span class="comment">    /** Get inclusive right border of bounding box.</span>
<a name="l01703"></a>01703 <span class="comment">    */</span>
<a name="l01704"></a><a class="code" href="classmp_bitmap_layer.html#a6d594813500cabd412d9a466b2e9095f">01704</a>     <span class="keyword">virtual</span> <span class="keywordtype">double</span> <a class="code" href="classmp_bitmap_layer.html#a6d594813500cabd412d9a466b2e9095f" title="Get inclusive right border of bounding box.">GetMaxX</a>() { <span class="keywordflow">return</span>  m_max_x; }
<a name="l01705"></a>01705 <span class="comment"></span>
<a name="l01706"></a>01706 <span class="comment">    /** Get inclusive bottom border of bounding box.</span>
<a name="l01707"></a>01707 <span class="comment">    */</span>
<a name="l01708"></a><a class="code" href="classmp_bitmap_layer.html#a06b6b2b66bd116b07340511c2785ddec">01708</a>     <span class="keyword">virtual</span> <span class="keywordtype">double</span> <a class="code" href="classmp_bitmap_layer.html#a06b6b2b66bd116b07340511c2785ddec" title="Get inclusive bottom border of bounding box.">GetMinY</a>() { <span class="keywordflow">return</span> m_min_y; }
<a name="l01709"></a>01709 <span class="comment"></span>
<a name="l01710"></a>01710 <span class="comment">    /** Get inclusive top border of bounding box.</span>
<a name="l01711"></a>01711 <span class="comment">    */</span>
<a name="l01712"></a><a class="code" href="classmp_bitmap_layer.html#afe0a3f0072c582db4de9dcc20000fa77">01712</a>     <span class="keyword">virtual</span> <span class="keywordtype">double</span> <a class="code" href="classmp_bitmap_layer.html#afe0a3f0072c582db4de9dcc20000fa77" title="Get inclusive top border of bounding box.">GetMaxY</a>() { <span class="keywordflow">return</span> m_max_y; }
<a name="l01713"></a>01713 
<a name="l01714"></a>01714     <span class="keyword">virtual</span> <span class="keywordtype">void</span>   Plot(wxDC &amp; dc, <a class="code" href="classmp_window.html" title="Canvas for plotting mpLayer implementations.">mpWindow</a> &amp; w);
<a name="l01715"></a>01715 <span class="comment"></span>
<a name="l01716"></a>01716 <span class="comment">    /** Set label axis alignment.</span>
<a name="l01717"></a>01717 <span class="comment">      *  @param align alignment (choose between mpALIGN_NE, mpALIGN_NW, mpALIGN_SW, mpALIGN_SE</span>
<a name="l01718"></a>01718 <span class="comment">      */</span>
<a name="l01719"></a><a class="code" href="classmp_bitmap_layer.html#a9436c219c4cd680b68b7c17f39ae36fc">01719</a>     <span class="keywordtype">void</span> <a class="code" href="classmp_bitmap_layer.html#a9436c219c4cd680b68b7c17f39ae36fc" title="Set label axis alignment.">SetAlign</a>(<span class="keywordtype">int</span> align) { m_flags = align; };
<a name="l01720"></a>01720 
<a name="l01721"></a>01721 <span class="keyword">protected</span>:
<a name="l01722"></a>01722     <span class="keywordtype">int</span> m_flags; <span class="comment">//!&lt; Holds label alignment</span>
<a name="l01723"></a>01723 <span class="comment"></span><span class="comment"></span>
<a name="l01724"></a>01724 <span class="comment">    /** The internal copy of the Bitmap:</span>
<a name="l01725"></a>01725 <span class="comment">      */</span>
<a name="l01726"></a><a class="code" href="classmp_bitmap_layer.html#a7fc0a8438243b25c0a0246808b67ba95">01726</a>     wxImage      <a class="code" href="classmp_bitmap_layer.html#a7fc0a8438243b25c0a0246808b67ba95" title="The internal copy of the Bitmap:">m_bitmap</a>;
<a name="l01727"></a><a class="code" href="classmp_bitmap_layer.html#a6896b9aa07ca0f30169b2def0b9dc8ae">01727</a>     wxBitmap     <a class="code" href="classmp_bitmap_layer.html#a6896b9aa07ca0f30169b2def0b9dc8ae">m_scaledBitmap</a>;
<a name="l01728"></a><a class="code" href="classmp_bitmap_layer.html#ae65dd97638d1a529236d3d84624a116c">01728</a>     wxCoord      m_scaledBitmap_offset_x,<a class="code" href="classmp_bitmap_layer.html#ae65dd97638d1a529236d3d84624a116c">m_scaledBitmap_offset_y</a>;
<a name="l01729"></a>01729 
<a name="l01730"></a>01730 
<a name="l01731"></a><a class="code" href="classmp_bitmap_layer.html#a2fadf84c6982996f2075ee928f36ccac">01731</a>     <span class="keywordtype">bool</span>            <a class="code" href="classmp_bitmap_layer.html#a2fadf84c6982996f2075ee928f36ccac">m_validImg</a>;
<a name="l01732"></a>01732 
<a name="l01733"></a>01733 <span class="comment"></span>
<a name="l01734"></a>01734 <span class="comment">    /** The shape of the bitmap:</span>
<a name="l01735"></a>01735 <span class="comment">      */</span>
<a name="l01736"></a><a class="code" href="classmp_bitmap_layer.html#a8021506605435a542f1d1ea595c8b4dc">01736</a>     <span class="keywordtype">double</span>  m_min_x,m_max_x,<a class="code" href="classmp_bitmap_layer.html#a8021506605435a542f1d1ea595c8b4dc">m_min_y</a>,m_max_y;
<a name="l01737"></a>01737 
<a name="l01738"></a>01738 
<a name="l01739"></a>01739 };
<a name="l01740"></a>01740 
<a name="l01741"></a>01741 
<a name="l01742"></a>01742 <span class="comment"></span>
<a name="l01743"></a>01743 <span class="comment">/*@}*/</span>
<a name="l01744"></a>01744 
<a name="l01745"></a>01745 <span class="preprocessor">#if defined(_MSC_VER)</span>
<a name="l01746"></a>01746 <span class="preprocessor"></span><span class="preprocessor">        #pragma warning(pop)</span>
<a name="l01747"></a>01747 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l01748"></a>01748 <span class="preprocessor"></span>
<a name="l01749"></a>01749 
<a name="l01750"></a>01750 <span class="preprocessor">#endif // _MP_MATHPLOT_H_</span>
</pre></div></div>
</div>
<br><hr><br> <table border="0" width="100%"> <tr> <td> Page generated by <a href="http://www.doxygen.org" target="_blank">Doxygen 1.7.5</a> for MRPT 0.9.5 SVN: at Sun Sep 25 17:20:18 UTC 2011</td><td></td> <td width="100"> </td> <td width="150">  </td></tr> </table>  </body></html>