<!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/vtkGLSLShader.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 Page</span></a></li> <li><a href="pages.html"><span>Related 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/vtkGLSLShader.h</h1><a href="a03406.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: vtkGLSLShader.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="l00015"></a>00015 <span class="comment">/*</span> <a name="l00016"></a>00016 <span class="comment"> * Copyright 2003 Sandia Corporation.</span> <a name="l00017"></a>00017 <span class="comment"> * Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive</span> <a name="l00018"></a>00018 <span class="comment"> * license for use of this work by or on behalf of the</span> <a name="l00019"></a>00019 <span class="comment"> * U.S. Government. Redistribution and use in source and binary forms, with</span> <a name="l00020"></a>00020 <span class="comment"> * or without modification, are permitted provided that this Notice and any</span> <a name="l00021"></a>00021 <span class="comment"> * statement of authorship are reproduced on all copies.</span> <a name="l00022"></a>00022 <span class="comment"> */</span> <a name="l00023"></a>00023 <a name="l00073"></a>00073 <span class="preprocessor">#ifndef __vtkGLSLShader_h</span> <a name="l00074"></a>00074 <span class="preprocessor"></span><span class="preprocessor">#define __vtkGLSLShader_h</span> <a name="l00075"></a>00075 <span class="preprocessor"></span> <a name="l00076"></a>00076 <span class="preprocessor">#include "<a class="code" href="a03547.html">vtkShader.h</a>"</span> <a name="l00077"></a>00077 <a name="l00078"></a>00078 <span class="keyword">class </span><a class="code" href="a00092.html" title="represents an object (geometry &amp; properties) in a rendered scene">vtkActor</a>; <a name="l00079"></a>00079 <span class="keyword">class </span><a class="code" href="a01480.html" title="abstract specification for renderers">vtkRenderer</a>; <a name="l00080"></a>00080 <span class="keyword">class </span><a class="code" href="a01322.html" title="represent surface properties of a geometric object">vtkProperty</a>; <a name="l00081"></a>00081 <span class="keyword">class </span><a class="code" href="a00954.html" title="a virtual light for 3D rendering">vtkLight</a>; <a name="l00082"></a>00082 <span class="keyword">class </span><a class="code" href="a00227.html" title="a virtual camera for 3D rendering">vtkCamera</a>; <a name="l00083"></a>00083 <span class="keyword">class </span><a class="code" href="a01489.html" title="create a window for renderers to draw into">vtkRenderWindow</a>; <a name="l00084"></a>00084 <a name="l00085"></a>00085 <span class="comment">// Manages all shaders defined in the XML file</span> <a name="l00086"></a>00086 <span class="comment">// especially the part about sending things to the card</span> <a name="l00087"></a><a class="code" href="a00645.html">00087</a> <span class="keyword">class </span><a class="code" href="a02170.html#4019f67b2e7d601f2cf984e448308dbb">VTK_RENDERING_EXPORT</a> <a class="code" href="a00645.html" title="GLSL Shader.">vtkGLSLShader</a> : <span class="keyword">public</span> <a class="code" href="a01532.html">vtkShader</a> <a name="l00088"></a>00088 { <a name="l00089"></a>00089 <span class="keyword">public</span>: <a name="l00090"></a>00090 <span class="keyword">static</span> <a class="code" href="a00645.html" title="GLSL Shader.">vtkGLSLShader</a> *<a class="code" href="a01084.html#4d5b227267c076d6f9e38483370b6612">New</a>(); <a name="l00091"></a><a class="code" href="a00645.html#d684c92895a3049c72082c9f3f095f34">00091</a> vtkTypeRevisionMacro(<a class="code" href="a00645.html" title="GLSL Shader.">vtkGLSLShader</a>, <a class="code" href="a01532.html">vtkShader</a>); <a name="l00092"></a>00092 <span class="keywordtype">void</span> <a class="code" href="a01532.html#0753943f722a8e7654a47f8a2f2f9b16">PrintSelf</a>(ostream &os, <a class="code" href="a00869.html" title="a simple class to control print indentation">vtkIndent</a> indent); <a name="l00093"></a>00093 <a name="l00098"></a>00098 <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="a01532.html#8183089056c1ac064022599e1ad1fe6f">Compile</a>(); <a name="l00099"></a>00099 <a name="l00101"></a><a class="code" href="a00645.html#21a986f276584aa0c29bf3cb47966ce2">00101</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> GetHandle() { <span class="keywordflow">return</span> this->Shader; } <a name="l00102"></a>00102 <a name="l00104"></a>00104 <a name="l00106"></a>00106 vtkSetMacro( Program, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> ); <a name="l00107"></a>00107 vtkGetMacro( Program, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> ); <a name="l00109"></a>00109 <a name="l00113"></a>00113 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="a01532.html#2fec3459ae3da55145738f9dcbbfb58e">ReleaseGraphicsResources</a>(<a class="code" href="a01886.html" title="window superclass for vtkRenderWindow">vtkWindow</a> *); <a name="l00114"></a>00114 <span class="keyword">protected</span>: <a name="l00115"></a>00115 <a class="code" href="a00645.html" title="GLSL Shader.">vtkGLSLShader</a>(); <a name="l00116"></a>00116 <span class="keyword">virtual</span> ~<a class="code" href="a00645.html" title="GLSL Shader.">vtkGLSLShader</a>(); <a name="l00117"></a>00117 <a name="l00118"></a>00118 <span class="comment">// These are GLuints.</span> <a name="l00119"></a><a class="code" href="a00645.html#26e585882914c258ceb8a73eab8267f6">00119</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> Program; <a name="l00120"></a><a class="code" href="a00645.html#772475e7da5d2523c70fe0f3e65984c8">00120</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> Shader; <a name="l00121"></a>00121 <a name="l00122"></a>00122 <span class="keywordtype">int</span> IsShader(); <a name="l00123"></a>00123 <span class="keywordtype">int</span> IsCompiled(); <a name="l00124"></a>00124 <a name="l00126"></a>00126 <span class="keywordtype">void</span> LoadShader(); <a name="l00127"></a>00127 <a name="l00129"></a>00129 <a name="l00130"></a>00130 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="a01532.html#d23983ed6d00f229badbb626b9f76992">SetUniformParameter</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="a03761.html#c6551f7bf833e8254b2b3ecdaea0d210c713735f1d46c2694d66e85217207be2">name</a>, <span class="keywordtype">int</span> numValues, <span class="keyword">const</span> <span class="keywordtype">int</span>* <a class="code" href="a03761.html#c6551f7bf833e8254b2b3ecdaea0d2106bf5e5151797630e91167caab3f22b9a">value</a>); <a name="l00131"></a>00131 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="a01532.html#d23983ed6d00f229badbb626b9f76992">SetUniformParameter</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="a03761.html#c6551f7bf833e8254b2b3ecdaea0d210c713735f1d46c2694d66e85217207be2">name</a>, <span class="keywordtype">int</span> numValues, <span class="keyword">const</span> <span class="keywordtype">float</span>* <a class="code" href="a03761.html#c6551f7bf833e8254b2b3ecdaea0d2106bf5e5151797630e91167caab3f22b9a">value</a>); <a name="l00132"></a>00132 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="a01532.html#d23983ed6d00f229badbb626b9f76992">SetUniformParameter</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="a03761.html#c6551f7bf833e8254b2b3ecdaea0d210c713735f1d46c2694d66e85217207be2">name</a>, <span class="keywordtype">int</span> numValues, <span class="keyword">const</span> <span class="keywordtype">double</span>* <a class="code" href="a03761.html#c6551f7bf833e8254b2b3ecdaea0d2106bf5e5151797630e91167caab3f22b9a">value</a>); <a name="l00134"></a>00134 <a name="l00136"></a>00136 <a name="l00137"></a>00137 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="a01532.html#c0ede013e4f88764c67cfbacaac74d97">SetMatrixParameter</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="a03761.html#c6551f7bf833e8254b2b3ecdaea0d210c713735f1d46c2694d66e85217207be2">name</a>, <span class="keywordtype">int</span> numValues, <a name="l00138"></a>00138 <span class="keywordtype">int</span> <a class="code" href="a03761.html#c6551f7bf833e8254b2b3ecdaea0d2101120342919d8f583cb57e39394154f33">order</a>, <span class="keyword">const</span> <span class="keywordtype">float</span>* <a class="code" href="a03761.html#c6551f7bf833e8254b2b3ecdaea0d2106bf5e5151797630e91167caab3f22b9a">value</a>); <a name="l00139"></a>00139 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="a01532.html#c0ede013e4f88764c67cfbacaac74d97">SetMatrixParameter</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="a03761.html#c6551f7bf833e8254b2b3ecdaea0d210c713735f1d46c2694d66e85217207be2">name</a>, <span class="keywordtype">int</span> numValues, <a name="l00140"></a>00140 <span class="keywordtype">int</span> <a class="code" href="a03761.html#c6551f7bf833e8254b2b3ecdaea0d2101120342919d8f583cb57e39394154f33">order</a>, <span class="keyword">const</span> <span class="keywordtype">double</span>* <a class="code" href="a03761.html#c6551f7bf833e8254b2b3ecdaea0d2106bf5e5151797630e91167caab3f22b9a">value</a>); <a name="l00141"></a>00141 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="a01532.html#c0ede013e4f88764c67cfbacaac74d97">SetMatrixParameter</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="a03761.html#c6551f7bf833e8254b2b3ecdaea0d210c713735f1d46c2694d66e85217207be2">name</a>, <span class="keyword">const</span> <span class="keywordtype">char</span>* state_matix_type, <a name="l00142"></a>00142 <span class="keyword">const</span> <span class="keywordtype">char</span>* transform_type); <a name="l00144"></a>00144 <a name="l00145"></a>00145 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="a01532.html#0248f0865288e094780a0d458f68efde">SetSamplerParameter</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="a03761.html#c6551f7bf833e8254b2b3ecdaea0d210c713735f1d46c2694d66e85217207be2">name</a>, <a class="code" href="a01695.html" title="handles properties associated with a texture map">vtkTexture</a>* texture, <a name="l00146"></a>00146 <span class="keywordtype">int</span> textureIndex); <a name="l00147"></a>00147 <span class="keyword">private</span>: <a name="l00148"></a>00148 <a class="code" href="a00645.html" title="GLSL Shader.">vtkGLSLShader</a>(<span class="keyword">const</span> <a class="code" href="a00645.html" title="GLSL Shader.">vtkGLSLShader</a>&); <span class="comment">// Not Implemented</span> <a name="l00149"></a>00149 <span class="keywordtype">void</span> operator=(<span class="keyword">const</span> <a class="code" href="a00645.html" title="GLSL Shader.">vtkGLSLShader</a>&); <span class="comment">// Not Implemented</span> <a name="l00150"></a>00150 <a name="l00151"></a>00151 <span class="keywordtype">int</span> GetUniformLocation( <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="a03761.html#c6551f7bf833e8254b2b3ecdaea0d210c713735f1d46c2694d66e85217207be2">name</a> ); <a name="l00152"></a>00152 }; <a name="l00153"></a>00153 <span class="preprocessor">#endif //__vtkGLSLShader_h</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 <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>