<!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>CMesh.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> > <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 Page</span></a></li> <li><a href="pages.html"><span>Related 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 List</span></a></li> <li><a href="globals.html"><span>File Members</span></a></li> </ul> </div> <div class="header"> <div class="headertitle"> <div class="title">CMesh.h</div> </div> </div> <div class="contents"> <a href="_c_mesh_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 <jlblanco@ctima.uma.es> |</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 <http://www.gnu.org/licenses/>. |</span> <a name="l00026"></a>00026 <span class="comment"> | |</span> <a name="l00027"></a>00027 <span class="comment"> +---------------------------------------------------------------------------+ */</span> <a name="l00028"></a>00028 <a name="l00029"></a>00029 <span class="preprocessor">#ifndef opengl_CMesh_H</span> <a name="l00030"></a>00030 <span class="preprocessor"></span><span class="preprocessor">#define opengl_CMesh_H</span> <a name="l00031"></a>00031 <span class="preprocessor"></span> <a name="l00032"></a>00032 <span class="preprocessor">#include <<a class="code" href="_c_renderizable_display_list_8h.html">mrpt/opengl/CRenderizableDisplayList.h</a>></span> <a name="l00033"></a>00033 <span class="preprocessor">#include <<a class="code" href="_c_matrix_8h.html">mrpt/math/CMatrix.h</a>></span> <a name="l00034"></a>00034 <span class="preprocessor">#include <<a class="code" href="_c_image_8h.html">mrpt/utils/CImage.h</a>></span> <a name="l00035"></a>00035 <span class="preprocessor">#include <<a class="code" href="color__maps_8h.html">mrpt/utils/color_maps.h</a>></span> <a name="l00036"></a>00036 <span class="preprocessor">#include <<a class="code" href="_c_set_of_triangles_8h.html">mrpt/opengl/CSetOfTriangles.h</a>></span> <a name="l00037"></a>00037 <a name="l00038"></a>00038 <span class="keyword">namespace </span>mrpt <a name="l00039"></a>00039 { <a name="l00040"></a>00040 <span class="keyword">namespace </span>opengl <a name="l00041"></a>00041 { <a name="l00042"></a><a class="code" href="namespacemrpt_1_1opengl.html#afb114707b1a4c7e85b1783a6d55f94e4">00042</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_mesh.html" title="A planar (XY) grid where each cell has an associated height and, optionally, a texture map...">CMesh</a>; <a name="l00043"></a>00043 <a name="l00044"></a>00044 <span class="comment">// This must be added to any CSerializable derived class:</span> <a name="l00045"></a><a class="code" href="structmrpt_1_1opengl_1_1_c_mesh_ptr.html#a5dc1d39aaf7188b4b4600e3f9983c5e7">00045</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_mesh.html" title="A planar (XY) grid where each cell has an associated height and, optionally, a texture map...">CMesh</a>, <a class="code" href="classmrpt_1_1opengl_1_1_c_renderizable_display_list.html" title="A renderizable object suitable for rendering with OpenGL's display lists.">CRenderizableDisplayList</a>, <a class="code" href="opengl_2include_2mrpt_2opengl_2link__pragmas_8h.html#af6a1c8d5d6b3c8c0af00dbeef88ce269">OPENGL_IMPEXP</a> ) <a name="l00046"></a>00046 <a name="l00047"></a>00047 <span class="comment">/** A planar (XY) grid where each cell has an associated height and, optionally, a texture map.</span> <a name="l00048"></a>00048 <span class="comment"> * A typical usage example would be an elevation map or a 3D model of a terrain.</span> <a name="l00049"></a>00049 <span class="comment"> * \sa opengl::COpenGLScene</span> <a name="l00050"></a>00050 <span class="comment"> * </span> <a name="l00051"></a>00051 <span class="comment"> * <div align="center"></span> <a name="l00052"></a>00052 <span class="comment"> * <table border="0" cellspan="4" cellspacing="4" style="border-width: 1px; border-style: solid;"></span> <a name="l00053"></a>00053 <span class="comment"> * <tr> <td> mrpt::opengl::CMesh </td> <td> \image html preview_CMesh.png </td> </tr></span> <a name="l00054"></a>00054 <span class="comment"> * </table></span> <a name="l00055"></a>00055 <span class="comment"> * </div></span> <a name="l00056"></a>00056 <span class="comment"> * </span> <a name="l00057"></a>00057 <span class="comment"> * \ingroup mrpt_opengl_grp</span> <a name="l00058"></a>00058 <span class="comment"> */</span> <a name="l00059"></a>00059 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_mesh.html" title="A planar (XY) grid where each cell has an associated height and, optionally, a texture map...">CMesh</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's display lists.">CRenderizableDisplayList</a> <a name="l00060"></a>00060 { <a name="l00061"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_mesh.html#adb2aa83b8af54ce33bbc14cde8769d0f">00061</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_mesh.html" title="A planar (XY) grid where each cell has an associated height and, optionally, a texture map...">CMesh</a> ) <a name="l00062"></a>00062 protected: <a name="l00063"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_mesh.html#afcbbb5753aaa2938668be6b8c26f3e3a">00063</a> mrpt::utils::<a class="code" href="classmrpt_1_1utils_1_1_c_image.html" title="A class for storing images as grayscale or RGB bitmaps.">CImage</a> m_textureImage; <a name="l00064"></a>00064 <a name="l00065"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_mesh.html#ab6c4fb9f3b874b653551a2cddde1bc5f">00065</a> <span class="keywordtype">bool</span> m_enableTransparency; <a name="l00066"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_mesh.html#a3f14fb828f17f954c98b0314f0973b04">00066</a> <span class="keywordtype">bool</span> m_colorFromZ; <a name="l00067"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_mesh.html#a9111ae07e2f230c455fa185413e77e5a">00067</a> <span class="keywordtype">bool</span> m_isWireFrame; <a name="l00068"></a>00068 <a name="l00069"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_mesh.html#a2dce772f79aa1f51ca14d392e0011f18">00069</a> math::<a class="code" href="classmrpt_1_1math_1_1_c_matrix.html" title="This class is a "CSerializable" wrapper for "CMatrixFloat".">CMatrix</a> Z; <span class="comment">//!< Z(x,y): Z-coordinate of the point (x,y)</span> <a name="l00070"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_mesh.html#aa4836051611d7f7b80ee2cc978d3c7ec">00070</a> <span class="comment"></span> math::<a class="code" href="classmrpt_1_1math_1_1_c_matrix.html" title="This class is a "CSerializable" wrapper for "CMatrixFloat".">CMatrix</a> mask; <a name="l00071"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_mesh.html#a88120cd5c7b17ffff45e1d97abcde53f">00071</a> math::<a class="code" href="classmrpt_1_1math_1_1_c_matrix.html" title="This class is a "CSerializable" wrapper for "CMatrixFloat".">CMatrix</a> U, V; <span class="comment">//!< Texture coordinates</span> <a name="l00072"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_mesh.html#a70168bbb0a13f5acb76016a3e8914b0f">00072</a> <span class="comment"></span> mutable math::<a class="code" href="classmrpt_1_1math_1_1_c_matrix.html" title="This class is a "CSerializable" wrapper for "CMatrixFloat".">CMatrix</a> C; <span class="comment">//!< Color [0,1] for each cell, updated by updateColorsMatrix</span> <a name="l00073"></a>00073 <span class="comment"></span> <a name="l00074"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_mesh.html#a65c9d498b32649890611f62abbd60de6">00074</a> mrpt::utils::<a class="code" href="namespacemrpt_1_1utils.html#ab5131767a45419c793f65718c29d0a16" title="Different colormaps.">TColormap</a> m_colorMap; <span class="comment">//!< Used when m_colorFromZ is true</span> <a name="l00075"></a>00075 <span class="comment"></span> <a name="l00076"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_mesh.html#a6619ffa74931e7d0460e1c9c253f5a30">00076</a> mutable <span class="keywordtype">bool</span> m_modified_Z; <span class="comment">//!< Whether C is not up-to-date wrt to Z</span> <a name="l00077"></a>00077 <span class="comment"></span> <a name="l00078"></a>00078 <span class="keywordtype">void</span> updateColorsMatrix() const; <span class="comment">//!< Called internally to assure C is updated.</span> <a name="l00079"></a>00079 <span class="comment"></span> <span class="keywordtype">void</span> updateTriangles() const; <span class="comment">//!< Called internally to assure the triangle list is updated.</span> <a name="l00080"></a>00080 <span class="comment"></span> <span class="keywordtype">void</span> updatePolygons() const; <span class="comment">//<!Called internally to assure that the polygon list is updated.</span> <a name="l00081"></a>00081 <a name="l00082"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_mesh.html#a3a8ed5c50b413bcbd652fd14ad30d13d">00082</a> <span class="keywordtype">float</span> xMin,xMax,yMin,yMax; <span class="comment">//!< Mesh bounds</span> <a name="l00083"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_mesh.html#a524a07c0203c56bbed66dac63b22e84a">00083</a> <span class="comment"></span> mutable std::<a class="code" href="classstd_1_1vector.html" title="STL class.">vector</a><<a class="code" href="classmrpt_1_1opengl_1_1_c_set_of_triangles.html" title="A set of colored triangles.">CSetOfTriangles</a>::TTriangle> actualMesh; <span class="comment">//!< List of triangles in the mesh</span> <a name="l00084"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_mesh.html#ae21471cd51fd6401390a3fc669f1a06a">00084</a> <span class="comment"></span> mutable <span class="keywordtype">bool</span> trianglesUpToDate; <span class="comment">//!<Whether the actual mesh needs to be recalculated</span> <a name="l00085"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_mesh.html#a56ed25b0945a0740254cef02827c5780">00085</a> <span class="comment"></span> mutable <span class="keywordtype">bool</span> polygonsUpToDate; <span class="comment">//<!Whether the polygon mesh (auxiliary structure for ray tracing) needs to be recalculated</span> <a name="l00086"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_mesh.html#a1bd6aa11fa54df818731a25401fc4a9c">00086</a> mutable std::<a class="code" href="classstd_1_1vector.html" title="STL class.">vector</a><mrpt::math::<a class="code" href="classmrpt_1_1math_1_1_t_polygon_with_plane.html" title="Slightly heavyweight type to speed-up calculations with polygons in 3D.">TPolygonWithPlane</a>> tmpPolys; <a name="l00087"></a>00087 <a name="l00088"></a>00088 public: <a name="l00089"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_mesh.html#adea3af1aa6cd6c9955cf9b9e552fcbb4">00089</a> <span class="keywordtype">void</span> setGridLimits(<span class="keywordtype">float</span> xmin,<span class="keywordtype">float</span> xmax, <span class="keywordtype">float</span> ymin, <span class="keywordtype">float</span> ymax) <a name="l00090"></a>00090 { <a name="l00091"></a>00091 xMin=xmin; xMax = xmax; <a name="l00092"></a>00092 yMin=ymin; yMax = ymax; <a name="l00093"></a>00093 <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="l00094"></a>00094 } <a name="l00095"></a>00095 <a name="l00096"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_mesh.html#a215d3f930e4ab55fb9673734710c1cb5">00096</a> <span class="keywordtype">void</span> getGridLimits(<span class="keywordtype">float</span> &xmin,<span class="keywordtype">float</span> &xmax, <span class="keywordtype">float</span> &ymin, <span class="keywordtype">float</span> &ymax)<span class="keyword"> const</span> <a name="l00097"></a>00097 <span class="keyword"> </span>{ <a name="l00098"></a>00098 xmin=xMin; xmax=xMax; <a name="l00099"></a>00099 ymin=yMin; ymax=yMax; <a name="l00100"></a>00100 } <a name="l00101"></a>00101 <a name="l00102"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_mesh.html#a4acc62ab601fe273e207849a4cbc2810">00102</a> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1opengl_1_1_c_mesh.html#a4acc62ab601fe273e207849a4cbc2810">enableTransparency</a>( <span class="keywordtype">bool</span> v ) { m_enableTransparency = v; <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="l00103"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_mesh.html#a527aa07bb2f291ad20dcfa07f59e9308">00103</a> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1opengl_1_1_c_mesh.html#a527aa07bb2f291ad20dcfa07f59e9308">enableWireFrame</a>( <span class="keywordtype">bool</span> v ) { m_isWireFrame = v; <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="l00104"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_mesh.html#a9bf1c18367d5f69140d48ea4eb21fc5d">00104</a> <span class="keywordtype">void</span> enableColorFromZ( <span class="keywordtype">bool</span> v, <a class="code" href="namespacemrpt_1_1utils.html#ab5131767a45419c793f65718c29d0a16" title="Different colormaps.">mrpt::utils::TColormap</a> colorMap = <a class="code" href="namespacemrpt_1_1utils.html#ab5131767a45419c793f65718c29d0a16a20b7ac2b94a5f2f1fcceaa0f08550b14">mrpt::utils::cmJET</a> ) <a name="l00105"></a>00105 { <a name="l00106"></a>00106 m_colorFromZ = v; <a name="l00107"></a>00107 m_colorMap = colorMap; <a name="l00108"></a>00108 <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="l00109"></a>00109 } <a name="l00110"></a>00110 <span class="comment"></span> <a name="l00111"></a>00111 <span class="comment"> /** This method sets the matrix of heights for each position (cell) in the mesh grid */</span> <a name="l00112"></a>00112 <span class="keywordtype">void</span> setZ( <span class="keyword">const</span> <a class="code" href="classmrpt_1_1math_1_1_c_matrix_template_numeric.html" title="A matrix of dynamic size.">mrpt::math::CMatrixTemplateNumeric<float></a> &in_Z ); <a name="l00113"></a>00113 <span class="comment"></span> <a name="l00114"></a>00114 <span class="comment"> /** Returns a reference to the internal Z matrix, allowing changing it efficiently */</span> <a name="l00115"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_mesh.html#ac6cd87067e85ae9e2e926d713fb66026">00115</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1opengl_1_1_c_mesh.html#ac6cd87067e85ae9e2e926d713fb66026" title="Returns a reference to the internal Z matrix, allowing changing it efficiently.">getZ</a>(<a class="code" href="classmrpt_1_1math_1_1_c_matrix_template_numeric.html" title="A matrix of dynamic size.">mrpt::math::CMatrixFloat</a> &out)<span class="keyword"> const </span>{ <a name="l00116"></a>00116 out=Z; <a name="l00117"></a>00117 } <a name="l00118"></a>00118 <span class="comment"></span> <a name="l00119"></a>00119 <span class="comment"> /** Returns a reference to the internal mask matrix, allowing changing it efficiently */</span> <a name="l00120"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_mesh.html#aaccde3bfb7dada44fda3fbe7061e1314">00120</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1opengl_1_1_c_mesh.html#aaccde3bfb7dada44fda3fbe7061e1314" title="Returns a reference to the internal mask matrix, allowing changing it efficiently.">getMask</a>(<a class="code" href="classmrpt_1_1math_1_1_c_matrix_template_numeric.html" title="A matrix of dynamic size.">mrpt::math::CMatrixFloat</a> &out)<span class="keyword"> const </span>{ <a name="l00121"></a>00121 out=mask; <a name="l00122"></a>00122 } <a name="l00123"></a>00123 <span class="comment"></span> <a name="l00124"></a>00124 <span class="comment"> /** This method sets the boolean mask of valid heights for each position (cell) in the mesh grid */</span> <a name="l00125"></a>00125 <span class="keywordtype">void</span> setMask( <span class="keyword">const</span> <a class="code" href="classmrpt_1_1math_1_1_c_matrix_template_numeric.html" title="A matrix of dynamic size.">mrpt::math::CMatrixTemplateNumeric<float></a> &in_mask ); <a name="l00126"></a>00126 <span class="comment"></span> <a name="l00127"></a>00127 <span class="comment"> /** Sets the (u,v) texture coordinates (in range [0,1]) for each cell */</span> <a name="l00128"></a>00128 <span class="keywordtype">void</span> setUV( <span class="keyword">const</span> <a class="code" href="classmrpt_1_1math_1_1_c_matrix_template_numeric.html" title="A matrix of dynamic size.">mrpt::math::CMatrixTemplateNumeric<float></a> &in_U, <span class="keyword">const</span> <a class="code" href="classmrpt_1_1math_1_1_c_matrix_template_numeric.html" title="A matrix of dynamic size.">mrpt::math::CMatrixTemplateNumeric<float></a> &in_V); <a name="l00129"></a>00129 <a name="l00130"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_mesh.html#acd5b46762e418cfd9c14929baee96194">00130</a> <span class="keyword">inline</span> <span class="keywordtype">float</span> <a class="code" href="classmrpt_1_1opengl_1_1_c_mesh.html#acd5b46762e418cfd9c14929baee96194">getXMin</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> xMin; } <a name="l00131"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_mesh.html#a56cc8d27b91d55da9f534c93c36c775a">00131</a> <span class="keyword">inline</span> <span class="keywordtype">float</span> <a class="code" href="classmrpt_1_1opengl_1_1_c_mesh.html#a56cc8d27b91d55da9f534c93c36c775a">getXMax</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> xMax; } <a name="l00132"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_mesh.html#a6063b9312bc5c7867956df40112402c5">00132</a> <span class="keyword">inline</span> <span class="keywordtype">float</span> <a class="code" href="classmrpt_1_1opengl_1_1_c_mesh.html#a6063b9312bc5c7867956df40112402c5">getYMin</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> yMin; } <a name="l00133"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_mesh.html#a58c8300347ecc9f5b07e0e0c948c6bc1">00133</a> <span class="keyword">inline</span> <span class="keywordtype">float</span> <a class="code" href="classmrpt_1_1opengl_1_1_c_mesh.html#a58c8300347ecc9f5b07e0e0c948c6bc1">getYMax</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> yMax; } <a name="l00134"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_mesh.html#a0d40f6e2312fd1830785e7d7ead5e0ec">00134</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1opengl_1_1_c_mesh.html#a0d40f6e2312fd1830785e7d7ead5e0ec">setXMin</a>(<span class="keyword">const</span> <span class="keywordtype">float</span> &nxm) { <a name="l00135"></a>00135 xMin=nxm; <a name="l00136"></a>00136 trianglesUpToDate=<span class="keyword">false</span>; <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="l00137"></a>00137 } <a name="l00138"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_mesh.html#a09f0efc2dddba928b0552ce292cb2ac5">00138</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1opengl_1_1_c_mesh.html#a09f0efc2dddba928b0552ce292cb2ac5">setXMax</a>(<span class="keyword">const</span> <span class="keywordtype">float</span> &nxm) { <a name="l00139"></a>00139 xMax=nxm; <a name="l00140"></a>00140 trianglesUpToDate=<span class="keyword">false</span>; <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="l00141"></a>00141 } <a name="l00142"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_mesh.html#a5f5214b2aeaebb989877b746491c9d92">00142</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1opengl_1_1_c_mesh.html#a5f5214b2aeaebb989877b746491c9d92">setYMin</a>(<span class="keyword">const</span> <span class="keywordtype">float</span> &nym) { <a name="l00143"></a>00143 yMin=nym; <a name="l00144"></a>00144 trianglesUpToDate=<span class="keyword">false</span>; <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="l00145"></a>00145 } <a name="l00146"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_mesh.html#ae4bd11a43098ef1f1e611694532b78a8">00146</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1opengl_1_1_c_mesh.html#ae4bd11a43098ef1f1e611694532b78a8">setYMax</a>(<span class="keyword">const</span> <span class="keywordtype">float</span> &nym) { <a name="l00147"></a>00147 yMax=nym; <a name="l00148"></a>00148 trianglesUpToDate=<span class="keyword">false</span>; <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="l00149"></a>00149 } <a name="l00150"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_mesh.html#aa82d61a4ced89d6efb662ad6c335ef91">00150</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1opengl_1_1_c_mesh.html#aa82d61a4ced89d6efb662ad6c335ef91">getXBounds</a>(<span class="keywordtype">float</span> &min,<span class="keywordtype">float</span> &max)<span class="keyword"> const </span>{ <a name="l00151"></a>00151 min=xMin; <a name="l00152"></a>00152 max=xMax; <a name="l00153"></a>00153 } <a name="l00154"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_mesh.html#a9869833fa83e47ddea77898dcc8d7b89">00154</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1opengl_1_1_c_mesh.html#a9869833fa83e47ddea77898dcc8d7b89">getYBounds</a>(<span class="keywordtype">float</span> &min,<span class="keywordtype">float</span> &max)<span class="keyword"> const </span>{ <a name="l00155"></a>00155 min=yMin; <a name="l00156"></a>00156 max=yMax; <a name="l00157"></a>00157 } <a name="l00158"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_mesh.html#afb43091e5e36ee9bb4e2716773e3469f">00158</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1opengl_1_1_c_mesh.html#afb43091e5e36ee9bb4e2716773e3469f">setXBounds</a>(<span class="keyword">const</span> <span class="keywordtype">float</span> &min,<span class="keyword">const</span> <span class="keywordtype">float</span> &max) { <a name="l00159"></a>00159 xMin=min; <a name="l00160"></a>00160 xMax=max; <a name="l00161"></a>00161 trianglesUpToDate=<span class="keyword">false</span>; <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="l00162"></a>00162 } <a name="l00163"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_mesh.html#a4d014a362591b42921127bdd2e715ab6">00163</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1opengl_1_1_c_mesh.html#a4d014a362591b42921127bdd2e715ab6">setYBounds</a>(<span class="keyword">const</span> <span class="keywordtype">float</span> &min,<span class="keyword">const</span> <span class="keywordtype">float</span> &max) { <a name="l00164"></a>00164 yMin=min; <a name="l00165"></a>00165 yMax=max; <a name="l00166"></a>00166 trianglesUpToDate=<span class="keyword">false</span>; <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="l00167"></a>00167 } <a name="l00168"></a>00168 <a name="l00169"></a>00169 <span class="comment"></span> <a name="l00170"></a>00170 <span class="comment"> /** Class factory */</span> <a name="l00171"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_mesh.html#ac8293ad1399292dd196c93ce5998d177">00171</a> <span class="keyword">static</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_mesh_ptr.html">CMeshPtr</a> Create(<span class="keywordtype">bool</span> enableTransparency, <span class="keywordtype">float</span> xMin = 0.0f, <span class="keywordtype">float</span> xMax = 0.0f, <span class="keywordtype">float</span> yMin = 0.0f, <span class="keywordtype">float</span> yMax = 0.0f ) <a name="l00172"></a>00172 { <a name="l00173"></a>00173 <span class="keywordflow">return</span> <a class="code" href="structmrpt_1_1opengl_1_1_c_mesh_ptr.html">CMeshPtr</a>( <span class="keyword">new</span> <a class="code" href="namespacemrpt_1_1opengl.html#afb114707b1a4c7e85b1783a6d55f94e4">CMesh</a>( enableTransparency, xMin ,xMax , yMin ,yMax ) ); <a name="l00174"></a>00174 } <a name="l00175"></a>00175 <span class="comment"></span> <a name="l00176"></a>00176 <span class="comment"> /** Render</span> <a name="l00177"></a>00177 <span class="comment"> */</span> <a name="l00178"></a>00178 <span class="keywordtype">void</span> render_dl() <span class="keyword">const</span>; <a name="l00179"></a>00179 <span class="comment"></span> <a name="l00180"></a>00180 <span class="comment"> /** Assigns a texture image, and disable transparency.</span> <a name="l00181"></a>00181 <span class="comment"> */</span> <a name="l00182"></a>00182 <span class="keywordtype">void</span> assignImage(<span class="keyword">const</span> <a class="code" href="classmrpt_1_1utils_1_1_c_image.html" title="A class for storing images as grayscale or RGB bitmaps.">utils::CImage</a>& img ); <a name="l00183"></a>00183 <span class="comment"></span> <a name="l00184"></a>00184 <span class="comment"> /** Trace ray</span> <a name="l00185"></a>00185 <span class="comment"> */</span> <a name="l00186"></a>00186 <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' 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> &o,<span class="keywordtype">double</span> &dist) <span class="keyword">const</span>; <a name="l00187"></a>00187 <a name="l00188"></a>00188 <span class="keyword">private</span>:<span class="comment"></span> <a name="l00189"></a>00189 <span class="comment"> /** Constructor</span> <a name="l00190"></a>00190 <span class="comment"> */</span> <a name="l00191"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_mesh.html#a57301e6001117cbb372ff6b24cd2d1c0">00191</a> <a class="code" href="namespacemrpt_1_1opengl.html#afb114707b1a4c7e85b1783a6d55f94e4">CMesh</a>( <span class="keywordtype">bool</span> enableTransparency = <span class="keyword">false</span>, <span class="keywordtype">float</span> xMin = 0.0f, <span class="keywordtype">float</span> xMax = 0.0f, <span class="keywordtype">float</span> yMin = 0.0f, <span class="keywordtype">float</span> yMax = 0.0f ) : <a name="l00192"></a>00192 m_textureImage(0,0), <a name="l00193"></a>00193 m_enableTransparency(enableTransparency), <a name="l00194"></a>00194 m_colorFromZ(false), <a name="l00195"></a>00195 m_isWireFrame(false), <a name="l00196"></a>00196 Z(0,0), mask(0,0), U(0,0), V(0,0), C(0,0), <a name="l00197"></a>00197 m_colorMap( mrpt::utils::<a class="code" href="namespacemrpt_1_1utils.html#ab5131767a45419c793f65718c29d0a16a20b7ac2b94a5f2f1fcceaa0f08550b14">cmJET</a> ), <a name="l00198"></a>00198 m_modified_Z(true), <a name="l00199"></a>00199 xMin(xMin), xMax(xMax), yMin(yMin), yMax(yMax), <a name="l00200"></a>00200 trianglesUpToDate(false) <a name="l00201"></a>00201 { <a name="l00202"></a>00202 m_color.A = 255; <a name="l00203"></a>00203 m_color.R = 0; <a name="l00204"></a>00204 m_color.G = 0; <a name="l00205"></a>00205 m_color.B = 150; <a name="l00206"></a>00206 }<span class="comment"></span> <a name="l00207"></a>00207 <span class="comment"> /** Private, virtual destructor: only can be deleted from smart pointers */</span> <a name="l00208"></a><a class="code" href="classmrpt_1_1opengl_1_1_c_mesh.html#a174dd70cc140ca674806aca4063a4896">00208</a> <span class="keyword">virtual</span> <a class="code" href="classmrpt_1_1opengl_1_1_c_mesh.html#a174dd70cc140ca674806aca4063a4896" title="Private, virtual destructor: only can be deleted from smart pointers.">~CMesh</a>() { } <a name="l00209"></a>00209 <a name="l00210"></a>00210 }; <a name="l00211"></a>00211 <a name="l00212"></a>00212 } <span class="comment">// end namespace</span> <a name="l00213"></a>00213 <a name="l00214"></a>00214 } <span class="comment">// End of namespace</span> <a name="l00215"></a>00215 <a name="l00216"></a>00216 <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>