📄 fg__rect_8h-source.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=gb2312"><title>FishGUI: FG_Rect.h Source File</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- 制作者 Doxygen 1.3.6 --><div class="qindex"><a class="qindex" href="main.html">首页</a> | <a class="qindex" href="modules.html">模块</a> | <a class="qindex" href="hierarchy.html">类继承关系</a> | <a class="qindex" href="classes.html">按字典顺序排序的列表</a> | <a class="qindex" href="annotated.html">组合类型列表</a> | <a class="qindex" href="files.html">文件列表</a> | <a class="qindex" href="functions.html">组合类型成员</a> | <a class="qindex" href="globals.html">文件成员</a></div><h1>FG_Rect.h</h1><a href="FG__Rect_8h.html">浏览该文件的文档。</a><div class="fragment"><pre>00001 <span class="comment">/*--------------------------------------------------------------------------</span>00002 <span class="comment"></span>00003 <span class="comment"> FG_Rect.h - 矩形结构的头文件</span>00004 <span class="comment"></span>00005 <span class="comment"> 本程序是FishGUI软件的一部分</span>00006 <span class="comment"></span>00007 <span class="comment"> 版权所有 (C) 2003,2004 王咏武</span>00008 <span class="comment"> http://www.contextfree.net/wangyw/</span>00009 <span class="comment"></span>00010 <span class="comment">----------------------------------------------------------------------------</span>00011 <span class="comment"></span>00012 <span class="comment"> 作者对 FishGUI 软件及其所有源代码授权如下:</span>00013 <span class="comment"></span>00014 <span class="comment"> 允许任何个人、组织、机构、企业无偿获得、修改、使用、重新发布 FishGUI 软</span>00015 <span class="comment"> 件及其源代码,或按照有偿或者无偿的方式发行基于 FishGUI 源代码的全部或部</span>00016 <span class="comment"> 分内容开发的软件产品,——但行使以上权利时,须遵守以下约定:</span>00017 <span class="comment"></span>00018 <span class="comment"> 1、重新发布 FishGUI 软件及其源代码时,不得隐去软件及其源代码中原有的版</span>00019 <span class="comment"> 权信息和开发者标识。</span>00020 <span class="comment"></span>00021 <span class="comment"> 2、发行基于 FishGUI 源代码的全部或部分内容开发的软件产品时,必须在产品</span>00022 <span class="comment"> 的显著位置标明以下字样:</span>00023 <span class="comment"></span>00024 <span class="comment"> 【本产品的一部分功能是基于王咏武在 FishGUI 软件中的工作完成的】</span>00025 <span class="comment"></span>00026 <span class="comment"> 3、在正式出版物中引用 FishGUI 的文档、源代码或注释内容的,应注明软件的</span>00027 <span class="comment"> 原作者为王咏武。</span>00028 <span class="comment"></span>00029 <span class="comment">--------------------------------------------------------------------------*/</span>00040 <span class="preprocessor">#ifndef FG_RECT_H_HEADER_INCLUDED_C0B10BA4</span>00041 <span class="preprocessor"></span><span class="preprocessor">#define FG_RECT_H_HEADER_INCLUDED_C0B10BA4</span>00042 <span class="preprocessor"></span>00043 <span class="preprocessor">#include "<a class="code" href="FG__Point_8h.html">FG_Point.h</a>"</span>00044 00045 <span class="comment">//##ModelId=3F4EC135021A</span><a name="l00050"></a><a class="code" href="structFG__Rect.html">00050</a> <span class="comment"></span><span class="keyword">struct </span><a class="code" href="structFG__Rect.html">FG_Rect</a>00051 {00052 <span class="comment">//##ModelId=3F4EC4780094</span><a name="l00053"></a><a class="code" href="structFG__Rect.html#o0">00053</a> <span class="keywordtype">short</span> <a class="code" href="structFG__Rect.html#o0">wLeft</a>; 00054 <span class="comment">//##ModelId=3F4EC47800B2</span><a name="l00055"></a><a class="code" href="structFG__Rect.html#o1">00055</a> <span class="keywordtype">short</span> <a class="code" href="structFG__Rect.html#o1">wTop</a>; 00056 <span class="comment">//##ModelId=3F4EC47800D0</span><a name="l00057"></a><a class="code" href="structFG__Rect.html#o2">00057</a> <span class="keywordtype">short</span> <a class="code" href="structFG__Rect.html#o2">wRight</a>; 00058 <span class="comment">//##ModelId=3F4EC47800EE</span><a name="l00059"></a><a class="code" href="structFG__Rect.html#o3">00059</a> <span class="keywordtype">short</span> <a class="code" href="structFG__Rect.html#o3">wBottom</a>; 00061 <span class="comment">//##ModelId=40925B4D01C1</span><a name="l00064"></a><a class="code" href="structFG__Rect.html#a0">00064</a> <span class="comment"></span> <a class="code" href="structFG__Rect.html#a0">FG_Rect</a>() : <a class="code" href="structFG__Rect.html#o0">wLeft</a>(0), <a class="code" href="structFG__Rect.html#o1">wTop</a>(0), <a class="code" href="structFG__Rect.html#o2">wRight</a>(0), <a class="code" href="structFG__Rect.html#o3">wBottom</a>(0) {}00065 <span class="comment">//##ModelId=40925B4D01DF</span><a name="l00072"></a><a class="code" href="structFG__Rect.html#a1">00072</a> <span class="comment"></span> <a class="code" href="structFG__Rect.html#a0">FG_Rect</a>(<span class="keyword">const</span> <span class="keywordtype">short</span> x1, <span class="keyword">const</span> <span class="keywordtype">short</span> y1, <span class="keyword">const</span> <span class="keywordtype">short</span> x2, <span class="keyword">const</span> <span class="keywordtype">short</span> y2) 00073 : <a class="code" href="structFG__Rect.html#o0">wLeft</a>(x1), <a class="code" href="structFG__Rect.html#o1">wTop</a>(y1), <a class="code" href="structFG__Rect.html#o2">wRight</a>(x2), <a class="code" href="structFG__Rect.html#o3">wBottom</a>(y2) {}00074 00075 <span class="comment">//##ModelId=3F4EC4780210</span><a name="l00082"></a><a class="code" href="structFG__Rect.html#a2">00082</a> <span class="comment"></span> <span class="keywordtype">void</span> <a class="code" href="structFG__Rect.html#a2">Set</a>(<span class="keyword">const</span> <span class="keywordtype">short</span> x1, <span class="keyword">const</span> <span class="keywordtype">short</span> y1, <span class="keyword">const</span> <span class="keywordtype">short</span> x2, <span class="keyword">const</span> <span class="keywordtype">short</span> y2)00083 {00084 <a class="code" href="structFG__Rect.html#o0">wLeft</a> = x1;00085 <a class="code" href="structFG__Rect.html#o1">wTop</a> = y1;00086 <a class="code" href="structFG__Rect.html#o2">wRight</a> = x2;00087 <a class="code" href="structFG__Rect.html#o3">wBottom</a> = y2;00088 }00089 00090 <span class="comment">//##ModelId=3F4EC47802E3</span><a name="l00095"></a><a class="code" href="structFG__Rect.html#a3">00095</a> <span class="comment"></span> <span class="keywordtype">void</span> <a class="code" href="structFG__Rect.html#a2">Set</a>(<span class="keyword">const</span> <a class="code" href="structFG__Point.html">FG_Point</a> ul, <span class="keyword">const</span> <a class="code" href="structFG__Point.html">FG_Point</a> br)00096 {00097 <a class="code" href="structFG__Rect.html#o0">wLeft</a> = ul.<a class="code" href="structFG__Point.html#o0">x</a>;00098 <a class="code" href="structFG__Rect.html#o1">wTop</a> = ul.<a class="code" href="structFG__Point.html#o1">y</a>;00099 <a class="code" href="structFG__Rect.html#o2">wRight</a> = br.<a class="code" href="structFG__Point.html#o0">x</a>;00100 <a class="code" href="structFG__Rect.html#o3">wBottom</a> = br.<a class="code" href="structFG__Point.html#o1">y</a>;00101 }00102 00103 <span class="comment">//##ModelId=3F4EC478035B</span>00109 <span class="comment"></span> <span class="keywordtype">bool</span> <a class="code" href="structFG__Rect.html#a4">Contains</a>(<span class="keyword">const</span> <a class="code" href="structFG__Point.html">FG_Point</a> Test) <span class="keyword">const</span>;00110 00111 <span class="comment">//##ModelId=3F4EC47803B5</span>00118 <span class="comment"></span> <span class="keywordtype">bool</span> <a class="code" href="structFG__Rect.html#a4">Contains</a>(<span class="keyword">const</span> <span class="keywordtype">short</span> x, <span class="keyword">const</span> <span class="keywordtype">short</span> y) <span class="keyword">const</span>;00119 00120 <span class="comment">//##ModelId=3F4EC4790059</span>00126 <span class="comment"></span> <span class="keywordtype">bool</span> <a class="code" href="structFG__Rect.html#a4">Contains</a>(<span class="keyword">const</span> <a class="code" href="structFG__Rect.html">FG_Rect</a> & Rect) <span class="keyword">const</span>;00127 00128 <span class="comment">//##ModelId=3F4EC47900C7</span>00134 <span class="comment"></span> <span class="keywordtype">bool</span> <a class="code" href="structFG__Rect.html#a7">Overlap</a>(<span class="keyword">const</span> <a class="code" href="structFG__Rect.html">FG_Rect</a> & Rect) <span class="keyword">const</span>;00135 00136 <span class="comment">//##ModelId=3F4EC479012B</span>00143 <span class="comment"></span> <span class="keywordtype">void</span> <a class="code" href="structFG__Rect.html#a8">MoveTo</a>(<span class="keyword">const</span> <span class="keywordtype">short</span> x, <span class="keyword">const</span> <span class="keywordtype">short</span> y);00144 00145 <span class="comment">//##ModelId=3F4EC47901C2</span>00152 <span class="comment"></span> <span class="keywordtype">void</span> <a class="code" href="structFG__Rect.html#a9">Shift</a>(<span class="keyword">const</span> <span class="keywordtype">short</span> xShift, <span class="keyword">const</span> <span class="keywordtype">short</span> yShift);00153 00154 <span class="comment">//##ModelId=3F4EC4790258</span>00161 <span class="comment"></span> <a class="code" href="structFG__Rect.html">FG_Rect</a> & <a class="code" href="structFG__Rect.html#a10">operator &=</a>(<span class="keyword">const</span> <a class="code" href="structFG__Rect.html">FG_Rect</a> & Other);00162 00163 <span class="comment">//##ModelId=3F4EC47902B2</span>00170 <span class="comment"></span> <a class="code" href="structFG__Rect.html">FG_Rect</a> & <a class="code" href="structFG__Rect.html#a11">operator |= </a>(<span class="keyword">const</span> <a class="code" href="structFG__Rect.html">FG_Rect</a> & Other);00171 00172 <span class="comment">//##ModelId=3F4EC479030C</span>00179 <span class="comment"></span> <a class="code" href="structFG__Rect.html">FG_Rect</a> <a class="code" href="structFG__Rect.html#a12">operator &</a>(<span class="keyword">const</span> <a class="code" href="structFG__Rect.html">FG_Rect</a> & Rect) <span class="keyword">const</span>;00180 00181 <span class="comment">//##ModelId=3F4EC47A0000</span>00188 <span class="comment"></span> <a class="code" href="structFG__Rect.html">FG_Rect</a> <a class="code" href="structFG__Rect.html#a13">operator +</a>(<span class="keyword">const</span> <a class="code" href="structFG__Point.html">FG_Point</a> & Point) <span class="keyword">const</span>; 00189 00190 <span class="comment">//##ModelId=3F4EC47A0079</span>00196 <span class="comment"></span> <span class="keyword">const</span> <a class="code" href="structFG__Rect.html">FG_Rect</a> <a class="code" href="structFG__Rect.html#a14">operator ++</a>(<span class="keywordtype">int</span>);00197 00198 <span class="comment">//##ModelId=3F4EC47A00D3</span>00205 <span class="comment"></span> <a class="code" href="structFG__Rect.html">FG_Rect</a> & <a class="code" href="structFG__Rect.html#a15">operator += </a>(<span class="keyword">const</span> <span class="keywordtype">int</span> x);00206 00207 <span class="comment">//##ModelId=3F4EC47A0137</span>00213 <span class="comment"></span> <span class="keyword">const</span> <a class="code" href="structFG__Rect.html">FG_Rect</a> <a class="code" href="structFG__Rect.html#a16">operator --</a>(<span class="keywordtype">int</span>);00214 00215 <span class="comment">//##ModelId=3F4EC47A019B</span>00222 <span class="comment"></span> <a class="code" href="structFG__Rect.html">FG_Rect</a> & <a class="code" href="structFG__Rect.html#a17">operator -= </a>(<span class="keyword">const</span> <span class="keywordtype">int</span> x);00223 00224 <span class="comment">//##ModelId=3F4EC47A0209</span>00231 <span class="comment"></span> <span class="keywordtype">bool</span> <a class="code" href="structFG__Rect.html#a18">operator != </a>(<span class="keyword">const</span> <a class="code" href="structFG__Rect.html">FG_Rect</a> & Rect) <span class="keyword">const</span>;00232 00233 <span class="comment">//##ModelId=3F4EC47A028B</span>00240 <span class="comment"></span> <span class="keywordtype">bool</span> <a class="code" href="structFG__Rect.html#a19">operator == </a>(<span class="keyword">const</span> <a class="code" href="structFG__Rect.html">FG_Rect</a> &Rect) <span class="keyword">const</span>;00241 00242 <span class="comment">//##ModelId=3F4EC47A0322</span><a name="l00247"></a><a class="code" href="structFG__Rect.html#a20">00247</a> <span class="comment"></span> <span class="keywordtype">short</span> <a class="code" href="structFG__Rect.html#a20">Width</a>(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> (<a class="code" href="structFG__Rect.html#o2">wRight</a> - <a class="code" href="structFG__Rect.html#o0">wLeft</a> + 1); }00248 00249 <span class="comment">//##ModelId=3F4EC47A039A</span><a name="l00254"></a><a class="code" href="structFG__Rect.html#a21">00254</a> <span class="comment"></span> <span class="keywordtype">short</span> <a class="code" href="structFG__Rect.html#a21">Height</a>(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> (<a class="code" href="structFG__Rect.html#o3">wBottom</a> - <a class="code" href="structFG__Rect.html#o1">wTop</a> + 1); }00255 };00256 00257 <span class="preprocessor">#endif </span><span class="comment">/* FG_RECT_H_HEADER_INCLUDED_C0B10BA4 */</span>00258 </pre></div><hr><center>由 DoxyGen 1.3.6 于 Wed Jun 9 22:34:41 2004 生成<br>版权所有 (C) 2003,2004 王咏武</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -