diff options
author | Jakob Odersky <jodersky@gmail.com> | 2009-12-13 16:06:50 +0000 |
---|---|---|
committer | Jakob Odersky <jodersky@gmail.com> | 2009-12-13 16:06:50 +0000 |
commit | 66d338aec5d632927fa561a68310c8931938e9e0 (patch) | |
tree | 1e200fd94bb903772b007690da4e5d13fc46fb5b /doc/sims/geometry/ConvexPolygon.html | |
parent | be2ee4dea92c5a4fc2329959d6e7272c50b221a6 (diff) | |
download | sims-66d338aec5d632927fa561a68310c8931938e9e0.tar.gz sims-66d338aec5d632927fa561a68310c8931938e9e0.tar.bz2 sims-66d338aec5d632927fa561a68310c8931938e9e0.zip |
Ported to scala 2.8.
Diffstat (limited to 'doc/sims/geometry/ConvexPolygon.html')
-rw-r--r-- | doc/sims/geometry/ConvexPolygon.html | 412 |
1 files changed, 215 insertions, 197 deletions
diff --git a/doc/sims/geometry/ConvexPolygon.html b/doc/sims/geometry/ConvexPolygon.html index 5db8789..e3cdc96 100644 --- a/doc/sims/geometry/ConvexPolygon.html +++ b/doc/sims/geometry/ConvexPolygon.html @@ -1,210 +1,228 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<?xml version='1.0' encoding='UTF-8'?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html> - <head><title>trait ConvexPolygon in sims.geometry</title> - <meta http-equiv="content-type" content="text/html; charset=UTF8"></meta><meta content="scaladoc (version 2.7.5.final)" name="generator"></meta><link href="../../style.css" type="text/css" rel="stylesheet"></link><script type="text/javascript" src="../../script.js"></script> + <head> + <title>Scaladoc for sims.geometry.ConvexPolygon</title> + <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> + <script type="text/javascript" src="../../lib/jquery.js"></script> + + <style type="text/css"> + @import url(../../lib/template.css) screen; + </style> + <script type="text/javascript" src="../../lib/template.js"></script> + </head> - <body onload="init()"> - <table summary="" class="navigation"> - <tr> - <td class="navigation-links" valign="top"> - <!-- <table><tr></tr></table> --> - </td> - <td align="right" valign="top" style="white-space:nowrap;" rowspan="2"> - <div class="doctitle-larger">SiMS</div> - </td> - </tr> - <tr><td></td></tr> - </table> - - <div class="entity"> - <a href="../../sims/geometry$package.html" target="_self">sims.geometry</a> - <br></br> - <span class="entity">trait ConvexPolygon</span> - </div><hr></hr> - <div class="source"> - [source: <a href="" class="sims/geometry/ConvexPolygon"><code>sims/geometry/ConvexPolygon.scala</code></a>] - </div><hr></hr> - <a name="ConvexPolygon"></a><dl> - <dt> - - <code></code> - <code>trait</code> - <em>ConvexPolygon</em> - </dt> - <dd><code> extends </code><a href="http://www.scala-lang.org/docu/files/api/scala/AnyRef.html" target="_self">AnyRef</a></dd> - </dl> - <dl><dd>Common properties of all convex polygons.</dd></dl> - <dl></dl> - <dl> - <dt style="margin:10px 0 0 20px;"><b>Direct Known Subclasses:</b></dt> - <dd><a href="../../sims/dynamics/Rectangle.html" target="_self">Rectangle</a>, <a href="../../sims/dynamics/RegularPolygon.html" target="_self">RegularPolygon</a></dd> - </dl><hr></hr> + <body class="type"> + <p id="owner"><a href="../package.html">sims</a>.<a href="package.html">geometry</a></p> + <div id="definition"> + <img src="../../lib/trait_big.png" /> + <h1>ConvexPolygon</h1> + </div> -<table summary="" cellpadding="3" class="member"> - <tr><td class="title" colspan="2">Method Summary</td></tr> - <tr> - <td class="modifiers" valign="top"> - <code> def</code> - </td> - <td class="signature"> - <em><a href="../../sims/geometry/ConvexPolygon.html#AABB" target="_self">AABB</a></em> - : <a href="../../sims/collision/AABB.html" target="_self">AABB</a> - - <div>Returns this polygon's axis aligned bounding box.</div> - </td> - </tr> -<tr> - <td class="modifiers" valign="top"> - <code> def</code> - </td> - <td class="signature"> - <em><a href="../../sims/geometry/ConvexPolygon.html#contains%28sims.geometry.Vector2D%29" target="_self">contains</a></em> - (<em>point</em> : <a href="../../sims/geometry/Vector2D.html" target="_self">Vector2D</a>) : <a href="http://www.scala-lang.org/docu/files/api/scala/Boolean.html" target="_self">Boolean</a> - - <div>Checks if the point <code>point</code> is contained in this polygon.</div> - </td> - </tr> -<tr> - <td class="modifiers" valign="top"> - <code> def</code> - </td> - <td class="signature"> - <em><a href="../../sims/geometry/ConvexPolygon.html#project%28sims.geometry.Vector2D%29" target="_self">project</a></em> - (<em>axis</em> : <a href="../../sims/geometry/Vector2D.html" target="_self">Vector2D</a>) : <a href="../../sims/geometry/Projection.html" target="_self">Projection</a> + <h4 class="signature"> + <span class="kind">trait</span> + <span class="symbol"> + <span class="name">ConvexPolygon</span><span class="result"> extends AnyRef</span> + </span> + </h4> + <div class="fullcomment" id="comment"> + <div class="comment cmt"><p>Common properties of all convex polygons.</p></div> + + + + <div class="block"> + known subclasses: <a href="../dynamics/RegularPolygon.html">RegularPolygon</a>, <a href="../dynamics/Rectangle.html">Rectangle</a> + </div> + </div> + + <div id="template"> + + <div id="mbrsel"> + <div id="ancestors"> + <h3>Inherits</h3> + <ol><li class="in" name="scala.AnyRef">AnyRef</li><li class="in" name="scala.Any">Any</li></ol> + </div> + </div> - <div>Returns the projection of this polygon onto the line given by the directional vector <code>axis</code>.</div> - </td> - </tr> -<tr> - <td class="modifiers" valign="top"> - <code> def</code> - </td> - <td class="signature"> - <em><a href="../../sims/geometry/ConvexPolygon.html#sides" target="_self">sides</a></em> - : <a href="" target="contentFrame" class="scala/Array">scala.Array</a>[<a href="../../sims/geometry/Segment.html" target="_self">Segment</a>] - <div>Returns all sides of this polygon. The sides are ordered counter-clockwise, the first vertex of the side
- giving the side index.</div> - </td> - </tr> -<tr> - <td class="modifiers" valign="top"> - <code>abstract def</code> - </td> - <td class="signature"> - <em><a href="../../sims/geometry/ConvexPolygon.html#vertices" target="_self">vertices</a></em> - : <a href="" target="contentFrame" class="scala/Seq">scala.Seq</a>[<a href="../../sims/geometry/Vector2D.html" target="_self">Vector2D</a>] - <div>Returns positions of all vertices of this Polygon. Vertices are ordered counter-clockwise.</div> - </td> - </tr> - </table><table summary="" cellpadding="3" class="inherited"> - <tr><td class="title" colspan="2"> - Methods inherited from <a href="http://www.scala-lang.org/docu/files/api/scala/AnyRef.html" target="_self">AnyRef</a> - </td></tr> - <tr><td class="signature" colspan="2"> - <a href="http://www.scala-lang.org/docu/files/api/scala/AnyRef.html#getClass%28%29" target="_self">getClass</a>, <a href="http://www.scala-lang.org/docu/files/api/scala/AnyRef.html#hashCode%28%29" target="_self">hashCode</a>, <a href="http://www.scala-lang.org/docu/files/api/scala/AnyRef.html#equals%28Any%29" target="_self">equals</a>, <a href="http://www.scala-lang.org/docu/files/api/scala/AnyRef.html#clone%28%29" target="_self">clone</a>, <a href="http://www.scala-lang.org/docu/files/api/scala/AnyRef.html#toString%28%29" target="_self">toString</a>, <a href="http://www.scala-lang.org/docu/files/api/scala/AnyRef.html#notify%28%29" target="_self">notify</a>, <a href="http://www.scala-lang.org/docu/files/api/scala/AnyRef.html#notifyAll%28%29" target="_self">notifyAll</a>, <a href="http://www.scala-lang.org/docu/files/api/scala/AnyRef.html#wait%28Long%29" target="_self">wait</a>, <a href="http://www.scala-lang.org/docu/files/api/scala/AnyRef.html#wait%28Long%2CInt%29" target="_self">wait</a>, <a href="http://www.scala-lang.org/docu/files/api/scala/AnyRef.html#wait%28%29" target="_self">wait</a>, <a href="http://www.scala-lang.org/docu/files/api/scala/AnyRef.html#finalize%28%29" target="_self">finalize</a>, <a href="http://www.scala-lang.org/docu/files/api/scala/AnyRef.html#%3D%3D%28AnyRef%29" target="_self">==</a>, <a href="http://www.scala-lang.org/docu/files/api/scala/AnyRef.html#%21%3D%28AnyRef%29" target="_self">!=</a>, <a href="http://www.scala-lang.org/docu/files/api/scala/AnyRef.html#eq%28AnyRef%29" target="_self">eq</a>, <a href="http://www.scala-lang.org/docu/files/api/scala/AnyRef.html#ne%28AnyRef%29" target="_self">ne</a>, <a href="http://www.scala-lang.org/docu/files/api/scala/AnyRef.html#synchronized%28T0%29" target="_self">synchronized</a> - </td></tr> - </table><table summary="" cellpadding="3" class="inherited"> - <tr><td class="title" colspan="2"> - Methods inherited from <a href="http://www.scala-lang.org/docu/files/api/scala/Any.html" target="_self">Any</a> - </td></tr> - <tr><td class="signature" colspan="2"> - <a href="http://www.scala-lang.org/docu/files/api/scala/Any.html#%3D%3D%28Any%29" target="_self">==</a>, <a href="http://www.scala-lang.org/docu/files/api/scala/Any.html#%21%3D%28Any%29" target="_self">!=</a>, <a href="http://www.scala-lang.org/docu/files/api/scala/Any.html#isInstanceOf" target="_self">isInstanceOf</a>, <a href="http://www.scala-lang.org/docu/files/api/scala/Any.html#asInstanceOf" target="_self">asInstanceOf</a> - </td></tr> - </table> - - + <div class="members" id="values"> + <h3>Value Members</h3> + <ol><li name="sims.geometry.ConvexPolygon#AABB"> + <h4 class="signature"> + <span class="kind">def</span> + <span class="symbol"> + <span class="name">AABB</span><span class="result">: <a href="../collision/AABB.html" class="extype" name="sims.collision.AABB">AABB</a></span> + </span> + </h4> + <p class="shortcomment cmt">Returns this polygon's axis aligned bounding box</p><div class="fullcomment"> + <div class="comment cmt"><p>Returns this polygon's axis aligned bounding box.</p></div> - - -<table summary="" cellpadding="3" class="member-detail"> - <tr><td class="title">Method Details</td></tr> - </table><div><a name="vertices"></a><dl> - <dt> - - <code>abstract</code> - <code>def</code> - <em>vertices</em> : <a href="" target="contentFrame" class="scala/Seq">scala.Seq</a>[<a href="../../sims/geometry/Vector2D.html" target="_self">Vector2D</a>] - </dt> - <dd></dd> - </dl> - <dl><dd>Returns positions of all vertices of this Polygon. Vertices are ordered counter-clockwise.</dd></dl> - <dl><dt style="margin:10px 0 0 20px;"> - <b>Returns</b></dt><dd>position vectors of the vertices</dd></dl> - <hr></hr> -<a name="sides"></a><dl> - <dt> - - <code></code> - <code>def</code> - <em>sides</em> : <a href="" target="contentFrame" class="scala/Array">scala.Array</a>[<a href="../../sims/geometry/Segment.html" target="_self">Segment</a>] - </dt> - <dd></dd> - </dl> - <dl><dd>Returns all sides of this polygon. The sides are ordered counter-clockwise, the first vertex of the side
- giving the side index.</dd></dl> - <dl></dl> - <hr></hr> -<a name="project%28sims.geometry.Vector2D%29"></a><dl> - <dt> + + + + </div> + </li><li name="sims.geometry.ConvexPolygon#contains"> + <h4 class="signature"> + <span class="kind">def</span> + <span class="symbol"> + <span class="name">contains</span><span class="params">(<span name="point">point: <a href="Vector2D.html" class="extype" name="sims.geometry.Vector2D">Vector2D</a></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span> + </span> + </h4> + <p class="shortcomment cmt">Checks if the point <code>point</code> is contained in this polygon</p><div class="fullcomment"> + <div class="comment cmt"><p>Checks if the point <code>point</code> is contained in this polygon. +<p> +A ray is created, originating from the point and following an arbitrary direction (X-Axis was chosen). +The number of intersections between the ray and this polygon's sides (including vertices) is counted. +The amount of intersections with vertices is substracted form the previuos number. +If the latter number is odd, the point is contained in the polygon.</p></div> + + + + + </div> + </li><li name="scala.AnyRef#equals"> + <h4 class="signature"> + <span class="kind">def</span> + <span class="symbol"> + <span class="name">equals</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Any">Any</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span> + </span> + </h4> + <p class="shortcomment cmt">This method is used to compare the receiver object (<code>this</code>) +with the argument object (<code>arg0</code>) for equivalence</p><div class="fullcomment"> + <div class="comment cmt"><p>This method is used to compare the receiver object (<code>this</code>) +with the argument object (<code>arg0</code>) for equivalence.</p><p><p> +The default implementations of this method is an <a +href="http://en.wikipedia.org/wiki/Equivalence_relation">equivalence +relation</a>: + <ul> + <li>It is reflexive: for any instance <code>x</code> of type <code>Any</code>, + <code>x.equals(x)</code> should return <code>true</code>.</li> + <li>It is symmetric: for any instances <code>x</code> and <code>y</code> of type + <code>Any</code>, <code>x.equals(y)</code> should return <code>true</code> if and only + if <code>y.equals(x)</code> returns <code>true</code>.</li> + <li>It is transitive: for any instances + <code>x</code>, <code>y</code>, and <code>z</code> of type <code>AnyRef</code> + if <code>x.equals(y)</code> returns <code>true</code> and + <code>y.equals(z)</code> returns + <code>true</code>, then <code>x.equals(z)</code> should return <code>true</code>.</li> +</ul> +</p></p><p><p> +If you override this method, you should verify that +your implementation remains an equivalence relation. +Additionally, when overriding this method it is often necessary to +override <code>hashCode</code> to ensure that objects that are +"equal" (<code>o1.equals(o2)</code> returns <code>true</code>) +hash to the same <a href="Int.html"><code>Int</code></a> +(<code>o1.hashCode.equals(o2.hashCode)</code>). +</p></div> + <dl class="paramcmts block"><dt class="param">arg0</dt><dd class="cmt"><p>the object to compare against this object for equality.</p></dd><dt>returns</dt><dd class="cmt"><p><code>true</code> if the receiver object is equivalent to the argument; <code>false</code> otherwise. +</p></p></dd></dl> + + <div class="block"> + definition classes: AnyRef ⇐ Any + </div> + + </div> + </li><li name="scala.AnyRef#hashCode"> + <h4 class="signature"> + <span class="kind">def</span> + <span class="symbol"> + <span class="name">hashCode</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Int">Int</span></span> + </span> + </h4> + <p class="shortcomment cmt">Returns a hash code value for the object</p><div class="fullcomment"> + <div class="comment cmt"><p>Returns a hash code value for the object.</p><p><p> +The default hashing algorithm is platform dependent.</p><p>Note that it is allowed for two objects to have identical hash +codes (<code>o1.hashCode.equals(o2.hashCode)</code>) yet not be +equal (<code>o1.equals(o2)</code> returns <code>false</code>). A +degenerate implementation could always return <code>0</code>. +However, it is required that if two objects are equal +(<code>o1.equals(o2)</code> returns <code>true</code>) that they +have identical hash codes +(<code>o1.hashCode.equals(o2.hashCode)</code>). Therefore, when +overriding this method, be sure to verify that the behavior is +consistent with the <code>equals</code> method. +</p></p><p><p></p></div> + + + <div class="block"> + definition classes: AnyRef ⇐ Any + </div> + + </div> + </li><li name="sims.geometry.ConvexPolygon#project"> + <h4 class="signature"> + <span class="kind">def</span> + <span class="symbol"> + <span class="name">project</span><span class="params">(<span name="axis">axis: <a href="Vector2D.html" class="extype" name="sims.geometry.Vector2D">Vector2D</a></span>)</span><span class="result">: <a href="Projection.html" class="extype" name="sims.geometry.Projection">Projection</a></span> + </span> + </h4> + <p class="shortcomment cmt">Returns the projection of this polygon onto the line given by the directional vector <code>axis</code></p><div class="fullcomment"> + <div class="comment cmt"><p>Returns the projection of this polygon onto the line given by the directional vector <code>axis</code>.</p></div> + <dl class="paramcmts block"><dt class="param">axis</dt><dd class="cmt"><p>directional vector of the line</p></dd><dt>returns</dt><dd class="cmt"><p>projection of this polygon</p></dd></dl> + + + + </div> + </li><li name="sims.geometry.ConvexPolygon#sides"> + <h4 class="signature"> + <span class="kind">def</span> + <span class="symbol"> + <span class="name">sides</span><span class="result">: <span class="extype" name="scala.Array">Array</span>[<a href="Segment.html" class="extype" name="sims.geometry.Segment">Segment</a>]</span> + </span> + </h4> + <p class="shortcomment cmt">Returns all sides of this polygon</p><div class="fullcomment"> + <div class="comment cmt"><p>Returns all sides of this polygon. The sides are ordered counter-clockwise, the first vertex of the side +giving the side index.</p></div> + + + + + </div> + </li><li name="scala.AnyRef#toString"> + <h4 class="signature"> + <span class="kind">def</span> + <span class="symbol"> + <span class="name">toString</span><span class="params">()</span><span class="result">: <span class="extype" name="java.lang.String">String</span></span> + </span> + </h4> + <p class="shortcomment cmt">Returns a string representation of the object</p><div class="fullcomment"> + <div class="comment cmt"><p>Returns a string representation of the object. +<p> +The default representation is platform dependent. +</p></div> + + + <div class="block"> + definition classes: AnyRef ⇐ Any + </div> + + </div> + </li><li name="sims.geometry.ConvexPolygon#vertices"> + <h4 class="signature"> + <span class="kind">def</span> + <span class="symbol"> + <span class="name">vertices</span><span class="result">: <span class="extype" name="scala.collection.Seq">Seq</span>[<a href="Vector2D.html" class="extype" name="sims.geometry.Vector2D">Vector2D</a>]</span> + </span> + </h4> + <p class="shortcomment cmt">Returns positions of all vertices of this Polygon</p><div class="fullcomment"> + <div class="comment cmt"><p>Returns positions of all vertices of this Polygon. Vertices are ordered counter-clockwise.</p></div> + + <div class="block"> + attributes: abstract + </div> + + + </div> + </li></ol> + </div> - <code></code> - <code>def</code> - <em>project</em>(<em>axis</em> : <a href="../../sims/geometry/Vector2D.html" target="_self">Vector2D</a>) : <a href="../../sims/geometry/Projection.html" target="_self">Projection</a> - </dt> - <dd></dd> - </dl> - <dl><dd>Returns the projection of this polygon onto the line given by the directional vector <code>axis</code>.</dd></dl> - <dl><dt style="margin:10px 0 0 20px;"> - <b>Parameters</b></dt><dd><code>axis - </code>directional vector of the line</dd><dt style="margin:10px 0 0 20px;"> - <b>Returns</b></dt><dd>projection of this polygon</dd></dl> - <hr></hr> -<a name="AABB"></a><dl> - <dt> - <code></code> - <code>def</code> - <em>AABB</em> : <a href="../../sims/collision/AABB.html" target="_self">AABB</a> - </dt> - <dd></dd> - </dl> - <dl><dd>Returns this polygon's axis aligned bounding box.</dd></dl> - <dl><dt style="margin:10px 0 0 20px;"> - <b>See Also</b></dt><dd>collision.AABB</dd></dl> - <hr></hr> -<a name="contains%28sims.geometry.Vector2D%29"></a><dl> - <dt> - <code></code> - <code>def</code> - <em>contains</em>(<em>point</em> : <a href="../../sims/geometry/Vector2D.html" target="_self">Vector2D</a>) : <a href="http://www.scala-lang.org/docu/files/api/scala/Boolean.html" target="_self">Boolean</a> - </dt> - <dd></dd> - </dl> - <dl><dd>Checks if the point <code>point</code> is contained in this polygon.
- <p>
- A ray is created, originating from the point and following an arbitrary direction (X-Axis was chosen).
- The number of intersections between the ray and this polygon's sides (including vertices) is counted.
- The amount of intersections with vertices is substracted form the previuos number.
- If the latter number is odd, the point is contained in the polygon.</dd></dl> - <dl></dl> - <hr></hr></div> - - - <hr></hr> - <table summary="" class="navigation"> - <tr> - <td class="navigation-links" valign="top"> - <!-- <table><tr></tr></table> --> - </td> - <td align="right" valign="top" style="white-space:nowrap;" rowspan="2"> - <div class="doctitle-larger">SiMS</div> - </td> - </tr> - <tr><td></td></tr> - </table> - </body> + </div> + + </body> </html>
\ No newline at end of file |