⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qwt__plot__grid_8cpp-source.html

📁 QWT5.01用于Qt开发的二维图形库程序
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!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>Qwt User&apos;s Guide: qwt_plot_grid.cpp Source File</title><link href="doxygen.css" rel="stylesheet" type="text/css"><link href="tabs.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.4.6 --><div class="tabs">  <ul>    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>    <li><a href="classes.html"><span>Classes</span></a></li>    <li id="current"><a href="files.html"><span>Files</span></a></li>    <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>  </ul></div><h1>qwt_plot_grid.cpp</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************</span><a name="l00002"></a>00002 <span class="comment"> * Qwt Widget Library</span><a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 1997   Josef Wilgen</span><a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002   Uwe Rathmann</span><a name="l00005"></a>00005 <span class="comment"> * </span><a name="l00006"></a>00006 <span class="comment"> * This library is free software; you can redistribute it and/or</span><a name="l00007"></a>00007 <span class="comment"> * modify it under the terms of the Qwt License, Version 1.0</span><a name="l00008"></a>00008 <span class="comment"> *****************************************************************************/</span><a name="l00009"></a>00009 <a name="l00010"></a>00010 <span class="preprocessor">#include &lt;qpainter.h&gt;</span><a name="l00011"></a>00011 <span class="preprocessor">#include &lt;qpen.h&gt;</span><a name="l00012"></a>00012 <span class="preprocessor">#include "qwt_painter.h"</span><a name="l00013"></a>00013 <span class="preprocessor">#include "qwt_text.h"</span><a name="l00014"></a>00014 <span class="preprocessor">#include "qwt_scale_map.h"</span><a name="l00015"></a>00015 <span class="preprocessor">#include "qwt_scale_div.h"</span><a name="l00016"></a>00016 <span class="preprocessor">#include "qwt_plot_grid.h"</span><a name="l00017"></a>00017 <a name="l00018"></a>00018 <span class="keyword">class </span>QwtPlotGrid::PrivateData<a name="l00019"></a>00019 {<a name="l00020"></a>00020 <span class="keyword">public</span>:<a name="l00021"></a>00021     PrivateData():<a name="l00022"></a>00022         <a class="code" href="class_qwt_plot_grid.html#46d19c58295d538518586374efadd34c">xEnabled</a>(true),<a name="l00023"></a>00023         <a class="code" href="class_qwt_plot_grid.html#d0f38876f49c5197e929ab80e389dbb5">yEnabled</a>(true),<a name="l00024"></a>00024         <a class="code" href="class_qwt_plot_grid.html#2eeb5b2118f35409cb1450c2a032e8ff">xMinEnabled</a>(false),<a name="l00025"></a>00025         <a class="code" href="class_qwt_plot_grid.html#f677551f6121de684888af6e2b77333f">yMinEnabled</a>(false)<a name="l00026"></a>00026     {<a name="l00027"></a>00027     }<a name="l00028"></a>00028 <a name="l00029"></a>00029     <span class="keywordtype">bool</span> <a class="code" href="class_qwt_plot_grid.html#46d19c58295d538518586374efadd34c">xEnabled</a>;<a name="l00030"></a>00030     <span class="keywordtype">bool</span> <a class="code" href="class_qwt_plot_grid.html#d0f38876f49c5197e929ab80e389dbb5">yEnabled</a>;<a name="l00031"></a>00031     <span class="keywordtype">bool</span> <a class="code" href="class_qwt_plot_grid.html#2eeb5b2118f35409cb1450c2a032e8ff">xMinEnabled</a>;<a name="l00032"></a>00032     <span class="keywordtype">bool</span> <a class="code" href="class_qwt_plot_grid.html#f677551f6121de684888af6e2b77333f">yMinEnabled</a>;<a name="l00033"></a>00033 <a name="l00034"></a>00034     <a class="code" href="class_qwt_scale_div.html">QwtScaleDiv</a> sdx;<a name="l00035"></a>00035     <a class="code" href="class_qwt_scale_div.html">QwtScaleDiv</a> sdy;<a name="l00036"></a>00036 <a name="l00037"></a>00037     QPen <a class="code" href="class_qwt_plot_grid.html#00cad53a757c6e724a68cc90eb1881bf">majPen</a>;<a name="l00038"></a>00038     QPen <a class="code" href="class_qwt_plot_grid.html#dbbaea0c1ba977aa40403f8ca6b13d8d">minPen</a>;<a name="l00039"></a>00039 };<a name="l00040"></a>00040 <a name="l00042"></a><a class="code" href="class_qwt_plot_grid.html#43001238f3024c15baa8ae61b29ae170">00042</a> <a class="code" href="class_qwt_plot_grid.html#43001238f3024c15baa8ae61b29ae170">QwtPlotGrid::QwtPlotGrid</a>():<a name="l00043"></a>00043     <a class="code" href="class_qwt_plot_item.html">QwtPlotItem</a>(<a class="code" href="class_qwt_text.html">QwtText</a>(<span class="stringliteral">"Grid"</span>))<a name="l00044"></a>00044 {<a name="l00045"></a>00045     d_data = <span class="keyword">new</span> PrivateData;<a name="l00046"></a>00046     <a class="code" href="class_qwt_plot_item.html#57d90e4146133b59d589c71b3a643e82">setZ</a>(10.0);<a name="l00047"></a>00047 }<a name="l00048"></a>00048 <a name="l00050"></a><a class="code" href="class_qwt_plot_grid.html#f39443cd91b8a96a797af1d6b78bfab3">00050</a> <a class="code" href="class_qwt_plot_grid.html#f39443cd91b8a96a797af1d6b78bfab3">QwtPlotGrid::~QwtPlotGrid</a>()<a name="l00051"></a>00051 {<a name="l00052"></a>00052     <span class="keyword">delete</span> d_data;<a name="l00053"></a>00053 }<a name="l00054"></a>00054 <a name="l00055"></a><a class="code" href="class_qwt_plot_grid.html#ae0d0b5afbc670dd257302b13601ea99">00055</a> <span class="keywordtype">int</span> <a class="code" href="class_qwt_plot_grid.html#ae0d0b5afbc670dd257302b13601ea99">QwtPlotGrid::rtti</a>()<span class="keyword"> const</span><a name="l00056"></a>00056 <span class="keyword"></span>{<a name="l00057"></a>00057     <span class="keywordflow">return</span> QwtPlotItem::Rtti_PlotGrid;<a name="l00058"></a>00058 }<a name="l00059"></a>00059 <a name="l00067"></a><a class="code" href="class_qwt_plot_grid.html#ba4de91f74f86e172e080fa62765bba8">00067</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_plot_grid.html#ba4de91f74f86e172e080fa62765bba8">QwtPlotGrid::enableX</a>(<span class="keywordtype">bool</span> tf)<a name="l00068"></a>00068 {<a name="l00069"></a>00069     <span class="keywordflow">if</span> ( d_data-&gt;xEnabled != tf )<a name="l00070"></a>00070     {<a name="l00071"></a>00071         d_data-&gt;xEnabled = tf;<a name="l00072"></a>00072         <a class="code" href="class_qwt_plot_item.html#d956fdbce5b0721abccce6d09fe4d5ce">itemChanged</a>();<a name="l00073"></a>00073     }<a name="l00074"></a>00074 }<a name="l00075"></a>00075 <a name="l00081"></a><a class="code" href="class_qwt_plot_grid.html#0172d8af861495a94aa856af26ad786d">00081</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_plot_grid.html#0172d8af861495a94aa856af26ad786d">QwtPlotGrid::enableY</a>(<span class="keywordtype">bool</span> tf)<a name="l00082"></a>00082 {<a name="l00083"></a>00083     <span class="keywordflow">if</span> ( d_data-&gt;yEnabled != tf )<a name="l00084"></a>00084     {<a name="l00085"></a>00085         d_data-&gt;yEnabled = tf;  <a name="l00086"></a>00086         <a class="code" href="class_qwt_plot_item.html#d956fdbce5b0721abccce6d09fe4d5ce">itemChanged</a>();<a name="l00087"></a>00087     }<a name="l00088"></a>00088 }<a name="l00089"></a>00089 <a name="l00095"></a><a class="code" href="class_qwt_plot_grid.html#4106c58c9d463bd4ccd94e215cc246bb">00095</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_plot_grid.html#4106c58c9d463bd4ccd94e215cc246bb">QwtPlotGrid::enableXMin</a>(<span class="keywordtype">bool</span> tf)<a name="l00096"></a>00096 {<a name="l00097"></a>00097     <span class="keywordflow">if</span> ( d_data-&gt;xMinEnabled != tf )<a name="l00098"></a>00098     {<a name="l00099"></a>00099         d_data-&gt;xMinEnabled = tf;<a name="l00100"></a>00100         <a class="code" href="class_qwt_plot_item.html#d956fdbce5b0721abccce6d09fe4d5ce">itemChanged</a>();<a name="l00101"></a>00101     }<a name="l00102"></a>00102 }<a name="l00103"></a>00103 <a name="l00109"></a><a class="code" href="class_qwt_plot_grid.html#21b26d5b6b0745ecdec12d6bdeb8ecb4">00109</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_plot_grid.html#21b26d5b6b0745ecdec12d6bdeb8ecb4">QwtPlotGrid::enableYMin</a>(<span class="keywordtype">bool</span> tf)<a name="l00110"></a>00110 {<a name="l00111"></a>00111     <span class="keywordflow">if</span> ( d_data-&gt;yMinEnabled != tf )<a name="l00112"></a>00112     {<a name="l00113"></a>00113         d_data-&gt;yMinEnabled = tf;<a name="l00114"></a>00114         <a class="code" href="class_qwt_plot_item.html#d956fdbce5b0721abccce6d09fe4d5ce">itemChanged</a>();<a name="l00115"></a>00115     }<a name="l00116"></a>00116 }<a name="l00117"></a>00117 <a name="l00124"></a><a class="code" href="class_qwt_plot_grid.html#eeb88397c2aaf5e763d57c898a2fcd13">00124</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_plot_grid.html#eeb88397c2aaf5e763d57c898a2fcd13">QwtPlotGrid::setXDiv</a>(<span class="keyword">const</span> <a class="code" href="class_qwt_scale_div.html">QwtScaleDiv</a> &amp;sx)<a name="l00125"></a>00125 {<a name="l00126"></a>00126     <span class="keywordflow">if</span> ( d_data-&gt;sdx != sx )<a name="l00127"></a>00127     {<a name="l00128"></a>00128         d_data-&gt;sdx = sx;<a name="l00129"></a>00129         <a class="code" href="class_qwt_plot_item.html#d956fdbce5b0721abccce6d09fe4d5ce">itemChanged</a>();<a name="l00130"></a>00130     }<a name="l00131"></a>00131 }<a name="l00132"></a>00132 <a name="l00139"></a><a class="code" href="class_qwt_plot_grid.html#9eb130275560bdaa65551e2f69232b72">00139</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_plot_grid.html#9eb130275560bdaa65551e2f69232b72">QwtPlotGrid::setYDiv</a>(<span class="keyword">const</span> <a class="code" href="class_qwt_scale_div.html">QwtScaleDiv</a> &amp;sy)<a name="l00140"></a>00140 {<a name="l00141"></a>00141     <span class="keywordflow">if</span> ( d_data-&gt;sdy != sy )<a name="l00142"></a>00142     {<a name="l00143"></a>00143         d_data-&gt;sdy = sy;    <a name="l00144"></a>00144         <a class="code" href="class_qwt_plot_item.html#d956fdbce5b0721abccce6d09fe4d5ce">itemChanged</a>();<a name="l00145"></a>00145     }<a name="l00146"></a>00146 }<a name="l00147"></a>00147 <a name="l00153"></a><a class="code" href="class_qwt_plot_grid.html#d84a6b1110d593af76e5e777ae1e8bfe">00153</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_plot_grid.html#d84a6b1110d593af76e5e777ae1e8bfe">QwtPlotGrid::setPen</a>(<span class="keyword">const</span> QPen &amp;p)<a name="l00154"></a>00154 {<a name="l00155"></a>00155     <span class="keywordflow">if</span> ( d_data-&gt;majPen != p || d_data-&gt;minPen != p )<a name="l00156"></a>00156     {<a name="l00157"></a>00157         d_data-&gt;majPen = p;<a name="l00158"></a>00158         d_data-&gt;minPen = p;<a name="l00159"></a>00159         <a class="code" href="class_qwt_plot_item.html#d956fdbce5b0721abccce6d09fe4d5ce">itemChanged</a>();<a name="l00160"></a>00160     }<a name="l00161"></a>00161 }<a name="l00162"></a>00162 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -