Sophie

Sophie

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

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>CGeneralizedCylinder.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">CGeneralizedCylinder.h</div>  </div>
</div>
<div class="contents">
<a href="_c_generalized_cylinder_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_CGeneralizedCylinder_H</span>
<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define opengl_CGeneralizedCylinder_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="_c_polyhedron_8h.html">mrpt/opengl/CPolyhedron.h</a>&gt;</span>
<a name="l00033"></a>00033 <span class="preprocessor">#include &lt;<a class="code" href="_c_set_of_triangles_8h.html">mrpt/opengl/CSetOfTriangles.h</a>&gt;</span>
<a name="l00034"></a>00034 <span class="preprocessor">#include &lt;<a class="code" href="geometry_8h.html">mrpt/math/geometry.h</a>&gt;</span>
<a name="l00035"></a>00035 <span class="preprocessor">#include &lt;<a class="code" href="_c_matrix_template_8h.html">mrpt/math/CMatrixTemplate.h</a>&gt;</span>
<a name="l00036"></a>00036 
<a name="l00037"></a>00037 <span class="keyword">namespace </span>mrpt  {
<a name="l00038"></a>00038 <span class="keyword">namespace </span>opengl        {
<a name="l00039"></a>00039         <span class="keyword">using namespace </span>std;
<a name="l00040"></a>00040         <span class="keyword">using namespace </span>mrpt::math;
<a name="l00041"></a><a class="code" href="namespacemrpt_1_1opengl.html#afd71ba490362fef3ed96b4cd868d6c1f">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_generalized_cylinder.html" title="This object represents any figure obtained by extruding any profile along a given axis...">CGeneralizedCylinder</a>;
<a name="l00042"></a>00042         <span class="comment">// This must be added to any CSerializable derived class:</span>
<a name="l00043"></a><a class="code" href="structmrpt_1_1opengl_1_1_c_generalized_cylinder_ptr.html#ad08b2c2b51d5b0cba2d2008fa7507f6b">00043</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_generalized_cylinder.html" title="This object represents any figure obtained by extruding any profile along a given axis...">CGeneralizedCylinder</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="l00044"></a>00044 <span class="comment">        /**</span>
<a name="l00045"></a>00045 <span class="comment">          * This object represents any figure obtained by extruding any profile along a given axis. The profile should lie over a x=0 plane, and the axis must be roughly perpendicular to this plane. In particular, it should be almost perpendicular to the Z axis.</span>
<a name="l00046"></a>00046 <span class="comment">          * \ingroup mrpt_opengl_grp</span>
<a name="l00047"></a>00047 <span class="comment">          */</span>
<a name="l00048"></a>00048         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_generalized_cylinder.html" title="This object represents any figure obtained by extruding any profile along a given axis...">CGeneralizedCylinder</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="l00049"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#a9f22753b597853becee82f816b500038">00049</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_generalized_cylinder.html" title="This object represents any figure obtained by extruding any profile along a given axis...">CGeneralizedCylinder</a>)
<a name="l00050"></a>00050         public:<span class="comment"></span>
<a name="l00051"></a>00051 <span class="comment">                /**</span>
<a name="l00052"></a>00052 <span class="comment">                  * Auxiliary struct holding any quadrilateral, represented by foour points.</span>
<a name="l00053"></a>00053 <span class="comment">                  */</span>
<a name="l00054"></a>00054                 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_generalized_cylinder_1_1_t_quadrilateral.html" title="Auxiliary struct holding any quadrilateral, represented by foour points.">TQuadrilateral</a>     {
<a name="l00055"></a>00055                 <span class="keyword">private</span>:<span class="comment"></span>
<a name="l00056"></a>00056 <span class="comment">                        /**</span>
<a name="l00057"></a>00057 <span class="comment">                          * Automatically compute a vector normal to this quadrilateral.</span>
<a name="l00058"></a>00058 <span class="comment">                          */</span>
<a name="l00059"></a>00059                         <span class="keywordtype">void</span> calculateNormal();
<a name="l00060"></a>00060                 <span class="keyword">public</span>:<span class="comment"></span>
<a name="l00061"></a>00061 <span class="comment">                        /**</span>
<a name="l00062"></a>00062 <span class="comment">                          * Quadrilateral`&#39;s points.</span>
<a name="l00063"></a>00063 <span class="comment">                          */</span>
<a name="l00064"></a><a class="code" href="structmrpt_1_1opengl_1_1_c_generalized_cylinder_1_1_t_quadrilateral.html#ab136fb72762d24a7029919fd0f0c16ee">00064</a>                         <a class="code" href="structmrpt_1_1math_1_1_t_point3_d.html" title="Lightweight 3D point.">TPoint3D</a> points[4];<span class="comment"></span>
<a name="l00065"></a>00065 <span class="comment">                        /**</span>
<a name="l00066"></a>00066 <span class="comment">                          * Normal vector.</span>
<a name="l00067"></a>00067 <span class="comment">                          */</span> 
<a name="l00068"></a><a class="code" href="structmrpt_1_1opengl_1_1_c_generalized_cylinder_1_1_t_quadrilateral.html#a825c80a7993e4f60574894aa14ebbf2f">00068</a>                         <span class="keywordtype">double</span> normal[3];<span class="comment"></span>
<a name="l00069"></a>00069 <span class="comment">                        /**</span>
<a name="l00070"></a>00070 <span class="comment">                          * Given a polygon with 4 already positions allocated, this method fills it with the quadrilateral points.</span>
<a name="l00071"></a>00071 <span class="comment">                          * \sa mrpt::math::TPolygon3D</span>
<a name="l00072"></a>00072 <span class="comment">                          */</span> 
<a name="l00073"></a><a class="code" href="structmrpt_1_1opengl_1_1_c_generalized_cylinder_1_1_t_quadrilateral.html#a5e28101f90869459a82efa51158e176c">00073</a>                         <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_generalized_cylinder_1_1_t_quadrilateral.html#a5e28101f90869459a82efa51158e176c" title="Given a polygon with 4 already positions allocated, this method fills it with the quadrilateral point...">getAsPolygonUnsafe</a>(<a class="code" href="classmrpt_1_1math_1_1_t_polygon3_d.html" title="3D polygon, inheriting from std::vector&lt;TPoint3D&gt;">mrpt::math::TPolygon3D</a> &amp;vec)<span class="keyword"> const       </span>{
<a name="l00074"></a>00074                                 vec[0]=points[0];
<a name="l00075"></a>00075                                 vec[1]=points[1];
<a name="l00076"></a>00076                                 vec[2]=points[2];
<a name="l00077"></a>00077                                 vec[3]=points[3];
<a name="l00078"></a>00078                         }<span class="comment"></span>
<a name="l00079"></a>00079 <span class="comment">                        /**</span>
<a name="l00080"></a>00080 <span class="comment">                          * Constructor from 4 points.</span>
<a name="l00081"></a>00081 <span class="comment">                          */</span> 
<a name="l00082"></a><a class="code" href="structmrpt_1_1opengl_1_1_c_generalized_cylinder_1_1_t_quadrilateral.html#ad2f9b9847479432fa882a94f1ae2c7da">00082</a>                         <a class="code" href="structmrpt_1_1opengl_1_1_c_generalized_cylinder_1_1_t_quadrilateral.html#ad2f9b9847479432fa882a94f1ae2c7da" title="Constructor from 4 points.">TQuadrilateral</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,<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;p3,<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;p4)     {
<a name="l00083"></a>00083                                 points[0]=p1;
<a name="l00084"></a>00084                                 points[1]=p2;
<a name="l00085"></a>00085                                 points[2]=p3;
<a name="l00086"></a>00086                                 points[3]=p4;
<a name="l00087"></a>00087                                 calculateNormal();
<a name="l00088"></a>00088                         }<span class="comment"></span>
<a name="l00089"></a>00089 <span class="comment">                        /**</span>
<a name="l00090"></a>00090 <span class="comment">                          * Construction from any array of four compatible objects.</span>
<a name="l00091"></a>00091 <span class="comment">                          */</span> 
<a name="l00092"></a><a class="code" href="structmrpt_1_1opengl_1_1_c_generalized_cylinder_1_1_t_quadrilateral.html#a73c9e2ab009cec196121c3db20ba73df">00092</a>                         <span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt; <a class="code" href="structmrpt_1_1opengl_1_1_c_generalized_cylinder_1_1_t_quadrilateral.html#a73c9e2ab009cec196121c3db20ba73df" title="Construction from any array of four compatible objects.">TQuadrilateral</a>(<span class="keyword">const</span> T (&amp;p)[4])       {
<a name="l00093"></a>00093                                 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i=0;i&lt;4;i++) points[i]=p[i];
<a name="l00094"></a>00094                                 calculateNormal();
<a name="l00095"></a>00095                         }<span class="comment"></span>
<a name="l00096"></a>00096 <span class="comment">                        /**</span>
<a name="l00097"></a>00097 <span class="comment">                          * Empty constructor. Initializes to garbage.</span>
<a name="l00098"></a>00098 <span class="comment">                          */</span> 
<a name="l00099"></a><a class="code" href="structmrpt_1_1opengl_1_1_c_generalized_cylinder_1_1_t_quadrilateral.html#aad160c018b8953c8c14d4d241090d41e">00099</a>                         <a class="code" href="structmrpt_1_1opengl_1_1_c_generalized_cylinder_1_1_t_quadrilateral.html#aad160c018b8953c8c14d4d241090d41e" title="Empty constructor.">TQuadrilateral</a>()        {}<span class="comment"></span>
<a name="l00100"></a>00100 <span class="comment">                        /**</span>
<a name="l00101"></a>00101 <span class="comment">                          * Destructor.</span>
<a name="l00102"></a>00102 <span class="comment">                          */</span> 
<a name="l00103"></a><a class="code" href="structmrpt_1_1opengl_1_1_c_generalized_cylinder_1_1_t_quadrilateral.html#a6ca27a7407b6e0cf65bbee26400da60c">00103</a>                         <a class="code" href="structmrpt_1_1opengl_1_1_c_generalized_cylinder_1_1_t_quadrilateral.html#a6ca27a7407b6e0cf65bbee26400da60c" title="Destructor.">~TQuadrilateral</a>()       {}
<a name="l00104"></a>00104                 };
<a name="l00105"></a>00105         <span class="keyword">protected</span>:<span class="comment"></span>
<a name="l00106"></a>00106 <span class="comment">                /**</span>
<a name="l00107"></a>00107 <span class="comment">                  * Cylinder&#39;s axis. It&#39;s represented as a pose because it holds the angle to get to the next pose.</span>
<a name="l00108"></a>00108 <span class="comment">                  */</span>
<a name="l00109"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#ac8dc02daa09600221f3b9b86788347d8">00109</a>                 <a class="code" href="classstd_1_1vector.html">vector&lt;CPose3D&gt;</a> <a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#ac8dc02daa09600221f3b9b86788347d8" title="Cylinder&#39;s axis.">axis</a>;<span class="comment"></span>
<a name="l00110"></a>00110 <span class="comment">                /**</span>
<a name="l00111"></a>00111 <span class="comment">                  * Object&#39;s generatrix, that is, profile which will be extruded.</span>
<a name="l00112"></a>00112 <span class="comment">                  */</span>
<a name="l00113"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#ad41dd88759511bb1cb79912964b59e54">00113</a>                 <a class="code" href="classstd_1_1vector.html">vector&lt;TPoint3D&gt;</a> <a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#ad41dd88759511bb1cb79912964b59e54" title="Object&#39;s generatrix, that is, profile which will be extruded.">generatrix</a>;<span class="comment"></span>
<a name="l00114"></a>00114 <span class="comment">                /**</span>
<a name="l00115"></a>00115 <span class="comment">                  * Mutable object with mesh information, used to avoid repeated computations.</span>
<a name="l00116"></a>00116 <span class="comment">                  */</span>
<a name="l00117"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#a05ab5eafa344554093f6bb3404addaf2">00117</a>                 <span class="keyword">mutable</span> std<a class="code" href="classstd_1_1vector.html">::vector&lt;TQuadrilateral&gt;</a> <a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#a05ab5eafa344554093f6bb3404addaf2" title="Mutable object with mesh information, used to avoid repeated computations.">mesh</a>;<span class="comment"></span>
<a name="l00118"></a>00118 <span class="comment">                /**</span>
<a name="l00119"></a>00119 <span class="comment">                  * Mutable object with the cylinder&#39;s points, used to avoid repeated computations.</span>
<a name="l00120"></a>00120 <span class="comment">                  */</span>
<a name="l00121"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#aa303649767d6463ab1a899c352c33577">00121</a>                 <span class="keyword">mutable</span> <a class="code" href="classmrpt_1_1math_1_1_c_matrix_template.html">CMatrixTemplate&lt;TPoint3D&gt;</a> <a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#aa303649767d6463ab1a899c352c33577" title="Mutable object with the cylinder&#39;s points, used to avoid repeated computations.">pointsMesh</a>;<span class="comment"></span>
<a name="l00122"></a>00122 <span class="comment">                /**</span>
<a name="l00123"></a>00123 <span class="comment">                  * Mutable flag which tells if recalculations are needed.</span>
<a name="l00124"></a>00124 <span class="comment">                  */</span>
<a name="l00125"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#ac8824f11f1cb1368b2fbc3ecb56784c8">00125</a>                 <span class="keyword">mutable</span> <span class="keywordtype">bool</span> <a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#ac8824f11f1cb1368b2fbc3ecb56784c8" title="Mutable flag which tells if recalculations are needed.">meshUpToDate</a>;<span class="comment"></span>
<a name="l00126"></a>00126 <span class="comment">                /**</span>
<a name="l00127"></a>00127 <span class="comment">                  * Mutable set of data used in ray tracing.</span>
<a name="l00128"></a>00128 <span class="comment">                  * \sa mrpt::math::TPolygonWithPlane</span>
<a name="l00129"></a>00129 <span class="comment">                  */</span>
<a name="l00130"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#af2efd3508713fd6721e27a09e2958183">00130</a>                 <span class="keyword">mutable</span> <a class="code" href="classstd_1_1vector.html">vector&lt;TPolygonWithPlane&gt;</a> <a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#af2efd3508713fd6721e27a09e2958183" title="Mutable set of data used in ray tracing.">polys</a>;<span class="comment"></span>
<a name="l00131"></a>00131 <span class="comment">                /**</span>
<a name="l00132"></a>00132 <span class="comment">                  * Mutable flag telling whether ray tracing temporary data must be recalculated or not.</span>
<a name="l00133"></a>00133 <span class="comment">                  */</span>
<a name="l00134"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#aa361a2eaff8c464bf1f82b2782151569">00134</a>                 <span class="keyword">mutable</span> <span class="keywordtype">bool</span> <a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#aa361a2eaff8c464bf1f82b2782151569" title="Mutable flag telling whether ray tracing temporary data must be recalculated or not.">polysUpToDate</a>;<span class="comment"></span>
<a name="l00135"></a>00135 <span class="comment">                /**</span>
<a name="l00136"></a>00136 <span class="comment">                  * Boolean variable which determines if the profile is closed at each section.</span>
<a name="l00137"></a>00137 <span class="comment">                  */</span>
<a name="l00138"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#a75d25124ccd8cf149c1613a68a512281">00138</a>                 <span class="keywordtype">bool</span> <a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#a75d25124ccd8cf149c1613a68a512281" title="Boolean variable which determines if the profile is closed at each section.">closed</a>;<span class="comment"></span>
<a name="l00139"></a>00139 <span class="comment">                /**</span>
<a name="l00140"></a>00140 <span class="comment">                  * Flag to determine whether the object is fully visible or only some sections are.</span>
<a name="l00141"></a>00141 <span class="comment">                  */</span>
<a name="l00142"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#a53f9bac81df78deea46ba16072338405">00142</a>                 <span class="keywordtype">bool</span> <a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#a53f9bac81df78deea46ba16072338405" title="Flag to determine whether the object is fully visible or only some sections are.">fullyVisible</a>;<span class="comment"></span>
<a name="l00143"></a>00143 <span class="comment">                /**</span>
<a name="l00144"></a>00144 <span class="comment">                  * First visible section, if fullyVisible is set to false.</span>
<a name="l00145"></a>00145 <span class="comment">                  * \sa fullyVisible,lastSection</span>
<a name="l00146"></a>00146 <span class="comment">                  */</span>
<a name="l00147"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#adf033f42238e78a2bb16df5ce5c1760e">00147</a>                 <span class="keywordtype">size_t</span> <a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#adf033f42238e78a2bb16df5ce5c1760e" title="First visible section, if fullyVisible is set to false.">firstSection</a>;<span class="comment"></span>
<a name="l00148"></a>00148 <span class="comment">                /**</span>
<a name="l00149"></a>00149 <span class="comment">                  * Last visible section, if fullyVisible is set to false.</span>
<a name="l00150"></a>00150 <span class="comment">                  * \sa fullyVisible,firstSection</span>
<a name="l00151"></a>00151 <span class="comment">                  */</span>
<a name="l00152"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#a67bb139685f5c7ad9e022b1b43c37714">00152</a>                 <span class="keywordtype">size_t</span> <a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#a67bb139685f5c7ad9e022b1b43c37714" title="Last visible section, if fullyVisible is set to false.">lastSection</a>;
<a name="l00153"></a>00153         <span class="keyword">public</span>:<span class="comment"></span>
<a name="l00154"></a>00154 <span class="comment">                /**</span>
<a name="l00155"></a>00155 <span class="comment">                  * Creation of generalized cylinder from axis and generatrix</span>
<a name="l00156"></a>00156 <span class="comment">                  */</span>
<a name="l00157"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#a5f711e56dffc82c2a53b94bc6b2f439f">00157</a>                 <span class="keyword">static</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_generalized_cylinder_ptr.html">CGeneralizedCylinderPtr</a> <a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#a5f711e56dffc82c2a53b94bc6b2f439f" title="Creation of generalized cylinder from axis and generatrix.">Create</a>(<span class="keyword">const</span> <a class="code" href="classstd_1_1vector.html">std::vector&lt;TPoint3D&gt;</a> &amp;axis,<span class="keyword">const</span> <a class="code" href="classstd_1_1vector.html">std::vector&lt;TPoint3D&gt;</a> &amp;generatrix)        {
<a name="l00158"></a>00158                         <span class="keywordflow">return</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_generalized_cylinder_ptr.html">CGeneralizedCylinderPtr</a>(<span class="keyword">new</span> <a class="code" href="namespacemrpt_1_1opengl.html#afd71ba490362fef3ed96b4cd868d6c1f">CGeneralizedCylinder</a>(axis,generatrix));
<a name="l00159"></a>00159                 }<span class="comment"></span>
<a name="l00160"></a>00160 <span class="comment">                /**</span>
<a name="l00161"></a>00161 <span class="comment">                  * Render.</span>
<a name="l00162"></a>00162 <span class="comment">                  * \sa mrpt::opengl::CRenderizable</span>
<a name="l00163"></a>00163 <span class="comment">                  */</span>
<a name="l00164"></a>00164                 <span class="keywordtype">void</span> render_dl() <span class="keyword">const</span>;<span class="comment"></span>
<a name="l00165"></a>00165 <span class="comment">                /**</span>
<a name="l00166"></a>00166 <span class="comment">                  * Ray tracing.</span>
<a name="l00167"></a>00167 <span class="comment">                  * \sa mrpt::opengl::CRenderizable.</span>
<a name="l00168"></a>00168 <span class="comment">                  */</span>
<a name="l00169"></a>00169                 <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="l00170"></a>00170 <span class="comment">                /**</span>
<a name="l00171"></a>00171 <span class="comment">                  * Get axis&#39;s spatial coordinates.</span>
<a name="l00172"></a>00172 <span class="comment">                  */</span>
<a name="l00173"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#af5e6c545b70604f86caee4852a77a036">00173</a>                 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#af5e6c545b70604f86caee4852a77a036" title="Get axis&#39;s spatial coordinates.">getAxis</a>(<a class="code" href="classstd_1_1vector.html">std::vector&lt;TPoint3D&gt;</a> &amp;a)<span class="keyword"> const     </span>{
<a name="l00174"></a>00174                         <span class="comment">//a=axis;</span>
<a name="l00175"></a>00175                         <span class="keywordtype">size_t</span> N=axis.size();
<a name="l00176"></a>00176                         a.resize(N);
<a name="l00177"></a>00177                         <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i=0;i&lt;N;i++)        {
<a name="l00178"></a>00178                                 a[i].x=axis[i].x();
<a name="l00179"></a>00179                                 a[i].y=axis[i].y();
<a name="l00180"></a>00180                                 a[i].z=axis[i].z();
<a name="l00181"></a>00181                         }
<a name="l00182"></a>00182                 }<span class="comment"></span>
<a name="l00183"></a>00183 <span class="comment">                /**</span>
<a name="l00184"></a>00184 <span class="comment">                  * Get axis, including angular coordinates.</span>
<a name="l00185"></a>00185 <span class="comment">                  */</span>
<a name="l00186"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#ae9623c992a724468bd968da1cd5e8d90">00186</a>                 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#ae9623c992a724468bd968da1cd5e8d90" title="Get axis, including angular coordinates.">getAxis</a>(<a class="code" href="classstd_1_1vector.html">std::vector&lt;CPose3D&gt;</a> &amp;a)<span class="keyword"> const      </span>{
<a name="l00187"></a>00187                         a=axis;
<a name="l00188"></a>00188                 }<span class="comment"></span>
<a name="l00189"></a>00189 <span class="comment">                /**</span>
<a name="l00190"></a>00190 <span class="comment">                  * Set the axis points.</span>
<a name="l00191"></a>00191 <span class="comment">                  */</span>
<a name="l00192"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#a9273cca052ddf44322036017a4bc90a3">00192</a>                 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#a9273cca052ddf44322036017a4bc90a3" title="Set the axis points.">setAxis</a>(<span class="keyword">const</span> <a class="code" href="classstd_1_1vector.html">std::vector&lt;TPoint3D&gt;</a> &amp;a)     {
<a name="l00193"></a>00193                         generatePoses(a,axis);
<a name="l00194"></a>00194                         meshUpToDate=<span class="keyword">false</span>;
<a name="l00195"></a>00195                         fullyVisible=<span class="keyword">true</span>;
<a name="l00196"></a>00196                         <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="l00197"></a>00197                 }<span class="comment"></span>
<a name="l00198"></a>00198 <span class="comment">                /**</span>
<a name="l00199"></a>00199 <span class="comment">                  * Get cylinder&#39;s profile.</span>
<a name="l00200"></a>00200 <span class="comment">                  */</span>
<a name="l00201"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#a3de9dcea10571ce12cc8ca05294f27bc">00201</a>                 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#a3de9dcea10571ce12cc8ca05294f27bc" title="Get cylinder&#39;s profile.">getGeneratrix</a>(<a class="code" href="classstd_1_1vector.html">std::vector&lt;TPoint3D&gt;</a> &amp;g)<span class="keyword"> const       </span>{
<a name="l00202"></a>00202                         g=generatrix;
<a name="l00203"></a>00203                 }<span class="comment"></span>
<a name="l00204"></a>00204 <span class="comment">                /**</span>
<a name="l00205"></a>00205 <span class="comment">                  * Set cylinder&#39;s profile.</span>
<a name="l00206"></a>00206 <span class="comment">                  */</span>
<a name="l00207"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#a6014ae9c585c72ea3a714c311dcf1dfc">00207</a>                 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#a6014ae9c585c72ea3a714c311dcf1dfc" title="Set cylinder&#39;s profile.">setGeneratrix</a>(<span class="keyword">const</span> <a class="code" href="classstd_1_1vector.html">std::vector&lt;TPoint3D&gt;</a> g)        {
<a name="l00208"></a>00208                         generatrix=g;
<a name="l00209"></a>00209                         meshUpToDate=<span class="keyword">false</span>;
<a name="l00210"></a>00210                         <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="l00211"></a>00211                 }<span class="comment"></span>
<a name="l00212"></a>00212 <span class="comment">                /**</span>
<a name="l00213"></a>00213 <span class="comment">                  * Returns true if each section is a closed polygon.</span>
<a name="l00214"></a>00214 <span class="comment">                  */</span>
<a name="l00215"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#a1000b19f031d6ce283ad047e1c68b72f">00215</a>                 <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#a1000b19f031d6ce283ad047e1c68b72f" title="Returns true if each section is a closed polygon.">isClosed</a>()<span class="keyword"> const    </span>{
<a name="l00216"></a>00216                         <span class="keywordflow">return</span> closed;
<a name="l00217"></a>00217                 }<span class="comment"></span>
<a name="l00218"></a>00218 <span class="comment">                /**</span>
<a name="l00219"></a>00219 <span class="comment">                  * Set whether each section is a closed polygon or not.</span>
<a name="l00220"></a>00220 <span class="comment">                  */</span>
<a name="l00221"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#ace15a1a83ddb0121b2e59ce91fe2771c">00221</a>                 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#ace15a1a83ddb0121b2e59ce91fe2771c" title="Set whether each section is a closed polygon or not.">setClosed</a>(<span class="keywordtype">bool</span> c=<span class="keyword">true</span>)      {
<a name="l00222"></a>00222                         closed=c;
<a name="l00223"></a>00223                         meshUpToDate=<span class="keyword">false</span>;
<a name="l00224"></a>00224                         <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="l00225"></a>00225                 }<span class="comment"></span>
<a name="l00226"></a>00226 <span class="comment">                /**</span>
<a name="l00227"></a>00227 <span class="comment">                  * Get a polyhedron containing the starting point of the cylinder (its &quot;base&quot;).</span>
<a name="l00228"></a>00228 <span class="comment">                  * \sa getEnd,mrpt::opengl::CPolyhedron</span>
<a name="l00229"></a>00229 <span class="comment">                  */</span>
<a name="l00230"></a>00230                 <span class="keywordtype">void</span> getOrigin(<a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> &amp;poly) <span class="keyword">const</span>;<span class="comment"></span>
<a name="l00231"></a>00231 <span class="comment">                /**</span>
<a name="l00232"></a>00232 <span class="comment">                  * Get a polyhedron containing the ending point of the cylinder (its &quot;base&quot;).</span>
<a name="l00233"></a>00233 <span class="comment">                  * \sa getOrigin,mrpt::opengl::CPolyhedron</span>
<a name="l00234"></a>00234 <span class="comment">                  */</span>
<a name="l00235"></a>00235                 <span class="keywordtype">void</span> getEnd(<a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> &amp;poly) <span class="keyword">const</span>;<span class="comment"></span>
<a name="l00236"></a>00236 <span class="comment">                /**</span>
<a name="l00237"></a>00237 <span class="comment">                  * Get the cylinder as a set of polygons in 3D.</span>
<a name="l00238"></a>00238 <span class="comment">                  * \sa mrpt::math::TPolygon3D</span>
<a name="l00239"></a>00239 <span class="comment">                  */</span>
<a name="l00240"></a>00240                 <span class="keywordtype">void</span> generateSetOfPolygons(<a class="code" href="classstd_1_1vector.html" title="STL class.">std::vector&lt;TPolygon3D&gt;</a> &amp;res) <span class="keyword">const</span>;<span class="comment"></span>
<a name="l00241"></a>00241 <span class="comment">                /**</span>
<a name="l00242"></a>00242 <span class="comment">                  * Get a polyhedron consisting of a set of closed sections of the cylinder.</span>
<a name="l00243"></a>00243 <span class="comment">                  * \sa mrpt::opengl::CPolyhedron</span>
<a name="l00244"></a>00244 <span class="comment">                  */</span>
<a name="l00245"></a>00245                 <span class="keywordtype">void</span> getClosedSection(<span class="keywordtype">size_t</span> index1,<span class="keywordtype">size_t</span> index2,<a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> &amp;poly) <span class="keyword">const</span>;<span class="comment"></span>
<a name="l00246"></a>00246 <span class="comment">                /**</span>
<a name="l00247"></a>00247 <span class="comment">                  * Get a polyhedron consisting of a single section of the cylinder.</span>
<a name="l00248"></a>00248 <span class="comment">                  * \sa mrpt::opengl::CPolyhedron</span>
<a name="l00249"></a>00249 <span class="comment">                  */</span>
<a name="l00250"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#a3cd861dba55fb34d60535ffd9cf4a120">00250</a>                 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#a3cd861dba55fb34d60535ffd9cf4a120" title="Get a polyhedron consisting of a single section of the cylinder.">getClosedSection</a>(<span class="keywordtype">size_t</span> index,<a class="code" href="structmrpt_1_1opengl_1_1_c_polyhedron_ptr.html">CPolyhedronPtr</a> &amp;poly)<span class="keyword"> const   </span>{
<a name="l00251"></a>00251                         getClosedSection(index,index,poly);
<a name="l00252"></a>00252                 }<span class="comment"></span>
<a name="l00253"></a>00253 <span class="comment">                /**</span>
<a name="l00254"></a>00254 <span class="comment">                  * Get the number of sections in this cylinder.</span>
<a name="l00255"></a>00255 <span class="comment">                  */</span>
<a name="l00256"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#ab9713a4660186bbfabac8d5dabf40b9f">00256</a>                 <span class="keyword">inline</span> <span class="keywordtype">size_t</span> <a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#ab9713a4660186bbfabac8d5dabf40b9f" title="Get the number of sections in this cylinder.">getNumberOfSections</a>()<span class="keyword"> const       </span>{
<a name="l00257"></a>00257                         <span class="keywordflow">return</span> axis.size()?(axis.size()-1):0;
<a name="l00258"></a>00258                 }<span class="comment"></span>
<a name="l00259"></a>00259 <span class="comment">                /**</span>
<a name="l00260"></a>00260 <span class="comment">                  * Get how many visible sections are in the cylinder.</span>
<a name="l00261"></a>00261 <span class="comment">                  */</span>
<a name="l00262"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#aba7cda08eb1c6d78b9adecc312629be7">00262</a>                 <span class="keyword">inline</span> <span class="keywordtype">size_t</span> <a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#aba7cda08eb1c6d78b9adecc312629be7" title="Get how many visible sections are in the cylinder.">getVisibleSections</a>()<span class="keyword"> const        </span>{
<a name="l00263"></a>00263                         <span class="keywordflow">return</span> fullyVisible?getNumberOfSections():(lastSection-firstSection);
<a name="l00264"></a>00264                 }<span class="comment"></span>
<a name="l00265"></a>00265 <span class="comment">                /**</span>
<a name="l00266"></a>00266 <span class="comment">                  * Gets the cylinder&#39;s visible sections.</span>
<a name="l00267"></a>00267 <span class="comment">                  */</span>
<a name="l00268"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#a8df1b497a74473f6412380521a24da70">00268</a>                 <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#a8df1b497a74473f6412380521a24da70" title="Gets the cylinder&#39;s visible sections.">getVisibleSections</a>(<span class="keywordtype">size_t</span> &amp;first,<span class="keywordtype">size_t</span> &amp;last)<span class="keyword"> const       </span>{
<a name="l00269"></a>00269                         <span class="keywordflow">if</span> (fullyVisible)       {
<a name="l00270"></a>00270                                 first=0;
<a name="l00271"></a>00271                                 last=getNumberOfSections();
<a name="l00272"></a>00272                         }       <span class="keywordflow">else</span>    {
<a name="l00273"></a>00273                                 first=firstSection;
<a name="l00274"></a>00274                                 last=lastSection;
<a name="l00275"></a>00275                         }
<a name="l00276"></a>00276                 }<span class="comment"></span>
<a name="l00277"></a>00277 <span class="comment">                /**</span>
<a name="l00278"></a>00278 <span class="comment">                  * Sets all sections visible.</span>
<a name="l00279"></a>00279 <span class="comment">                  */</span>
<a name="l00280"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#a3cf4c224ffc07afa7ef29e256b561ef3">00280</a>                 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#a3cf4c224ffc07afa7ef29e256b561ef3" title="Sets all sections visible.">setAllSectionsVisible</a>()     {
<a name="l00281"></a>00281                         fullyVisible=<span class="keyword">true</span>;
<a name="l00282"></a>00282                         <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="l00283"></a>00283                 }<span class="comment"></span>
<a name="l00284"></a>00284 <span class="comment">                /**</span>
<a name="l00285"></a>00285 <span class="comment">                  * Hides all sections.</span>
<a name="l00286"></a>00286 <span class="comment">                  */</span>
<a name="l00287"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#a711df3cf173fa30adf2462fec6fed48a">00287</a>                 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#a711df3cf173fa30adf2462fec6fed48a" title="Hides all sections.">setAllSectionsInvisible</a>(<span class="keywordtype">size_t</span> pointer=0)   {
<a name="l00288"></a>00288                         fullyVisible=<span class="keyword">false</span>;
<a name="l00289"></a>00289                         firstSection=pointer;
<a name="l00290"></a>00290                         lastSection=pointer;
<a name="l00291"></a>00291                         <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="l00292"></a>00292                 }<span class="comment"></span>
<a name="l00293"></a>00293 <span class="comment">                /**</span>
<a name="l00294"></a>00294 <span class="comment">                  * Sets which sections are visible.</span>
<a name="l00295"></a>00295 <span class="comment">                  * \throw std::logic_error on wrongly defined bounds.</span>
<a name="l00296"></a>00296 <span class="comment">                  */</span>
<a name="l00297"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#a2267c46a8b7fcdd8968b35b7c4185bc9">00297</a>                 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#a2267c46a8b7fcdd8968b35b7c4185bc9" title="Sets which sections are visible.">setVisibleSections</a>(<span class="keywordtype">size_t</span> first,<span class="keywordtype">size_t</span> last)        {
<a name="l00298"></a>00298                         fullyVisible=<span class="keyword">false</span>;
<a name="l00299"></a>00299                         <span class="keywordflow">if</span> (first&gt;last||last&gt;getNumberOfSections()) <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;Wrong bound definition&quot;</span>);
<a name="l00300"></a>00300                         firstSection=first;
<a name="l00301"></a>00301                         lastSection=last;
<a name="l00302"></a>00302                         <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="l00303"></a>00303                 }<span class="comment"></span>
<a name="l00304"></a>00304 <span class="comment">                /**</span>
<a name="l00305"></a>00305 <span class="comment">                  * Adds another visible section at the start of the cylinder. The cylinder must have an invisble section to display.</span>
<a name="l00306"></a>00306 <span class="comment">                  * \throw std::logic_error if there is no section to add to the displaying set.</span>
<a name="l00307"></a>00307 <span class="comment">                  * \sa addVisibleSectionAtEnd,removeVisibleSectionAtStart,removeVisibleSectionAtEnd</span>
<a name="l00308"></a>00308 <span class="comment">                  */</span>
<a name="l00309"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#ad8c62a27d590d557f1f6e0d5d7b008ac">00309</a>                 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#ad8c62a27d590d557f1f6e0d5d7b008ac" title="Adds another visible section at the start of the cylinder.">addVisibleSectionAtStart</a>()  {
<a name="l00310"></a>00310                         <span class="keywordflow">if</span> (fullyVisible||firstSection==0) <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;No more sections&quot;</span>);
<a name="l00311"></a>00311                         firstSection--;
<a name="l00312"></a>00312                         <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="l00313"></a>00313                 }<span class="comment"></span>
<a name="l00314"></a>00314 <span class="comment">                /**</span>
<a name="l00315"></a>00315 <span class="comment">                  * Adds another visible section at the end of the cylinder. The cylinder must have an invisible section to display.</span>
<a name="l00316"></a>00316 <span class="comment">                  * \throw std::logic_error if there is no section to add to the displaying set.</span>
<a name="l00317"></a>00317 <span class="comment">                  * \sa addVisibleSectionAtStart,removeVisibleSectionAtStart,removeVisibleSectionAtEnd</span>
<a name="l00318"></a>00318 <span class="comment">                  */</span>
<a name="l00319"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#af764b5f275ebb77869c1a94f5326780c">00319</a>                 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#af764b5f275ebb77869c1a94f5326780c" title="Adds another visible section at the end of the cylinder.">addVisibleSectionAtEnd</a>()    {
<a name="l00320"></a>00320                         <span class="keywordflow">if</span> (fullyVisible||lastSection==getNumberOfSections()) <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;No more sections&quot;</span>);
<a name="l00321"></a>00321                         lastSection++;
<a name="l00322"></a>00322                         <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="l00323"></a>00323                 }<span class="comment"></span>
<a name="l00324"></a>00324 <span class="comment">                /**</span>
<a name="l00325"></a>00325 <span class="comment">                  * Removes a visible section from the start of the currently visible set.</span>
<a name="l00326"></a>00326 <span class="comment">                  * \throw std::logic_error if there are no visible sections.</span>
<a name="l00327"></a>00327 <span class="comment">                  * \sa addVisibleSectionAtStart,addVisibleSectionAtEnd,removeVisibleSectionAtEnd</span>
<a name="l00328"></a>00328 <span class="comment">                  */</span>
<a name="l00329"></a>00329                 <span class="keywordtype">void</span> removeVisibleSectionAtStart();<span class="comment"></span>
<a name="l00330"></a>00330 <span class="comment">                /**</span>
<a name="l00331"></a>00331 <span class="comment">                  * Removes a visible section from the ending of the currently visible set.</span>
<a name="l00332"></a>00332 <span class="comment">                  * \throw std::logic_error when there is no such section.</span>
<a name="l00333"></a>00333 <span class="comment">                  * \sa addVisibleSectionAtStart,addVisibleSectionAtEnd,removeVisibleSectionAtStart</span>
<a name="l00334"></a>00334 <span class="comment">                  */</span>
<a name="l00335"></a>00335                 <span class="keywordtype">void</span> removeVisibleSectionAtEnd();<span class="comment"></span>
<a name="l00336"></a>00336 <span class="comment">                /**</span>
<a name="l00337"></a>00337 <span class="comment">                  * Gets the axis pose of the first section, returning false if there is no such pose.</span>
<a name="l00338"></a>00338 <span class="comment">                  */</span>
<a name="l00339"></a>00339                 <span class="keywordtype">bool</span> getFirstSectionPose(<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;p);<span class="comment"></span>
<a name="l00340"></a>00340 <span class="comment">                /**</span>
<a name="l00341"></a>00341 <span class="comment">                  * Gets the axis pose of the last section, returning false if there is no such pose.</span>
<a name="l00342"></a>00342 <span class="comment">                  */</span>
<a name="l00343"></a>00343                 <span class="keywordtype">bool</span> getLastSectionPose(<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;p);<span class="comment"></span>
<a name="l00344"></a>00344 <span class="comment">                /**</span>
<a name="l00345"></a>00345 <span class="comment">                  * Gets the axis pose of the first visible section, returning false if there is no such pose.</span>
<a name="l00346"></a>00346 <span class="comment">                  */</span>
<a name="l00347"></a>00347                 <span class="keywordtype">bool</span> getFirstVisibleSectionPose(<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;p);<span class="comment"></span>
<a name="l00348"></a>00348 <span class="comment">                /**</span>
<a name="l00349"></a>00349 <span class="comment">                  * Gets the axis pose of the last section, returning false if there is no such pose.</span>
<a name="l00350"></a>00350 <span class="comment">                  */</span>
<a name="l00351"></a>00351                 <span class="keywordtype">bool</span> getLastVisibleSectionPose(<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;p);<span class="comment"></span>
<a name="l00352"></a>00352 <span class="comment">                /**</span>
<a name="l00353"></a>00353 <span class="comment">                  * Updates the mutable set of polygons used in ray tracing.</span>
<a name="l00354"></a>00354 <span class="comment">                  */</span>
<a name="l00355"></a>00355                 <span class="keywordtype">void</span> updatePolys() <span class="keyword">const</span>;
<a name="l00356"></a>00356         <span class="keyword">private</span>:<span class="comment"></span>
<a name="l00357"></a>00357 <span class="comment">                /**</span>
<a name="l00358"></a>00358 <span class="comment">                  * Updates the axis, transforming each point into a pose pointing to the next section.</span>
<a name="l00359"></a>00359 <span class="comment">                  */</span>
<a name="l00360"></a>00360                 <span class="keywordtype">void</span> generatePoses(<span class="keyword">const</span> <a class="code" href="classstd_1_1vector.html">std::vector&lt;TPoint3D&gt;</a> &amp;pIn,<a class="code" href="classstd_1_1vector.html">std::vector&lt;CPose3D&gt;</a> &amp;pOut);<span class="comment"></span>
<a name="l00361"></a>00361 <span class="comment">                /**</span>
<a name="l00362"></a>00362 <span class="comment">                  * Updates the mutable mesh.</span>
<a name="l00363"></a>00363 <span class="comment">                  */</span>
<a name="l00364"></a>00364                 <span class="keywordtype">void</span> updateMesh() <span class="keyword">const</span>;<span class="comment"></span>
<a name="l00365"></a>00365 <span class="comment">                /**</span>
<a name="l00366"></a>00366 <span class="comment">                  * Given a vector of polyhedrons, gets the starting and ending iterators to the section to be actually rendered.</span>
<a name="l00367"></a>00367 <span class="comment">                  */</span>
<a name="l00368"></a>00368                 <span class="keywordtype">void</span> getMeshIterators(<span class="keyword">const</span> <a class="code" href="classstd_1_1vector.html">vector&lt;TQuadrilateral&gt;</a> &amp;m,<a class="code" href="classstd_1_1vector.html" title="STL class.">vector&lt;TQuadrilateral&gt;::const_iterator</a> &amp;<a class="code" href="eigen__plugins_8h.html#ab295fd8164bf1b1acecbcb29520d62b7">begin</a>,<a class="code" href="classstd_1_1vector.html" title="STL class.">vector&lt;TQuadrilateral&gt;::const_iterator</a> &amp;<a class="code" href="eigen__plugins_8h.html#ade5b39864c905cbb824d0ff6eb0d888c">end</a>) <span class="keyword">const</span>;<span class="comment"></span>
<a name="l00369"></a>00369 <span class="comment">                /**</span>
<a name="l00370"></a>00370 <span class="comment">                  * Basic constructor with default initialization.</span>
<a name="l00371"></a>00371 <span class="comment">                  */</span>
<a name="l00372"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#a9839c983ce1c1a0c0c28447041f037b9">00372</a>                 <a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#a9839c983ce1c1a0c0c28447041f037b9" title="Basic constructor with default initialization.">CGeneralizedCylinder</a>():axis(),generatrix(),mesh(),meshUpToDate(false),polysUpToDate(false),closed(false),fullyVisible(true)     {}<span class="comment"></span>
<a name="l00373"></a>00373 <span class="comment">                /**</span>
<a name="l00374"></a>00374 <span class="comment">                  * Constructor with axis and generatrix.</span>
<a name="l00375"></a>00375 <span class="comment">                  */</span>
<a name="l00376"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#a364b56df7b718b7483f9d23aa99025c0">00376</a>                 <a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#a364b56df7b718b7483f9d23aa99025c0" title="Constructor with axis and generatrix.">CGeneralizedCylinder</a>(<span class="keyword">const</span> <a class="code" href="classstd_1_1vector.html">std::vector&lt;TPoint3D&gt;</a> &amp;a,<span class="keyword">const</span> <a class="code" href="classstd_1_1vector.html">std::vector&lt;TPoint3D&gt;</a> &amp;g):generatrix(g),mesh(),meshUpToDate(false),polysUpToDate(false),closed(false),fullyVisible(true)      {
<a name="l00377"></a>00377                         generatePoses(a,axis);
<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">                  * Destructor.</span>
<a name="l00381"></a>00381 <span class="comment">                  */</span>
<a name="l00382"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#a46ef0f80e26b246f4754ac3138e20878">00382</a>                 <span class="keyword">virtual</span> <a class="code" href="classmrpt_1_1opengl_1_1_c_generalized_cylinder.html#a46ef0f80e26b246f4754ac3138e20878" title="Destructor.">~CGeneralizedCylinder</a>() {};
<a name="l00383"></a>00383         };
<a name="l00384"></a>00384 }
<a name="l00385"></a>00385 }
<a name="l00386"></a>00386 <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>