Sophie

Sophie

distrib > Fedora > 16 > i386 > by-pkgid > 4bc66056a634db26a1f4d0845dc41ca6 > files > 1613

mrpt-doc-0.9.5-0.1.20110925svn2670.fc16.i686.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>CPolyhedron.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<div align="left"><a href="http://www.mrpt.org/">Main MRPT website</a> &gt; <b>C++ reference</b> </div>
<div align="right">
<a href="index.html"><img border="0" src="mrpt_logo.png" alt="MRPT logo"></a>
</div>
<!-- Generated by Doxygen 1.7.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
          <div class="left">
            <form id="FSearchBox" action="search.php" method="get">
              <img id="MSearchSelect" src="search/mag.png" alt=""/>
              <input type="text" id="MSearchField" name="query" value="Search" size="20" accesskey="S" 
                     onfocus="searchBox.OnSearchFieldFocus(true)" 
                     onblur="searchBox.OnSearchFieldFocus(false)"/>
            </form>
          </div><div class="right"></div>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<div class="title">CPolyhedron.h</div>  </div>
</div>
<div class="contents">
<a href="_c_polyhedron_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* +---------------------------------------------------------------------------+</span>
<a name="l00002"></a>00002 <span class="comment">   |          The Mobile Robot Programming Toolkit (MRPT) C++ library          |</span>
<a name="l00003"></a>00003 <span class="comment">   |                                                                           |</span>
<a name="l00004"></a>00004 <span class="comment">   |                       http://www.mrpt.org/                                |</span>
<a name="l00005"></a>00005 <span class="comment">   |                                                                           |</span>
<a name="l00006"></a>00006 <span class="comment">   |   Copyright (C) 2005-2011  University of Malaga                           |</span>
<a name="l00007"></a>00007 <span class="comment">   |                                                                           |</span>
<a name="l00008"></a>00008 <span class="comment">   |    This software was written by the Machine Perception and Intelligent    |</span>
<a name="l00009"></a>00009 <span class="comment">   |      Robotics Lab, University of Malaga (Spain).                          |</span>
<a name="l00010"></a>00010 <span class="comment">   |    Contact: Jose-Luis Blanco  &lt;jlblanco@ctima.uma.es&gt;                     |</span>
<a name="l00011"></a>00011 <span class="comment">   |                                                                           |</span>
<a name="l00012"></a>00012 <span class="comment">   |  This file is part of the MRPT project.                                   |</span>
<a name="l00013"></a>00013 <span class="comment">   |                                                                           |</span>
<a name="l00014"></a>00014 <span class="comment">   |     MRPT is free software: you can redistribute it and/or modify          |</span>
<a name="l00015"></a>00015 <span class="comment">   |     it under the terms of the GNU General Public License as published by  |</span>
<a name="l00016"></a>00016 <span class="comment">   |     the Free Software Foundation, either version 3 of the License, or     |</span>
<a name="l00017"></a>00017 <span class="comment">   |     (at your option) any later version.                                   |</span>
<a name="l00018"></a>00018 <span class="comment">   |                                                                           |</span>
<a name="l00019"></a>00019 <span class="comment">   |   MRPT is distributed in the hope that it will be useful,                 |</span>
<a name="l00020"></a>00020 <span class="comment">   |     but WITHOUT ANY WARRANTY; without even the implied warranty of        |</span>
<a name="l00021"></a>00021 <span class="comment">   |     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         |</span>
<a name="l00022"></a>00022 <span class="comment">   |     GNU General Public License for more details.                          |</span>
<a name="l00023"></a>00023 <span class="comment">   |                                                                           |</span>
<a name="l00024"></a>00024 <span class="comment">   |     You should have received a copy of the GNU General Public License     |</span>
<a name="l00025"></a>00025 <span class="comment">   |     along with MRPT.  If not, see &lt;http://www.gnu.org/licenses/&gt;.         |</span>
<a name="l00026"></a>00026 <span class="comment">   |                                                                           |</span>
<a name="l00027"></a>00027 <span class="comment">   +---------------------------------------------------------------------------+ */</span>
<a name="l00028"></a>00028 <span class="preprocessor">#ifndef opengl_CPolyhedron_H</span>
<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define opengl_CPolyhedron_H</span>
<a name="l00030"></a>00030 <span class="preprocessor"></span>
<a name="l00031"></a>00031 <span class="preprocessor">#include &lt;<a class="code" href="_c_renderizable_display_list_8h.html">mrpt/opengl/CRenderizableDisplayList.h</a>&gt;</span>
<a name="l00032"></a>00032 <span class="preprocessor">#include &lt;<a class="code" href="stl__extensions_8h.html">mrpt/utils/stl_extensions.h</a>&gt;</span>
<a name="l00033"></a>00033 <span class="preprocessor">#include &lt;<a class="code" href="geometry_8h.html">mrpt/math/geometry.h</a>&gt;</span>
<a name="l00034"></a>00034 
<a name="l00035"></a>00035 <span class="keyword">namespace </span>mrpt  {
<a name="l00036"></a>00036 <span class="keyword">namespace </span>opengl        {
<a name="l00037"></a>00037         <span class="keyword">using namespace </span>mrpt::utils;
<a name="l00038"></a>00038         <span class="keyword">using namespace </span>mrpt::poses;
<a name="l00039"></a>00039         <span class="keyword">using namespace </span>std;
<a name="l00040"></a>00040 
<a name="l00041"></a><a class="code" href="namespacemrpt_1_1opengl.html#aca7da3a54971b25c26508857039248aa">00041</a>         <span class="keyword">class </span><a class="code" href="opengl_2include_2mrpt_2opengl_2link__pragmas_8h.html#af6a1c8d5d6b3c8c0af00dbeef88ce269">OPENGL_IMPEXP</a> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html" title="This class represents arbitrary polyhedra.">CPolyhedron</a>;
<a name="l00042"></a>00042 
<a name="l00043"></a>00043         <span class="comment">// This must be added to any CSerializable derived class:</span>
<a name="l00044"></a><a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html#acadc5f5ae70ea8524e5ffb0ee88ef2e7">00044</a>         <a class="code" href="_c_serializable_8h.html#a9ef523d787f6cb837a0585b790882588" title="This declaration must be inserted in all CSerializable classes definition, before the class declarati...">DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE_LINKAGE</a>(<a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html" title="This class represents arbitrary polyhedra.">CPolyhedron</a>,<a class="code" href="classmrpt_1_1opengl_1_1_c_renderizable_display_list.html" title="A renderizable object suitable for rendering with OpenGL&#39;s display lists.">CRenderizableDisplayList</a>, <a class="code" href="opengl_2include_2mrpt_2opengl_2link__pragmas_8h.html#af6a1c8d5d6b3c8c0af00dbeef88ce269">OPENGL_IMPEXP</a>)<span class="comment"></span>
<a name="l00045"></a>00045 <span class="comment">        /**</span>
<a name="l00046"></a>00046 <span class="comment">          * This class represents arbitrary polyhedra. The class includes a set of static methods to create common polyhedrons. The class includes many methods to create standard polyhedra, not intended to be fast but to be simple. For example, the dodecahedron is not created efficiently: first, an icosahedron is created, and a duality operator is applied to it, which yields the dodecahedron. This way, code is much smaller, although much slower. This is not a big problem, since polyhedron creation does not usually take a significant amount of time (they are created once and rendered many times).</span>
<a name="l00047"></a>00047 <span class="comment">          * Polyhedra information and models have been gotten from the Wikipedia, http://wikipedia.org</span>
<a name="l00048"></a>00048 <span class="comment">          * \sa opengl::COpenGLScene</span>
<a name="l00049"></a>00049 <span class="comment">          *  </span>
<a name="l00050"></a>00050 <span class="comment">          *  &lt;div align=&quot;center&quot;&gt;</span>
<a name="l00051"></a>00051 <span class="comment">          *  &lt;table border=&quot;0&quot; cellspan=&quot;4&quot; cellspacing=&quot;4&quot; style=&quot;border-width: 1px; border-style: solid;&quot;&gt;</span>
<a name="l00052"></a>00052 <span class="comment">          *   &lt;tr&gt; &lt;td&gt; mrpt::opengl::CPolyhedron &lt;/td&gt; &lt;td&gt; \image html preview_CPolyhedron.png &lt;/td&gt; &lt;/tr&gt;</span>
<a name="l00053"></a>00053 <span class="comment">          *  &lt;/table&gt;</span>
<a name="l00054"></a>00054 <span class="comment">          *  &lt;/div&gt;</span>
<a name="l00055"></a>00055 <span class="comment">          *  </span>
<a name="l00056"></a>00056 <span class="comment">          * \ingroup mrpt_opengl_grp</span>
<a name="l00057"></a>00057 <span class="comment">          */</span>
<a name="l00058"></a>00058         class <a class="code" href="opengl_2include_2mrpt_2opengl_2link__pragmas_8h.html#af6a1c8d5d6b3c8c0af00dbeef88ce269">OPENGL_IMPEXP</a> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html" title="This class represents arbitrary polyhedra.">CPolyhedron</a>:public <a class="code" href="classmrpt_1_1opengl_1_1_c_renderizable_display_list.html" title="A renderizable object suitable for rendering with OpenGL&#39;s display lists.">CRenderizableDisplayList</a> {
<a name="l00059"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a923f9601d86cbf2c00ddafc156a8ddc6">00059</a>                 <a class="code" href="_c_serializable_8h.html#a72ab55bf7ae009c89b75715cfa21e84d" title="This declaration must be inserted in all CSerializable classes definition, within the class declarati...">DEFINE_SERIALIZABLE</a>(<a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html" title="This class represents arbitrary polyhedra.">CPolyhedron</a>)
<a name="l00060"></a>00060         public:<span class="comment"></span>
<a name="l00061"></a>00061 <span class="comment">                /**</span>
<a name="l00062"></a>00062 <span class="comment">                  * Struct used to store a polyhedron edge. The struct consists only of two vertex indices, used to access the polyhedron vertex list.</span>
<a name="l00063"></a>00063 <span class="comment">                  */</span>
<a name="l00064"></a>00064                 struct <a class="code" href="opengl_2include_2mrpt_2opengl_2link__pragmas_8h.html#af6a1c8d5d6b3c8c0af00dbeef88ce269">OPENGL_IMPEXP</a> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_1_1_t_polyhedron_edge.html" title="Struct used to store a polyhedron edge.">TPolyhedronEdge</a>    {<span class="comment"></span>
<a name="l00065"></a>00065 <span class="comment">                        /**</span>
<a name="l00066"></a>00066 <span class="comment">                          * First vertex.</span>
<a name="l00067"></a>00067 <span class="comment">                          */</span>
<a name="l00068"></a><a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_1_1_t_polyhedron_edge.html#a0772048f116b6ab3c7e8774b6b2e060e">00068</a>                         uint32_t <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_1_1_t_polyhedron_edge.html#a0772048f116b6ab3c7e8774b6b2e060e" title="First vertex.">v1</a>;<span class="comment"></span>
<a name="l00069"></a>00069 <span class="comment">                        /**</span>
<a name="l00070"></a>00070 <span class="comment">                          * Second vertex.</span>
<a name="l00071"></a>00071 <span class="comment">                          */</span>
<a name="l00072"></a><a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_1_1_t_polyhedron_edge.html#a2cfa185c63a2c53d9966f17fdcd9a2eb">00072</a>                         uint32_t <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_1_1_t_polyhedron_edge.html#a2cfa185c63a2c53d9966f17fdcd9a2eb" title="Second vertex.">v2</a>;<span class="comment"></span>
<a name="l00073"></a>00073 <span class="comment">                        /**</span>
<a name="l00074"></a>00074 <span class="comment">                          * Default constructor. Initializes to garbage.</span>
<a name="l00075"></a>00075 <span class="comment">                          */</span>
<a name="l00076"></a><a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_1_1_t_polyhedron_edge.html#a73a2cf8d6bea16c20a9f6254aa471d58">00076</a>                         <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_1_1_t_polyhedron_edge.html#a73a2cf8d6bea16c20a9f6254aa471d58" title="Default constructor.">TPolyhedronEdge</a>():v1(),v2()     {}<span class="comment"></span>
<a name="l00077"></a>00077 <span class="comment">                        /**</span>
<a name="l00078"></a>00078 <span class="comment">                          * Comparison agains another edge. Simmetry is taken into account.</span>
<a name="l00079"></a>00079 <span class="comment">                          */</span>
<a name="l00080"></a><a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_1_1_t_polyhedron_edge.html#aa968ed7047bbb01c695028eb9e1b9fc8">00080</a>                         <span class="keywordtype">bool</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_1_1_t_polyhedron_edge.html#aa968ed7047bbb01c695028eb9e1b9fc8" title="Comparison agains another edge.">operator==</a>(<span class="keyword">const</span> TPolyhedronEdge &amp;e)<span class="keyword"> const </span>{
<a name="l00081"></a>00081                                 <span class="keywordflow">if</span> (e.<a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_1_1_t_polyhedron_edge.html#a0772048f116b6ab3c7e8774b6b2e060e" title="First vertex.">v1</a>==v1&amp;&amp;e.<a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_1_1_t_polyhedron_edge.html#a2cfa185c63a2c53d9966f17fdcd9a2eb" title="Second vertex.">v2</a>==v2) <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00082"></a>00082                                 <span class="keywordflow">else</span> <span class="keywordflow">return</span> e.<a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_1_1_t_polyhedron_edge.html#a0772048f116b6ab3c7e8774b6b2e060e" title="First vertex.">v1</a>==v2&amp;&amp;e.<a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_1_1_t_polyhedron_edge.html#a2cfa185c63a2c53d9966f17fdcd9a2eb" title="Second vertex.">v2</a>==v1;
<a name="l00083"></a>00083                         }<span class="comment"></span>
<a name="l00084"></a>00084 <span class="comment">                        /**</span>
<a name="l00085"></a>00085 <span class="comment">                          * Given a set of vertices, computes the length of the vertex.</span>
<a name="l00086"></a>00086 <span class="comment">                          */</span>
<a name="l00087"></a>00087                         <span class="keywordtype">double</span> length(<span class="keyword">const</span> <a class="code" href="classstd_1_1vector.html">vector&lt;TPoint3D&gt;</a> &amp;vs) <span class="keyword">const</span>;<span class="comment"></span>
<a name="l00088"></a>00088 <span class="comment">                        /**</span>
<a name="l00089"></a>00089 <span class="comment">                          * Destructor.</span>
<a name="l00090"></a>00090 <span class="comment">                          */</span>
<a name="l00091"></a><a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_1_1_t_polyhedron_edge.html#a1f3975f8daa01844eb5da1f5b3be4d3e">00091</a>                         <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_1_1_t_polyhedron_edge.html#a1f3975f8daa01844eb5da1f5b3be4d3e" title="Destructor.">~TPolyhedronEdge</a>()      {}
<a name="l00092"></a>00092                 };<span class="comment"></span>
<a name="l00093"></a>00093 <span class="comment">                /**</span>
<a name="l00094"></a>00094 <span class="comment">                  * Struct used to store a polyhedron face. Consists on a set of vertex indices and a normal vector.</span>
<a name="l00095"></a>00095 <span class="comment">                  */</span>
<a name="l00096"></a>00096                 <span class="keyword">struct </span><a class="code" href="opengl_2include_2mrpt_2opengl_2link__pragmas_8h.html#af6a1c8d5d6b3c8c0af00dbeef88ce269">OPENGL_IMPEXP</a> TPolyhedronFace    {<span class="comment"></span>
<a name="l00097"></a>00097 <span class="comment">                        /**</span>
<a name="l00098"></a>00098 <span class="comment">                          * Vector of indices to the vertex list.</span>
<a name="l00099"></a>00099 <span class="comment">                          */</span>
<a name="l00100"></a><a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_1_1_t_polyhedron_face.html#a978b01f5669f5dc07bd1a6ec20136edf">00100</a>                         <a class="code" href="classstd_1_1vector.html">vector&lt;uint32_t&gt;</a> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_1_1_t_polyhedron_face.html#a978b01f5669f5dc07bd1a6ec20136edf" title="Vector of indices to the vertex list.">vertices</a>;<span class="comment"></span>
<a name="l00101"></a>00101 <span class="comment">                        /**</span>
<a name="l00102"></a>00102 <span class="comment">                          * Normal vector.</span>
<a name="l00103"></a>00103 <span class="comment">                          */</span>
<a name="l00104"></a><a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_1_1_t_polyhedron_face.html#a88eee1fb98696e877289fd97576d882e">00104</a>                         <span class="keywordtype">double</span> normal[3];<span class="comment"></span>
<a name="l00105"></a>00105 <span class="comment">                        /**</span>
<a name="l00106"></a>00106 <span class="comment">                          * Fast default constructor. Initializes to garbage.</span>
<a name="l00107"></a>00107 <span class="comment">                          */</span>
<a name="l00108"></a><a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_1_1_t_polyhedron_face.html#a3967e837c81d2073d32821d5b4b1eb86">00108</a>                         <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_1_1_t_polyhedron_face.html#a3967e837c81d2073d32821d5b4b1eb86" title="Fast default constructor.">TPolyhedronFace</a>():vertices()    {}<span class="comment"></span>
<a name="l00109"></a>00109 <span class="comment">                        /**</span>
<a name="l00110"></a>00110 <span class="comment">                          * Destructor.</span>
<a name="l00111"></a>00111 <span class="comment">                          */</span>
<a name="l00112"></a><a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_1_1_t_polyhedron_face.html#a7ddc8da44af779d608e725a7b5ab28c4">00112</a>                         <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_1_1_t_polyhedron_face.html#a7ddc8da44af779d608e725a7b5ab28c4" title="Destructor.">~TPolyhedronFace</a>()      {}<span class="comment"></span>
<a name="l00113"></a>00113 <span class="comment">                        /**</span>
<a name="l00114"></a>00114 <span class="comment">                          * Given a set of vertices, computes the area of this face.</span>
<a name="l00115"></a>00115 <span class="comment">                          */</span>
<a name="l00116"></a>00116                         <span class="keywordtype">double</span> area(<span class="keyword">const</span> <a class="code" href="classstd_1_1vector.html">vector&lt;TPoint3D&gt;</a> &amp;vertices) <span class="keyword">const</span>;<span class="comment"></span>
<a name="l00117"></a>00117 <span class="comment">                        /**</span>
<a name="l00118"></a>00118 <span class="comment">                          * Given a set of vertices, get this face&#39;s center.</span>
<a name="l00119"></a>00119 <span class="comment">                          */</span>
<a name="l00120"></a>00120                         <span class="keywordtype">void</span> getCenter(<span class="keyword">const</span> <a class="code" href="classstd_1_1vector.html">vector&lt;TPoint3D&gt;</a> &amp;vertices,<a class="code" href="structmrpt_1_1math_1_1_t_point3_d.html" title="Lightweight 3D point.">TPoint3D</a> &amp;p) <span class="keyword">const</span>;
<a name="l00121"></a>00121                 };
<a name="l00122"></a>00122         <span class="keyword">protected</span>:<span class="comment"></span>
<a name="l00123"></a>00123 <span class="comment">                /**</span>
<a name="l00124"></a>00124 <span class="comment">                  * List of vertices presents in the polyhedron.</span>
<a name="l00125"></a>00125 <span class="comment">                  */</span>
<a name="l00126"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a00892c8ef6b43290f642c148cba358e4">00126</a>                 <a class="code" href="classstd_1_1vector.html">vector&lt;TPoint3D&gt;</a> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a00892c8ef6b43290f642c148cba358e4" title="List of vertices presents in the polyhedron.">mVertices</a>;<span class="comment"></span>
<a name="l00127"></a>00127 <span class="comment">                /**</span>
<a name="l00128"></a>00128 <span class="comment">                  * List of polyhedron&#39;s edges.</span>
<a name="l00129"></a>00129 <span class="comment">                  */</span>
<a name="l00130"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a51713062c91d55827b6a1796a621c49f">00130</a>                 <a class="code" href="classstd_1_1vector.html">vector&lt;TPolyhedronEdge&gt;</a> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a51713062c91d55827b6a1796a621c49f" title="List of polyhedron&#39;s edges.">mEdges</a>;<span class="comment"></span>
<a name="l00131"></a>00131 <span class="comment">                /**</span>
<a name="l00132"></a>00132 <span class="comment">                  * List of polyhedron&#39;s faces.</span>
<a name="l00133"></a>00133 <span class="comment">                  */</span>
<a name="l00134"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a557a516979ea8d492a644f9f158fda4c">00134</a>                 <a class="code" href="classstd_1_1vector.html">vector&lt;TPolyhedronFace&gt;</a> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a557a516979ea8d492a644f9f158fda4c" title="List of polyhedron&#39;s faces.">mFaces</a>;<span class="comment"></span>
<a name="l00135"></a>00135 <span class="comment">                /**</span>
<a name="l00136"></a>00136 <span class="comment">                  * This flag determines whether the polyhedron will be displayed as a solid object or as a set of edges.</span>
<a name="l00137"></a>00137 <span class="comment">                  */</span>
<a name="l00138"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#af620619a1a33070480eb22b8a918bf54">00138</a>                 <span class="keywordtype">bool</span> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#af620619a1a33070480eb22b8a918bf54" title="This flag determines whether the polyhedron will be displayed as a solid object or as a set of edges...">mWireframe</a>;<span class="comment"></span>
<a name="l00139"></a>00139 <span class="comment">                /**</span>
<a name="l00140"></a>00140 <span class="comment">                  * When displaying as wireframe object, this variable stores the width of the edges.</span>
<a name="l00141"></a>00141 <span class="comment">                  */</span>
<a name="l00142"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#abe3854c8f608e850644950f811f930b1">00142</a>                 <span class="keywordtype">double</span> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#abe3854c8f608e850644950f811f930b1" title="When displaying as wireframe object, this variable stores the width of the edges.">mLineWidth</a>;<span class="comment"></span>
<a name="l00143"></a>00143 <span class="comment">                /**</span>
<a name="l00144"></a>00144 <span class="comment">                  * Mutable list of actual polygons, maintained for speed.</span>
<a name="l00145"></a>00145 <span class="comment">                  */</span>
<a name="l00146"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#ac6b6cb2f69324c452055a32b9cfcdb9e">00146</a>                 <span class="keyword">mutable</span> std<a class="code" href="classstd_1_1vector.html">::vector&lt;TPolygonWithPlane&gt;</a> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#ac6b6cb2f69324c452055a32b9cfcdb9e" title="Mutable list of actual polygons, maintained for speed.">tempPolygons</a>;<span class="comment"></span>
<a name="l00147"></a>00147 <span class="comment">                /**</span>
<a name="l00148"></a>00148 <span class="comment">                  * Whether the set of actual polygons is up to date or not.</span>
<a name="l00149"></a>00149 <span class="comment">                  */</span>
<a name="l00150"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a05dd62bae9188974721d7261cd489b11">00150</a>                 <span class="keyword">mutable</span> <span class="keywordtype">bool</span> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a05dd62bae9188974721d7261cd489b11" title="Whether the set of actual polygons is up to date or not.">polygonsUpToDate</a>;
<a name="l00151"></a>00151         <span class="keyword">public</span>:<span class="comment"></span>
<a name="l00152"></a>00152 <span class="comment">                /**</span>
<a name="l00153"></a>00153 <span class="comment">                  * Creation of a polyhedron from its vertices and faces.</span>
<a name="l00154"></a>00154 <span class="comment">                  * \throw logic_error if the polyhedron definition has flaws (bad vertex indices, etc.).</span>
<a name="l00155"></a>00155 <span class="comment">                  */</span>
<a name="l00156"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a2a1e05c411170737b699ac055494948a">00156</a>                 <span class="keyword">inline</span> <span class="keyword">static</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a2a1e05c411170737b699ac055494948a" title="Creation of a polyhedron from its vertices and faces.">Create</a>(<span class="keyword">const</span> <a class="code" href="classstd_1_1vector.html">vector&lt;TPoint3D&gt;</a> &amp;vertices,<span class="keyword">const</span> <a class="code" href="classstd_1_1vector.html" title="STL class.">vector</a>&lt;<a class="code" href="classstd_1_1vector.html">vector&lt;uint32_t&gt;</a> &gt; &amp;faces)    {
<a name="l00157"></a>00157                         <a class="code" href="classstd_1_1vector.html">vector&lt;TPolyhedronFace&gt;</a> aux;
<a name="l00158"></a>00158                         <span class="keywordflow">for</span> (<a class="code" href="classstd_1_1vector.html" title="STL class.">vector</a>&lt;<a class="code" href="classstd_1_1vector.html">vector&lt;uint32_t&gt;</a> &gt;::<a class="code" href="eigen__plugins_8h.html#a8dbda719917732693c56cee228465ed9">const_iterator</a> it=faces.begin();it!=faces.end();++it)   {
<a name="l00159"></a>00159                                 <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_1_1_t_polyhedron_face.html" title="Struct used to store a polyhedron face.">TPolyhedronFace</a> f;
<a name="l00160"></a>00160                                 f.<a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_1_1_t_polyhedron_face.html#a978b01f5669f5dc07bd1a6ec20136edf" title="Vector of indices to the vertex list.">vertices</a>=*it;
<a name="l00161"></a>00161                                 aux.push_back(f);
<a name="l00162"></a>00162                         }
<a name="l00163"></a>00163                         <span class="keywordflow">return</span> Create(vertices,aux);
<a name="l00164"></a>00164                 }<span class="comment"></span>
<a name="l00165"></a>00165 <span class="comment">                /**</span>
<a name="l00166"></a>00166 <span class="comment">                  * Creation of a polyhedron from its vertices and faces.</span>
<a name="l00167"></a>00167 <span class="comment">                  * \throw logic_error if the polyhedron definition has flaws (bad vertex indices, etc.).</span>
<a name="l00168"></a>00168 <span class="comment">                  */</span>
<a name="l00169"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#ab043adec19d45e87d1fb640496d86931">00169</a>                 <span class="keyword">inline</span> <span class="keyword">static</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#ab043adec19d45e87d1fb640496d86931" title="Creation of a polyhedron from its vertices and faces.">Create</a>(<span class="keyword">const</span> <a class="code" href="classstd_1_1vector.html">vector&lt;TPoint3D&gt;</a> &amp;vertices,<span class="keyword">const</span> <a class="code" href="classstd_1_1vector.html">vector&lt;TPolyhedronFace&gt;</a> &amp;faces)      {
<a name="l00170"></a>00170                         <span class="keywordflow">return</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a>(<span class="keyword">new</span> <a class="code" href="namespacemrpt_1_1opengl.html#aca7da3a54971b25c26508857039248aa">CPolyhedron</a>(vertices,faces,<span class="keyword">true</span>));
<a name="l00171"></a>00171                 }<span class="comment"></span>
<a name="l00172"></a>00172 <span class="comment">                /**</span>
<a name="l00173"></a>00173 <span class="comment">                  * Creation from a set of polygons.</span>
<a name="l00174"></a>00174 <span class="comment">                  * \sa mrpt::math::TPolygon3D</span>
<a name="l00175"></a>00175 <span class="comment">                  */</span>
<a name="l00176"></a>00176                 <span class="keyword">static</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> Create(<span class="keyword">const</span> <a class="code" href="classstd_1_1vector.html" title="STL class.">std::vector&lt;math::TPolygon3D&gt;</a> &amp;polys);
<a name="l00177"></a>00177 
<a name="l00178"></a>00178                 <span class="comment">//Static methods to create frequent polyhedra. More bizarre polyhedra are intended to be added in a near future.</span>
<a name="l00179"></a>00179 <span class="comment"></span>
<a name="l00180"></a>00180 <span class="comment">                /** @name Platonic solids.</span>
<a name="l00181"></a>00181 <span class="comment">                        @{</span>
<a name="l00182"></a>00182 <span class="comment">                 */</span><span class="comment"></span>
<a name="l00183"></a>00183 <span class="comment">                /**</span>
<a name="l00184"></a>00184 <span class="comment">                  * Creates a regular tetrahedron (see http://en.wikipedia.org/wiki/Tetrahedron). The tetrahedron is created as a triangular pyramid whose edges and vertices are transitive.</span>
<a name="l00185"></a>00185 <span class="comment">                  * The tetrahedron is the dual to itself.</span>
<a name="l00186"></a>00186 <span class="comment">                  &lt;p align=&quot;center&quot;&gt;&lt;img src=&quot;Tetrahedron.gif&quot;&gt;&lt;/p&gt;</span>
<a name="l00187"></a>00187 <span class="comment">                  * \sa CreatePyramid,CreateJohnsonSolidWithConstantBase,CreateTruncatedTetrahedron</span>
<a name="l00188"></a>00188 <span class="comment">                  */</span>
<a name="l00189"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a68bb037f21253016dda8c3107424059f">00189</a>                 <span class="keyword">inline</span> <span class="keyword">static</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a68bb037f21253016dda8c3107424059f" title="Creates a regular tetrahedron (see http://en.wikipedia.org/wiki/Tetrahedron).">CreateTetrahedron</a>(<span class="keywordtype">double</span> radius)   {
<a name="l00190"></a>00190                         <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> tetra=CreateJohnsonSolidWithConstantBase(3,radius*sqrt(8.0)/3.0,<span class="stringliteral">&quot;P+&quot;</span>);
<a name="l00191"></a>00191                         <span class="keywordflow">for</span> (<a class="code" href="classstd_1_1vector.html" title="STL class.">vector&lt;TPoint3D&gt;::iterator</a> it=tetra-&gt;mVertices.begin();it!=tetra-&gt;mVertices.end();++it) it-&gt;z-=radius/3;
<a name="l00192"></a>00192                         <span class="keywordflow">return</span> tetra;
<a name="l00193"></a>00193                 }<span class="comment"></span>
<a name="l00194"></a>00194 <span class="comment">                /**</span>
<a name="l00195"></a>00195 <span class="comment">                  * Creates a regular cube, also called hexahedron (see http://en.wikipedia.org/wiki/Hexahedron). The hexahedron is created as a cubic prism which transitive edges. Another ways to create it include:</span>
<a name="l00196"></a>00196 <span class="comment">                  &lt;ul&gt;&lt;li&gt;Dual to an octahedron.&lt;/li&gt;&lt;li&gt;Parallelepiped with three orthogonal, equally-lengthed vectors.&lt;/li&gt;&lt;li&gt;Triangular trapezohedron with proper height.&lt;/li&gt;&lt;/ul&gt;</span>
<a name="l00197"></a>00197 <span class="comment">                  &lt;p align=&quot;center&quot;&gt;&lt;img src=&quot;Hexahedron.gif&quot;&gt;&lt;/p&gt;</span>
<a name="l00198"></a>00198 <span class="comment">                  * \sa CreateOctahedron,getDual,CreateParallelepiped,CreateTrapezohedron,CreateTruncatedHexahedron,CreateTruncatedOctahedron,CreateCuboctahedron,CreateRhombicuboctahedron</span>
<a name="l00199"></a>00199 <span class="comment">                  */</span>
<a name="l00200"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a825d924818c1d20c1f96c76f1a510603">00200</a>                 <span class="keyword">inline</span> <span class="keyword">static</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a825d924818c1d20c1f96c76f1a510603" title="Creates a regular cube, also called hexahedron (see http://en.wikipedia.org/wiki/Hexahedron).">CreateHexahedron</a>(<span class="keywordtype">double</span> radius)    {
<a name="l00201"></a>00201                         <span class="keywordflow">if</span> (radius==0.0) <span class="keywordflow">return</span> CreateEmpty();
<a name="l00202"></a>00202                         <span class="keywordtype">double</span> r=radius/sqrt(3.0);
<a name="l00203"></a>00203                         <span class="keywordflow">return</span> CreateCubicPrism(-r,r,-r,r,-r,r);
<a name="l00204"></a>00204                 }<span class="comment"></span>
<a name="l00205"></a>00205 <span class="comment">                /**</span>
<a name="l00206"></a>00206 <span class="comment">                  * Creates a regular octahedron (see http://en.wikipedia.org/wiki/Octahedron). The octahedron is created as a square bipyramid whit transitive edges and vertices. Another ways to create an octahedron are:</span>
<a name="l00207"></a>00207 <span class="comment">                  &lt;ul&gt;&lt;li&gt;Dual to an hexahedron&lt;/li&gt;&lt;li&gt;Triangular antiprism with transitive vertices.&lt;/li&gt;&lt;li&gt;Conveniently truncated tetrahedron.&lt;/li&gt;&lt;/ul&gt;</span>
<a name="l00208"></a>00208 <span class="comment">                  &lt;p align=&quot;center&quot;&gt;&lt;img src=&quot;Octahedron.gif&quot;&gt;&lt;/p&gt;</span>
<a name="l00209"></a>00209 <span class="comment">                  * \sa CreateHexahedron,getDual,CreateArchimedeanAntiprism,CreateTetrahedron,truncate,CreateTruncatedOctahedron,CreateTruncatedHexahedron,CreateCuboctahedron,CreateRhombicuboctahedron</span>
<a name="l00210"></a>00210 <span class="comment">                  */</span>
<a name="l00211"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#aafb26eb43f14cdb5652e0d6b61235369">00211</a>                 <span class="keyword">inline</span> <span class="keyword">static</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#aafb26eb43f14cdb5652e0d6b61235369" title="Creates a regular octahedron (see http://en.wikipedia.org/wiki/Octahedron).">CreateOctahedron</a>(<span class="keywordtype">double</span> radius)    {
<a name="l00212"></a>00212                         <span class="keywordflow">return</span> CreateJohnsonSolidWithConstantBase(4,radius,<span class="stringliteral">&quot;P-P+&quot;</span>);
<a name="l00213"></a>00213                 }<span class="comment"></span>
<a name="l00214"></a>00214 <span class="comment">                /**</span>
<a name="l00215"></a>00215 <span class="comment">                  * Creates a regular dodecahedron (see http://en.wikipedia.org/wiki/Dodecahedron). The dodecahedron is created as the dual to an icosahedron.</span>
<a name="l00216"></a>00216 <span class="comment">                  &lt;p align=&quot;center&quot;&gt;&lt;img src=&quot;Dodecahedron.gif&quot;&gt;&lt;/p&gt;</span>
<a name="l00217"></a>00217 <span class="comment">                  * \sa CreateIcosahedron,getDual,CreateTruncatedDodecahedron,CreateTruncatedIcosahedron,CreateIcosidodecahedron,CreateRhombicosidodecahedron</span>
<a name="l00218"></a>00218 <span class="comment">                  */</span>
<a name="l00219"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a3a5d9f432b82a7111ef157bcaf4c6d1e">00219</a>                 <span class="keyword">inline</span> <span class="keyword">static</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a3a5d9f432b82a7111ef157bcaf4c6d1e" title="Creates a regular dodecahedron (see http://en.wikipedia.org/wiki/Dodecahedron).">CreateDodecahedron</a>(<span class="keywordtype">double</span> radius)  {
<a name="l00220"></a>00220                         <span class="keywordflow">return</span> CreateIcosahedron(radius/sqrt(15-6*sqrt(5.0)))-&gt;getDual();
<a name="l00221"></a>00221                 }<span class="comment"></span>
<a name="l00222"></a>00222 <span class="comment">                /**</span>
<a name="l00223"></a>00223 <span class="comment">                  * Creates a regular icosahedron (see http://en.wikipedia.org/wiki/Icosahedron). The icosahedron is created as a gyroelongated pentagonal bipyramid with transitive edges, and it&#39;s the dual to a dodecahedron.</span>
<a name="l00224"></a>00224 <span class="comment">                  &lt;p align=&quot;center&quot;&gt;&lt;img src=&quot;Icosahedron.gif&quot;&gt;&lt;/p&gt;</span>
<a name="l00225"></a>00225 <span class="comment">                  * \sa CreateJohnsonSolidWithConstantBase,CreateDodecahedron,getDual,CreateTruncatedIcosahedron,CreateTruncatedDodecahedron,CreateIcosidodecahedron,CreateRhombicosidodecahedron</span>
<a name="l00226"></a>00226 <span class="comment">                  */</span>
<a name="l00227"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#ac85b11b7fc9a7ff2d204e9f95059a2f9">00227</a>                 <span class="keyword">inline</span> <span class="keyword">static</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#ac85b11b7fc9a7ff2d204e9f95059a2f9" title="Creates a regular icosahedron (see http://en.wikipedia.org/wiki/Icosahedron).">CreateIcosahedron</a>(<span class="keywordtype">double</span> radius)   {
<a name="l00228"></a>00228                         <span class="keywordtype">double</span> ang=<a class="code" href="mrpt__macros_8h.html#ae71449b1cc6e6250b91f539153a7a0d3">M_PI</a>/5;
<a name="l00229"></a>00229                         <span class="keywordtype">double</span> s2=4*<a class="code" href="namespacemrpt_1_1utils.html#a67cb05bb8ad4e725875a7ee54b7042ae" title="Inline function for the square of a number.">square</a>(sin(ang));
<a name="l00230"></a>00230                         <span class="keywordtype">double</span> prop=sqrt(s2-1)+sqrt(s2-2+2*cos(ang))/2;
<a name="l00231"></a>00231                         <span class="keywordflow">return</span> CreateJohnsonSolidWithConstantBase(5,radius/prop,<span class="stringliteral">&quot;P-AP+&quot;</span>,1);
<a name="l00232"></a>00232                 }<span class="comment"></span>
<a name="l00233"></a>00233 <span class="comment">                /** @}</span>
<a name="l00234"></a>00234 <span class="comment">                  */</span>
<a name="l00235"></a>00235 <span class="comment"></span>
<a name="l00236"></a>00236 <span class="comment">                /** @name Archimedean solids.</span>
<a name="l00237"></a>00237 <span class="comment">                        @{</span>
<a name="l00238"></a>00238 <span class="comment">                 */</span><span class="comment"></span>
<a name="l00239"></a>00239 <span class="comment">                /**</span>
<a name="l00240"></a>00240 <span class="comment">                  * Creates a truncated tetrahedron, consisting of four triangular faces and for hexagonal ones (see http://en.wikipedia.org/wiki/Truncated_tetrahedron). Its dual is the triakis tetrahedron.</span>
<a name="l00241"></a>00241 <span class="comment">                  &lt;p align=&quot;center&quot;&gt;&lt;img src=&quot;Truncatedtetrahedron.gif&quot;&gt;&lt;/p&gt;</span>
<a name="l00242"></a>00242 <span class="comment">                  * \sa CreateTetrahedron,CreateTriakisTetrahedron</span>
<a name="l00243"></a>00243 <span class="comment">                  */</span>
<a name="l00244"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#ab95a801e6908db87573b0dd2bd5efcc6">00244</a>                 <span class="keyword">inline</span> <span class="keyword">static</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#ab95a801e6908db87573b0dd2bd5efcc6" title="Creates a truncated tetrahedron, consisting of four triangular faces and for hexagonal ones (see http...">CreateTruncatedTetrahedron</a>(<span class="keywordtype">double</span> radius)  {
<a name="l00245"></a>00245                         <span class="keywordflow">return</span> CreateTetrahedron(radius*sqrt(27.0/11.0))-&gt;truncate(2.0/3.0);
<a name="l00246"></a>00246                 }<span class="comment"></span>
<a name="l00247"></a>00247 <span class="comment">                /**</span>
<a name="l00248"></a>00248 <span class="comment">                  * Creates a cuboctahedron, consisting of six square faces and eight triangular ones (see http://en.wikipedia.org/wiki/Cuboctahedron). There are several ways to create a cuboctahedron:</span>
<a name="l00249"></a>00249 <span class="comment">                  &lt;ul&gt;&lt;li&gt;Hexahedron truncated to a certain extent.&lt;/li&gt;&lt;li&gt;Octahedron truncated to a certain extent.&lt;/li&gt;&lt;li&gt;Cantellated tetrahedron&lt;/li&gt;&lt;li&gt;Dual to a rhombic dodecahedron.&lt;/li&gt;&lt;/ul&gt;</span>
<a name="l00250"></a>00250 <span class="comment">                  &lt;p align=&quot;center&quot;&gt;&lt;img src=&quot;Cuboctahedron.gif&quot;&gt;&lt;/p&gt;</span>
<a name="l00251"></a>00251 <span class="comment">                  * \sa CreateHexahedron,CreateOctahedron,truncate,CreateTetrahedron,cantellate,CreateRhombicuboctahedron,CreateRhombicDodecahedron,</span>
<a name="l00252"></a>00252 <span class="comment">                  */</span>
<a name="l00253"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a278592678d7db21878da2dd82b800e6f">00253</a>                 <span class="keyword">inline</span> <span class="keyword">static</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a278592678d7db21878da2dd82b800e6f" title="Creates a cuboctahedron, consisting of six square faces and eight triangular ones (see http://en...">CreateCuboctahedron</a>(<span class="keywordtype">double</span> radius) {
<a name="l00254"></a>00254                         <span class="keywordflow">return</span> CreateHexahedron(radius*sqrt(1.5))-&gt;truncate(1.0);
<a name="l00255"></a>00255                 }<span class="comment"></span>
<a name="l00256"></a>00256 <span class="comment">                /**</span>
<a name="l00257"></a>00257 <span class="comment">                  * Creates a truncated hexahedron, with six octogonal faces and eight triangular ones (see http://en.wikipedia.org/wiki/Truncated_hexahedron). The truncated octahedron is dual to the triakis octahedron.</span>
<a name="l00258"></a>00258 <span class="comment">                  &lt;p align=&quot;center&quot;&gt;&lt;img src=&quot;Truncatedhexahedron.gif&quot;&gt;&lt;/p&gt;</span>
<a name="l00259"></a>00259 <span class="comment">                  * \sa CreateHexahedron,CreateTriakisOctahedron</span>
<a name="l00260"></a>00260 <span class="comment">                  */</span>
<a name="l00261"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a0f60dde324e4df0ed62f915f34df91ef">00261</a>                 <span class="keyword">inline</span> <span class="keyword">static</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a0f60dde324e4df0ed62f915f34df91ef" title="Creates a truncated hexahedron, with six octogonal faces and eight triangular ones (see http://en...">CreateTruncatedHexahedron</a>(<span class="keywordtype">double</span> radius)   {
<a name="l00262"></a>00262                         <span class="keywordflow">return</span> CreateHexahedron(radius*sqrt(3.0/(5-sqrt(8.0))))-&gt;truncate(2-sqrt(2.0));
<a name="l00263"></a>00263                 }<span class="comment"></span>
<a name="l00264"></a>00264 <span class="comment">                /**</span>
<a name="l00265"></a>00265 <span class="comment">                  * Creates a truncated octahedron, with eight hexagons and eight squares (see http://en.wikipedia.org/wiki/Truncated_octahedron). It&#39;s the dual to the tetrakis hexahedron.</span>
<a name="l00266"></a>00266 <span class="comment">                  &lt;p align=&quot;center&quot;&gt;&lt;img src=&quot;Truncatedoctahedron.gif&quot;&gt;&lt;/p&gt;</span>
<a name="l00267"></a>00267 <span class="comment">                  * \sa CreateOctahedron,CreateTetrakisHexahedron</span>
<a name="l00268"></a>00268 <span class="comment">                  */</span>
<a name="l00269"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a4b6ab0d31bd0e04dcb9d1e0e04364bd3">00269</a>                 <span class="keyword">inline</span> <span class="keyword">static</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a4b6ab0d31bd0e04dcb9d1e0e04364bd3" title="Creates a truncated octahedron, with eight hexagons and eight squares (see http://en.wikipedia.org/wiki/Truncated_octahedron).">CreateTruncatedOctahedron</a>(<span class="keywordtype">double</span> radius)   {
<a name="l00270"></a>00270                         <span class="keywordflow">return</span> CreateOctahedron(radius*3/sqrt(5.0))-&gt;truncate(2.0/3.0);
<a name="l00271"></a>00271                 }<span class="comment"></span>
<a name="l00272"></a>00272 <span class="comment">                /**</span>
<a name="l00273"></a>00273 <span class="comment">                  * Creates a rhombicuboctahedron, with 18 squares and 8 triangles (see http://en.wikipedia.org/wiki/Rhombicuboctahedron), calculated as an elongated square bicupola. It can also be calculated as a cantellated hexahedron or octahedron, and its dual is the deltoidal icositetrahedron.</span>
<a name="l00274"></a>00274 <span class="comment">                  * If the second argument is set to false, the lower cupola is rotated, so that the objet created is an elongated square gyrobicupola (see http://en.wikipedia.org/wiki/Elongated_square_gyrobicupola). This is not an archimedean solid, but a Johnson one, since it hasn&#39;t got vertex transitivity.</span>
<a name="l00275"></a>00275 <span class="comment">                  &lt;p align=&quot;center&quot;&gt;&lt;img src=&quot;Rhombicuboctahedron.gif&quot;&gt;&lt;/p&gt;</span>
<a name="l00276"></a>00276 <span class="comment">                  * \sa CreateJohnsonSolidWithConstantBase,CreateHexahedron,CreateOctahedron,cantellate,CreateCuboctahedron,CreateDeltoidalIcositetrahedron</span>
<a name="l00277"></a>00277 <span class="comment">                  */</span>
<a name="l00278"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#abbcc7e07b79275c2cf6e644fb2f2edc4">00278</a>                 <span class="keyword">inline</span> <span class="keyword">static</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#abbcc7e07b79275c2cf6e644fb2f2edc4" title="Creates a rhombicuboctahedron, with 18 squares and 8 triangles (see http://en.wikipedia.org/wiki/Rhombicuboctahedron), calculated as an elongated square bicupola.">CreateRhombicuboctahedron</a>(<span class="keywordtype">double</span> radius,<span class="keywordtype">bool</span> type=<span class="keyword">true</span>)    {
<a name="l00279"></a>00279                         <span class="keywordflow">return</span> CreateJohnsonSolidWithConstantBase(8,radius/sqrt(1+<a class="code" href="namespacemrpt_1_1utils.html#a67cb05bb8ad4e725875a7ee54b7042ae" title="Inline function for the square of a number.">square</a>(sin(<a class="code" href="mrpt__macros_8h.html#ae71449b1cc6e6250b91f539153a7a0d3">M_PI</a>/8))),type?<span class="stringliteral">&quot;C-PRC+&quot;</span>:<span class="stringliteral">&quot;GC-PRC+&quot;</span>,3);
<a name="l00280"></a>00280                 }<span class="comment"></span>
<a name="l00281"></a>00281 <span class="comment">                /**</span>
<a name="l00282"></a>00282 <span class="comment">                  * Creates an icosidodecahedron, with 12 pentagons and 20 triangles (see http://en.wikipedia.org/wiki/Icosidodecahedron). Certain truncations of either a dodecahedron or an icosahedron yield an icosidodecahedron.</span>
<a name="l00283"></a>00283 <span class="comment">                  * The dual of the icosidodecahedron is the rhombic triacontahedron.</span>
<a name="l00284"></a>00284 <span class="comment">                  * If the second argument is set to false, the lower rotunda is rotated. In this case, the object created is a pentagonal orthobirotunda (see http://en.wikipedia.org/wiki/Pentagonal_orthobirotunda). This object presents symmetry against the XY plane and is not vertex transitive, so it&#39;s a Johnson&#39;s solid.</span>
<a name="l00285"></a>00285 <span class="comment">                  &lt;p align=&quot;center&quot;&gt;&lt;img src=&quot;Icosidodecahedron.gif&quot;&gt;&lt;/p&gt;</span>
<a name="l00286"></a>00286 <span class="comment">                  * \sa CreateDodecahedron,CreateIcosahedron,truncate,CreateRhombicosidodecahedron,CreateRhombicTriacontahedron</span>
<a name="l00287"></a>00287 <span class="comment">                  */</span>
<a name="l00288"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#aa3c7301231c8f025c3f755b4292f18ea">00288</a>                 <span class="keyword">inline</span> <span class="keyword">static</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#aa3c7301231c8f025c3f755b4292f18ea" title="Creates an icosidodecahedron, with 12 pentagons and 20 triangles (see http://en.wikipedia.org/wiki/Icosidodecahedron).">CreateIcosidodecahedron</a>(<span class="keywordtype">double</span> radius,<span class="keywordtype">bool</span> type=<span class="keyword">true</span>)      {
<a name="l00289"></a>00289                         <span class="keywordflow">return</span> CreateJohnsonSolidWithConstantBase(10,radius,type?<span class="stringliteral">&quot;GR-R+&quot;</span>:<span class="stringliteral">&quot;R-R+&quot;</span>,1);
<a name="l00290"></a>00290                 }<span class="comment"></span>
<a name="l00291"></a>00291 <span class="comment">                /**</span>
<a name="l00292"></a>00292 <span class="comment">                  * Creates a truncated dodecahedron, consisting of 12 dodecagons and 20 triangles (see http://en.wikipedia.org/wiki/Truncated_dodecahedron). The truncated dodecahedron is the dual to the triakis icosahedron.</span>
<a name="l00293"></a>00293 <span class="comment">                  &lt;p align=&quot;center&quot;&gt;&lt;img src=&quot;Truncateddodecahedron.gif&quot;&gt;&lt;/p&gt;</span>
<a name="l00294"></a>00294 <span class="comment">                  * \sa CreateDodecahedron,CreateTriakisIcosahedron</span>
<a name="l00295"></a>00295 <span class="comment">                  */</span>
<a name="l00296"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#ace6a781e07834b848a4a013d1f401897">00296</a>                 <span class="keyword">inline</span> <span class="keyword">static</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#ace6a781e07834b848a4a013d1f401897" title="Creates a truncated dodecahedron, consisting of 12 dodecagons and 20 triangles (see http://en...">CreateTruncatedDodecahedron</a>(<span class="keywordtype">double</span> radius) {
<a name="l00297"></a>00297                         <span class="keywordflow">return</span> CreateDodecahedron(radius*sqrt(45.0)/sqrt(27+6*sqrt(5.0)))-&gt;truncate(1-sqrt(0.2));
<a name="l00298"></a>00298                 }<span class="comment"></span>
<a name="l00299"></a>00299 <span class="comment">                /**</span>
<a name="l00300"></a>00300 <span class="comment">                  * Creates a truncated icosahedron, consisting of 20 hexagons and 12 pentagons. This object resembles a typical soccer ball (see http://en.wikipedia.org/wiki/Truncated_icosahedron). The pentakis dodecahedron is the dual to the truncated icosahedron.</span>
<a name="l00301"></a>00301 <span class="comment">                  &lt;p align=&quot;center&quot;&gt;&lt;img src=&quot;Truncatedicosahedron.gif&quot;&gt;&lt;/p&gt;</span>
<a name="l00302"></a>00302 <span class="comment">                  * \sa CreateIcosahedron,CreatePentakisDodecahedron</span>
<a name="l00303"></a>00303 <span class="comment">                  */</span>
<a name="l00304"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#ace880e6a89b94859b655cb499e5a280b">00304</a>                 <span class="keyword">inline</span> <span class="keyword">static</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#ace880e6a89b94859b655cb499e5a280b" title="Creates a truncated icosahedron, consisting of 20 hexagons and 12 pentagons.">CreateTruncatedIcosahedron</a>(<span class="keywordtype">double</span> radius)  {
<a name="l00305"></a>00305                         <span class="keywordflow">return</span> CreateIcosahedron(radius*sqrt(45.0)/sqrt(25+4*sqrt(5.0)))-&gt;truncate(2.0/3.0);
<a name="l00306"></a>00306                 }<span class="comment"></span>
<a name="l00307"></a>00307 <span class="comment">                /**</span>
<a name="l00308"></a>00308 <span class="comment">                  * Creates a rhombicosidodecahedron, consisting of 30 squares, 12 pentagons and 20 triangles (see http://en.wikipedia.org/wiki/Rhombicosidodecahedron). This object can be obtained as the cantellation of either a dodecahedron or an icosahedron. The dual of the rhombicosidodecahedron is the deltoidal hexecontahedron.</span>
<a name="l00309"></a>00309 <span class="comment">                  &lt;p align=&quot;center&quot;&gt;&lt;img src=&quot;Rhombicosidodecahedron.gif&quot;&gt;&lt;/p&gt;</span>
<a name="l00310"></a>00310 <span class="comment">                  * \sa CreateDodecahedron,CreateIcosahedron,CreateIcosidodecahedron,CreateDeltoidalHexecontahedron</span>
<a name="l00311"></a>00311 <span class="comment">                  */</span>
<a name="l00312"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#aa4e3394c57d85925dcf3dde8fed07509">00312</a>                 <span class="keyword">inline</span> <span class="keyword">static</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#aa4e3394c57d85925dcf3dde8fed07509" title="Creates a rhombicosidodecahedron, consisting of 30 squares, 12 pentagons and 20 triangles (see http:/...">CreateRhombicosidodecahedron</a>(<span class="keywordtype">double</span> radius)        {
<a name="l00313"></a>00313                         <span class="keywordflow">return</span> CreateIcosahedron(radius*sqrt(10.0/(35.0+9.0*sqrt(5.0))))-&gt;cantellate(1.5*(sqrt(5.0)-1));
<a name="l00314"></a>00314                 }<span class="comment"></span>
<a name="l00315"></a>00315 <span class="comment">                /** @}</span>
<a name="l00316"></a>00316 <span class="comment">                 */</span>
<a name="l00317"></a>00317 <span class="comment"></span>
<a name="l00318"></a>00318 <span class="comment">                /** @name Other Johnson solids.</span>
<a name="l00319"></a>00319 <span class="comment">                        @{</span>
<a name="l00320"></a>00320 <span class="comment">                 */</span><span class="comment"></span>
<a name="l00321"></a>00321 <span class="comment">                /**</span>
<a name="l00322"></a>00322 <span class="comment">                  * Creates a pentagonal rotunda (half an icosidodecahedron), consisting of six pentagons, ten triangles and a decagon (see http://en.wikipedia.org/wiki/Pentagonal_rotunda).</span>
<a name="l00323"></a>00323 <span class="comment">                  * \sa CreateIcosidodecahedron,CreateJohnsonSolidWithConstantBase</span>
<a name="l00324"></a>00324 <span class="comment">                  */</span>
<a name="l00325"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a8cf9189ac24118b34d6a072dc57e6718">00325</a>                 <span class="keyword">inline</span> <span class="keyword">static</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a8cf9189ac24118b34d6a072dc57e6718" title="Creates a pentagonal rotunda (half an icosidodecahedron), consisting of six pentagons, ten triangles and a decagon (see http://en.wikipedia.org/wiki/Pentagonal_rotunda).">CreatePentagonalRotunda</a>(<span class="keywordtype">double</span> radius)     {
<a name="l00326"></a>00326                         <span class="keywordflow">return</span> CreateJohnsonSolidWithConstantBase(10,radius,<span class="stringliteral">&quot;R+&quot;</span>);
<a name="l00327"></a>00327                 }<span class="comment"></span>
<a name="l00328"></a>00328 <span class="comment">                /** @}</span>
<a name="l00329"></a>00329 <span class="comment">                 */</span>
<a name="l00330"></a>00330 <span class="comment"></span>
<a name="l00331"></a>00331 <span class="comment">                /** @name Catalan solids.</span>
<a name="l00332"></a>00332 <span class="comment">                        @{</span>
<a name="l00333"></a>00333 <span class="comment">                */</span><span class="comment"></span>
<a name="l00334"></a>00334 <span class="comment">                /**</span>
<a name="l00335"></a>00335 <span class="comment">                  * Creates a triakis tetrahedron, dual to the truncated tetrahedron. This body consists of 12 isosceles triangles (see http://en.wikipedia.org/wiki/Triakis_tetrahedron).</span>
<a name="l00336"></a>00336 <span class="comment">                  &lt;p align=&quot;center&quot;&gt;&lt;img src=&quot;Triakistetrahedron.gif&quot;&gt;&lt;/p&gt;</span>
<a name="l00337"></a>00337 <span class="comment">                  * \sa CreateTruncatedTetrahedron</span>
<a name="l00338"></a>00338 <span class="comment">                  */</span>
<a name="l00339"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a001614f2b8f8c62404b42b8cbe94ed96">00339</a>                 <span class="keyword">inline</span> <span class="keyword">static</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a001614f2b8f8c62404b42b8cbe94ed96" title="Creates a triakis tetrahedron, dual to the truncated tetrahedron.">CreateTriakisTetrahedron</a>(<span class="keywordtype">double</span> radius)    {
<a name="l00340"></a>00340                         <span class="keywordflow">return</span> CreateTruncatedTetrahedron(radius*3/sqrt(33.0))-&gt;getDual();
<a name="l00341"></a>00341                 }
<a name="l00342"></a>00342 <span class="comment"></span>
<a name="l00343"></a>00343 <span class="comment">                /**</span>
<a name="l00344"></a>00344 <span class="comment">                  * Creates a rhombic dodecahedron, dual to the cuboctahedron. This body consists of 12 rhombi (see http://en.wikipedia.org/wiki/Rhombic_dodecahedron).</span>
<a name="l00345"></a>00345 <span class="comment">                  &lt;p align=&quot;center&quot;&gt;&lt;img src=&quot;Rhombicdodecahedron.gif&quot;&gt;&lt;/p&gt;</span>
<a name="l00346"></a>00346 <span class="comment">                  * \sa CreateCuboctahedron</span>
<a name="l00347"></a>00347 <span class="comment">                  */</span>
<a name="l00348"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a33e96c2f17fc475d6148a7ee0f3dc595">00348</a>                 <span class="keyword">inline</span> <span class="keyword">static</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a33e96c2f17fc475d6148a7ee0f3dc595" title="Creates a rhombic dodecahedron, dual to the cuboctahedron.">CreateRhombicDodecahedron</a>(<span class="keywordtype">double</span> radius)   {
<a name="l00349"></a>00349                         <span class="keywordflow">return</span> CreateCuboctahedron(radius/sqrt(2.0))-&gt;getDual();
<a name="l00350"></a>00350                 }
<a name="l00351"></a>00351 <span class="comment"></span>
<a name="l00352"></a>00352 <span class="comment">                /**</span>
<a name="l00353"></a>00353 <span class="comment">                  * Creates a triakis octahedron, dual to the truncated hexahedron. This body consists of 24 isosceles triangles (see http://en.wikipedia.org/wiki/Triakis_octahedron).</span>
<a name="l00354"></a>00354 <span class="comment">                  &lt;p align=&quot;center&quot;&gt;&lt;img src=&quot;Triakisoctahedron.gif&quot;&gt;&lt;/p&gt;</span>
<a name="l00355"></a>00355 <span class="comment">                  * \sa CreateTruncatedHexahedron</span>
<a name="l00356"></a>00356 <span class="comment">                  */</span>
<a name="l00357"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#ac71f68f920b4aaed689e3266ebcff63b">00357</a>                 <span class="keyword">inline</span> <span class="keyword">static</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#ac71f68f920b4aaed689e3266ebcff63b" title="Creates a triakis octahedron, dual to the truncated hexahedron.">CreateTriakisOctahedron</a>(<span class="keywordtype">double</span> radius)     {
<a name="l00358"></a>00358                         <span class="keywordflow">return</span> CreateTruncatedHexahedron(radius/sqrt((5-sqrt(8.0))))-&gt;getDual();
<a name="l00359"></a>00359                 }
<a name="l00360"></a>00360 <span class="comment"></span>
<a name="l00361"></a>00361 <span class="comment">                /**</span>
<a name="l00362"></a>00362 <span class="comment">                  * Creates a tetrakis hexahedron, dual to the truncated octahedron. This body consists of 24 isosceles triangles (see http://en.wikipedia.org/wiki/Tetrakis_hexahedron).</span>
<a name="l00363"></a>00363 <span class="comment">                  &lt;p align=&quot;center&quot;&gt;&lt;img src=&quot;Tetrakishexahedron.gif&quot;&gt;&lt;/p&gt;</span>
<a name="l00364"></a>00364 <span class="comment">                  * \sa CreateTruncatedOctahedron</span>
<a name="l00365"></a>00365 <span class="comment">                  */</span>
<a name="l00366"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a6334bb21643afb281db195ecbe953e75">00366</a>                 <span class="keyword">inline</span> <span class="keyword">static</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a6334bb21643afb281db195ecbe953e75" title="Creates a tetrakis hexahedron, dual to the truncated octahedron.">CreateTetrakisHexahedron</a>(<span class="keywordtype">double</span> radius)    {
<a name="l00367"></a>00367                         <span class="keywordflow">return</span> CreateTruncatedOctahedron(radius*sqrt(0.6))-&gt;getDual();
<a name="l00368"></a>00368                 }
<a name="l00369"></a>00369 <span class="comment"></span>
<a name="l00370"></a>00370 <span class="comment">                /**</span>
<a name="l00371"></a>00371 <span class="comment">                  * Creates a deltoidal icositetrahedron, dual to the rhombicuboctahedron. This body consists of 24 kites (see http://en.wikipedia.org/wiki/Deltoidal_icositetrahedron).</span>
<a name="l00372"></a>00372 <span class="comment">                  &lt;p align=&quot;center&quot;&gt;&lt;img src=&quot;Deltoidalicositetrahedron.gif&quot;&gt;&lt;/p&gt;</span>
<a name="l00373"></a>00373 <span class="comment">                  * \sa CreateRhombicuboctahedron</span>
<a name="l00374"></a>00374 <span class="comment">                  */</span>
<a name="l00375"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a9a5c5cfc7394914396f7b431dbc4520f">00375</a>                 <span class="keyword">inline</span> <span class="keyword">static</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a9a5c5cfc7394914396f7b431dbc4520f" title="Creates a deltoidal icositetrahedron, dual to the rhombicuboctahedron.">CreateDeltoidalIcositetrahedron</a>(<span class="keywordtype">double</span> radius)     {
<a name="l00376"></a>00376                         <span class="keywordflow">return</span> CreateRhombicuboctahedron(radius/sqrt(7-sqrt(32.0)),<span class="keyword">true</span>)-&gt;getDual();
<a name="l00377"></a>00377                 }
<a name="l00378"></a>00378 <span class="comment"></span>
<a name="l00379"></a>00379 <span class="comment">                /**</span>
<a name="l00380"></a>00380 <span class="comment">                  * Creates a rhombic triacontahedron, dual to the icosidodecahedron. This body consists of 30 rhombi (see http://en.wikipedia.org/wiki/Rhombic_triacontahedron).</span>
<a name="l00381"></a>00381 <span class="comment">                  &lt;p align=&quot;center&quot;&gt;&lt;img src=&quot;Rhombictriacontahedron.gif&quot;&gt;&lt;/p&gt;</span>
<a name="l00382"></a>00382 <span class="comment">                  * \sa CreateIcosidodecahedron</span>
<a name="l00383"></a>00383 <span class="comment">                  */</span>
<a name="l00384"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a3974c89c4b1ee7b4d705b615dc96c972">00384</a>                 <span class="keyword">inline</span> <span class="keyword">static</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a3974c89c4b1ee7b4d705b615dc96c972" title="Creates a rhombic triacontahedron, dual to the icosidodecahedron.">CreateRhombicTriacontahedron</a>(<span class="keywordtype">double</span> radius)        {
<a name="l00385"></a>00385                         <span class="keywordflow">return</span> CreateIcosidodecahedron(radius*sqrt(2/(5-sqrt(5.0))),<span class="keyword">true</span>)-&gt;getDual();
<a name="l00386"></a>00386                 }
<a name="l00387"></a>00387 <span class="comment"></span>
<a name="l00388"></a>00388 <span class="comment">                /**</span>
<a name="l00389"></a>00389 <span class="comment">                  * Creates a triakis icosahedron, dual to the truncated dodecahedron. This body consists of 60 isosceles triangles http://en.wikipedia.org/wiki/Triakis_icosahedron).</span>
<a name="l00390"></a>00390 <span class="comment">                  &lt;p align=&quot;center&quot;&gt;&lt;img src=&quot;Triakisicosahedron.gif&quot;&gt;&lt;/p&gt;</span>
<a name="l00391"></a>00391 <span class="comment">                  * \sa CreateTruncatedDodecahedron</span>
<a name="l00392"></a>00392 <span class="comment">                  */</span>
<a name="l00393"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#af31285b29e8cc531d9e02ca8aabb3fb3">00393</a>                 <span class="keyword">inline</span> <span class="keyword">static</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#af31285b29e8cc531d9e02ca8aabb3fb3" title="Creates a triakis icosahedron, dual to the truncated dodecahedron.">CreateTriakisIcosahedron</a>(<span class="keywordtype">double</span> radius)    {
<a name="l00394"></a>00394                         <span class="keywordflow">return</span> CreateTruncatedDodecahedron(radius*sqrt(5/(25-8*sqrt(5.0))))-&gt;getDual();
<a name="l00395"></a>00395                 }
<a name="l00396"></a>00396 <span class="comment"></span>
<a name="l00397"></a>00397 <span class="comment">                /**</span>
<a name="l00398"></a>00398 <span class="comment">                  * Creates a pentakis dodecahedron, dual to the truncated icosahedron. This body consists of 60 isosceles triangles (see http://en.wikipedia.org/wiki/Pentakis_dodecahedron).</span>
<a name="l00399"></a>00399 <span class="comment">                  &lt;p align=&quot;center&quot;&gt;&lt;img src=&quot;Pentakisdodecahedron.gif&quot;&gt;&lt;/p&gt;</span>
<a name="l00400"></a>00400 <span class="comment">                  * \sa CreateTruncatedIcosahedron</span>
<a name="l00401"></a>00401 <span class="comment">                  */</span>
<a name="l00402"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#afcdf908116321bb438c21ed1e05e2569">00402</a>                 <span class="keyword">inline</span> <span class="keyword">static</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#afcdf908116321bb438c21ed1e05e2569" title="Creates a pentakis dodecahedron, dual to the truncated icosahedron.">CreatePentakisDodecahedron</a>(<span class="keywordtype">double</span> radius)  {
<a name="l00403"></a>00403                         <span class="keywordflow">return</span> CreateTruncatedIcosahedron(radius*sqrt(3/(17-6*sqrt(5.0))))-&gt;getDual();
<a name="l00404"></a>00404                 }
<a name="l00405"></a>00405 <span class="comment"></span>
<a name="l00406"></a>00406 <span class="comment">                /**</span>
<a name="l00407"></a>00407 <span class="comment">                  * Creates a deltoidal hexecontahedron, dual to the rhombicosidodecahedron. This body consists of 60 kites (see http://en.wikipedia.org/wiki/Deltoidal_hexecontahedron).</span>
<a name="l00408"></a>00408 <span class="comment">                  &lt;p align=&quot;center&quot;&gt;&lt;img src=&quot;Deltoidalhexecontahedron.gif&quot;&gt;&lt;/p&gt;</span>
<a name="l00409"></a>00409 <span class="comment">                  * \sa CreateRhombicosidodecahedron</span>
<a name="l00410"></a>00410 <span class="comment">                  */</span>
<a name="l00411"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#ad48fc0fee55125494e037f623699e2a5">00411</a>                 <span class="keyword">inline</span> <span class="keyword">static</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#ad48fc0fee55125494e037f623699e2a5" title="Creates a deltoidal hexecontahedron, dual to the rhombicosidodecahedron.">CreateDeltoidalHexecontahedron</a>(<span class="keywordtype">double</span> radius)      {
<a name="l00412"></a>00412                         <span class="keywordflow">return</span> CreateRhombicosidodecahedron(radius*3.0/sqrt(15-2*sqrt(5.0)))-&gt;getDual();
<a name="l00413"></a>00413                 }<span class="comment"></span>
<a name="l00414"></a>00414 <span class="comment">                /** @}</span>
<a name="l00415"></a>00415 <span class="comment">                 */</span>
<a name="l00416"></a>00416 <span class="comment"></span>
<a name="l00417"></a>00417 <span class="comment">                /** @name Customizable polyhedra</span>
<a name="l00418"></a>00418 <span class="comment">                        @{</span>
<a name="l00419"></a>00419 <span class="comment">                 */</span><span class="comment"></span>
<a name="l00420"></a>00420 <span class="comment">                /**</span>
<a name="l00421"></a>00421 <span class="comment">                  * Creates a cubic prism, given the coordinates of two opposite vertices. Each edge will be parallel to one of the coordinate axes, although the orientation may change by assigning a pose to the object.</span>
<a name="l00422"></a>00422 <span class="comment">                  * \sa CreateCubicPrism(const mrpt::math::TPoint3D &amp;,const mrpt::math::TPoint3D &amp;),CreateParallelepiped,CreateCustomPrism,CreateRegularPrism,CreateArchimedeanRegularPrism</span>
<a name="l00423"></a>00423 <span class="comment">                  */</span>
<a name="l00424"></a>00424                 <span class="keyword">static</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> CreateCubicPrism(<span class="keywordtype">double</span> x1,<span class="keywordtype">double</span> x2,<span class="keywordtype">double</span> y1,<span class="keywordtype">double</span> y2,<span class="keywordtype">double</span> z1,<span class="keywordtype">double</span> z2);<span class="comment"></span>
<a name="l00425"></a>00425 <span class="comment">                /**</span>
<a name="l00426"></a>00426 <span class="comment">                  * Creates a cubic prism, given two opposite vertices.</span>
<a name="l00427"></a>00427 <span class="comment">                  * \sa CreateCubicPrism(double,double,double,double,double,double),CreateParallelepiped,CreateCustomPrism,CreateRegularPrism,CreateArchimedeanRegularPrism</span>
<a name="l00428"></a>00428 <span class="comment">                  */</span>
<a name="l00429"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a87af3f5900561d030cf73396c1a48242">00429</a>                 <span class="keyword">inline</span> <span class="keyword">static</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a87af3f5900561d030cf73396c1a48242" title="Creates a cubic prism, given two opposite vertices.">CreateCubicPrism</a>(<span class="keyword">const</span> <a class="code" href="structmrpt_1_1math_1_1_t_point3_d.html" title="Lightweight 3D point.">TPoint3D</a> &amp;p1,<span class="keyword">const</span> <a class="code" href="structmrpt_1_1math_1_1_t_point3_d.html" title="Lightweight 3D point.">TPoint3D</a> &amp;p2)    {
<a name="l00430"></a>00430                         <span class="keywordflow">return</span> CreateCubicPrism(p1.<a class="code" href="structmrpt_1_1math_1_1_t_point3_d.html#a5014ee49d97866d293568300b619a7e2" title="X coordinate.">x</a>,p2.<a class="code" href="structmrpt_1_1math_1_1_t_point3_d.html#a5014ee49d97866d293568300b619a7e2" title="X coordinate.">x</a>,p1.<a class="code" href="structmrpt_1_1math_1_1_t_point3_d.html#aec879c0d61d8446e93b7d09344931d37" title="Y coordinate.">y</a>,p2.<a class="code" href="structmrpt_1_1math_1_1_t_point3_d.html#aec879c0d61d8446e93b7d09344931d37" title="Y coordinate.">y</a>,p1.<a class="code" href="structmrpt_1_1math_1_1_t_point3_d.html#a61df04839b9146696e696fc7af3bc307" title="Z coordinate.">z</a>,p2.<a class="code" href="structmrpt_1_1math_1_1_t_point3_d.html#a61df04839b9146696e696fc7af3bc307" title="Z coordinate.">z</a>);
<a name="l00431"></a>00431                 }<span class="comment"></span>
<a name="l00432"></a>00432 <span class="comment">                /**</span>
<a name="l00433"></a>00433 <span class="comment">                  * Creates a custom pyramid, using a set of 2D vertices which will lie on the XY plane.</span>
<a name="l00434"></a>00434 <span class="comment">                  * \sa CreateDoublePyramid,CreateFrustum,CreateBifrustum,CreateRegularPyramid</span>
<a name="l00435"></a>00435 <span class="comment">                  */</span>
<a name="l00436"></a>00436                 <span class="keyword">static</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> CreatePyramid(<span class="keyword">const</span> <a class="code" href="classstd_1_1vector.html">vector&lt;TPoint2D&gt;</a> &amp;baseVertices,<span class="keywordtype">double</span> height);<span class="comment"></span>
<a name="l00437"></a>00437 <span class="comment">                /**</span>
<a name="l00438"></a>00438 <span class="comment">                  * Creates a double pyramid, using a set of 2D vertices which will lie on the XY plane. The second height is used with the downwards pointing pyramid, so that it will effectively point downwards if it&#39;s positive.</span>
<a name="l00439"></a>00439 <span class="comment">                  * \sa CreatePyramid,CreateBifrustum,CreateRegularDoublePyramid</span>
<a name="l00440"></a>00440 <span class="comment">                  */</span>
<a name="l00441"></a>00441                 <span class="keyword">static</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> CreateDoublePyramid(<span class="keyword">const</span> <a class="code" href="classstd_1_1vector.html">vector&lt;TPoint2D&gt;</a> &amp;baseVertices,<span class="keywordtype">double</span> height1,<span class="keywordtype">double</span> height2);<span class="comment"></span>
<a name="l00442"></a>00442 <span class="comment">                /**</span>
<a name="l00443"></a>00443 <span class="comment">                  * Creates a truncated pyramid, using a set of vertices which will lie on the XY plane.</span>
<a name="l00444"></a>00444 <span class="comment">                  * Do not try to use with a ratio equal to zero; use CreatePyramid instead. When using a ratio of 1, it will create a Prism.</span>
<a name="l00445"></a>00445 <span class="comment">                  * \sa CreatePyramid,CreateBifrustum</span>
<a name="l00446"></a>00446 <span class="comment">                  */</span>
<a name="l00447"></a>00447                 <span class="keyword">static</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> CreateTruncatedPyramid(<span class="keyword">const</span> <a class="code" href="classstd_1_1vector.html">vector&lt;TPoint2D&gt;</a> &amp;baseVertices,<span class="keywordtype">double</span> height,<span class="keywordtype">double</span> ratio);<span class="comment"></span>
<a name="l00448"></a>00448 <span class="comment">                /**</span>
<a name="l00449"></a>00449 <span class="comment">                  * This is a synonym for CreateTruncatedPyramid.</span>
<a name="l00450"></a>00450 <span class="comment">                  * \sa CreateTruncatedPyramid</span>
<a name="l00451"></a>00451 <span class="comment">                  */</span>
<a name="l00452"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#afb420b4e2f254f54bbe8db0273173b90">00452</a>                 <span class="keyword">inline</span> <span class="keyword">static</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#afb420b4e2f254f54bbe8db0273173b90" title="This is a synonym for CreateTruncatedPyramid.">CreateFrustum</a>(<span class="keyword">const</span> <a class="code" href="classstd_1_1vector.html">vector&lt;TPoint2D&gt;</a> &amp;baseVertices,<span class="keywordtype">double</span> height,<span class="keywordtype">double</span> ratio)     {
<a name="l00453"></a>00453                         <span class="keywordflow">return</span> CreateTruncatedPyramid(baseVertices,height,ratio);
<a name="l00454"></a>00454                 }<span class="comment"></span>
<a name="l00455"></a>00455 <span class="comment">                /**</span>
<a name="l00456"></a>00456 <span class="comment">                  * Creates a custom prism with vertical edges, given any base which will lie on the XY plane.</span>
<a name="l00457"></a>00457 <span class="comment">                  * \sa CreateCubicPrism,CreateCustomAntiprism,CreateRegularPrism,CreateArchimedeanRegularPrism</span>
<a name="l00458"></a>00458 <span class="comment">                  */</span>
<a name="l00459"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#aefdf1fa647b348eb8a3976a895608272">00459</a>                 <span class="keyword">inline</span> <span class="keyword">static</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#aefdf1fa647b348eb8a3976a895608272" title="Creates a custom prism with vertical edges, given any base which will lie on the XY plane...">CreateCustomPrism</a>(<span class="keyword">const</span> <a class="code" href="classstd_1_1vector.html">vector&lt;TPoint2D&gt;</a> &amp;baseVertices,<span class="keywordtype">double</span> height)      {
<a name="l00460"></a>00460                         <span class="keywordflow">return</span> CreateTruncatedPyramid(baseVertices,height,1.0);
<a name="l00461"></a>00461                 }<span class="comment"></span>
<a name="l00462"></a>00462 <span class="comment">                /**</span>
<a name="l00463"></a>00463 <span class="comment">                  * Creates a custom antiprism, using two custom bases. For better results, the top base should be slightly rotated with respect to the bottom one.</span>
<a name="l00464"></a>00464 <span class="comment">                  * \sa CreateCustomPrism,CreateRegularAntiprism,CreateArchimedeanRegularAntiprism</span>
<a name="l00465"></a>00465 <span class="comment">                  */</span>
<a name="l00466"></a>00466                 <span class="keyword">static</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> CreateCustomAntiprism(<span class="keyword">const</span> <a class="code" href="classstd_1_1vector.html">vector&lt;TPoint2D&gt;</a> &amp;bottomBase,<span class="keyword">const</span> <a class="code" href="classstd_1_1vector.html">vector&lt;TPoint2D&gt;</a> &amp;topBase,<span class="keywordtype">double</span> height);<span class="comment"></span>
<a name="l00467"></a>00467 <span class="comment">                /**</span>
<a name="l00468"></a>00468 <span class="comment">                  * Creates a parallelepiped, given a base point and three vectors represented as points.</span>
<a name="l00469"></a>00469 <span class="comment">                  * \sa CreateCubicPrism</span>
<a name="l00470"></a>00470 <span class="comment">                  */</span>
<a name="l00471"></a>00471                 <span class="keyword">static</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> CreateParallelepiped(<span class="keyword">const</span> <a class="code" href="structmrpt_1_1math_1_1_t_point3_d.html" title="Lightweight 3D point.">TPoint3D</a> &amp;base,<span class="keyword">const</span> <a class="code" href="structmrpt_1_1math_1_1_t_point3_d.html" title="Lightweight 3D point.">TPoint3D</a> &amp;v1,<span class="keyword">const</span> <a class="code" href="structmrpt_1_1math_1_1_t_point3_d.html" title="Lightweight 3D point.">TPoint3D</a> &amp;v2,<span class="keyword">const</span> <a class="code" href="structmrpt_1_1math_1_1_t_point3_d.html" title="Lightweight 3D point.">TPoint3D</a> &amp;v3);<span class="comment"></span>
<a name="l00472"></a>00472 <span class="comment">                /**</span>
<a name="l00473"></a>00473 <span class="comment">                  * Creates a bifrustum, or double truncated pyramid, given a base which will lie on the XY plane.</span>
<a name="l00474"></a>00474 <span class="comment">                  * \sa CreateFrustum,CreateDoublePyramid</span>
<a name="l00475"></a>00475 <span class="comment">                  */</span>
<a name="l00476"></a>00476                 <span class="keyword">static</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> CreateBifrustum(<span class="keyword">const</span> <a class="code" href="classstd_1_1vector.html">vector&lt;TPoint2D&gt;</a> &amp;baseVertices,<span class="keywordtype">double</span> height1,<span class="keywordtype">double</span> ratio1,<span class="keywordtype">double</span> height2,<span class="keywordtype">double</span> ratio2);<span class="comment"></span>
<a name="l00477"></a>00477 <span class="comment">                /**</span>
<a name="l00478"></a>00478 <span class="comment">                  * Creates a trapezohedron, consisting of 2*N kites, where N is the number of edges in the base. The base radius controls the polyhedron height, whilst the distance between bases affects the height.</span>
<a name="l00479"></a>00479 <span class="comment">                  * When the number of edges equals 3, the polyhedron is actually a parallelepiped, and it can even be a cube.</span>
<a name="l00480"></a>00480 <span class="comment">                  */</span>
<a name="l00481"></a>00481                 <span class="keyword">static</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> CreateTrapezohedron(uint32_t numBaseEdges,<span class="keywordtype">double</span> baseRadius,<span class="keywordtype">double</span> basesDistance);<span class="comment"></span>
<a name="l00482"></a>00482 <span class="comment">                /**</span>
<a name="l00483"></a>00483 <span class="comment">                  * Creates an antiprism whose base is a regular polygon. The upper base is rotated \f$\frac\pi N\f$ with respect to the lower one, where N is the number of vertices in the base, and thus the lateral triangles are isosceles.</span>
<a name="l00484"></a>00484 <span class="comment">                  * \sa CreateCustomAntiprism,CreateArchimedeanRegularAntiprism</span>
<a name="l00485"></a>00485 <span class="comment">                  */</span>
<a name="l00486"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a2bfd0bcfc190c78a502e5649a3220d7a">00486</a>                 <span class="keyword">inline</span> <span class="keyword">static</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a2bfd0bcfc190c78a502e5649a3220d7a" title="Creates an antiprism whose base is a regular polygon.">CreateRegularAntiprism</a>(uint32_t numBaseEdges,<span class="keywordtype">double</span> baseRadius,<span class="keywordtype">double</span> height)      {
<a name="l00487"></a>00487                         <span class="keywordflow">return</span> CreateCustomAntiprism(generateBase(numBaseEdges,baseRadius),generateShiftedBase(numBaseEdges,baseRadius),height);
<a name="l00488"></a>00488                 }<span class="comment"></span>
<a name="l00489"></a>00489 <span class="comment">                /**</span>
<a name="l00490"></a>00490 <span class="comment">                  * Creates a regular prism whose base is a regular polygon and whose edges are either parallel or perpendicular to the XY plane.</span>
<a name="l00491"></a>00491 <span class="comment">                  * \sa CreateCubicPrism,CreateCustomPrism,CreateArchimedeanRegularAntiprism</span>
<a name="l00492"></a>00492 <span class="comment">                  */</span>
<a name="l00493"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a4da598ce54c1c2f1218e1a068ef7c7b2">00493</a>                 <span class="keyword">inline</span> <span class="keyword">static</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a4da598ce54c1c2f1218e1a068ef7c7b2" title="Creates a regular prism whose base is a regular polygon and whose edges are either parallel or perpen...">CreateRegularPrism</a>(uint32_t numBaseEdges,<span class="keywordtype">double</span> baseRadius,<span class="keywordtype">double</span> height)  {
<a name="l00494"></a>00494                         <span class="keywordflow">return</span> CreateCustomPrism(generateBase(numBaseEdges,baseRadius),height);
<a name="l00495"></a>00495                 }<span class="comment"></span>
<a name="l00496"></a>00496 <span class="comment">                /**</span>
<a name="l00497"></a>00497 <span class="comment">                  * Creates a regular pyramid whose base is a regular polygon.</span>
<a name="l00498"></a>00498 <span class="comment">                  * \sa CreatePyramid</span>
<a name="l00499"></a>00499 <span class="comment">                  */</span>
<a name="l00500"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#ab6c98de9ae4ea645eaf1c81c3702cde8">00500</a>                 <span class="keyword">inline</span> <span class="keyword">static</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#ab6c98de9ae4ea645eaf1c81c3702cde8" title="Creates a regular pyramid whose base is a regular polygon.">CreateRegularPyramid</a>(uint32_t numBaseEdges,<span class="keywordtype">double</span> baseRadius,<span class="keywordtype">double</span> height)        {
<a name="l00501"></a>00501                         <span class="keywordflow">return</span> CreatePyramid(generateBase(numBaseEdges,baseRadius),height);
<a name="l00502"></a>00502                 }<span class="comment"></span>
<a name="l00503"></a>00503 <span class="comment">                /**</span>
<a name="l00504"></a>00504 <span class="comment">                  * Creates a regular double pyramid whose base is a regular polygon.</span>
<a name="l00505"></a>00505 <span class="comment">                  * \sa CreateDoublePyramid</span>
<a name="l00506"></a>00506 <span class="comment">                  */</span>
<a name="l00507"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a3a236dd64b7cadcd47018d4b03ac5921">00507</a>                 <span class="keyword">inline</span> <span class="keyword">static</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a3a236dd64b7cadcd47018d4b03ac5921" title="Creates a regular double pyramid whose base is a regular polygon.">CreateRegularDoublePyramid</a>(uint32_t numBaseEdges,<span class="keywordtype">double</span> baseRadius,<span class="keywordtype">double</span> height1,<span class="keywordtype">double</span> height2)  {
<a name="l00508"></a>00508                         <span class="keywordflow">return</span> CreateDoublePyramid(generateBase(numBaseEdges,baseRadius),height1,height2);
<a name="l00509"></a>00509                 }<span class="comment"></span>
<a name="l00510"></a>00510 <span class="comment">                /**</span>
<a name="l00511"></a>00511 <span class="comment">                  * Creates a regular prism whose lateral area is comprised of squares, and so each face of its is a regular polygon. Due to vertex transitivity, the resulting object is always archimedean.</span>
<a name="l00512"></a>00512 <span class="comment">                  * \sa CreateRegularPrism,CreateCustomPrism</span>
<a name="l00513"></a>00513 <span class="comment">                  */</span>
<a name="l00514"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a3dc5604546ae836502f799f6f9e32ba8">00514</a>                 <span class="keyword">inline</span> <span class="keyword">static</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a3dc5604546ae836502f799f6f9e32ba8" title="Creates a regular prism whose lateral area is comprised of squares, and so each face of its is a regu...">CreateArchimedeanRegularPrism</a>(uint32_t numBaseEdges,<span class="keywordtype">double</span> baseRadius)     {
<a name="l00515"></a>00515                         <span class="keywordflow">return</span> CreateJohnsonSolidWithConstantBase(numBaseEdges,baseRadius,<span class="stringliteral">&quot;PR&quot;</span>);
<a name="l00516"></a>00516                 }<span class="comment"></span>
<a name="l00517"></a>00517 <span class="comment">                /**</span>
<a name="l00518"></a>00518 <span class="comment">                  * Creates a regular antiprism whose lateral polygons are equilateral triangles, and so each face of its is a regular polygon. Due to vertex transitivity, the resulting object is always archimedean.</span>
<a name="l00519"></a>00519 <span class="comment">                  * \sa CreateRegularAntiprism,CreateCustomAntiprism</span>
<a name="l00520"></a>00520 <span class="comment">                  */</span>
<a name="l00521"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a35f122e254f0a18cbb68835b7559300c">00521</a>                 <span class="keyword">inline</span> <span class="keyword">static</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a35f122e254f0a18cbb68835b7559300c" title="Creates a regular antiprism whose lateral polygons are equilateral triangles, and so each face of its...">CreateArchimedeanRegularAntiprism</a>(uint32_t numBaseEdges,<span class="keywordtype">double</span> baseRadius) {
<a name="l00522"></a>00522                         <span class="keywordflow">return</span> CreateJohnsonSolidWithConstantBase(numBaseEdges,baseRadius,<span class="stringliteral">&quot;A&quot;</span>);
<a name="l00523"></a>00523                 }<span class="comment"></span>
<a name="l00524"></a>00524 <span class="comment">                /**</span>
<a name="l00525"></a>00525 <span class="comment">                  * Creates a regular truncated pyramid whose base is a regular polygon.</span>
<a name="l00526"></a>00526 <span class="comment">                  * \sa CreateTruncatedPyramid</span>
<a name="l00527"></a>00527 <span class="comment">                  */</span>
<a name="l00528"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a98c7109a4a39267e9d34682a12da692e">00528</a>                 <span class="keyword">inline</span> <span class="keyword">static</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a98c7109a4a39267e9d34682a12da692e" title="Creates a regular truncated pyramid whose base is a regular polygon.">CreateRegularTruncatedPyramid</a>(uint32_t numBaseEdges,<span class="keywordtype">double</span> baseRadius,<span class="keywordtype">double</span> height,<span class="keywordtype">double</span> ratio)  {
<a name="l00529"></a>00529                         <span class="keywordflow">return</span> CreateTruncatedPyramid(generateBase(numBaseEdges,baseRadius),height,ratio);
<a name="l00530"></a>00530                 }<span class="comment"></span>
<a name="l00531"></a>00531 <span class="comment">                /**</span>
<a name="l00532"></a>00532 <span class="comment">                  * This is a synonym for CreateRegularTruncatedPyramid.</span>
<a name="l00533"></a>00533 <span class="comment">                  * \sa CreateRegularTruncatedPyramid</span>
<a name="l00534"></a>00534 <span class="comment">                  */</span>
<a name="l00535"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a8b3ec5141ab6768824ca1f72ff9f5a85">00535</a>                 <span class="keyword">inline</span> <span class="keyword">static</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a8b3ec5141ab6768824ca1f72ff9f5a85" title="This is a synonym for CreateRegularTruncatedPyramid.">CreateRegularFrustum</a>(uint32_t numBaseEdges,<span class="keywordtype">double</span> baseRadius,<span class="keywordtype">double</span> height,<span class="keywordtype">double</span> ratio)   {
<a name="l00536"></a>00536                         <span class="keywordflow">return</span> CreateRegularTruncatedPyramid(numBaseEdges,baseRadius,height,ratio);
<a name="l00537"></a>00537                 }<span class="comment"></span>
<a name="l00538"></a>00538 <span class="comment">                /**</span>
<a name="l00539"></a>00539 <span class="comment">                  * Creates a bifrustum (double truncated pyramid) whose base is a regular polygon lying in the XY plane.</span>
<a name="l00540"></a>00540 <span class="comment">                  * \sa CreateBifrustum</span>
<a name="l00541"></a>00541 <span class="comment">                  */</span>
<a name="l00542"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a4c94a84f7d439be5c6352886641c38fa">00542</a>                 <span class="keyword">inline</span> <span class="keyword">static</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a4c94a84f7d439be5c6352886641c38fa" title="Creates a bifrustum (double truncated pyramid) whose base is a regular polygon lying in the XY plane...">CreateRegularBifrustum</a>(uint32_t numBaseEdges,<span class="keywordtype">double</span> baseRadius,<span class="keywordtype">double</span> height1,<span class="keywordtype">double</span> ratio1,<span class="keywordtype">double</span> height2,<span class="keywordtype">double</span> ratio2)  {
<a name="l00543"></a>00543                         <span class="keywordflow">return</span> CreateBifrustum(generateBase(numBaseEdges,baseRadius),height1,ratio1,height2,ratio2);
<a name="l00544"></a>00544                 }<span class="comment"></span>
<a name="l00545"></a>00545 <span class="comment">                /**</span>
<a name="l00546"></a>00546 <span class="comment">                  * Creates a cupola.</span>
<a name="l00547"></a>00547 <span class="comment">                  * \throw std::logic_error if the number of edges is odd or less than four.</span>
<a name="l00548"></a>00548 <span class="comment">                  */</span>
<a name="l00549"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#aefe00691ac58380eabdb7bbfb8c7c466">00549</a>                 <span class="keyword">inline</span> <span class="keyword">static</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#aefe00691ac58380eabdb7bbfb8c7c466" title="Creates a cupola.">CreateCupola</a>(uint32_t numBaseEdges,<span class="keywordtype">double</span> edgeLength)      {
<a name="l00550"></a>00550                         <span class="keywordflow">return</span> CreateJohnsonSolidWithConstantBase(numBaseEdges,edgeLength/(2*sin(<a class="code" href="mrpt__macros_8h.html#ae71449b1cc6e6250b91f539153a7a0d3">M_PI</a>/numBaseEdges)),<span class="stringliteral">&quot;C+&quot;</span>);
<a name="l00551"></a>00551                 }<span class="comment"></span>
<a name="l00552"></a>00552 <span class="comment">                /**</span>
<a name="l00553"></a>00553 <span class="comment">                  * Creates a trapezohedron whose dual is exactly an archimedean antiprism. Creates a cube if numBaseEdges is equal to 3.</span>
<a name="l00554"></a>00554 <span class="comment">                  * \todo Actually resulting height is significantly higher than that passed to the algorithm.</span>
<a name="l00555"></a>00555 <span class="comment">                  * \sa CreateTrapezohedron,CreateArchimedeanRegularAntiprism,getDual</span>
<a name="l00556"></a>00556 <span class="comment">                  */</span>
<a name="l00557"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a5d9f3a15f0c8196446b8a8b62278cc50">00557</a>                 <span class="keyword">inline</span> <span class="keyword">static</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a5d9f3a15f0c8196446b8a8b62278cc50" title="Creates a trapezohedron whose dual is exactly an archimedean antiprism.">CreateCatalanTrapezohedron</a>(uint32_t numBaseEdges,<span class="keywordtype">double</span> height)    {
<a name="l00558"></a>00558                         <span class="keywordflow">return</span> CreateArchimedeanRegularAntiprism(numBaseEdges,height)-&gt;getDual();
<a name="l00559"></a>00559                 }<span class="comment"></span>
<a name="l00560"></a>00560 <span class="comment">                /**</span>
<a name="l00561"></a>00561 <span class="comment">                  * Creates a double pyramid whose dual is exactly an archimedean prism. Creates an octahedron if numBaseEdges is equal to 4.</span>
<a name="l00562"></a>00562 <span class="comment">                  * \todo Actually resulting height is significantly higher than that passed to the algorithm.</span>
<a name="l00563"></a>00563 <span class="comment">                  * \sa CreateDoublePyramid,CreateArchimedeanRegularPrism,getDual</span>
<a name="l00564"></a>00564 <span class="comment">                  */</span>
<a name="l00565"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a2a30c3dede6cac1a3c9d2098846136bc">00565</a>                 <span class="keyword">inline</span> <span class="keyword">static</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a2a30c3dede6cac1a3c9d2098846136bc" title="Creates a double pyramid whose dual is exactly an archimedean prism.">CreateCatalanDoublePyramid</a>(uint32_t numBaseEdges,<span class="keywordtype">double</span> height)    {
<a name="l00566"></a>00566                         <span class="keywordflow">return</span> CreateArchimedeanRegularPrism(numBaseEdges,height)-&gt;getDual();
<a name="l00567"></a>00567                 }<span class="comment"></span>
<a name="l00568"></a>00568 <span class="comment">                /**</span>
<a name="l00569"></a>00569 <span class="comment">                  * Creates a series of concatenated solids (most of which are prismatoids) whose base is a regular polygon with a given number of edges. Every face of the resulting body will be a regular polygon, so it is a Johnson solid; in special cases, it may be archimedean or even platonic.</span>
<a name="l00570"></a>00570 <span class="comment">                  * The shape of the body is defined by the string argument, which can include one or more of the following:</span>
<a name="l00571"></a>00571 <span class="comment">                  &lt;center&gt;&lt;table&gt;</span>
<a name="l00572"></a>00572 <span class="comment">                  &lt;tr&gt;&lt;td&gt;&lt;b&gt;String&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&lt;b&gt;Body&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&lt;b&gt;Restrictions&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;</span>
<a name="l00573"></a>00573 <span class="comment">                  &lt;tr&gt;&lt;td&gt;P+&lt;/td&gt;&lt;td&gt;Upward pointing pyramid&lt;/td&gt;&lt;td&gt;Must be the last object, vertex number cannot surpass 5&lt;/td&gt;&lt;/tr&gt;</span>
<a name="l00574"></a>00574 <span class="comment">                  &lt;tr&gt;&lt;td&gt;P-&lt;/td&gt;&lt;td&gt;Downward pointing pyramid&lt;/td&gt;&lt;td&gt;Must be the first object, vertex number cannot surpass 5&lt;/td&gt;&lt;/tr&gt;</span>
<a name="l00575"></a>00575 <span class="comment">                  &lt;tr&gt;&lt;td&gt;C+&lt;/td&gt;&lt;td&gt;Upward pointing cupola&lt;/td&gt;&lt;td&gt;Must be the last object, vertex number must be an even number in the range 4-10.&lt;/td&gt;&lt;/tr&gt;</span>
<a name="l00576"></a>00576 <span class="comment">                  &lt;tr&gt;&lt;td&gt;C-&lt;/td&gt;&lt;td&gt;Downward pointing cupola&lt;/td&gt;&lt;td&gt;Must be the first object, vertex number must be an even number in the range 4-10.&lt;/td&gt;&lt;/tr&gt;</span>
<a name="l00577"></a>00577 <span class="comment">                  &lt;tr&gt;&lt;td&gt;GC+&lt;/td&gt;&lt;td&gt;Upward pointing cupola, rotated&lt;/td&gt;&lt;td&gt;Must be the last object, vertex number must be an even number in the range 4-10.&lt;/td&gt;&lt;/tr&gt;</span>
<a name="l00578"></a>00578 <span class="comment">                  &lt;tr&gt;&lt;td&gt;GC-&lt;/td&gt;&lt;td&gt;Downward pointing cupola, rotated&lt;/td&gt;&lt;td&gt;Must be the first object, vertex number must be an even number in the range 4-10.&lt;/td&gt;&lt;/tr&gt;</span>
<a name="l00579"></a>00579 <span class="comment">                  &lt;tr&gt;&lt;td&gt;PR&lt;/td&gt;&lt;td&gt;Archimedean prism&lt;/td&gt;&lt;td&gt;Cannot abut other prism&lt;/td&gt;&lt;/tr&gt;</span>
<a name="l00580"></a>00580 <span class="comment">                  &lt;tr&gt;&lt;td&gt;A&lt;/td&gt;&lt;td&gt;Archimedean antiprism&lt;/td&gt;&lt;td&gt;None&lt;/td&gt;&lt;/tr&gt;</span>
<a name="l00581"></a>00581 <span class="comment">                  &lt;tr&gt;&lt;td&gt;R+&lt;/td&gt;&lt;td&gt;Upward pointing rotunda&lt;/td&gt;&lt;td&gt;Must be the last object, vertex number must be exactly 10&lt;/td&gt;&lt;/tr&gt;</span>
<a name="l00582"></a>00582 <span class="comment">                  &lt;tr&gt;&lt;td&gt;R-&lt;/td&gt;&lt;td&gt;Downward pointing rotunda&lt;/td&gt;&lt;td&gt;Must be the first object, vertex number must be exactly 10&lt;/td&gt;&lt;/tr&gt;</span>
<a name="l00583"></a>00583 <span class="comment">                  &lt;tr&gt;&lt;td&gt;GR+&lt;/td&gt;&lt;td&gt;Upward pointing rotunda, rotated&lt;/td&gt;&lt;td&gt;Must be the last object, vertex number must be exactly 10&lt;/td&gt;&lt;/tr&gt;</span>
<a name="l00584"></a>00584 <span class="comment">                  &lt;tr&gt;&lt;td&gt;GR-&lt;/td&gt;&lt;td&gt;Downward pointing rotunda&lt;/td&gt;&lt;td&gt;Must be the first object, vertex number must be exactly 10&lt;/td&gt;&lt;/tr&gt;</span>
<a name="l00585"></a>00585 <span class="comment">                  &lt;/table&gt;&lt;/center&gt;</span>
<a name="l00586"></a>00586 <span class="comment">                  * Some examples of bodies are:</span>
<a name="l00587"></a>00587 <span class="comment">                  &lt;center&gt;&lt;table&gt;</span>
<a name="l00588"></a>00588 <span class="comment">                  &lt;tr&gt;&lt;td&gt;&lt;b&gt;String&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&lt;b&gt;Vertices&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&lt;b&gt;Resulting body&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;</span>
<a name="l00589"></a>00589 <span class="comment">                  &lt;tr&gt;&lt;td&gt;P+&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;3&lt;/td&gt;&lt;td&gt;Tetrahedron&lt;/td&gt;&lt;/tr&gt;</span>
<a name="l00590"></a>00590 <span class="comment">                  &lt;tr&gt;&lt;td&gt;PR&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;4&lt;/td&gt;&lt;td&gt;Hexahedron&lt;/td&gt;&lt;/tr&gt;</span>
<a name="l00591"></a>00591 <span class="comment">                  &lt;tr&gt;&lt;td&gt;P-P+&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;4&lt;/td&gt;&lt;td&gt;Octahedron&lt;/td&gt;&lt;/tr&gt;</span>
<a name="l00592"></a>00592 <span class="comment">                  &lt;tr&gt;&lt;td&gt;A&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;3&lt;/td&gt;&lt;td&gt;Octahedron&lt;/td&gt;&lt;/tr&gt;</span>
<a name="l00593"></a>00593 <span class="comment">                  &lt;tr&gt;&lt;td&gt;C+PRC-&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;8&lt;/td&gt;&lt;td&gt;Rhombicuboctahedron&lt;/td&gt;&lt;/tr&gt;</span>
<a name="l00594"></a>00594 <span class="comment">                  &lt;tr&gt;&lt;td&gt;P-AP+&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;5&lt;/td&gt;&lt;td&gt;Icosahedron&lt;/td&gt;&lt;/tr&gt;</span>
<a name="l00595"></a>00595 <span class="comment">                  &lt;tr&gt;&lt;td&gt;R-R+&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;10&lt;/td&gt;&lt;td&gt;Icosidodecahedron&lt;/td&gt;&lt;/tr&gt;</span>
<a name="l00596"></a>00596 <span class="comment">                  &lt;/table&gt;&lt;/center&gt;</span>
<a name="l00597"></a>00597 <span class="comment">                  */</span>
<a name="l00598"></a>00598                 <span class="keyword">static</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> CreateJohnsonSolidWithConstantBase(uint32_t numBaseEdges,<span class="keywordtype">double</span> baseRadius,<span class="keyword">const</span> <a class="code" href="classstd_1_1string.html" title="STL class.">std::string</a> &amp;components,<span class="keywordtype">size_t</span> shifts=0);<span class="comment"></span>
<a name="l00599"></a>00599 <span class="comment">                /** @}</span>
<a name="l00600"></a>00600 <span class="comment">                 */</span>
<a name="l00601"></a>00601 <span class="comment"></span>
<a name="l00602"></a>00602 <span class="comment">                /**</span>
<a name="l00603"></a>00603 <span class="comment">                  * Render</span>
<a name="l00604"></a>00604 <span class="comment">                  * \sa CRenderizable</span>
<a name="l00605"></a>00605 <span class="comment">                  */</span>
<a name="l00606"></a>00606                 <span class="keywordtype">void</span> render_dl() <span class="keyword">const</span>;<span class="comment"></span>
<a name="l00607"></a>00607 <span class="comment">                /**</span>
<a name="l00608"></a>00608 <span class="comment">                  * Ray trace</span>
<a name="l00609"></a>00609 <span class="comment">                  * \sa CRenderizable</span>
<a name="l00610"></a>00610 <span class="comment">                  */</span>
<a name="l00611"></a>00611                 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="group__geometry__grp.html#ga363e00600f9c000dd774e6c721faba7d" title="Fast ray tracing method using polygons&#39; properties.">traceRay</a>(<span class="keyword">const</span> <a class="code" href="classmrpt_1_1poses_1_1_c_pose3_d.html" title="A class used to store a 3D pose (a 3D translation + a rotation in 3D).">mrpt::poses::CPose3D</a> &amp;o,<span class="keywordtype">double</span> &amp;dist) <span class="keyword">const</span>;<span class="comment"></span>
<a name="l00612"></a>00612 <span class="comment">                /**</span>
<a name="l00613"></a>00613 <span class="comment">                  * Gets a list with the polyhedron&#39;s vertices.</span>
<a name="l00614"></a>00614 <span class="comment">                  */</span>
<a name="l00615"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#aaf225d9ad42f03a066191e87d8901cc8">00615</a>                 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#aaf225d9ad42f03a066191e87d8901cc8" title="Gets a list with the polyhedron&#39;s vertices.">getVertices</a>(<a class="code" href="classstd_1_1vector.html">vector&lt;TPoint3D&gt;</a> &amp;vertices)<span class="keyword"> const       </span>{
<a name="l00616"></a>00616                         vertices=mVertices;
<a name="l00617"></a>00617                 }<span class="comment"></span>
<a name="l00618"></a>00618 <span class="comment">                /**</span>
<a name="l00619"></a>00619 <span class="comment">                  * Gets a list with the polyhedron&#39;s edges.</span>
<a name="l00620"></a>00620 <span class="comment">                  */</span>
<a name="l00621"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#aa24635a5dae23cd253a1a23d3db3ece8">00621</a>                 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#aa24635a5dae23cd253a1a23d3db3ece8" title="Gets a list with the polyhedron&#39;s edges.">getEdges</a>(<a class="code" href="classstd_1_1vector.html">vector&lt;TPolyhedronEdge&gt;</a> &amp;edges)<span class="keyword"> const      </span>{
<a name="l00622"></a>00622                         edges=mEdges;
<a name="l00623"></a>00623                 }<span class="comment"></span>
<a name="l00624"></a>00624 <span class="comment">                /**</span>
<a name="l00625"></a>00625 <span class="comment">                  * Gets a list with the polyhedron&#39;s faces.</span>
<a name="l00626"></a>00626 <span class="comment">                  */</span>
<a name="l00627"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a4ae4991d357bd7dd5684a3fc70bef099">00627</a>                 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a4ae4991d357bd7dd5684a3fc70bef099" title="Gets a list with the polyhedron&#39;s faces.">getFaces</a>(<a class="code" href="classstd_1_1vector.html">vector&lt;TPolyhedronFace&gt;</a> &amp;faces)<span class="keyword"> const      </span>{
<a name="l00628"></a>00628                         faces=mFaces;
<a name="l00629"></a>00629                 }<span class="comment"></span>
<a name="l00630"></a>00630 <span class="comment">                /**</span>
<a name="l00631"></a>00631 <span class="comment">                  * Gets the amount of vertices.</span>
<a name="l00632"></a>00632 <span class="comment">                  */</span>
<a name="l00633"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a2a8ff0cd149d5ca892cb7ca4f0c5300e">00633</a>                 <span class="keyword">inline</span> uint32_t <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a2a8ff0cd149d5ca892cb7ca4f0c5300e" title="Gets the amount of vertices.">getNumberOfVertices</a>()<span class="keyword"> const     </span>{
<a name="l00634"></a>00634                         <span class="keywordflow">return</span> mVertices.size();
<a name="l00635"></a>00635                 }<span class="comment"></span>
<a name="l00636"></a>00636 <span class="comment">                /**</span>
<a name="l00637"></a>00637 <span class="comment">                  * Gets the amount of edges.</span>
<a name="l00638"></a>00638 <span class="comment">                  */</span>
<a name="l00639"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a999e5681b055539a1968b4290386ebef">00639</a>                 <span class="keyword">inline</span> uint32_t <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a999e5681b055539a1968b4290386ebef" title="Gets the amount of edges.">getNumberOfEdges</a>()<span class="keyword"> const        </span>{
<a name="l00640"></a>00640                         <span class="keywordflow">return</span> mEdges.size();
<a name="l00641"></a>00641                 }<span class="comment"></span>
<a name="l00642"></a>00642 <span class="comment">                /**</span>
<a name="l00643"></a>00643 <span class="comment">                  * Gets the amount of faces.</span>
<a name="l00644"></a>00644 <span class="comment">                  */</span>
<a name="l00645"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a7d1c9f80de29569046632518198e4101">00645</a>                 <span class="keyword">inline</span> uint32_t <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a7d1c9f80de29569046632518198e4101" title="Gets the amount of faces.">getNumberOfFaces</a>()<span class="keyword"> const        </span>{
<a name="l00646"></a>00646                         <span class="keywordflow">return</span> mFaces.size();
<a name="l00647"></a>00647                 }<span class="comment"></span>
<a name="l00648"></a>00648 <span class="comment">                /**</span>
<a name="l00649"></a>00649 <span class="comment">                  * Gets a vector with each edge&#39;s length.</span>
<a name="l00650"></a>00650 <span class="comment">                  */</span>
<a name="l00651"></a>00651                 <span class="keywordtype">void</span> getEdgesLength(<a class="code" href="classstd_1_1vector.html">vector&lt;double&gt;</a> &amp;lengths) <span class="keyword">const</span>;<span class="comment"></span>
<a name="l00652"></a>00652 <span class="comment">                /**</span>
<a name="l00653"></a>00653 <span class="comment">                  * Gets a vector with each face&#39;s area. Won&#39;t work properly if the polygons are not convex.</span>
<a name="l00654"></a>00654 <span class="comment">                  */</span>
<a name="l00655"></a>00655                 <span class="keywordtype">void</span> getFacesArea(<a class="code" href="classstd_1_1vector.html">vector&lt;double&gt;</a> &amp;areas) <span class="keyword">const</span>;<span class="comment"></span>
<a name="l00656"></a>00656 <span class="comment">                /**</span>
<a name="l00657"></a>00657 <span class="comment">                  * Gets the polyhedron volume. Won&#39;t work properly if the polyhedron is not convex.</span>
<a name="l00658"></a>00658 <span class="comment">                  */</span>
<a name="l00659"></a>00659                 <span class="keywordtype">double</span> getVolume() <span class="keyword">const</span>;<span class="comment"></span>
<a name="l00660"></a>00660 <span class="comment">                /**</span>
<a name="l00661"></a>00661 <span class="comment">                  * Returns whether the polyhedron will be rendered as a wireframe object.</span>
<a name="l00662"></a>00662 <span class="comment">                  */</span>
<a name="l00663"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a8603b65246b3cba5d1bdfe769c1d55c7">00663</a>                 <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a8603b65246b3cba5d1bdfe769c1d55c7" title="Returns whether the polyhedron will be rendered as a wireframe object.">isWireframe</a>()<span class="keyword"> const </span>{
<a name="l00664"></a>00664                         <span class="keywordflow">return</span> mWireframe;
<a name="l00665"></a>00665                 }<span class="comment"></span>
<a name="l00666"></a>00666 <span class="comment">                /**</span>
<a name="l00667"></a>00667 <span class="comment">                  * Sets whether the polyhedron will be rendered as a wireframe object.</span>
<a name="l00668"></a>00668 <span class="comment">                  */</span>
<a name="l00669"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#adb5ef20a953c5437470617eafe3aa728">00669</a>                 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#adb5ef20a953c5437470617eafe3aa728" title="Sets whether the polyhedron will be rendered as a wireframe object.">setWireframe</a>(<span class="keywordtype">bool</span> enabled=<span class="keyword">true</span>)     {
<a name="l00670"></a>00670                         mWireframe=enabled;
<a name="l00671"></a>00671                         <a class="code" href="classmrpt_1_1opengl_1_1_c_renderizable_display_list.html#a77f8b97d7f4937b3f0777b76bc0ddf7a" title="Must be called to notify that the object has changed (so, the display list must be updated)...">CRenderizableDisplayList::notifyChange</a>();
<a name="l00672"></a>00672                 }<span class="comment"></span>
<a name="l00673"></a>00673 <span class="comment">                /**</span>
<a name="l00674"></a>00674 <span class="comment">                  * Gets the wireframe lines width.</span>
<a name="l00675"></a>00675 <span class="comment">                  */</span>
<a name="l00676"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#ae31b8187c13044d2a44141b039b9e3b2">00676</a>                 <span class="keyword">inline</span> <span class="keywordtype">double</span> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#ae31b8187c13044d2a44141b039b9e3b2" title="Gets the wireframe lines width.">getLineWidth</a>()<span class="keyword"> const      </span>{
<a name="l00677"></a>00677                         <span class="keywordflow">return</span> mLineWidth;
<a name="l00678"></a>00678                 }<span class="comment"></span>
<a name="l00679"></a>00679 <span class="comment">                /**</span>
<a name="l00680"></a>00680 <span class="comment">                  * Sets the width used to render lines, when wireframe rendering is activated.</span>
<a name="l00681"></a>00681 <span class="comment">                  */</span>
<a name="l00682"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#afb6c56aa1d0d2cb09568ea4557703f15">00682</a>                 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#afb6c56aa1d0d2cb09568ea4557703f15" title="Sets the width used to render lines, when wireframe rendering is activated.">setLineWidth</a>(<span class="keywordtype">double</span> lineWidth)      {
<a name="l00683"></a>00683                         mLineWidth=lineWidth;
<a name="l00684"></a>00684                         <a class="code" href="classmrpt_1_1opengl_1_1_c_renderizable_display_list.html#a77f8b97d7f4937b3f0777b76bc0ddf7a" title="Must be called to notify that the object has changed (so, the display list must be updated)...">CRenderizableDisplayList::notifyChange</a>();
<a name="l00685"></a>00685                 }<span class="comment"></span>
<a name="l00686"></a>00686 <span class="comment">                /**</span>
<a name="l00687"></a>00687 <span class="comment">                  * Gets the polyhedron as a set of polygons.</span>
<a name="l00688"></a>00688 <span class="comment">                  * \sa mrpt::math::TPolygon3D</span>
<a name="l00689"></a>00689 <span class="comment">                  */</span>
<a name="l00690"></a>00690                 <span class="keywordtype">void</span> getSetOfPolygons(<a class="code" href="classstd_1_1vector.html" title="STL class.">std::vector&lt;math::TPolygon3D&gt;</a> &amp;vec) <span class="keyword">const</span>;<span class="comment"></span>
<a name="l00691"></a>00691 <span class="comment">                /**</span>
<a name="l00692"></a>00692 <span class="comment">                  * Gets the polyhedron as a set of polygons, with the pose transformation already applied.</span>
<a name="l00693"></a>00693 <span class="comment">                  * \sa mrpt::math::TPolygon3D,mrpt::poses::CPose3D</span>
<a name="l00694"></a>00694 <span class="comment">                  */</span>
<a name="l00695"></a>00695                 <span class="keywordtype">void</span> getSetOfPolygonsAbsolute(<a class="code" href="classstd_1_1vector.html" title="STL class.">std::vector&lt;math::TPolygon3D&gt;</a> &amp;vec) <span class="keyword">const</span>;<span class="comment"></span>
<a name="l00696"></a>00696 <span class="comment">                /**</span>
<a name="l00697"></a>00697 <span class="comment">                  * Gets the intersection of two polyhedra, either as a set or as a matrix of intersections. Each intersection is represented by a TObject3D.</span>
<a name="l00698"></a>00698 <span class="comment">                  * \sa mrpt::math::TObject3D</span>
<a name="l00699"></a>00699 <span class="comment">                  */</span>
<a name="l00700"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a65b8343edcb2ac21e062aaeb61a3fbf4">00700</a>                 <span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt; <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">size_t</span> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a65b8343edcb2ac21e062aaeb61a3fbf4" title="Gets the intersection of two polyhedra, either as a set or as a matrix of intersections.">getIntersection</a>(<span class="keyword">const</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> &amp;p1,<span class="keyword">const</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> &amp;p2,T &amp;container)  {
<a name="l00701"></a>00701                         std<a class="code" href="classstd_1_1vector.html" title="STL class.">::vector&lt;TPolygon3D&gt;</a> polys1,polys2;
<a name="l00702"></a>00702                         p1-&gt;getSetOfPolygonsAbsolute(polys1);
<a name="l00703"></a>00703                         p2-&gt;getSetOfPolygonsAbsolute(polys2);
<a name="l00704"></a>00704                         <span class="keywordflow">return</span> <a class="code" href="group__geometry__grp.html#ga096194319b696aecf5ab9337a2f60c44" title="Gets the intersection between two 3D segments.">mrpt::math::intersect</a>(polys1,polys2,container);
<a name="l00705"></a>00705                 }<span class="comment"></span>
<a name="l00706"></a>00706 <span class="comment">                /**</span>
<a name="l00707"></a>00707 <span class="comment">                  * Returns true if the polygon is a completely closed object.</span>
<a name="l00708"></a>00708 <span class="comment">                  */</span>
<a name="l00709"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#adef57a458f2ff948bd07cb569171d57d">00709</a>                 <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#adef57a458f2ff948bd07cb569171d57d" title="Returns true if the polygon is a completely closed object.">isClosed</a>()<span class="keyword"> const    </span>{
<a name="l00710"></a>00710                         <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i=0;i&lt;mVertices.size();i++) <span class="keywordflow">if</span> (edgesInVertex(i)!=facesInVertex(i)) <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00711"></a>00711                         <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00712"></a>00712                 }<span class="comment"></span>
<a name="l00713"></a>00713 <span class="comment">                /**</span>
<a name="l00714"></a>00714 <span class="comment">                  * Recomputes polygons, if necessary, so that each one is convex.</span>
<a name="l00715"></a>00715 <span class="comment">                  */</span>
<a name="l00716"></a>00716                 <span class="keywordtype">void</span> makeConvexPolygons();<span class="comment"></span>
<a name="l00717"></a>00717 <span class="comment">                /**</span>
<a name="l00718"></a>00718 <span class="comment">                  * Gets the center of the polyhedron.</span>
<a name="l00719"></a>00719 <span class="comment">                  */</span>
<a name="l00720"></a>00720                 <span class="keywordtype">void</span> getCenter(<a class="code" href="structmrpt_1_1math_1_1_t_point3_d.html" title="Lightweight 3D point.">TPoint3D</a> &amp;center) <span class="keyword">const</span>;<span class="comment"></span>
<a name="l00721"></a>00721 <span class="comment">                /**</span>
<a name="l00722"></a>00722 <span class="comment">                  * Creates a random polyhedron from the static methods.</span>
<a name="l00723"></a>00723 <span class="comment">                  */</span>
<a name="l00724"></a>00724                 <span class="keyword">static</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> CreateRandomPolyhedron(<span class="keywordtype">double</span> radius);
<a name="l00725"></a>00725 <span class="comment"></span>
<a name="l00726"></a>00726 <span class="comment">                /** @name Polyhedron special operations.</span>
<a name="l00727"></a>00727 <span class="comment">                        @{</span>
<a name="l00728"></a>00728 <span class="comment">                 */</span><span class="comment"></span>
<a name="l00729"></a>00729 <span class="comment">                /**</span>
<a name="l00730"></a>00730 <span class="comment">                  * Given a polyhedron, creates its dual.</span>
<a name="l00731"></a>00731 <span class="comment">                  * \sa truncate,cantellate,augment</span>
<a name="l00732"></a>00732 <span class="comment">                  * \throw std::logic_error Can&#39;t get the dual to this polyhedron.</span>
<a name="l00733"></a>00733 <span class="comment">                  */</span>
<a name="l00734"></a>00734                 <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> getDual() <span class="keyword">const</span>;<span class="comment"></span>
<a name="l00735"></a>00735 <span class="comment">                /**</span>
<a name="l00736"></a>00736 <span class="comment">                  * Truncates a polyhedron to a given factor.</span>
<a name="l00737"></a>00737 <span class="comment">                  * \sa getDual,cantellate,augment</span>
<a name="l00738"></a>00738 <span class="comment">                  * \throw std::logic_error Polyhedron truncation results in skew polygons and thus it&#39;s impossible to perform.</span>
<a name="l00739"></a>00739 <span class="comment">                  */</span>
<a name="l00740"></a>00740                 <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> truncate(<span class="keywordtype">double</span> factor) <span class="keyword">const</span>;<span class="comment"></span>
<a name="l00741"></a>00741 <span class="comment">                /**</span>
<a name="l00742"></a>00742 <span class="comment">                  * Cantellates a polyhedron to a given factor.</span>
<a name="l00743"></a>00743 <span class="comment">                  * \sa getDual,truncate,augment</span>
<a name="l00744"></a>00744 <span class="comment">                  */</span>
<a name="l00745"></a>00745                 <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> cantellate(<span class="keywordtype">double</span> factor) <span class="keyword">const</span>;<span class="comment"></span>
<a name="l00746"></a>00746 <span class="comment">                /**</span>
<a name="l00747"></a>00747 <span class="comment">                  * Augments a polyhedron to a given height. This operation is roughly dual to the truncation: given a body P, the operation dtdP and aP yield resembling results.</span>
<a name="l00748"></a>00748 <span class="comment">                  * \sa getDual,truncate,cantellate</span>
<a name="l00749"></a>00749 <span class="comment">                  */</span>
<a name="l00750"></a>00750                 <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> augment(<span class="keywordtype">double</span> height) <span class="keyword">const</span>;<span class="comment"></span>
<a name="l00751"></a>00751 <span class="comment">                /**</span>
<a name="l00752"></a>00752 <span class="comment">                  * Augments a polyhedron to a given height. This method only affects to faces with certain number of vertices.</span>
<a name="l00753"></a>00753 <span class="comment">                  * \sa augment(double) const</span>
<a name="l00754"></a>00754 <span class="comment">                  */</span>
<a name="l00755"></a>00755                 <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> augment(<span class="keywordtype">double</span> height,<span class="keywordtype">size_t</span> numVertices) <span class="keyword">const</span>;<span class="comment"></span>
<a name="l00756"></a>00756 <span class="comment">                /**</span>
<a name="l00757"></a>00757 <span class="comment">                  * Augments a polyhedron, so that the resulting triangles are equilateral. If the argument is true, triangles are &quot;cut&quot; from the polyhedron, instead of being added.</span>
<a name="l00758"></a>00758 <span class="comment">                  * \throw std::logic_error a non-regular face has been found.</span>
<a name="l00759"></a>00759 <span class="comment">                  * \sa augment(double) const</span>
<a name="l00760"></a>00760 <span class="comment">                  */</span>
<a name="l00761"></a>00761                 <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> augment(<span class="keywordtype">bool</span> direction=<span class="keyword">false</span>) <span class="keyword">const</span>;<span class="comment"></span>
<a name="l00762"></a>00762 <span class="comment">                /**</span>
<a name="l00763"></a>00763 <span class="comment">                  * Augments a polyhedron, so that the resulting triangles are equilateral; affects only faces with certain number of faces. If the second argument is true, triangles are &quot;cut&quot; from the polyhedron.</span>
<a name="l00764"></a>00764 <span class="comment">                  * \throw std::logic_error a non-regular face has been found.</span>
<a name="l00765"></a>00765 <span class="comment">                  * \sa augment(double) const</span>
<a name="l00766"></a>00766 <span class="comment">                  */</span>
<a name="l00767"></a>00767                 <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> augment(<span class="keywordtype">size_t</span> numVertices,<span class="keywordtype">bool</span> direction=<span class="keyword">false</span>) <span class="keyword">const</span>;<span class="comment"></span>
<a name="l00768"></a>00768 <span class="comment">                /**</span>
<a name="l00769"></a>00769 <span class="comment">                  * Rotates a polyhedron around the Z axis a given amount of radians. In some cases, this operation may be necessary to view the symmetry between related objects.</span>
<a name="l00770"></a>00770 <span class="comment">                  *     \sa scale</span>
<a name="l00771"></a>00771 <span class="comment">                  */</span>
<a name="l00772"></a>00772                 <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> rotate(<span class="keywordtype">double</span> angle) <span class="keyword">const</span>;<span class="comment"></span>
<a name="l00773"></a>00773 <span class="comment">                /**</span>
<a name="l00774"></a>00774 <span class="comment">                  * Scales a polyhedron to a given factor.</span>
<a name="l00775"></a>00775 <span class="comment">                  * \throw std::logic_error factor is not a strictly positive number.</span>
<a name="l00776"></a>00776 <span class="comment">                  * \sa rotate</span>
<a name="l00777"></a>00777 <span class="comment">                  */</span>
<a name="l00778"></a>00778                 <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> scale(<span class="keywordtype">double</span> factor) <span class="keyword">const</span>;<span class="comment"></span>
<a name="l00779"></a>00779 <span class="comment">                /** @}</span>
<a name="l00780"></a>00780 <span class="comment">                 */</span><span class="comment"></span>
<a name="l00781"></a>00781 <span class="comment">                /**</span>
<a name="l00782"></a>00782 <span class="comment">                  * Updates the mutable list of polygons used in rendering and ray tracing.</span>
<a name="l00783"></a>00783 <span class="comment">                  */</span>
<a name="l00784"></a>00784                 <span class="keywordtype">void</span> updatePolygons() <span class="keyword">const</span>;
<a name="l00785"></a>00785         <span class="keyword">private</span>:<span class="comment"></span>
<a name="l00786"></a>00786 <span class="comment">                /**</span>
<a name="l00787"></a>00787 <span class="comment">                  * Generates a list of 2D vertices constituting a regular polygon.</span>
<a name="l00788"></a>00788 <span class="comment">                  */</span>
<a name="l00789"></a>00789                 <span class="keyword">static</span> <a class="code" href="classstd_1_1vector.html">vector&lt;TPoint2D&gt;</a> generateBase(uint32_t numBaseEdges,<span class="keywordtype">double</span> baseRadius);<span class="comment"></span>
<a name="l00790"></a>00790 <span class="comment">                /**</span>
<a name="l00791"></a>00791 <span class="comment">                  * Generates a list of 2D vertices constituting a regular polygon, with an angle shift which makes it suitable for antiprisms.</span>
<a name="l00792"></a>00792 <span class="comment">                  */</span>
<a name="l00793"></a>00793                 <span class="keyword">static</span> <a class="code" href="classstd_1_1vector.html">vector&lt;TPoint2D&gt;</a> generateShiftedBase(uint32_t numBaseEdges,<span class="keywordtype">double</span> baseRadius);<span class="comment"></span>
<a name="l00794"></a>00794 <span class="comment">                /**</span>
<a name="l00795"></a>00795 <span class="comment">                  * Generates a list of 3D vertices constituting a regular polygon, appending it to an existing vector.</span>
<a name="l00796"></a>00796 <span class="comment">                  */</span>
<a name="l00797"></a>00797                 <span class="keyword">static</span> <span class="keywordtype">void</span> generateBase(uint32_t numBaseEdges,<span class="keywordtype">double</span> baseRadius,<span class="keywordtype">double</span> height,<a class="code" href="classstd_1_1vector.html">vector&lt;TPoint3D&gt;</a> &amp;vec);<span class="comment"></span>
<a name="l00798"></a>00798 <span class="comment">                /**</span>
<a name="l00799"></a>00799 <span class="comment">                  * Generates a list of 3D vertices constituting a regular polygon conveniently shifted, appending it to an existing vector.</span>
<a name="l00800"></a>00800 <span class="comment">                  */</span>
<a name="l00801"></a>00801                 <span class="keyword">static</span> <span class="keywordtype">void</span> generateShiftedBase(uint32_t numBaseEdges,<span class="keywordtype">double</span> baseRadius,<span class="keywordtype">double</span> height,<span class="keywordtype">double</span> shift,<a class="code" href="classstd_1_1vector.html">vector&lt;TPoint3D&gt;</a> &amp;vec);<span class="comment"></span>
<a name="l00802"></a>00802 <span class="comment">                /**</span>
<a name="l00803"></a>00803 <span class="comment">                  * Calculates the normal vector to a face.</span>
<a name="l00804"></a>00804 <span class="comment">                  */</span>
<a name="l00805"></a>00805                 <span class="keywordtype">bool</span> setNormal(TPolyhedronFace &amp;f,<span class="keywordtype">bool</span> doCheck=<span class="keyword">true</span>);<span class="comment"></span>
<a name="l00806"></a>00806 <span class="comment">                /**</span>
<a name="l00807"></a>00807 <span class="comment">                  * Adds, to the existing list of edges, each edge in a given face.</span>
<a name="l00808"></a>00808 <span class="comment">                  */</span>
<a name="l00809"></a>00809                 <span class="keywordtype">void</span> addEdges(<span class="keyword">const</span> TPolyhedronFace &amp;e);<span class="comment"></span>
<a name="l00810"></a>00810 <span class="comment">                /**</span>
<a name="l00811"></a>00811 <span class="comment">                  * Checks whether a set of faces is suitable for a set of vertices.</span>
<a name="l00812"></a>00812 <span class="comment">                  */</span>
<a name="l00813"></a>00813                 <span class="keyword">static</span> <span class="keywordtype">bool</span> checkConsistence(<span class="keyword">const</span> <a class="code" href="classstd_1_1vector.html">vector&lt;TPoint3D&gt;</a> &amp;vertices,<span class="keyword">const</span> <a class="code" href="classstd_1_1vector.html">vector&lt;TPolyhedronFace&gt;</a> &amp;faces);<span class="comment"></span>
<a name="l00814"></a>00814 <span class="comment">                /**</span>
<a name="l00815"></a>00815 <span class="comment">                  * Returns how many edges converge in a given vertex.</span>
<a name="l00816"></a>00816 <span class="comment">                  */</span>
<a name="l00817"></a>00817                 <span class="keywordtype">size_t</span> edgesInVertex(<span class="keywordtype">size_t</span> vertex) <span class="keyword">const</span>;<span class="comment"></span>
<a name="l00818"></a>00818 <span class="comment">                /**</span>
<a name="l00819"></a>00819 <span class="comment">                  * Returns how many faces converge in a given vertex.</span>
<a name="l00820"></a>00820 <span class="comment">                  */</span>
<a name="l00821"></a>00821                 <span class="keywordtype">size_t</span> facesInVertex(<span class="keywordtype">size_t</span> vertex) <span class="keyword">const</span>;<span class="comment"></span>
<a name="l00822"></a>00822 <span class="comment">                /**</span>
<a name="l00823"></a>00823 <span class="comment">                  * Basic empty constructor.</span>
<a name="l00824"></a>00824 <span class="comment">                  */</span>
<a name="l00825"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#acb16e5bc96c962f1f0ebd9b62ccaa935">00825</a>                 <span class="keyword">inline</span> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#acb16e5bc96c962f1f0ebd9b62ccaa935" title="Basic empty constructor.">CPolyhedron</a>():mVertices(),mEdges(),mFaces(),mWireframe(false),mLineWidth(1),polygonsUpToDate(false)      {}<span class="comment"></span>
<a name="l00826"></a>00826 <span class="comment">                /**</span>
<a name="l00827"></a>00827 <span class="comment">                  * Basic constructor with a list of vertices and another of faces, checking for correctness.</span>
<a name="l00828"></a>00828 <span class="comment">                  */</span>
<a name="l00829"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a113e801ce694c9a2c9b5376b17af5b91">00829</a>                 <span class="keyword">inline</span> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a113e801ce694c9a2c9b5376b17af5b91" title="Basic constructor with a list of vertices and another of faces, checking for correctness.">CPolyhedron</a>(<span class="keyword">const</span> <a class="code" href="classstd_1_1vector.html">vector&lt;TPoint3D&gt;</a> &amp;vertices,<span class="keyword">const</span> <a class="code" href="classstd_1_1vector.html">vector&lt;TPolyhedronFace&gt;</a> &amp;faces,<span class="keywordtype">bool</span> doCheck=<span class="keyword">true</span>):mVertices(vertices),mEdges(),mFaces(faces),mWireframe(false),mLineWidth(1),polygonsUpToDate(false)  {
<a name="l00830"></a>00830                         <span class="keywordflow">if</span> (doCheck) <span class="keywordflow">if</span> (!checkConsistence(vertices,faces)) <span class="keywordflow">throw</span> <a class="code" href="classstd_1_1logic__error.html" title="STL class.">std::logic_error</a>(<span class="stringliteral">&quot;Face list accesses a vertex out of range&quot;</span>);
<a name="l00831"></a>00831                         <span class="keywordflow">for</span> (<a class="code" href="classstd_1_1vector.html" title="STL class.">vector&lt;TPolyhedronFace&gt;::iterator</a> it=mFaces.begin();it!=mFaces.end();++it) {
<a name="l00832"></a>00832                                 <span class="keywordflow">if</span> (!setNormal(*it,doCheck)) <span class="keywordflow">throw</span> <a class="code" href="classstd_1_1logic__error.html" title="STL class.">std::logic_error</a>(<span class="stringliteral">&quot;Bad face specification&quot;</span>);
<a name="l00833"></a>00833                                 addEdges(*it);
<a name="l00834"></a>00834                         }
<a name="l00835"></a>00835                 }<span class="comment"></span>
<a name="l00836"></a>00836 <span class="comment">                /**</span>
<a name="l00837"></a>00837 <span class="comment">                  * Creates a polyhedron without checking its correctness.</span>
<a name="l00838"></a>00838 <span class="comment">                  */</span>
<a name="l00839"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a1e3e298443301769813ed7da2ef73c15">00839</a>                 <span class="keyword">inline</span> <span class="keyword">static</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#a1e3e298443301769813ed7da2ef73c15" title="Creates a polyhedron without checking its correctness.">CreateNoCheck</a>(<span class="keyword">const</span> <a class="code" href="classstd_1_1vector.html">vector&lt;TPoint3D&gt;</a> &amp;vertices,<span class="keyword">const</span> <a class="code" href="classstd_1_1vector.html">vector&lt;TPolyhedronFace&gt;</a> &amp;faces)       {
<a name="l00840"></a>00840                         <span class="keywordflow">return</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a>(<span class="keyword">new</span> <a class="code" href="namespacemrpt_1_1opengl.html#aca7da3a54971b25c26508857039248aa">CPolyhedron</a>(vertices,faces,<span class="keyword">false</span>));
<a name="l00841"></a>00841                 }<span class="comment"></span>
<a name="l00842"></a>00842 <span class="comment">                /**</span>
<a name="l00843"></a>00843 <span class="comment">                  * Creates an empty Polyhedron.</span>
<a name="l00844"></a>00844 <span class="comment">                  */</span>
<a name="l00845"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#ada3c811270a3a4e7d74b02a8ac0f4cb0">00845</a>                 <span class="keyword">inline</span> <span class="keyword">static</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#ada3c811270a3a4e7d74b02a8ac0f4cb0" title="Creates an empty Polyhedron.">CreateEmpty</a>()      {
<a name="l00846"></a>00846                         <span class="keywordflow">return</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a>(<span class="keyword">new</span> <a class="code" href="namespacemrpt_1_1opengl.html#aca7da3a54971b25c26508857039248aa">CPolyhedron</a>());
<a name="l00847"></a>00847                 }<span class="comment"></span>
<a name="l00848"></a>00848 <span class="comment">                /**</span>
<a name="l00849"></a>00849 <span class="comment">                  * Destructor.</span>
<a name="l00850"></a>00850 <span class="comment">                  */</span>
<a name="l00851"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#add443a95586b06ddcd5d2bea4b12b018">00851</a>                 <span class="keyword">virtual</span> <a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html#add443a95586b06ddcd5d2bea4b12b018" title="Destructor.">~CPolyhedron</a>()  {}
<a name="l00852"></a>00852         };<span class="comment"></span>
<a name="l00853"></a>00853 <span class="comment">        /**</span>
<a name="l00854"></a>00854 <span class="comment">          * Reads a polyhedron edge from a binary stream.</span>
<a name="l00855"></a>00855 <span class="comment">          */</span>
<a name="l00856"></a>00856         <a class="code" href="opengl_2include_2mrpt_2opengl_2link__pragmas_8h.html#af6a1c8d5d6b3c8c0af00dbeef88ce269">OPENGL_IMPEXP</a> mrpt<a class="code" href="classmrpt_1_1utils_1_1_c_stream.html" title="This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...">::utils::CStream</a>&amp; <a class="code" href="namespacemrpt_1_1opengl.html#a34eb2b27b17baf0675d3868913bc9d12">operator&gt;&gt;</a>(<a class="code" href="classmrpt_1_1utils_1_1_c_stream.html" title="This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...">mrpt::utils::CStream</a>&amp; in,CPolyhedron::TPolyhedronEdge &amp;o);<span class="comment"></span>
<a name="l00857"></a>00857 <span class="comment">        /**</span>
<a name="l00858"></a>00858 <span class="comment">          * Writes a polyhedron edge to a binary stream.</span>
<a name="l00859"></a>00859 <span class="comment">          */</span>
<a name="l00860"></a>00860         <a class="code" href="opengl_2include_2mrpt_2opengl_2link__pragmas_8h.html#af6a1c8d5d6b3c8c0af00dbeef88ce269">OPENGL_IMPEXP</a> mrpt<a class="code" href="classmrpt_1_1utils_1_1_c_stream.html" title="This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...">::utils::CStream</a>&amp; <a class="code" href="namespacemrpt_1_1opengl.html#a12e49154ca3af8dcb06d847404a0d4ea" title="Inserts an openGL object into a scene.">operator&lt;&lt;</a>(<a class="code" href="classmrpt_1_1utils_1_1_c_stream.html" title="This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...">mrpt::utils::CStream</a>&amp; out,<span class="keyword">const</span> CPolyhedron::TPolyhedronEdge &amp;o);<span class="comment"></span>
<a name="l00861"></a>00861 <span class="comment">        /**</span>
<a name="l00862"></a>00862 <span class="comment">          * Reads a polyhedron face from a binary stream.</span>
<a name="l00863"></a>00863 <span class="comment">          */</span>
<a name="l00864"></a>00864         <a class="code" href="opengl_2include_2mrpt_2opengl_2link__pragmas_8h.html#af6a1c8d5d6b3c8c0af00dbeef88ce269">OPENGL_IMPEXP</a> mrpt<a class="code" href="classmrpt_1_1utils_1_1_c_stream.html" title="This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...">::utils::CStream</a>&amp; <a class="code" href="namespacemrpt_1_1opengl.html#a34eb2b27b17baf0675d3868913bc9d12">operator&gt;&gt;</a>(<a class="code" href="classmrpt_1_1utils_1_1_c_stream.html" title="This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...">mrpt::utils::CStream</a>&amp; in,CPolyhedron::TPolyhedronFace &amp;o);<span class="comment"></span>
<a name="l00865"></a>00865 <span class="comment">        /**</span>
<a name="l00866"></a>00866 <span class="comment">          * Writes a polyhedron face to a binary stream.</span>
<a name="l00867"></a>00867 <span class="comment">          */</span>
<a name="l00868"></a>00868         <a class="code" href="opengl_2include_2mrpt_2opengl_2link__pragmas_8h.html#af6a1c8d5d6b3c8c0af00dbeef88ce269">OPENGL_IMPEXP</a> mrpt<a class="code" href="classmrpt_1_1utils_1_1_c_stream.html" title="This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...">::utils::CStream</a>&amp; <a class="code" href="namespacemrpt_1_1opengl.html#a12e49154ca3af8dcb06d847404a0d4ea" title="Inserts an openGL object into a scene.">operator&lt;&lt;</a>(<a class="code" href="classmrpt_1_1utils_1_1_c_stream.html" title="This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...">mrpt::utils::CStream</a>&amp; out,<span class="keyword">const</span> CPolyhedron::TPolyhedronFace &amp;o);
<a name="l00869"></a>00869 }
<a name="l00870"></a>00870         <span class="keyword">namespace </span>utils {
<a name="l00871"></a>00871                 <span class="keyword">using namespace </span>mrpt::opengl;
<a name="l00872"></a>00872                 <span class="comment">// Specialization must occur in the same namespace</span>
<a name="l00873"></a>00873                 <a class="code" href="_c_serializable_8h.html#a3d50ead2a44af4340ef8e3a88b78df10">MRPT_DECLARE_TTYPENAME</a>(<a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_1_1_t_polyhedron_edge.html" title="Struct used to store a polyhedron edge.">CPolyhedron::TPolyhedronEdge</a>)
<a name="l00874"></a>00874                 <a class="code" href="_c_serializable_8h.html#a3d50ead2a44af4340ef8e3a88b78df10">MRPT_DECLARE_TTYPENAME</a>(<a class="code" href="classmrpt_1_1opengl_1_1_c_polyhedron.html" title="This class represents arbitrary polyhedra.">CPolyhedron</a>::TPolyhedronFace)
<a name="l00875"></a>00875         }
<a name="l00876"></a>00876 }
<a name="l00877"></a>00877 <span class="preprocessor">#endif</span>
</pre></div></div>
</div>
<br><hr><br> <table border="0" width="100%"> <tr> <td> Page generated by <a href="http://www.doxygen.org" target="_blank">Doxygen 1.7.5</a> for MRPT 0.9.5 SVN: at Sun Sep 25 17:20:18 UTC 2011</td><td></td> <td width="100"> </td> <td width="150">  </td></tr> </table>  </body></html>