Sophie

Sophie

distrib > Mandriva > 10.2 > i586 > media > contrib > by-pkgid > 04e5d8c10ae76748689b4e7f48e0fa33 > files > 682

libogre5-devel-1.0.0-1mdk.i586.rpm

<html>
<head>
<title>OgrePatchSurface.h Source File - OGRE Documentation</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> 
<link type="text/css" rel="stylesheet" href="style.css">
</head>

<body>
<!-- Generated by Doxygen 1.3.6 -->
<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Class&nbsp;List</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="namespacemembers.html">Namespace&nbsp;Members</a> | <a class="qindex" href="functions.html">Class&nbsp;Members</a> | <a class="qindex" href="globals.html">File&nbsp;Members</a> | <a class="qindex" href="pages.html">Related&nbsp;Pages</a></div>
<h1>OgrePatchSurface.h</h1><a href="OgrePatchSurface_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/*</span>
00002 <span class="comment">-----------------------------------------------------------------------------</span>
00003 <span class="comment">This source file is part of OGRE</span>
00004 <span class="comment">    (Object-oriented Graphics Rendering Engine)</span>
00005 <span class="comment">For the latest info, see http://www.ogre3d.org/</span>
00006 <span class="comment"></span>
00007 <span class="comment">Copyright (c) 2000-2005 The OGRE Team</span>
00008 <span class="comment">Also see acknowledgements in Readme.html</span>
00009 <span class="comment"></span>
00010 <span class="comment">This program is free software; you can redistribute it and/or modify it under</span>
00011 <span class="comment">the terms of the GNU Lesser General Public License as published by the Free Software</span>
00012 <span class="comment">Foundation; either version 2 of the License, or (at your option) any later</span>
00013 <span class="comment">version.</span>
00014 <span class="comment"></span>
00015 <span class="comment">This program is distributed in the hope that it will be useful, but WITHOUT</span>
00016 <span class="comment">ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS</span>
00017 <span class="comment">FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.</span>
00018 <span class="comment"></span>
00019 <span class="comment">You should have received a copy of the GNU Lesser General Public License along with</span>
00020 <span class="comment">this program; if not, write to the Free Software Foundation, Inc., 59 Temple</span>
00021 <span class="comment">Place - Suite 330, Boston, MA 02111-1307, USA, or go to</span>
00022 <span class="comment">http://www.gnu.org/copyleft/lesser.txt.</span>
00023 <span class="comment">-----------------------------------------------------------------------------</span>
00024 <span class="comment">*/</span>
00025 <span class="preprocessor">#ifndef __PatchSurface_H__</span>
00026 <span class="preprocessor"></span><span class="preprocessor">#define __PatchSurface_H__</span>
00027 <span class="preprocessor"></span>
00028 <span class="preprocessor">#include "<a class="code" href="OgrePrerequisites_8h.html">OgrePrerequisites.h</a>"</span>
00029 
00030 <span class="preprocessor">#include "<a class="code" href="OgreVector3_8h.html">OgreVector3.h</a>"</span>
00031 <span class="preprocessor">#include "<a class="code" href="OgreString_8h.html">OgreString.h</a>"</span>
00032 <span class="preprocessor">#include "<a class="code" href="OgreRenderOperation_8h.html">OgreRenderOperation.h</a>"</span>
00033 <span class="preprocessor">#include "<a class="code" href="OgreAxisAlignedBox_8h.html">OgreAxisAlignedBox.h</a>"</span>
00034 
00035 <span class="keyword">namespace </span>Ogre {
00036 
<a name="l00043"></a><a class="code" href="classOgre_1_1PatchSurface.html">00043</a>     <span class="keyword">class </span><a class="code" href="OgrePlatform_8h.html#a13">_OgreExport</a> PatchSurface
00044     {
00045     <span class="keyword">public</span>:
00046         PatchSurface();
00047         ~PatchSurface();
00048 
<a name="l00049"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacew5">00049</a>         <span class="keyword">enum</span> PatchSurfaceType
00050         {
00052             PST_BEZIER
00053         };
00054 
00056         <span class="keyword">enum</span>
00057         {
00058             AUTO_LEVEL = -1
00059         };
00060 
<a name="l00061"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacew7">00061</a>         <span class="keyword">enum</span> VisibleSide {
00063             VS_FRONT,
00065             VS_BACK,
00067             VS_BOTH
00068         };
00096         <span class="keywordtype">void</span> defineSurface(<span class="keywordtype">void</span>* controlPointBuffer, 
00097             <a class="code" href="classOgre_1_1VertexDeclaration.html">VertexDeclaration</a> *declaration, size_t width, size_t height,
00098             PatchSurfaceType pType = PST_BEZIER, 
00099             size_t uMaxSubdivisionLevel = AUTO_LEVEL, size_t vMaxSubdivisionLevel = AUTO_LEVEL,
00100             VisibleSide visibleSide = VS_FRONT);
00101 
00107         size_t getRequiredVertexCount(<span class="keywordtype">void</span>) <span class="keyword">const</span>;
00113         size_t getRequiredIndexCount(<span class="keywordtype">void</span>) <span class="keyword">const</span>;
00114 
00116         size_t getCurrentIndexCount(<span class="keywordtype">void</span>) <span class="keyword">const</span>;
<a name="l00118"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacea6">00118</a>         size_t getIndexOffset(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mIndexOffset; }
<a name="l00120"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacea7">00120</a>         size_t getVertexOffset(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mVertexOffset; }
00121 
00122 
00124         <span class="keyword">const</span> <a class="code" href="classOgre_1_1AxisAlignedBox.html">AxisAlignedBox</a>&amp; getBounds(<span class="keywordtype">void</span>) <span class="keyword">const</span>;
00127         <a class="code" href="namespaceOgre.html#a420">Real</a> getBoundingSphereRadius(<span class="keywordtype">void</span>) <span class="keyword">const</span>;
00143         <span class="keywordtype">void</span> build(<a class="code" href="classOgre_1_1HardwareVertexBufferSharedPtr.html">HardwareVertexBufferSharedPtr</a> destVertexBuffer, size_t vertexStart,
00144             <a class="code" href="classOgre_1_1HardwareIndexBufferSharedPtr.html">HardwareIndexBufferSharedPtr</a> destIndexBuffer, size_t indexStart);
00145 
00154         <span class="keywordtype">void</span> setSubdivisionFactor(<a class="code" href="namespaceOgre.html#a420">Real</a> factor);
00155 
00157         <a class="code" href="namespaceOgre.html#a420">Real</a> getSubdivisionFactor(<span class="keywordtype">void</span>) <span class="keyword">const</span>;
00158 
<a name="l00159"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacea13">00159</a>         <span class="keywordtype">void</span>* getControlPointBuffer(<span class="keywordtype">void</span>)<span class="keyword"> const</span>
00160 <span class="keyword">        </span>{
00161             <span class="keywordflow">return</span> mControlPointBuffer;
00162         }
<a name="l00165"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacea14">00165</a>         <span class="keywordtype">void</span> notifyControlPointBufferDeallocated(<span class="keywordtype">void</span>) { 
00166             mControlPointBuffer = 0;
00167         }
00168     <span class="keyword">protected</span>:
<a name="l00170"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacep0">00170</a>         <a class="code" href="classOgre_1_1VertexDeclaration.html">VertexDeclaration</a>* mDeclaration;
<a name="l00172"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacep1">00172</a>         <span class="keywordtype">void</span>* mControlPointBuffer;
<a name="l00174"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacep2">00174</a>         PatchSurfaceType mType;
<a name="l00176"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacep3">00176</a>         size_t mCtlWidth;
<a name="l00178"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacep4">00178</a>         size_t mCtlHeight;
<a name="l00180"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacep5">00180</a>         size_t mCtlCount;
<a name="l00182"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacep6">00182</a>         size_t mULevel;
<a name="l00184"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacep7">00184</a>         size_t mVLevel;
<a name="l00186"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacep8">00186</a>         size_t mMaxULevel;
<a name="l00187"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacep9">00187</a>         size_t mMaxVLevel;
<a name="l00189"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacep10">00189</a>         size_t mMeshWidth;
<a name="l00191"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacep11">00191</a>         size_t mMeshHeight;
<a name="l00193"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacep12">00193</a>         VisibleSide mVSide;
00194 
<a name="l00195"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacep13">00195</a>         <a class="code" href="namespaceOgre.html#a420">Real</a> mSubdivisionFactor;
00196 
<a name="l00197"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacep14">00197</a>         std::vector&lt;Vector3&gt; mVecCtlPoints;
00198 
00201         size_t findLevel( <a class="code" href="classOgre_1_1Vector3.html">Vector3</a>&amp; a, <a class="code" href="classOgre_1_1Vector3.html">Vector3</a>&amp; b, <a class="code" href="classOgre_1_1Vector3.html">Vector3</a>&amp; c);
00202 
00203         <span class="keywordtype">void</span> distributeControlPoints(<span class="keywordtype">void</span>* lockedBuffer);
00204         <span class="keywordtype">void</span> subdivideCurve(<span class="keywordtype">void</span>* lockedBuffer, size_t startIdx, size_t stepSize, size_t numSteps, size_t iterations);
00205         <span class="keywordtype">void</span> interpolateVertexData(<span class="keywordtype">void</span>* lockedBuffer, size_t leftIndex, size_t rightIndex, size_t destIndex);
00206         <span class="keywordtype">void</span> makeTriangles(<span class="keywordtype">void</span>);
00207 
00208         size_t getAutoULevel(<span class="keywordtype">bool</span> forMax = <span class="keyword">false</span>);
00209         size_t getAutoVLevel(<span class="keywordtype">bool</span> forMax = <span class="keyword">false</span>);
00210 
<a name="l00211"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacep15">00211</a>         <a class="code" href="classOgre_1_1HardwareVertexBufferSharedPtr.html">HardwareVertexBufferSharedPtr</a> mVertexBuffer;
<a name="l00212"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacep16">00212</a>         <a class="code" href="classOgre_1_1HardwareIndexBufferSharedPtr.html">HardwareIndexBufferSharedPtr</a> mIndexBuffer;
<a name="l00213"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacep17">00213</a>         size_t mVertexOffset;
<a name="l00214"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacep18">00214</a>         size_t mIndexOffset;
<a name="l00215"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacep19">00215</a>         size_t mRequiredVertexCount;
<a name="l00216"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacep20">00216</a>         size_t mRequiredIndexCount;
<a name="l00217"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacep21">00217</a>         size_t mCurrIndexCount;
00218 
<a name="l00219"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacep22">00219</a>         <a class="code" href="classOgre_1_1AxisAlignedBox.html">AxisAlignedBox</a> mAABB;
<a name="l00220"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacep23">00220</a>         <a class="code" href="namespaceOgre.html#a420">Real</a> mBoundingSphere;
00221 
00222 
00223 
00224     };
00225 
00226 
00227 } <span class="comment">// namespace</span>
00228 
00229 <span class="preprocessor">#endif</span>
</pre></div><p>
Copyright &copy; 2000-2005 by The OGRE Team<br />
Last modified Wed Feb 23 00:19:10 2005
</p>
</body>
</html>