Sophie

Sophie

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

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/VolumeRendering/vtkVolumeRayCastFunction.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/VolumeRendering/vtkVolumeRayCastFunction.h</h1><a href="a03641.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: vtkVolumeRayCastFunction.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 
<a name="l00030"></a>00030 <span class="preprocessor">#ifndef __vtkVolumeRayCastFunction_h</span>
<a name="l00031"></a>00031 <span class="preprocessor"></span><span class="preprocessor">#define __vtkVolumeRayCastFunction_h</span>
<a name="l00032"></a>00032 <span class="preprocessor"></span>
<a name="l00033"></a>00033 <span class="preprocessor">#include "<a class="code" href="a02079.html">vtkObject.h</a>"</span>
<a name="l00034"></a>00034 
<a name="l00035"></a>00035 <span class="keyword">class </span><a class="code" href="a01480.html" title="abstract specification for renderers">vtkRenderer</a>;
<a name="l00036"></a>00036 <span class="keyword">class </span><a class="code" href="a01839.html" title="represents a volume (data &amp;amp; properties) in a rendered scene">vtkVolume</a>;
<a name="l00037"></a>00037 <span class="keyword">class </span><a class="code" href="a01850.html" title="A slow but accurate mapper for rendering volumes.">vtkVolumeRayCastMapper</a>;
<a name="l00038"></a>00038 
<a name="l00039"></a>00039 <span class="comment">// Define a couple of structures we need to hold all the important information</span>
<a name="l00040"></a>00040 <span class="comment">// This first structure hold the dynamic information - stuff that changes per </span>
<a name="l00041"></a>00041 <span class="comment">// ray</span>
<a name="l00042"></a><a class="code" href="a01847.html">00042</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>
<a name="l00043"></a>00043 {
<a name="l00044"></a>00044   <span class="comment">// These are the return values - RGBA</span>
<a name="l00045"></a><a class="code" href="a01847.html#8ea3bbbdada4e75bfd3e69e9f8b89ed8">00045</a>   <span class="keywordtype">float</span> <a class="code" href="a03761.html#88ade42854f67d6297898362e17a515f17c6615bb6855c26543a4a2c0aaa529f">Color</a>[4];
<a name="l00046"></a><a class="code" href="a01847.html#dec39c3f0485e450f223134a033c2653">00046</a>   <span class="keywordtype">float</span> ScalarValue;
<a name="l00047"></a>00047 
<a name="l00048"></a>00048   <span class="comment">// Ray information transformed into local coordinates</span>
<a name="l00049"></a><a class="code" href="a01847.html#0f7f56499ca3407d07502c282124b4b1">00049</a>   <span class="keywordtype">float</span>                        TransformedStart[4];
<a name="l00050"></a><a class="code" href="a01847.html#2dc8336e81b1c24423889afeb58e7fb2">00050</a>   <span class="keywordtype">float</span>                        TransformedEnd[4];
<a name="l00051"></a><a class="code" href="a01847.html#1c6a27bb95dbdeadeca4b2573ee27af2">00051</a>   <span class="keywordtype">float</span>                        TransformedDirection[4];
<a name="l00052"></a><a class="code" href="a01847.html#0ce3e4d025fd3d74abc5037cf1ba87db">00052</a>   <span class="keywordtype">float</span>                        TransformedIncrement[3];
<a name="l00053"></a>00053   
<a name="l00054"></a>00054   <span class="comment">// The number of steps we want to take if this is</span>
<a name="l00055"></a>00055   <span class="comment">// a ray caster that takes steps</span>
<a name="l00056"></a><a class="code" href="a01847.html#dd5f05bf5894a1c954568864e8878d40">00056</a>   <span class="keywordtype">int</span>                          NumberOfStepsToTake;
<a name="l00057"></a>00057   
<a name="l00058"></a>00058   <span class="comment">// The number of steps we actually take if this is</span>
<a name="l00059"></a>00059   <span class="comment">// a ray caster that takes steps</span>
<a name="l00060"></a><a class="code" href="a01847.html#8af1fbe335b83f109fbd00e9c0afca03">00060</a>   <span class="keywordtype">int</span>                          NumberOfStepsTaken;
<a name="l00061"></a>00061 
<a name="l00062"></a>00062 } <a class="code" href="a01847.html">vtkVolumeRayCastDynamicInfo</a>;
<a name="l00063"></a>00063 
<a name="l00064"></a>00064 <span class="comment">// This second structure hold the static information - things that don't</span>
<a name="l00065"></a>00065 <span class="comment">// change over the whole image</span>
<a name="l00066"></a><a class="code" href="a01852.html">00066</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>
<a name="l00067"></a>00067 {
<a name="l00068"></a>00068   <span class="comment">// A pointer to the volume</span>
<a name="l00069"></a><a class="code" href="a01852.html#575e2af4eef86e3beb446a7a7ce2108b">00069</a>   <a class="code" href="a01839.html" title="represents a volume (data &amp;amp; properties) in a rendered scene">vtkVolume</a>                   *Volume;
<a name="l00070"></a>00070 
<a name="l00071"></a>00071   <span class="comment">// A pointer to the renderer</span>
<a name="l00072"></a><a class="code" href="a01852.html#0b37d2d976b077e6402a6f0189de8fe2">00072</a>   <a class="code" href="a01480.html" title="abstract specification for renderers">vtkRenderer</a>                 *Renderer;
<a name="l00073"></a>00073   
<a name="l00074"></a>00074   <span class="comment">// Matrices for switching from view to volume coordinate, and back</span>
<a name="l00075"></a><a class="code" href="a01852.html#cbde2d7b601444212e85595df48eda87">00075</a>   <span class="keywordtype">float</span>                        WorldToVoxelsMatrix[16];
<a name="l00076"></a><a class="code" href="a01852.html#0daba9e55d6982009811b4fdc75c942c">00076</a>   <span class="keywordtype">float</span>                        VoxelsToWorldMatrix[16];
<a name="l00077"></a><a class="code" href="a01852.html#c8c57ac10ab65deded78f993a4c28f2a">00077</a>   <span class="keywordtype">float</span>                        ViewToVoxelsMatrix[16];
<a name="l00078"></a>00078 
<a name="l00079"></a><a class="code" href="a01852.html#f8ae2775ad52fee150e20c1a29fda900">00079</a>   <span class="keywordtype">float</span>                       *ClippingPlane;
<a name="l00080"></a><a class="code" href="a01852.html#33dda85f407141aed5a7b150385175da">00080</a>   <span class="keywordtype">int</span>                          NumberOfClippingPlanes;
<a name="l00081"></a>00081   
<a name="l00082"></a>00082   <span class="comment">// The camera thickness (distance between near and far) is necessary </span>
<a name="l00083"></a>00083   <span class="comment">// for computing sampling distance</span>
<a name="l00084"></a><a class="code" href="a01852.html#6cf38dbc461aa4ce127f4809f8c54b45">00084</a>   <span class="keywordtype">float</span>                        CameraThickness;
<a name="l00085"></a>00085 
<a name="l00086"></a>00086   <span class="comment">// The type of the data and a pointer to it, and the information</span>
<a name="l00087"></a>00087   <span class="comment">// about its size, spacing, origin and precomputed increment</span>
<a name="l00088"></a><a class="code" href="a01852.html#b9d2cb8dad54909e87618311f798ad31">00088</a>   <span class="keywordtype">int</span>                          ScalarDataType;
<a name="l00089"></a><a class="code" href="a01852.html#731db807118dc899a2ee9c91edecc232">00089</a>   <span class="keywordtype">void</span>                        *ScalarDataPointer;
<a name="l00090"></a><a class="code" href="a01852.html#d1b4b86eabd2c19e006e13017a7630bb">00090</a>   <span class="keywordtype">int</span>                          DataIncrement[3];
<a name="l00091"></a><a class="code" href="a01852.html#e25a683cde5eec9ad4a047c67b469b12">00091</a>   <span class="keywordtype">int</span>                          DataSize[3];
<a name="l00092"></a><a class="code" href="a01852.html#71c982205c9ca0e6b7c1e2d9bcaf5de2">00092</a>   <span class="keywordtype">double</span>                       DataSpacing[3];
<a name="l00093"></a><a class="code" href="a01852.html#f5ee51a1d079c3d2b1d16899932c3ba8">00093</a>   <span class="keywordtype">double</span>                       DataOrigin[3];
<a name="l00094"></a>00094 
<a name="l00095"></a>00095   <span class="comment">// Information from the vtkVolumeProperty</span>
<a name="l00096"></a><a class="code" href="a01852.html#08568297f4c309e71e89180ff250708a">00096</a>   <span class="keywordtype">int</span>                          Shading;
<a name="l00097"></a><a class="code" href="a01852.html#35135dadb3d1f92c0ad96d1b81d2d9a9">00097</a>   <span class="keywordtype">int</span>                          ColorChannels;
<a name="l00098"></a><a class="code" href="a01852.html#0ff94acba4cf8e4b586575fc5c7a78fa">00098</a>   <span class="keywordtype">float</span>                        <a class="code" href="a03761.html#88ade42854f67d6297898362e17a515f17c6615bb6855c26543a4a2c0aaa529f">Color</a>[3];
<a name="l00099"></a><a class="code" href="a01852.html#ce0845632f2c5aeac21fb8456aabc36f">00099</a>   <span class="keywordtype">int</span>                          InterpolationType;
<a name="l00100"></a>00100 
<a name="l00101"></a>00101   <span class="comment">// The shading tables from the vtkEncodedGradientShader</span>
<a name="l00102"></a>00102   <span class="comment">// that will be used for shading the volume.</span>
<a name="l00103"></a><a class="code" href="a01852.html#fa9b73ea4122a31594929b30122d5143">00103</a>   <span class="keywordtype">float</span>                       *RedDiffuseShadingTable;
<a name="l00104"></a><a class="code" href="a01852.html#c14156a074300480eb6f9eaebe8f7ffc">00104</a>   <span class="keywordtype">float</span>                       *GreenDiffuseShadingTable;
<a name="l00105"></a><a class="code" href="a01852.html#89064c2e1c21d7eaa85c8765b30d3d5a">00105</a>   <span class="keywordtype">float</span>                       *BlueDiffuseShadingTable;
<a name="l00106"></a><a class="code" href="a01852.html#622f7300169de19a1a2036971b4b6c7d">00106</a>   <span class="keywordtype">float</span>                       *RedSpecularShadingTable;
<a name="l00107"></a><a class="code" href="a01852.html#76b4d41b67f6204943b71bf2dd55cf34">00107</a>   <span class="keywordtype">float</span>                       *GreenSpecularShadingTable;
<a name="l00108"></a><a class="code" href="a01852.html#014bf747ac72b09dfc62a02adc883599">00108</a>   <span class="keywordtype">float</span>                       *BlueSpecularShadingTable;
<a name="l00109"></a>00109 
<a name="l00110"></a>00110   <span class="comment">// Info needed from the gradient estimator</span>
<a name="l00111"></a><a class="code" href="a01852.html#d132149ae4fe4cc3c37d42417d8c1909">00111</a>   <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span>               *EncodedNormals;
<a name="l00112"></a><a class="code" href="a01852.html#a476be278b1d990086893ad6d1e8837d">00112</a>   <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>                *GradientMagnitudes;
<a name="l00113"></a>00113 
<a name="l00114"></a>00114   <span class="comment">// Image information</span>
<a name="l00115"></a><a class="code" href="a01852.html#662a5d83285331c58370178a5db0ddf0">00115</a>   <span class="keywordtype">int</span>                          ImageInUseSize[2];
<a name="l00116"></a><a class="code" href="a01852.html#0df7a7a9e91d14bbf147c9bba75f37bc">00116</a>   <span class="keywordtype">int</span>                          ImageMemorySize[2];
<a name="l00117"></a><a class="code" href="a01852.html#ba4bbda4072f0ff24aa8990bd806fd9e">00117</a>   <span class="keywordtype">int</span>                          ImageViewportSize[2];
<a name="l00118"></a><a class="code" href="a01852.html#18162871b976ab733ba35dfa6f7fbdd5">00118</a>   <span class="keywordtype">int</span>                          ImageOrigin[2];
<a name="l00119"></a><a class="code" href="a01852.html#7621e0f2ffd9a5bcbe465281c9066909">00119</a>   <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>               *Image;
<a name="l00120"></a>00120   
<a name="l00121"></a><a class="code" href="a01852.html#c235248ffb8e51c7d26e64bc8a9e6b01">00121</a>   <span class="keywordtype">int</span>                         *RowBounds;
<a name="l00122"></a>00122 
<a name="l00123"></a>00123   <span class="comment">// Is a MIP ray cast function in use? This will control</span>
<a name="l00124"></a>00124   <span class="comment">// how subsegments of the ray are combined when non-subvolume </span>
<a name="l00125"></a>00125   <span class="comment">// cropping is used. If maximize opacity is used, the color[3] </span>
<a name="l00126"></a>00126   <span class="comment">// value is used to find the max othersize the dynamicInfo-&gt;ScalarValue</span>
<a name="l00127"></a>00127   <span class="comment">// value is used</span>
<a name="l00128"></a><a class="code" href="a01852.html#52d85bba0ec5212aa52cd79c12c4f33a">00128</a>   <span class="keywordtype">int</span>                          MIPFunction;
<a name="l00129"></a><a class="code" href="a01852.html#f8a473dbf1d9e8bb266fae027d3e1ef4">00129</a>   <span class="keywordtype">int</span>                          MaximizeOpacity;
<a name="l00130"></a>00130 } <a class="code" href="a01852.html">vtkVolumeRayCastStaticInfo</a>;
<a name="l00131"></a>00131 
<a name="l00132"></a><a class="code" href="a01848.html">00132</a> <span class="keyword">class </span><a class="code" href="a02170.html#4c512a1c00e5052ca1bbef09929dba95">VTK_VOLUMERENDERING_EXPORT</a> <a class="code" href="a01848.html" title="a superclass for ray casting functions">vtkVolumeRayCastFunction</a> : <span class="keyword">public</span> <a class="code" href="a01084.html" title="abstract base class for most VTK objects">vtkObject</a>
<a name="l00133"></a>00133 {
<a name="l00134"></a>00134 <span class="keyword">public</span>:
<a name="l00135"></a><a class="code" href="a01848.html#4e3479a5fad03b79743fd0a2eb5eba77">00135</a>   vtkTypeRevisionMacro(<a class="code" href="a01848.html" title="a superclass for ray casting functions">vtkVolumeRayCastFunction</a>,<a class="code" href="a01084.html" title="abstract base class for most VTK objects">vtkObject</a>);
<a name="l00136"></a>00136   <span class="keyword">virtual</span> <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="l00137"></a>00137 
<a name="l00139"></a>00139 
<a name="l00144"></a>00144   <span class="keywordtype">void</span> FunctionInitialize( <a class="code" href="a01480.html" title="abstract specification for renderers">vtkRenderer</a> *ren,
<a name="l00145"></a>00145                            <a class="code" href="a01839.html" title="represents a volume (data &amp;amp; properties) in a rendered scene">vtkVolume</a>   *vol,
<a name="l00146"></a>00146                            <a class="code" href="a01852.html">vtkVolumeRayCastStaticInfo</a> *staticInfo );
<a name="l00148"></a>00148 
<a name="l00149"></a>00149   <span class="keyword">virtual</span> <span class="keywordtype">void</span> CastRay( <a class="code" href="a01847.html">vtkVolumeRayCastDynamicInfo</a> *dynamicInfo,
<a name="l00150"></a>00150                         <a class="code" href="a01852.html">vtkVolumeRayCastStaticInfo</a> *staticInfo )=0;
<a name="l00151"></a>00151 <span class="comment">//ETX</span>
<a name="l00152"></a>00152 
<a name="l00155"></a>00155   <span class="keyword">virtual</span> <span class="keywordtype">float</span> GetZeroOpacityThreshold( <a class="code" href="a01839.html" title="represents a volume (data &amp;amp; properties) in a rendered scene">vtkVolume</a> *vol )=0;
<a name="l00156"></a>00156 
<a name="l00157"></a>00157 <span class="keyword">protected</span>:
<a name="l00158"></a><a class="code" href="a01848.html#d3da166f0a02e05738137870ecd72bb9">00158</a>   <a class="code" href="a01848.html" title="a superclass for ray casting functions">vtkVolumeRayCastFunction</a>() {};
<a name="l00159"></a><a class="code" href="a01848.html#b92c6a8ab8a78a90cc0e1bdc4a042f3f">00159</a>   ~<a class="code" href="a01848.html" title="a superclass for ray casting functions">vtkVolumeRayCastFunction</a>() {};
<a name="l00160"></a>00160 
<a name="l00162"></a>00162 
<a name="l00164"></a>00164   <span class="keyword">virtual</span> <span class="keywordtype">void</span> SpecificFunctionInitialize( <a class="code" href="a01480.html" title="abstract specification for renderers">vtkRenderer</a> *ren,
<a name="l00165"></a>00165                                            <a class="code" href="a01839.html" title="represents a volume (data &amp;amp; properties) in a rendered scene">vtkVolume</a>   *vol,
<a name="l00166"></a>00166                                            <a class="code" href="a01852.html">vtkVolumeRayCastStaticInfo</a> *staticInfo,
<a name="l00167"></a>00167                                            <a class="code" href="a01850.html" title="A slow but accurate mapper for rendering volumes.">vtkVolumeRayCastMapper</a> *mapper )=0;
<a name="l00169"></a>00169 <span class="comment">//ETX</span>
<a name="l00170"></a>00170 <span class="keyword">private</span>:
<a name="l00171"></a>00171   <a class="code" href="a01848.html" title="a superclass for ray casting functions">vtkVolumeRayCastFunction</a>(<span class="keyword">const</span> <a class="code" href="a01848.html" title="a superclass for ray casting functions">vtkVolumeRayCastFunction</a>&amp;);  <span class="comment">// Not implemented.</span>
<a name="l00172"></a>00172   <span class="keywordtype">void</span> operator=(<span class="keyword">const</span> <a class="code" href="a01848.html" title="a superclass for ray casting functions">vtkVolumeRayCastFunction</a>&amp;);  <span class="comment">// Not implemented.</span>
<a name="l00173"></a>00173 };
<a name="l00174"></a>00174 
<a name="l00175"></a>00175 <span class="preprocessor">#endif</span>
</pre></div></div>
<hr size="1"><address style="text-align: right;"><small>Generated on Wed Jun 3 18:35:51 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>