<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>The Gnome Chemistry Utils: gcu::Sphere Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">The Gnome Chemistry Utils  <span id="projectnumber">0.14.2</span> </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.1.2 --> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class List</span></a></li> <li><a href="classes.html"><span>Class Index</span></a></li> <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> <li><a href="functions.html"><span>Class Members</span></a></li> </ul> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="namespacegcu.html">gcu</a></li><li class="navelem"><a class="el" href="classgcu_1_1Sphere.html">Sphere</a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="summary"> <a href="#pub-methods">Public Member Functions</a> | <a href="#pro-methods">Protected Member Functions</a> | <a href="classgcu_1_1Sphere-members.html">List of all members</a> </div> <div class="headertitle"> <div class="title">gcu::Sphere Class Reference</div> </div> </div><!--header--> <div class="contents"> <p><code>#include <<a class="el" href="sphere_8h_source.html">gcu/sphere.h</a>></code></p> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr class="memitem:a36e1408924c2e817173f25500695ec3f"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classgcu_1_1Sphere.html#a36e1408924c2e817173f25500695ec3f">setup</a> (int detail)</td></tr> <tr class="memitem:a51c6a4079b9ece2ebcfbc30d571e1c75"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classgcu_1_1Sphere.html#a51c6a4079b9ece2ebcfbc30d571e1c75">draw</a> (<a class="el" href="classgcu_1_1Vector.html">Vector</a> const &center, double radius) const </td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2><a name="pro-methods"></a> Protected Member Functions</h2></td></tr> <tr class="memitem:afd8ed2daed53b017cff34df27387fed4"><td class="memItemLeft" align="right" valign="top">unsigned short </td><td class="memItemRight" valign="bottom"><a class="el" href="classgcu_1_1Sphere.html#afd8ed2daed53b017cff34df27387fed4">indexOfVertex</a> (int strip, int column, int row)</td></tr> <tr class="memitem:aeae6c5c73f74e437298aefcbe9c651d3"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classgcu_1_1Sphere.html#aeae6c5c73f74e437298aefcbe9c651d3">computeVertex</a> (int strip, int column, int row)</td></tr> </table> <a name="details" id="details"></a><h2>Detailed Description</h2> <div class="textblock"><p>This class represents and draws a sphere. The level of detail can be controlled. At level 0, the sphere is a octahedron. At levels >=1, the sphere is a "geosphere", that is, one starts with an icosahedron, which is the regular solid with 20 triangular faces, and one then sub-tesselates each face into smaller triangles. This is a classical tesselation, known to give a very good quality/complexity ratio.</p> <dl class="section author"><dt>Author</dt><dd>Benoit Jacob <a href="#" onclick="location.href='mai'+'lto:'+'jac'+'ob'+'@ma'+'th'+'.ju'+'ss'+'ieu'+'.f'+'r'; return false;">jacob<span style="display: none;">.nosp@m.</span>@mat<span style="display: none;">.nosp@m.</span>h.jus<span style="display: none;">.nosp@m.</span>sieu<span style="display: none;">.nosp@m.</span>.fr</a> </dd></dl> <p>Definition at line <a class="el" href="sphere_8h_source.html#l00046">46</a> of file <a class="el" href="sphere_8h_source.html">sphere.h</a>.</p> </div><h2>Member Function Documentation</h2> <a class="anchor" id="aeae6c5c73f74e437298aefcbe9c651d3"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">void gcu::Sphere::computeVertex </td> <td>(</td> <td class="paramtype">int </td> <td class="paramname"><em>strip</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"><em>column</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"><em>row</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">protected</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>computes the coordinates of a vertex given by its position (strip, column, row) inside a certain flat model of the sub-tesselated icosahedron </p> </div> </div> <a class="anchor" id="a51c6a4079b9ece2ebcfbc30d571e1c75"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void gcu::Sphere::draw </td> <td>(</td> <td class="paramtype"><a class="el" href="classgcu_1_1Vector.html">Vector</a> const & </td> <td class="paramname"><em>center</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">double </td> <td class="paramname"><em>radius</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const</td> </tr> </table> </div><div class="memdoc"> <p>draws the sphere at specified position and with specified radius </p> </div> </div> <a class="anchor" id="afd8ed2daed53b017cff34df27387fed4"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">unsigned short gcu::Sphere::indexOfVertex </td> <td>(</td> <td class="paramtype">int </td> <td class="paramname"><em>strip</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"><em>column</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"><em>row</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">protected</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>computes the index (position inside the index buffer) of a vertex given by its position (strip, column, row) inside a certain flat model of the sub-tesselated icosahedron </p> </div> </div> <a class="anchor" id="a36e1408924c2e817173f25500695ec3f"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void gcu::Sphere::setup </td> <td>(</td> <td class="paramtype">int </td> <td class="paramname"><em>detail</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <pre class="fragment">initializes the sphere with given level of detail. If the </pre><p> sphere was already initialized, any pre-allocated buffers are freed and then re-allocated. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">detail</td><td>the wanted level of detail. See m_detail member </td></tr> </table> </dd> </dl> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li><a class="el" href="sphere_8h_source.html">sphere.h</a></li> </ul> </div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated on Thu Mar 14 2013 17:34:32 for The Gnome Chemistry Utils by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.1.2 </small></address> </body> </html>