Sophie

Sophie

distrib > Mandriva > 2010.0 > x86_64 > by-pkgid > 294b2abd8cd7fb1324218acbfd142240 > files > 166

clanlib0.6-docs-0.6.5-35mdv2010.0.x86_64.rpm


<html>
<head><title>ClanLib Reference: CL_Rect</title></head>
<body text=black link=blue vlink=#800080 bgcolor=white topmargin=0 leftmargin=0>
<table border=0 cellspacing=0 cellpadding=0 width=100%><tr><td><img border=0 src="../images/eyeheader-main-purple-a.gif" alt="ClanSoft logo" width=525 height=96></td></tr>
<tr bgcolor=#dadada><td align=left valign=top><img border=0 src="../images/eyeheader-main-purple-b.gif" alt="ClanSoft logo" width=190 height=14></td><td align=right valign=top><img border=0 src="../images/clanlib_light.gif" width=42 height=14></td></tr></table>
<table align=center border=0 cellspacing=10> <tr>
<td><a href="entire_class_index.html">Entire Class Index</a></td>
<td><a href="class_index.html">Main Class Index</a></td>
<td><a href="cross_index.html">Cross Index</a></td>
<td><a href="global_index.html">Global Index</a></td>
</table><h1 align=center>Class CL_Rect</h1><p>
<b>  Rect Class</b><br>
Contained in: <a href="global_index.html">global</a><br>
Derived from:
<i>none</i>
<br>
Derived by:
<i>none</i>
<br>Group: Core (Math)
<p>
#include &lt;ClanLib/core.h&gt;
<p>
<hr noshade>
<table border=0>
<tr><td colspan=3><h3>public function member index:</h3></td>
<tr valign=top><td align=left><h3>Construction:</h3></td>
<tr valign=top><td align=right><tt></tt> </td><td align=right><a href="CL_Rect.html#2562"><tt><font color=blue><b>CL_Rect</b></font></tt></a></td><td><tt>(<tt><font color=purple>int</font></tt> <tt><font color=blue>nx1</font></tt> = 0, <tt><font color=purple>int</font></tt> <tt><font color=blue>ny1</font></tt> = 0, <tt><font color=purple>int</font></tt> <tt><font color=blue>nx2</font></tt> = 0, <tt><font color=purple>int</font></tt> <tt><font color=blue>ny2</font></tt> = 0)</tt>;</td>
<tr valign=top><td align=right><tt></tt> </td><td align=right><a href="CL_Rect.html#2563"><tt><font color=blue><b>CL_Rect</b></font></tt></a></td><td><tt>(<tt>const</tt> <a href="CL_Rect.html#2563"><tt><font color=blue><b>CL_Rect</b></font></tt></a>& <tt><font color=blue>rect</font></tt>)</tt>;</td>
<tr valign=top><td align=left><h3>Operations:</h3></td>
<tr valign=top><td align=right><tt><tt>static</tt> <a href="CL_Rect.html#2563"><tt><font color=blue><b>CL_Rect</b></font></tt></a></tt> </td><td align=right><a href="CL_Rect.html#2564"><tt><font color=blue><b>center</b></font></tt></a></td><td><tt>(<tt><font color=purple>int</font></tt> <tt><font color=blue>center_x</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>center_y</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>width</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>height</font></tt>)</tt>;</td>
<tr valign=top><td align=right><tt><tt>static</tt> <a href="CL_Rect.html#2563"><tt><font color=blue><b>CL_Rect</b></font></tt></a></tt> </td><td align=right><a href="CL_Rect.html#2565"><tt><font color=blue><b>left</b></font></tt></a></td><td><tt>(<tt><font color=purple>int</font></tt> <tt><font color=blue>x</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>y</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>width</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>height</font></tt>, <tt><font color=purple>bool</font></tt> <tt><font color=blue>center_vert</font></tt> = true)</tt>;</td>
<tr valign=top><td align=right><tt><tt>static</tt> <a href="CL_Rect.html#2563"><tt><font color=blue><b>CL_Rect</b></font></tt></a></tt> </td><td align=right><a href="CL_Rect.html#2566"><tt><font color=blue><b>right</b></font></tt></a></td><td><tt>(<tt><font color=purple>int</font></tt> <tt><font color=blue>x</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>y</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>width</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>height</font></tt>, <tt><font color=purple>bool</font></tt> <tt><font color=blue>center_vert</font></tt> = true)</tt>;</td>
<tr valign=top><td align=right><tt><tt><font color=purple>void</font></tt></tt> </td><td align=right><a href="CL_Rect.html#2567"><tt><font color=blue><b>move</b></font></tt></a></td><td><tt>(<tt><font color=purple>int</font></tt> <tt><font color=blue>delta_x</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>delta_y</font></tt>)</tt>;</td>
<tr valign=top><td align=right><tt><tt><font color=purple>void</font></tt></tt> </td><td align=right><a href="CL_Rect.html#2568"><tt><font color=blue><b>normalize</b></font></tt></a></td><td><tt>()</tt>;</td>
<tr valign=top><td align=left><h3>Attributes:</h3></td>
<tr valign=top><td align=right><tt><tt><font color=purple>bool</font></tt></tt> </td><td align=right><a href="CL_Rect.html#2569"><tt><font color=blue><b>inside</b></font></tt></a></td><td><tt>(<tt><font color=purple>int</font></tt> <tt><font color=blue>x</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>y</font></tt>) <tt>const</tt></tt>;</td>
<tr valign=top><td align=right><tt><tt><font color=purple>int</font></tt></tt> </td><td align=right><a href="CL_Rect.html#2570"><tt><font color=blue><b>get_width</b></font></tt></a></td><td><tt>() <tt>const</tt></tt>;</td>
<tr valign=top><td align=right><tt><tt><font color=purple>int</font></tt></tt> </td><td align=right><a href="CL_Rect.html#2571"><tt><font color=blue><b>get_height</b></font></tt></a></td><td><tt>() <tt>const</tt></tt>;</td>
<tr valign=top><td align=right><tt><tt><font color=purple>void</font></tt></tt> </td><td align=right><a href="CL_Rect.html#2572"><tt><font color=blue><b>clear</b></font></tt></a></td><td><tt>()</tt>;</td>
<tr valign=top><td align=left><h3>Operators:</h3></td>
<tr valign=top><td align=right><tt><tt><font color=purple>bool</font></tt></tt> </td><td align=right><a href="CL_Rect.html#2573"><tt><font color=black><b>operator</b></font></tt><tt> == </tt></a></td><td><tt>(<tt>const</tt> <a href="CL_Rect.html#2563"><tt><font color=blue><b>CL_Rect</b></font></tt></a>& <tt><font color=blue>rect</font></tt>) <tt>const</tt></tt>;</td>
<tr><td>&nbsp;</td></table>
<hr noshade>
<h2>Description:</h2>
<p>
<hr noshade>
<h2>Function Member Descriptions:</h2>
<a name="2562"><font size=+1><b>CL_Rect::CL_Rect</b></font></a> -   Rect Constructor<br><tt></tt> <a href="CL_Rect.html#2562"><tt><font color=blue><b>CL_Rect</b></font></tt></a><tt>(<tt><font color=purple>int</font></tt> <tt><font color=blue>nx1</font></tt> = 0, <tt><font color=purple>int</font></tt> <tt><font color=blue>ny1</font></tt> = 0, <tt><font color=purple>int</font></tt> <tt><font color=blue>nx2</font></tt> = 0, <tt><font color=purple>int</font></tt> <tt><font color=blue>ny2</font></tt> = 0)</tt>;<br><blockquote>  nx1	- right constraint<br>  ny1 - bottom constraint<br>  nx2 - left constraint<br>  ny2 - top constraint</blockquote>
<hr size="1" width="70%" align="left" noshade="noshade"><br><br>
<a name="2563"><font size=+1><b>CL_Rect::CL_Rect</b></font></a> -   Rect Copy Constructor<br><tt></tt> <a href="CL_Rect.html#2563"><tt><font color=blue><b>CL_Rect</b></font></tt></a><tt>(<tt>const</tt> <a href="CL_Rect.html#2563"><tt><font color=blue><b>CL_Rect</b></font></tt></a>& <tt><font color=blue>rect</font></tt>)</tt>;<br><blockquote>  rect - The rectangle to copy</blockquote>
<hr size="1" width="70%" align="left" noshade="noshade"><br><br>
<a name="2564"><font size=+1><b>CL_Rect::center</b></font></a> -   Creates a rectangle around the given centre<br><tt><tt>static</tt> <a href="CL_Rect.html#2563"><tt><font color=blue><b>CL_Rect</b></font></tt></a></tt> <a href="CL_Rect.html#2564"><tt><font color=blue><b>center</b></font></tt></a><tt>(<tt><font color=purple>int</font></tt> <tt><font color=blue>center_x</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>center_y</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>width</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>height</font></tt>)</tt>;<br><blockquote>  center_x - The x coord of the centre<br>  center_y - the y coord of the centre<br>  width - The width of the rectangle<br>  height - The height of the rectangle<br>  Returns - The centred rectangle</blockquote>
<hr size="1" width="70%" align="left" noshade="noshade"><br><br>
<a name="2572"><font size=+1><b>CL_Rect::clear</b></font></a> -   Sets all rectangle dimensions/points to 0.<br><tt><tt><font color=purple>void</font></tt></tt> <a href="CL_Rect.html#2572"><tt><font color=blue><b>clear</b></font></tt></a><tt>()</tt>;<hr size="1" width="70%" align="left" noshade="noshade"><br><br>
<a name="2571"><font size=+1><b>CL_Rect::get_height</b></font></a> -   Get Height<br><tt><tt><font color=purple>int</font></tt></tt> <a href="CL_Rect.html#2571"><tt><font color=blue><b>get_height</b></font></tt></a><tt>() <tt>const</tt></tt>;<br><blockquote>  Returns - Height of rectangle</blockquote>
<hr size="1" width="70%" align="left" noshade="noshade"><br><br>
<a name="2570"><font size=+1><b>CL_Rect::get_width</b></font></a> -   Get Width<br><tt><tt><font color=purple>int</font></tt></tt> <a href="CL_Rect.html#2570"><tt><font color=blue><b>get_width</b></font></tt></a><tt>() <tt>const</tt></tt>;<br><blockquote>  Returns - Width of rectangle</blockquote>
<hr size="1" width="70%" align="left" noshade="noshade"><br><br>
<a name="2569"><font size=+1><b>CL_Rect::inside</b></font></a> -   Determine if a point is inside the rectangle<br><tt><tt><font color=purple>bool</font></tt></tt> <a href="CL_Rect.html#2569"><tt><font color=blue><b>inside</b></font></tt></a><tt>(<tt><font color=purple>int</font></tt> <tt><font color=blue>x</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>y</font></tt>) <tt>const</tt></tt>;<br><blockquote>  x - the x coord of the point<br>  y - the y coord of the point<br>  Returns - True if the point is in the rectangle or on it's border.</blockquote>
<hr size="1" width="70%" align="left" noshade="noshade"><br><br>
<a name="2565"><font size=+1><b>CL_Rect::left</b></font></a> -   Align the rectangle left<br><tt><tt>static</tt> <a href="CL_Rect.html#2563"><tt><font color=blue><b>CL_Rect</b></font></tt></a></tt> <a href="CL_Rect.html#2565"><tt><font color=blue><b>left</b></font></tt></a><tt>(<tt><font color=purple>int</font></tt> <tt><font color=blue>x</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>y</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>width</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>height</font></tt>, <tt><font color=purple>bool</font></tt> <tt><font color=blue>center_vert</font></tt> = true)</tt>;<br><blockquote>  x - the left edge of the rectangle<br>  y - the bottom of the rectangle<br>  width - the width of the rectangle<br>  height - the height of the rectangle<br>  centre_vert - centre the rectangle around the y coord<br>  Returns - Left aligned rectangle </blockquote>
<hr size="1" width="70%" align="left" noshade="noshade"><br><br>
<a name="2567"><font size=+1><b>CL_Rect::move</b></font></a> -   Move the rectangle<br><tt><tt><font color=purple>void</font></tt></tt> <a href="CL_Rect.html#2567"><tt><font color=blue><b>move</b></font></tt></a><tt>(<tt><font color=purple>int</font></tt> <tt><font color=blue>delta_x</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>delta_y</font></tt>)</tt>;<br><blockquote>  delta_x - Distance to move rectangle on x-axis<br>  delta_y - Distance to move rectangle on y-axis</blockquote>
<hr size="1" width="70%" align="left" noshade="noshade"><br><br>
<a name="2568"><font size=+1><b>CL_Rect::normalize</b></font></a> -   Normalize rectangle. Ensures that x1&lt;x2 and y1&lt;y2.<br><tt><tt><font color=purple>void</font></tt></tt> <a href="CL_Rect.html#2568"><tt><font color=blue><b>normalize</b></font></tt></a><tt>()</tt>;<hr size="1" width="70%" align="left" noshade="noshade"><br><br>
<a name="2573"><font size=+1><b>CL_Rect::operator == </b></font></a> -   Equivalancy operator<br><tt><tt><font color=purple>bool</font></tt></tt> <a href="CL_Rect.html#2573"><tt><font color=black><b>operator</b></font></tt><tt> == </tt></a><tt>(<tt>const</tt> <a href="CL_Rect.html#2563"><tt><font color=blue><b>CL_Rect</b></font></tt></a>& <tt><font color=blue>rect</font></tt>) <tt>const</tt></tt>;<hr size="1" width="70%" align="left" noshade="noshade"><br><br>
<a name="2566"><font size=+1><b>CL_Rect::right</b></font></a> -   Align the rectangle right<br><tt><tt>static</tt> <a href="CL_Rect.html#2563"><tt><font color=blue><b>CL_Rect</b></font></tt></a></tt> <a href="CL_Rect.html#2566"><tt><font color=blue><b>right</b></font></tt></a><tt>(<tt><font color=purple>int</font></tt> <tt><font color=blue>x</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>y</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>width</font></tt>, <tt><font color=purple>int</font></tt> <tt><font color=blue>height</font></tt>, <tt><font color=purple>bool</font></tt> <tt><font color=blue>center_vert</font></tt> = true)</tt>;<br><blockquote>  x - the right edge of the rectangle<br>  y - the bottom of the rectangle<br>  width - the width of the rectangle<br>  height - the height of the rectangle<br>  centre_vert - centre the rectangle around the y coord<br>  Returns - Right aligned rectangle </blockquote>
<hr size="1" width="70%" align="left" noshade="noshade"><br><br>
<hr noshade>
<h2>Variable Member Descriptions:</h2>
<a name="2558"><font size=+1><b>CL_Rect::x1</b></font></a> -   Left x coord<br>
<tt><tt><font color=purple>int</font></tt> </tt> <tt><a href="CL_Rect.html#2558"><tt><font color=blue>x1</font></tt></a>;</tt><hr size="1" width="70%" align="left" noshade="noshade"><br>
<a name="2560"><font size=+1><b>CL_Rect::x2</b></font></a> -   Right x coord<br>
<tt><tt><font color=purple>int</font></tt> </tt> <tt><a href="CL_Rect.html#2560"><tt><font color=blue>x2</font></tt></a>;</tt><hr size="1" width="70%" align="left" noshade="noshade"><br>
<a name="2559"><font size=+1><b>CL_Rect::y1</b></font></a> -   Bottom y coord<br>
<tt><tt><font color=purple>int</font></tt> </tt> <tt><a href="CL_Rect.html#2559"><tt><font color=blue>y1</font></tt></a>;</tt><hr size="1" width="70%" align="left" noshade="noshade"><br>
<a name="2561"><font size=+1><b>CL_Rect::y2</b></font></a> -   Top y coord<br>
<tt><tt><font color=purple>int</font></tt> </tt> <tt><a href="CL_Rect.html#2561"><tt><font color=blue>y2</font></tt></a>;</tt><hr size="1" width="70%" align="left" noshade="noshade"><br>
<hr noshade>
</body>
</html>