classrectangle.html

来自「仿真人工智能是指用人工的方法和技术」· HTML 代码 · 共 434 行 · 第 1/2 页

HTML
434
字号
<!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>Rectangle class Reference</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body bgcolor="#ffffff"><!-- Generated by Doxygen 1.2.12 --><center><a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="globals.html">File Members</a> &nbsp; </center><hr><h1>Rectangle  Class Reference</h1><code>#include &lt;<a class="el" href="Geometry_8h-source.html">Geometry.h</a>&gt;</code><p>Collaboration diagram for Rectangle:<p><center><img src="classRectangle__coll__graph.gif" border="0" usemap="#Rectangle__coll__map" alt="Collaboration graph"></center><map name="Rectangle__coll__map"><area href="classVecPosition.html" shape="rect" coords="14,14,91,33" alt=""></map><center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center><a href="classRectangle-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0><tr><td colspan=2><br><h2>Public Methods</h2></td></tr><tr><td nowrap align=right valign=top>&nbsp;</td><td valign=bottom><a class="el" href="classRectangle.html#a0">Rectangle</a> (<a class="el" href="classVecPosition.html">VecPosition</a> pos, <a class="el" href="classVecPosition.html">VecPosition</a> pos2)</td></tr><tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classRectangle.html#a1">show</a> (ostream &amp;os=cout)</td></tr><tr><td nowrap align=right valign=top>bool&nbsp;</td><td valign=bottom><a class="el" href="classRectangle.html#a2">isInside</a> (<a class="el" href="classVecPosition.html">VecPosition</a> pos)</td></tr><tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classRectangle.html#a3">setRectanglePoints</a> (<a class="el" href="classVecPosition.html">VecPosition</a> pos1, <a class="el" href="classVecPosition.html">VecPosition</a> pos2)</td></tr><tr><td nowrap align=right valign=top>bool&nbsp;</td><td valign=bottom><a class="el" href="classRectangle.html#a4">setPosLeftTop</a> (<a class="el" href="classVecPosition.html">VecPosition</a> pos)</td></tr><tr><td nowrap align=right valign=top><a class="el" href="classVecPosition.html">VecPosition</a>&nbsp;</td><td valign=bottom><a class="el" href="classRectangle.html#a5">getPosLeftTop</a> (<a class="el" href="classVecPosition.html">VecPosition</a> pos)</td></tr><tr><td nowrap align=right valign=top>bool&nbsp;</td><td valign=bottom><a class="el" href="classRectangle.html#a6">setPosRightBottom</a> (<a class="el" href="classVecPosition.html">VecPosition</a> pos)</td></tr><tr><td nowrap align=right valign=top><a class="el" href="classVecPosition.html">VecPosition</a>&nbsp;</td><td valign=bottom><a class="el" href="classRectangle.html#a7">getPosRightBottom</a> (<a class="el" href="classVecPosition.html">VecPosition</a> pos)</td></tr><tr><td colspan=2><br><h2>Private Attributes</h2></td></tr><tr><td nowrap align=right valign=top><a class="el" href="classVecPosition.html">VecPosition</a>&nbsp;</td><td valign=bottom><a class="el" href="classRectangle.html#o0">m_posLeftTop</a></td></tr><tr><td nowrap align=right valign=top><a class="el" href="classVecPosition.html">VecPosition</a>&nbsp;</td><td valign=bottom><a class="el" href="classRectangle.html#o1">m_posRightBottom</a></td></tr></table><hr><a name="_details"></a><h2>Detailed Description</h2>This class represents a rectangle. A rectangle is defined by two VecPositions the one at the upper left corner and the one at the right bottom. <p><p>Definition at line <a class="el" href="Geometry_8h-source.html#l00300">300</a> of file <a class="el" href="Geometry_8h-source.html">Geometry.h</a>.<hr><h2>Constructor &amp; Destructor Documentation</h2><a name="a0" doxytag="Rectangle::Rectangle"></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"> Rectangle::Rectangle </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top"><a class="el" href="classVecPosition.html">VecPosition</a>&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>pos</em>, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap><a class="el" href="classVecPosition.html">VecPosition</a>&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>pos2</em></td>        </tr>        <tr>          <td></td>          <td class="md">)&nbsp;</td>          <td class="md" colspan="2"></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>This is the constructor of a Rectangle. Two points will be given. The order does not matter as long as two opposite points are given (left top and right bottom or right top and left bottom). <dl compact><dt><b>Parameters: </b><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>pos</em>&nbsp;</td><td>first point that defines corner of rectangle </td></tr><tr><td valign=top><em>pos2</em>&nbsp;</td><td>second point that defines other corner of rectangle </td></tr></table></dl><dl compact><dt><b>Returns: </b><dd>rectangle with 'pos' and 'pos2' as opposite corners. </dl><p>Definition at line <a class="el" href="Geometry_8C-source.html#l01513">1513</a> of file <a class="el" href="Geometry_8C-source.html">Geometry.C</a>.<p>References <a class="el" href="Geometry_8C-source.html#l01522">setRectanglePoints</a>().    </td>  </tr></table><hr><h2>Member Function Documentation</h2><a name="a5" doxytag="Rectangle::getPosLeftTop"></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"> <a class="el" href="classVecPosition.html">VecPosition</a> Rectangle::getPosLeftTop </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top"><a class="el" href="classVecPosition.html">VecPosition</a>&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp; <em>pos</em>          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>This method returns the top left position of the rectangle <dl compact><dt><b>Returns: </b><dd>top left position of the rectangle </dl><p>Definition at line <a class="el" href="Geometry_8C-source.html#l01560">1560</a> of file <a class="el" href="Geometry_8C-source.html">Geometry.C</a>.<p>References <a class="el" href="Geometry_8h-source.html#l00302">m_posLeftTop</a>.    </td>  </tr></table><a name="a7" doxytag="Rectangle::getPosRightBottom"></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"> <a class="el" href="classVecPosition.html">VecPosition</a> Rectangle::getPosRightBottom </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top"><a class="el" href="classVecPosition.html">VecPosition</a>&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp; <em>pos</em>          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>This method returns the right bottom position of the rectangle <dl compact><dt><b>Returns: </b><dd>top right bottom of the rectangle </dl><p>Definition at line <a class="el" href="Geometry_8C-source.html#l01576">1576</a> of file <a class="el" href="Geometry_8C-source.html">Geometry.C</a>.<p>References <a class="el" href="Geometry_8h-source.html#l00303">m_posRightBottom</a>.    </td>  </tr></table><a name="a2" doxytag="Rectangle::isInside"></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"> bool Rectangle::isInside </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top"><a class="el" href="classVecPosition.html">VecPosition</a>&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp; <em>pos</em>          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>This method determines whether the given position lies inside the current rectangle. <dl compact><dt><b>Parameters: </b><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>pos</em>&nbsp;</td><td>position which is checked whether it lies in rectangle </td></tr></table></dl><dl compact><dt><b>Returns: </b><dd>true when 'pos' lies in the rectangle, false otherwise </dl><p>Definition at line <a class="el" href="Geometry_8C-source.html#l01542">1542</a> of file <a class="el" href="Geometry_8C-source.html">Geometry.C</a>.<p>References <a class="el" href="Geometry_8C-source.html#l00542">VecPosition::getX</a>(), <a class="el" href="Geometry_8C-source.html#l00558">VecPosition::getY</a>(), <a class="el" href="Geometry_8C-source.html#l00721">VecPosition::isBetweenX</a>(), <a class="el" href="Geometry_8C-source.html#l00746">VecPosition::isBetweenY</a>(), <a class="el" href="Geometry_8h-source.html#l00302">m_posLeftTop</a>, and <a class="el" href="Geometry_8h-source.html#l00303">m_posRightBottom</a>.    </td>  </tr></table><a name="a4" doxytag="Rectangle::setPosLeftTop"></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"> bool Rectangle::setPosLeftTop </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top"><a class="el" href="classVecPosition.html">VecPosition</a>&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp; <em>pos</em>          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>

⌨️ 快捷键说明

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