📄 classwgui_1_1crect.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>wGui::CRect class Reference</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.2.18 --><center><a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Data Structures</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Data Fields</a> </center><hr><h1>wGui::CRect Class Reference</h1>A representation of a rectangle. <a href="#_details">More...</a><p><code>#include <<a class="el" href="wg__rect_8h-source.html">wg_rect.h</a>></code><p><h2>Public Types</h2><ul><li>enum <a class="el" href="classwGui_1_1CRect.html#s5">ERelativePosition</a> { <br> <a class="el" href="classwGui_1_1CRect.html#s5s0">RELPOS_ABOVE</a> = 1, <a class="el" href="classwGui_1_1CRect.html#s5s1">RELPOS_BELOW</a> = 2, <a class="el" href="classwGui_1_1CRect.html#s5s2">RELPOS_LEFT</a> = 4, <a class="el" href="classwGui_1_1CRect.html#s5s3">RELPOS_RIGHT</a> = 8, <br> <a class="el" href="classwGui_1_1CRect.html#s5s4">RELPOS_INSIDE</a> = 16<br> }</ul><h2>Public Methods</h2><ul><li><a name="a0" doxytag="wGui::CRect::CRect"></a><a class="el" href="classwGui_1_1CRect.html#a0">CRect</a> ()<dl class="el"><dd><font size=-1><em>The default constructor will initialize all 4 corners to (0, 0).<br><br></em></font></dl><li><a class="el" href="classwGui_1_1CRect.html#a1">CRect</a> (const int left, const int top, const int right, const int bottom)<li><a class="el" href="classwGui_1_1CRect.html#a2">CRect</a> (const <a class="el" href="classwGui_1_1CPoint.html">CPoint</a> &p1, const <a class="el" href="classwGui_1_1CPoint.html">CPoint</a> &p2)<li><a class="el" href="classwGui_1_1CRect.html#a3">CRect</a> (const CRect &r)<li><a name="a4" doxytag="wGui::CRect::~CRect"></a>virtual <a class="el" href="classwGui_1_1CRect.html#a4">~CRect</a> ()<dl class="el"><dd><font size=-1><em>Standard Destructor.<br><br></em></font></dl><li>void <a class="el" href="classwGui_1_1CRect.html#a5">SetTop</a> (const int top)<li>void <a class="el" href="classwGui_1_1CRect.html#a6">SetLeft</a> (const int left)<li>void <a class="el" href="classwGui_1_1CRect.html#a7">SetRight</a> (const int right)<li>void <a class="el" href="classwGui_1_1CRect.html#a8">SetBottom</a> (const int bottom)<li><a name="a9" doxytag="wGui::CRect::Top"></a>int <a class="el" href="classwGui_1_1CRect.html#a9">Top</a> (void) const<dl class="el"><dd><font size=-1><em><dl compact><dt><b>Returns: </b></dt><dd>The Top position</dl><br><br></em></font></dl><li><a name="a10" doxytag="wGui::CRect::Left"></a>int <a class="el" href="classwGui_1_1CRect.html#a10">Left</a> (void) const<dl class="el"><dd><font size=-1><em><dl compact><dt><b>Returns: </b></dt><dd>The Left position</dl><br><br></em></font></dl><li><a name="a11" doxytag="wGui::CRect::Right"></a>int <a class="el" href="classwGui_1_1CRect.html#a11">Right</a> (void) const<dl class="el"><dd><font size=-1><em><dl compact><dt><b>Returns: </b></dt><dd>The Right position</dl><br><br></em></font></dl><li><a name="a12" doxytag="wGui::CRect::Bottom"></a>int <a class="el" href="classwGui_1_1CRect.html#a12">Bottom</a> (void) const<dl class="el"><dd><font size=-1><em><dl compact><dt><b>Returns: </b></dt><dd>The Bottom position</dl><br><br></em></font></dl><li><a name="a13" doxytag="wGui::CRect::TopLeft"></a><a class="el" href="classwGui_1_1CPoint.html">CPoint</a> <a class="el" href="classwGui_1_1CRect.html#a13">TopLeft</a> (void) const<dl class="el"><dd><font size=-1><em><dl compact><dt><b>Returns: </b></dt><dd>A point representing the Top Left corner of the <a class="el" href="classwGui_1_1CRect.html">CRect</a></dl><br><br></em></font></dl><li><a name="a14" doxytag="wGui::CRect::TopRight"></a><a class="el" href="classwGui_1_1CPoint.html">CPoint</a> <a class="el" href="classwGui_1_1CRect.html#a14">TopRight</a> (void) const<dl class="el"><dd><font size=-1><em><dl compact><dt><b>Returns: </b></dt><dd>A point representing the Top Right corner of the <a class="el" href="classwGui_1_1CRect.html">CRect</a></dl><br><br></em></font></dl><li><a name="a15" doxytag="wGui::CRect::BottomLeft"></a><a class="el" href="classwGui_1_1CPoint.html">CPoint</a> <a class="el" href="classwGui_1_1CRect.html#a15">BottomLeft</a> (void) const<dl class="el"><dd><font size=-1><em><dl compact><dt><b>Returns: </b></dt><dd>A point representing the Bottom Left corner of the <a class="el" href="classwGui_1_1CRect.html">CRect</a></dl><br><br></em></font></dl><li><a name="a16" doxytag="wGui::CRect::BottomRight"></a><a class="el" href="classwGui_1_1CPoint.html">CPoint</a> <a class="el" href="classwGui_1_1CRect.html#a16">BottomRight</a> (void) const<dl class="el"><dd><font size=-1><em><dl compact><dt><b>Returns: </b></dt><dd>A point representing the Bottom Right corner of the <a class="el" href="classwGui_1_1CRect.html">CRect</a></dl><br><br></em></font></dl><li><a name="a17" doxytag="wGui::CRect::Center"></a><a class="el" href="classwGui_1_1CPoint.html">CPoint</a> <a class="el" href="classwGui_1_1CRect.html#a17">Center</a> (void) const<dl class="el"><dd><font size=-1><em><dl compact><dt><b>Returns: </b></dt><dd>A point representing the center of the <a class="el" href="classwGui_1_1CRect.html">CRect</a></dl><br><br></em></font></dl><li><a name="a18" doxytag="wGui::CRect::CenterLeft"></a><a class="el" href="classwGui_1_1CPoint.html">CPoint</a> <a class="el" href="classwGui_1_1CRect.html#a18">CenterLeft</a> (void) const<dl class="el"><dd><font size=-1><em><dl compact><dt><b>Returns: </b></dt><dd>A point representing the CenterLeft point of the <a class="el" href="classwGui_1_1CRect.html">CRect</a></dl><br><br></em></font></dl><li><a name="a19" doxytag="wGui::CRect::CenterTop"></a><a class="el" href="classwGui_1_1CPoint.html">CPoint</a> <a class="el" href="classwGui_1_1CRect.html#a19">CenterTop</a> (void) const<dl class="el"><dd><font size=-1><em><dl compact><dt><b>Returns: </b></dt><dd>A point representing the CenterTop point of the <a class="el" href="classwGui_1_1CRect.html">CRect</a></dl><br><br></em></font></dl><li><a name="a20" doxytag="wGui::CRect::CenterBottom"></a><a class="el" href="classwGui_1_1CPoint.html">CPoint</a> <a class="el" href="classwGui_1_1CRect.html#a20">CenterBottom</a> (void) const<dl class="el"><dd><font size=-1><em><dl compact><dt><b>Returns: </b></dt><dd>A point representing the Bottom Left corner of the <a class="el" href="classwGui_1_1CRect.html">CRect</a></dl><br><br></em></font></dl><li><a name="a21" doxytag="wGui::CRect::CenterRight"></a><a class="el" href="classwGui_1_1CPoint.html">CPoint</a> <a class="el" href="classwGui_1_1CRect.html#a21">CenterRight</a> (void) const<dl class="el"><dd><font size=-1><em><dl compact><dt><b>Returns: </b></dt><dd>A point representing the Bottom Right corner of the <a class="el" href="classwGui_1_1CRect.html">CRect</a></dl><br><br></em></font></dl><li>SDL_Rect <a class="el" href="classwGui_1_1CRect.html#a22">SDLRect</a> (void) const<li><a name="a23" doxytag="wGui::CRect::Width"></a>int <a class="el" href="classwGui_1_1CRect.html#a23">Width</a> (void) const<dl class="el"><dd><font size=-1><em><dl compact><dt><b>Returns: </b></dt><dd>The width (along the X axis) of the <a class="el" href="classwGui_1_1CRect.html">CRect</a></dl><br><br></em></font></dl><li><a name="a24" doxytag="wGui::CRect::Height"></a>int <a class="el" href="classwGui_1_1CRect.html#a24">Height</a> (void) const<dl class="el"><dd><font size=-1><em><dl compact><dt><b>Returns: </b></dt><dd>The height (along the Y axis) of the <a class="el" href="classwGui_1_1CRect.html">CRect</a></dl><br><br></em></font></dl><li><a name="a25" doxytag="wGui::CRect::operator="></a>CRect & <a class="el" href="classwGui_1_1CRect.html#a25">operator=</a> (const CRect &r)<dl class="el"><dd><font size=-1><em>Assignment operator will copy the values of the other rect.<br><br></em></font></dl><li>CRect <a class="el" href="classwGui_1_1CRect.html#a26">operator+</a> (const <a class="el" href="classwGui_1_1CPoint.html">CPoint</a> &p) const<li>CRect <a class="el" href="classwGui_1_1CRect.html#a27">operator-</a> (const <a class="el" href="classwGui_1_1CPoint.html">CPoint</a> &p) const<li>CRect & <a class="el" href="classwGui_1_1CRect.html#a28">Grow</a> (int iGrowAmount)<li>CRect & <a class="el" href="classwGui_1_1CRect.html#a29">Move</a> (int iOffsetX, int iOffsetY)<li>bool <a class="el" href="classwGui_1_1CRect.html#a30">Overlaps</a> (const CRect &r)<li>void <a class="el" href="classwGui_1_1CRect.html#a31">ClipTo</a> (const CRect &r)<li>unsigned int <a class="el" href="classwGui_1_1CRect.html#a32">HitTest</a> (const <a class="el" href="classwGui_1_1CPoint.html">CPoint</a> &p) const<dl class="el"><dd><font size=-1><em>The HitTest will test to see where a point is in relation to the rect.</em> <a href="#a32"></a><em><br><br></em></font></dl></ul><h2>Protected Attributes</h2><ul><li><a name="n0" doxytag="wGui::CRect::m_Left"></a>int <a class="el" href="classwGui_1_1CRect.html#n0">m_Left</a><dl class="el"><dd><font size=-1><em>X position of the left border.<br><br></em></font></dl><li><a name="n1" doxytag="wGui::CRect::m_Right"></a>int <a class="el" href="classwGui_1_1CRect.html#n1">m_Right</a><dl class="el"><dd><font size=-1><em>X position of the right border.<br><br></em></font></dl><li><a name="n2" doxytag="wGui::CRect::m_Top"></a>int <a class="el" href="classwGui_1_1CRect.html#n2">m_Top</a><dl class="el"><dd><font size=-1><em>Y position of the top border.<br><br></em></font></dl><li><a name="n3" doxytag="wGui::CRect::m_Bottom"></a>int <a class="el" href="classwGui_1_1CRect.html#n3">m_Bottom</a><dl class="el"><dd><font size=-1><em>Y position of the bottom border.<br><br></em></font></dl></ul><hr><a name="_details"></a><h2>Detailed Description</h2>A representation of a rectangle.<p><p>Definition at line <a class="el" href="wg__rect_8h-source.html#l00038">38</a> of file <a class="el" href="wg__rect_8h-source.html">wg_rect.h</a>.<hr><h2>Member Enumeration Documentation</h2><a name="s5" doxytag="wGui::CRect::ERelativePosition"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> enum wGui::CRect::ERelativePosition </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p><dl compact><dt><b>Enumeration values: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em><a name="s5s0" doxytag="RELPOS_ABOVE"></a><em>RELPOS_ABOVE</em></em> </td><td>The point is above the top of the <a class="el" href="classwGui_1_1CRect.html">CRect</a>.</td></tr><tr><td valign=top><em><a name="s5s1" doxytag="RELPOS_BELOW"></a><em>RELPOS_BELOW</em></em> </td><td>The point is below the bottom of the <a class="el" href="classwGui_1_1CRect.html">CRect</a>.</td></tr><tr><td valign=top><em><a name="s5s2" doxytag="RELPOS_LEFT"></a><em>RELPOS_LEFT</em></em> </td><td>The point is to the left of the <a class="el" href="classwGui_1_1CRect.html">CRect</a>.</td></tr><tr><td valign=top><em><a name="s5s3" doxytag="RELPOS_RIGHT"></a><em>RELPOS_RIGHT</em></em> </td><td>The point is to the right of the <a class="el" href="classwGui_1_1CRect.html">CRect</a>.</td></tr><tr><td valign=top><em><a name="s5s4" doxytag="RELPOS_INSIDE"></a><em>RELPOS_INSIDE</em></em> </td><td>The point lies within the bounds of the <a class="el" href="classwGui_1_1CRect.html">CRect</a>.</td></tr></table></dl><p>Definition at line <a class="el" href="wg__rect_8h-source.html#l00165">165</a> of file <a class="el" href="wg__rect_8h-source.html">wg_rect.h</a>. </td> </tr></table><hr><h2>Constructor & Destructor Documentation</h2><a name="a1" doxytag="wGui::CRect::CRect"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> wGui::CRect::CRect </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const int </td> <td class="mdname" nowrap> <em>left</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>const int </td> <td class="mdname" nowrap> <em>top</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>const int </td> <td class="mdname" nowrap> <em>right</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>const int </td> <td class="mdname" nowrap> <em>bottom</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"><code> [inline]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p><dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>left</em> </td><td>The left edge of the rectangle </td></tr><tr><td valign=top><em>top</em> </td><td>The top edge of the rectangle </td></tr><tr><td valign=top><em>right</em> </td><td>The right edge of the rectangle </td></tr><tr><td valign=top><em>bottom</em> </td><td>The bottom edge of the rectangle </td></tr></table></dl><p>Definition at line <a class="el" href="wg__rect_8h-source.html#l00048">48</a> of file <a class="el" href="wg__rect_8h-source.html">wg_rect.h</a>.<p>References <a class="el" href="wg__rect_8h-source.html#l00190">m_Bottom</a>, <a class="el" href="wg__rect_8h-source.html#l00181">m_Left</a>, <a class="el" href="wg__rect_8h-source.html#l00184">m_Right</a>, and <a class="el" href="wg__rect_8h-source.html#l00187">m_Top</a>. </td> </tr></table><a name="a2" doxytag="wGui::CRect::CRect"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> wGui::CRect::CRect </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const <a class="el" href="classwGui_1_1CPoint.html">CPoint</a> & </td> <td class="mdname" nowrap> <em>p1</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>const <a class="el" href="classwGui_1_1CPoint.html">CPoint</a> & </td> <td class="mdname" nowrap> <em>p2</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"><code> [inline]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Create a <a class="el" href="classwGui_1_1CRect.html">CRect</a> using a pair of CPoints that represent the Top-Left, and Bottom-Right corners <dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>p1</em> </td><td>Top left corner </td></tr><tr><td valign=top><em>p2</em> </td><td>Bottom right corner </td></tr></table></dl><p>Definition at line <a class="el" href="wg__rect_8h-source.html#l00054">54</a> of file <a class="el" href="wg__rect_8h-source.html">wg_rect.h</a>.<p>References <a class="el" href="wg__rect_8h-source.html#l00190">m_Bottom</a>, <a class="el" href="wg__rect_8h-source.html#l00181">m_Left</a>, <a class="el" href="wg__rect_8h-source.html#l00184">m_Right</a>, and <a class="el" href="wg__rect_8h-source.html#l00187">m_Top</a>. </td> </tr></table><a name="a3" doxytag="wGui::CRect::CRect"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -