Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 60f1dc962abad0f3b492991a4fbef9be > files > 5191

vtk-doc-5.4.2-5mdv2010.0.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>VTK: dox/Rendering/vtkFrameBufferObject.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.6 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="classes.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
<h1>dox/Rendering/vtkFrameBufferObject.h</h1><a href="a03399.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"></span>
<a name="l00003"></a>00003 <span class="comment">  Program:   Visualization Toolkit</span>
<a name="l00004"></a>00004 <span class="comment">  Module:    $RCSfile: vtkFrameBufferObject.h,v $</span>
<a name="l00005"></a>00005 <span class="comment"></span>
<a name="l00006"></a>00006 <span class="comment">  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen</span>
<a name="l00007"></a>00007 <span class="comment">  All rights reserved.</span>
<a name="l00008"></a>00008 <span class="comment">  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.</span>
<a name="l00009"></a>00009 <span class="comment"></span>
<a name="l00010"></a>00010 <span class="comment">     This software is distributed WITHOUT ANY WARRANTY; without even</span>
<a name="l00011"></a>00011 <span class="comment">     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR</span>
<a name="l00012"></a>00012 <span class="comment">     PURPOSE.  See the above copyright notice for more information.</span>
<a name="l00013"></a>00013 <span class="comment"></span>
<a name="l00014"></a>00014 <span class="comment">=========================================================================*/</span>
<a name="l00025"></a>00025 <span class="preprocessor">#ifndef __vtkFrameBufferObject_h</span>
<a name="l00026"></a>00026 <span class="preprocessor"></span><span class="preprocessor">#define __vtkFrameBufferObject_h</span>
<a name="l00027"></a>00027 <span class="preprocessor"></span>
<a name="l00028"></a>00028 <span class="preprocessor">#include "<a class="code" href="a02079.html">vtkObject.h</a>"</span>
<a name="l00029"></a>00029 <span class="preprocessor">#include "<a class="code" href="a02127.html">vtkSmartPointer.h</a>"</span> <span class="comment">// needed for vtkSmartPointer.</span>
<a name="l00030"></a>00030 <span class="preprocessor">#include "<a class="code" href="a02168.html">vtkWeakPointer.h</a>"</span> <span class="comment">// needed for vtkWeakPointer.</span>
<a name="l00031"></a>00031 <span class="comment">//BTX</span>
<a name="l00032"></a>00032 <span class="preprocessor">#include &lt;vtkstd/vector&gt;</span> <span class="comment">// for the lists of logical buffers.</span>
<a name="l00033"></a>00033 <span class="comment">//ETX</span>
<a name="l00034"></a>00034 
<a name="l00035"></a>00035 <span class="keyword">class </span><a class="code" href="a01489.html" title="create a window for renderers to draw into">vtkRenderWindow</a>;
<a name="l00036"></a>00036 <span class="keyword">class </span><a class="code" href="a01701.html" title="abstracts an OpenGL texture object.">vtkTextureObject</a>;
<a name="l00037"></a>00037 <span class="keyword">class </span><a class="code" href="a01105.html" title="Interface class for querying and using OpenGL extensions.">vtkOpenGLExtensionManager</a>;
<a name="l00038"></a>00038 
<a name="l00039"></a><a class="code" href="a00563.html">00039</a> <span class="keyword">class </span><a class="code" href="a02170.html#4019f67b2e7d601f2cf984e448308dbb">VTK_RENDERING_EXPORT</a> <a class="code" href="a00563.html" title="internal class which encapsulates OpenGL frame buffer object. Not to be used directly...">vtkFrameBufferObject</a> : <span class="keyword">public</span> <a class="code" href="a01084.html" title="abstract base class for most VTK objects">vtkObject</a>
<a name="l00040"></a>00040 {
<a name="l00041"></a>00041 <span class="keyword">public</span>:
<a name="l00042"></a>00042   <span class="keyword">static</span> <a class="code" href="a00563.html" title="internal class which encapsulates OpenGL frame buffer object. Not to be used directly...">vtkFrameBufferObject</a>* <a class="code" href="a01084.html#4d5b227267c076d6f9e38483370b6612">New</a>();
<a name="l00043"></a><a class="code" href="a00563.html#9d4ccc71f1475fea3f987460942a1f4f">00043</a>   vtkTypeRevisionMacro(<a class="code" href="a00563.html" title="internal class which encapsulates OpenGL frame buffer object. Not to be used directly...">vtkFrameBufferObject</a>, <a class="code" href="a01084.html" title="abstract base class for most VTK objects">vtkObject</a>);
<a name="l00044"></a>00044   <span class="keywordtype">void</span> <a class="code" href="a01084.html#bf3dbb4154289b56a12483eee3866263">PrintSelf</a>(ostream&amp; os, <a class="code" href="a00869.html" title="a simple class to control print indentation">vtkIndent</a> indent);
<a name="l00045"></a>00045 
<a name="l00047"></a>00047 
<a name="l00051"></a>00051   <span class="keywordtype">void</span> SetContext(<a class="code" href="a01489.html" title="create a window for renderers to draw into">vtkRenderWindow</a> *context);
<a name="l00052"></a>00052   <a class="code" href="a01489.html" title="create a window for renderers to draw into">vtkRenderWindow</a> *GetContext();
<a name="l00054"></a>00054 
<a name="l00056"></a>00056 
<a name="l00062"></a>00062   <span class="keywordtype">bool</span> Start(<span class="keywordtype">int</span> width,
<a name="l00063"></a>00063              <span class="keywordtype">int</span> <a class="code" href="a03761.html#c6551f7bf833e8254b2b3ecdaea0d210c076ccbe549041286aaf7bc34202ebdf">height</a>,
<a name="l00064"></a>00064              <span class="keywordtype">bool</span> shaderSupportsTextureInt);
<a name="l00065"></a>00065   <span class="keywordtype">bool</span> StartNonOrtho(<span class="keywordtype">int</span> width,
<a name="l00066"></a>00066                      <span class="keywordtype">int</span> <a class="code" href="a03761.html#c6551f7bf833e8254b2b3ecdaea0d210c076ccbe549041286aaf7bc34202ebdf">height</a>,
<a name="l00067"></a>00067                      <span class="keywordtype">bool</span> shaderSupportsTextureInt);
<a name="l00069"></a>00069 
<a name="l00071"></a>00071 
<a name="l00076"></a>00076   <span class="keywordtype">void</span> RenderQuad(<span class="keywordtype">int</span> minX,
<a name="l00077"></a>00077                   <span class="keywordtype">int</span> maxX,
<a name="l00078"></a>00078                   <span class="keywordtype">int</span> minY,
<a name="l00079"></a>00079                   <span class="keywordtype">int</span> maxY);
<a name="l00081"></a>00081 
<a name="l00084"></a>00084   <span class="keywordtype">void</span> Bind();
<a name="l00085"></a>00085 
<a name="l00088"></a>00088   <span class="keywordtype">void</span> UnBind();
<a name="l00089"></a>00089 
<a name="l00091"></a>00091 
<a name="l00092"></a><a class="code" href="a00563.html#843e62dc19268cbf777428ca47b884c1">00092</a>   <span class="keywordtype">void</span> SetActiveBuffer(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="a03761.html#c6551f7bf833e8254b2b3ecdaea0d210e519c5019582479480124c44722a451f">index</a>)
<a name="l00093"></a>00093     {
<a name="l00094"></a>00094       this-&gt;SetActiveBuffers(1, &amp;index);
<a name="l00095"></a>00095     }
<a name="l00097"></a>00097   
<a name="l00099"></a>00099 
<a name="l00101"></a>00101   <span class="keywordtype">void</span> SetActiveBuffers(<span class="keywordtype">int</span> numbuffers,
<a name="l00102"></a>00102                         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> indices[]);
<a name="l00104"></a>00104 
<a name="l00105"></a>00105   <span class="comment">// All user specified texture objects must match the FBO dimensions</span>
<a name="l00106"></a>00106   <span class="comment">// and must have been created by the time Start() gets called.</span>
<a name="l00107"></a>00107   <span class="comment">// If texture is a 3D texture, zslice identifies the zslice that will be</span>
<a name="l00108"></a>00108   <span class="comment">// attached to the color buffer.</span>
<a name="l00109"></a>00109   <span class="comment">// .SECTION Caveat</span>
<a name="l00110"></a>00110   <span class="comment">// Currently, 1D textures are not supported.</span>
<a name="l00111"></a>00111   <span class="keywordtype">void</span> SetColorBuffer(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="a03761.html#c6551f7bf833e8254b2b3ecdaea0d210e519c5019582479480124c44722a451f">index</a>,
<a name="l00112"></a>00112                       <a class="code" href="a01701.html" title="abstracts an OpenGL texture object.">vtkTextureObject</a> *texture,
<a name="l00113"></a>00113                       <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> zslice=0);
<a name="l00114"></a>00114 
<a name="l00115"></a>00115   <a class="code" href="a01701.html" title="abstracts an OpenGL texture object.">vtkTextureObject</a> *GetColorBuffer(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="a03761.html#c6551f7bf833e8254b2b3ecdaea0d210e519c5019582479480124c44722a451f">index</a>);
<a name="l00116"></a>00116   <span class="keywordtype">void</span> RemoveColorBuffer(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="a03761.html#c6551f7bf833e8254b2b3ecdaea0d210e519c5019582479480124c44722a451f">index</a>);
<a name="l00117"></a>00117   <span class="keywordtype">void</span> RemoveAllColorBuffers();
<a name="l00118"></a>00118 
<a name="l00120"></a>00120 
<a name="l00121"></a>00121   <span class="keywordtype">void</span> SetDepthBuffer(<a class="code" href="a01701.html" title="abstracts an OpenGL texture object.">vtkTextureObject</a> *depthTexture);
<a name="l00122"></a>00122   <span class="keywordtype">void</span> RemoveDepthBuffer();
<a name="l00124"></a>00124 
<a name="l00126"></a>00126 
<a name="l00128"></a>00128   vtkSetMacro(DepthBufferNeeded,<span class="keywordtype">bool</span>);
<a name="l00129"></a>00129   vtkGetMacro(DepthBufferNeeded,<span class="keywordtype">bool</span>);
<a name="l00131"></a>00131 
<a name="l00133"></a>00133 
<a name="l00134"></a>00134   <span class="keywordtype">void</span> SetNumberOfRenderTargets(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>);
<a name="l00135"></a>00135   vtkGetMacro(NumberOfRenderTargets,<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>);
<a name="l00137"></a>00137 
<a name="l00141"></a>00141   <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> GetMaximumNumberOfActiveTargets();
<a name="l00142"></a>00142 
<a name="l00146"></a>00146   <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> GetMaximumNumberOfRenderTargets();
<a name="l00147"></a>00147   
<a name="l00149"></a>00149 
<a name="l00150"></a>00150   vtkGetVector2Macro(LastSize,<span class="keywordtype">int</span>);
<a name="l00152"></a>00152 
<a name="l00154"></a>00154   <span class="keyword">static</span> <span class="keywordtype">bool</span> IsSupported(<a class="code" href="a01489.html" title="create a window for renderers to draw into">vtkRenderWindow</a> *renWin);
<a name="l00155"></a>00155 
<a name="l00156"></a>00156 <span class="comment">//BTX</span>
<a name="l00157"></a>00157 <span class="keyword">protected</span>:
<a name="l00159"></a>00159   <span class="keywordtype">void</span> CheckFrameBufferStatus();
<a name="l00160"></a>00160   
<a name="l00162"></a>00162   <span class="keywordtype">void</span> DisplayFrameBufferAttachments();
<a name="l00163"></a>00163   
<a name="l00165"></a>00165   <span class="keywordtype">void</span> DisplayFrameBufferAttachment(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> uattachment);
<a name="l00166"></a>00166   
<a name="l00168"></a>00168   <span class="keywordtype">void</span> DisplayDrawBuffers();
<a name="l00169"></a>00169   
<a name="l00171"></a>00171   <span class="keywordtype">void</span> DisplayReadBuffer();
<a name="l00172"></a>00172   
<a name="l00174"></a>00174   <span class="keywordtype">void</span> DisplayBuffer(<span class="keywordtype">int</span> <a class="code" href="a03761.html#c6551f7bf833e8254b2b3ecdaea0d2106bf5e5151797630e91167caab3f22b9a">value</a>);
<a name="l00175"></a>00175   
<a name="l00176"></a>00176   <a class="code" href="a00563.html" title="internal class which encapsulates OpenGL frame buffer object. Not to be used directly...">vtkFrameBufferObject</a>();
<a name="l00177"></a>00177   ~<a class="code" href="a00563.html" title="internal class which encapsulates OpenGL frame buffer object. Not to be used directly...">vtkFrameBufferObject</a>();
<a name="l00178"></a>00178 
<a name="l00179"></a><a class="code" href="a00563.html#a857d2926799dffee01bcf87ce9eac10">00179</a>   <a class="code" href="a01869.html" title="a weak reference to a vtkObject.">vtkWeakPointer&lt;vtkRenderWindow&gt;</a> Context;
<a name="l00180"></a>00180 
<a name="l00181"></a><a class="code" href="a00563.html#98ed7bedcf9943855e8968cd83480d15">00181</a>   <span class="keywordtype">bool</span> DepthBufferNeeded;
<a name="l00182"></a><a class="code" href="a00563.html#9e0c48a51e1c07cafb97c5b7992d8b3a">00182</a>   <span class="keywordtype">bool</span> ColorBuffersDirty;
<a name="l00183"></a><a class="code" href="a00563.html#cb7959994e413e2c9feed4cc22f3b656">00183</a>   <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> FBOIndex;
<a name="l00184"></a><a class="code" href="a00563.html#2cdb81430cb3cab42e617b0b8d81326d">00184</a>   <span class="keywordtype">int</span> PreviousFBOIndex; <span class="comment">// -1: no previous FBO</span>
<a name="l00185"></a><a class="code" href="a00563.html#462ec5d1d1e167f9b60139cdb554b669">00185</a>   <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> DepthBuffer;
<a name="l00186"></a>00186 
<a name="l00187"></a><a class="code" href="a00563.html#70ed67f4319184b35668b3179b7911b3">00187</a>   <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> NumberOfRenderTargets;
<a name="l00188"></a>00188   <span class="comment">// TODO: add support for stencil buffer.</span>
<a name="l00189"></a>00189  
<a name="l00190"></a><a class="code" href="a00563.html#f29a43058a6c9296f2d1bcb2061781c6">00190</a>   <span class="keywordtype">int</span> LastSize[2];
<a name="l00191"></a>00191  
<a name="l00192"></a>00192   <span class="keywordtype">void</span> CreateFBO();
<a name="l00193"></a>00193   <span class="keywordtype">void</span> DestroyFBO();
<a name="l00194"></a>00194   <span class="keywordtype">void</span> Create(<span class="keywordtype">int</span> width,
<a name="l00195"></a>00195               <span class="keywordtype">int</span> <a class="code" href="a03761.html#c6551f7bf833e8254b2b3ecdaea0d210c076ccbe549041286aaf7bc34202ebdf">height</a>);
<a name="l00196"></a>00196   <span class="keywordtype">void</span> CreateBuffers(<span class="keywordtype">int</span> width,
<a name="l00197"></a>00197                      <span class="keywordtype">int</span> <a class="code" href="a03761.html#c6551f7bf833e8254b2b3ecdaea0d210c076ccbe549041286aaf7bc34202ebdf">height</a>);
<a name="l00198"></a>00198   <span class="keywordtype">void</span> CreateColorBuffers(<span class="keywordtype">int</span> width,
<a name="l00199"></a>00199                           <span class="keywordtype">int</span> <a class="code" href="a03761.html#c6551f7bf833e8254b2b3ecdaea0d210c076ccbe549041286aaf7bc34202ebdf">height</a>,
<a name="l00200"></a>00200                           <span class="keywordtype">bool</span> shaderSupportsTextureInt);
<a name="l00201"></a>00201   <span class="keywordtype">void</span> Destroy();
<a name="l00202"></a>00202   <span class="keywordtype">void</span> DestroyBuffers();
<a name="l00203"></a>00203   <span class="keywordtype">void</span> DestroyColorBuffers();
<a name="l00204"></a>00204   <span class="keywordtype">void</span> ActivateBuffers();
<a name="l00205"></a>00205 
<a name="l00207"></a>00207   <span class="keywordtype">bool</span> LoadRequiredExtensions(<a class="code" href="a01105.html" title="Interface class for querying and using OpenGL extensions.">vtkOpenGLExtensionManager</a> *manager);
<a name="l00208"></a>00208 
<a name="l00209"></a><a class="code" href="a00563.html#80dd2bd52c6abf8630e08ad712175e6f">00209</a>   vtkstd::vector&lt;unsigned int&gt; UserZSlices;
<a name="l00210"></a><a class="code" href="a00563.html#59ea07c34c10cf5bde3499d0294c81a1">00210</a>   vtkstd::vector&lt;vtkSmartPointer&lt;vtkTextureObject&gt; &gt; UserColorBuffers;
<a name="l00211"></a><a class="code" href="a00563.html#a5dc5f44c1c693bfb480b0e3f8ff9e55">00211</a>   vtkstd::vector&lt;vtkSmartPointer&lt;vtkTextureObject&gt; &gt; ColorBuffers;
<a name="l00212"></a><a class="code" href="a00563.html#eacd69d0879c41b32654e71b3bb0ce19">00212</a>   vtkstd::vector&lt;unsigned int&gt; ActiveBuffers;
<a name="l00213"></a><a class="code" href="a00563.html#d897877b65bee09a9464969673517067">00213</a>   <a class="code" href="a01562.html" title="Hold a reference to a vtkObjectBase instance.">vtkSmartPointer&lt;vtkTextureObject&gt;</a> UserDepthBuffer;
<a name="l00214"></a><a class="code" href="a00563.html#16765f63cbf53602e7bf3b0944fa5f0c">00214</a>   <span class="keywordtype">bool</span> DepthBufferDirty;
<a name="l00215"></a>00215 <span class="keyword">private</span>:
<a name="l00216"></a>00216   <a class="code" href="a00563.html" title="internal class which encapsulates OpenGL frame buffer object. Not to be used directly...">vtkFrameBufferObject</a>(<span class="keyword">const</span> <a class="code" href="a00563.html" title="internal class which encapsulates OpenGL frame buffer object. Not to be used directly...">vtkFrameBufferObject</a>&amp;); <span class="comment">// Not implemented.</span>
<a name="l00217"></a>00217   <span class="keywordtype">void</span> operator=(<span class="keyword">const</span> <a class="code" href="a00563.html" title="internal class which encapsulates OpenGL frame buffer object. Not to be used directly...">vtkFrameBufferObject</a>&amp;); <span class="comment">// Not implemented.</span>
<a name="l00218"></a>00218 <span class="comment">//ETX</span>
<a name="l00219"></a>00219 };
<a name="l00220"></a>00220 
<a name="l00221"></a>00221 <span class="preprocessor">#endif</span>
</pre></div></div>
<hr size="1"><address style="text-align: right;"><small>Generated on Wed Jun 3 18:35:46 2009 for VTK by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address>
</body>
</html>