<!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/Graphics/vtkImageMarchingCubes.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/Graphics/vtkImageMarchingCubes.h</h1><a href="a02578.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: vtkImageMarchingCubes.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="l00041"></a>00041 <span class="preprocessor">#ifndef __vtkImageMarchingCubes_h</span> <a name="l00042"></a>00042 <span class="preprocessor"></span><span class="preprocessor">#define __vtkImageMarchingCubes_h</span> <a name="l00043"></a>00043 <span class="preprocessor"></span> <a name="l00044"></a>00044 <span class="preprocessor">#include "<a class="code" href="a02331.html">vtkPolyDataAlgorithm.h</a>"</span> <a name="l00045"></a>00045 <a name="l00046"></a>00046 <span class="preprocessor">#include "<a class="code" href="a02002.html">vtkContourValues.h</a>"</span> <span class="comment">// Needed for direct access to ContourValues</span> <a name="l00047"></a>00047 <a name="l00048"></a>00048 <span class="keyword">class </span><a class="code" href="a00242.html" title="object to represent cell connectivity">vtkCellArray</a>; <a name="l00049"></a>00049 <span class="keyword">class </span><a class="code" href="a00556.html" title="dynamic, self-adjusting array of float">vtkFloatArray</a>; <a name="l00050"></a>00050 <span class="keyword">class </span><a class="code" href="a00751.html" title="topologically and geometrically regular array of data">vtkImageData</a>; <a name="l00051"></a>00051 <span class="keyword">class </span><a class="code" href="a01250.html" title="represent and manipulate 3D points">vtkPoints</a>; <a name="l00052"></a>00052 <a name="l00053"></a><a class="code" href="a00795.html">00053</a> <span class="keyword">class </span><a class="code" href="a02170.html#c3c1ffe2fe47b9b70ba90182b7860cce">VTK_GRAPHICS_EXPORT</a> <a class="code" href="a00795.html" title="generate isosurface(s) from volume/images">vtkImageMarchingCubes</a> : <span class="keyword">public</span> <a class="code" href="a01261.html" title="Superclass for algorithms that produce only polydata as output.">vtkPolyDataAlgorithm</a> <a name="l00054"></a>00054 { <a name="l00055"></a>00055 <span class="keyword">public</span>: <a name="l00056"></a>00056 <span class="keyword">static</span> <a class="code" href="a00795.html" title="generate isosurface(s) from volume/images">vtkImageMarchingCubes</a> *<a class="code" href="a01261.html#cf785ac526132296ff652c636f713b5e">New</a>(); <a name="l00057"></a><a class="code" href="a00795.html#8d9ba3d67646e50e9a41138c95e39731">00057</a> vtkTypeRevisionMacro(<a class="code" href="a00795.html" title="generate isosurface(s) from volume/images">vtkImageMarchingCubes</a>,<a class="code" href="a01261.html" title="Superclass for algorithms that produce only polydata as output.">vtkPolyDataAlgorithm</a>); <a name="l00058"></a>00058 <span class="keywordtype">void</span> <a class="code" href="a01261.html#e6d59a63261b0c56f8f473984ae0e1b6">PrintSelf</a>(ostream& os, <a class="code" href="a00869.html" title="a simple class to control print indentation">vtkIndent</a> indent); <a name="l00059"></a>00059 <a name="l00061"></a>00061 <a name="l00062"></a>00062 <span class="keywordtype">void</span> SetValue(<span class="keywordtype">int</span> i, <span class="keywordtype">double</span> <a class="code" href="a03761.html#c6551f7bf833e8254b2b3ecdaea0d2106bf5e5151797630e91167caab3f22b9a">value</a>); <a name="l00063"></a>00063 <span class="keywordtype">double</span> GetValue(<span class="keywordtype">int</span> i); <a name="l00064"></a>00064 <span class="keywordtype">double</span> *GetValues(); <a name="l00065"></a>00065 <span class="keywordtype">void</span> GetValues(<span class="keywordtype">double</span> *contourValues); <a name="l00066"></a>00066 <span class="keywordtype">void</span> SetNumberOfContours(<span class="keywordtype">int</span> number); <a name="l00067"></a>00067 <span class="keywordtype">int</span> GetNumberOfContours(); <a name="l00068"></a>00068 <span class="keywordtype">void</span> GenerateValues(<span class="keywordtype">int</span> numContours, <span class="keywordtype">double</span> <a class="code" href="a03761.html#c6551f7bf833e8254b2b3ecdaea0d21076786d084c43d32f242990f932679539">range</a>[2]); <a name="l00069"></a>00069 <span class="keywordtype">void</span> GenerateValues(<span class="keywordtype">int</span> numContours, <span class="keywordtype">double</span> rangeStart, <span class="keywordtype">double</span> rangeEnd); <a name="l00071"></a>00071 <a name="l00074"></a>00074 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <span class="keywordtype">int</span> <a class="code" href="a01084.html#8137c0551b29bb996f0dd2f886bcd2da">GetMTime</a>(); <a name="l00075"></a>00075 <a name="l00077"></a>00077 <a name="l00078"></a>00078 vtkSetMacro(ComputeScalars, <span class="keywordtype">int</span>); <a name="l00079"></a>00079 vtkGetMacro(ComputeScalars, <span class="keywordtype">int</span>); <a name="l00080"></a>00080 vtkBooleanMacro(ComputeScalars, <span class="keywordtype">int</span>); <a name="l00082"></a>00082 <a name="l00084"></a>00084 <a name="l00088"></a>00088 vtkSetMacro(ComputeNormals, <span class="keywordtype">int</span>); <a name="l00089"></a>00089 vtkGetMacro(ComputeNormals, <span class="keywordtype">int</span>); <a name="l00090"></a>00090 vtkBooleanMacro(ComputeNormals, <span class="keywordtype">int</span>); <a name="l00092"></a>00092 <a name="l00094"></a>00094 <a name="l00100"></a>00100 vtkSetMacro(ComputeGradients, <span class="keywordtype">int</span>); <a name="l00101"></a>00101 vtkGetMacro(ComputeGradients, <span class="keywordtype">int</span>); <a name="l00102"></a><a class="code" href="a00795.html#9f33a66cc9f9db2f0c7623a3db48524a">00102</a> vtkBooleanMacro(ComputeGradients, <span class="keywordtype">int</span>); <a name="l00104"></a>00104 <a name="l00105"></a>00105 <span class="comment">// Should be protected, but the templated functions need these</span> <a name="l00106"></a>00106 <span class="keywordtype">int</span> ComputeScalars; <a name="l00107"></a><a class="code" href="a00795.html#000582502221685f6a69476bb47646bf">00107</a> <span class="keywordtype">int</span> ComputeNormals; <a name="l00108"></a><a class="code" href="a00795.html#c449dc042973c6035fa7e69374e19e43">00108</a> <span class="keywordtype">int</span> ComputeGradients; <a name="l00109"></a><a class="code" href="a00795.html#f86b28b511100d76af1e0b620fe8e4a7">00109</a> <span class="keywordtype">int</span> NeedGradients; <a name="l00110"></a>00110 <a name="l00111"></a><a class="code" href="a00795.html#38a5402b5cb87d215cba73922343c507">00111</a> <a class="code" href="a00242.html" title="object to represent cell connectivity">vtkCellArray</a> *Triangles; <a name="l00112"></a><a class="code" href="a00795.html#0ac6785f1476996b0bea12685a12bbe1">00112</a> <a class="code" href="a00556.html" title="dynamic, self-adjusting array of float">vtkFloatArray</a> *Scalars; <a name="l00113"></a><a class="code" href="a00795.html#63212bf4e6e8617340f1df5780ba1ce1">00113</a> <a class="code" href="a01250.html" title="represent and manipulate 3D points">vtkPoints</a> *Points; <a name="l00114"></a><a class="code" href="a00795.html#c21b89f4ba10007364622906253ac442">00114</a> <a class="code" href="a00556.html" title="dynamic, self-adjusting array of float">vtkFloatArray</a> *Normals; <a name="l00115"></a><a class="code" href="a00795.html#0bdfbbbb2049dfc49387bef78b0f7ff4">00115</a> <a class="code" href="a00556.html" title="dynamic, self-adjusting array of float">vtkFloatArray</a> *Gradients; <a name="l00116"></a>00116 <a name="l00117"></a>00117 <span class="keywordtype">int</span> GetLocatorPoint(<span class="keywordtype">int</span> cellX, <span class="keywordtype">int</span> cellY, <span class="keywordtype">int</span> edge); <a name="l00118"></a>00118 <span class="keywordtype">void</span> AddLocatorPoint(<span class="keywordtype">int</span> cellX, <span class="keywordtype">int</span> cellY, <span class="keywordtype">int</span> edge, <span class="keywordtype">int</span> ptId); <a name="l00119"></a>00119 <span class="keywordtype">void</span> IncrementLocatorZ(); <a name="l00120"></a>00120 <a name="l00122"></a>00122 <a name="l00125"></a>00125 vtkSetMacro(InputMemoryLimit, <span class="keywordtype">int</span>); <a name="l00126"></a>00126 vtkGetMacro(InputMemoryLimit, <span class="keywordtype">int</span>); <a name="l00128"></a>00128 <a name="l00129"></a>00129 <span class="keyword">protected</span>: <a name="l00130"></a>00130 <a class="code" href="a00795.html" title="generate isosurface(s) from volume/images">vtkImageMarchingCubes</a>(); <a name="l00131"></a>00131 ~<a class="code" href="a00795.html" title="generate isosurface(s) from volume/images">vtkImageMarchingCubes</a>(); <a name="l00132"></a>00132 <a name="l00133"></a><a class="code" href="a00795.html#fd85076f666b5a5a1d235c0d606b0192">00133</a> <span class="keywordtype">int</span> NumberOfSlicesPerChunk; <a name="l00134"></a><a class="code" href="a00795.html#2c604c6e996b2e855faed8a5767cea02">00134</a> <span class="keywordtype">int</span> InputMemoryLimit; <a name="l00135"></a>00135 <a name="l00136"></a><a class="code" href="a00795.html#649f047889466fbf1c8a191736711eb7">00136</a> <a class="code" href="a00330.html" title="helper object to manage setting and generating contour values">vtkContourValues</a> *ContourValues; <a name="l00137"></a>00137 <a name="l00138"></a><a class="code" href="a00795.html#ee89de630dfb967c86e6b58da6ef5433">00138</a> <span class="keywordtype">int</span> *LocatorPointIds; <a name="l00139"></a><a class="code" href="a00795.html#891ce943e69f74af44c5d8733a50ece8">00139</a> <span class="keywordtype">int</span> LocatorDimX; <a name="l00140"></a><a class="code" href="a00795.html#5df935cb8a59c7d87ea5a1650136b760">00140</a> <span class="keywordtype">int</span> LocatorDimY; <a name="l00141"></a><a class="code" href="a00795.html#a2026f7b746c232b38756bdb74aaa415">00141</a> <span class="keywordtype">int</span> LocatorMinX; <a name="l00142"></a><a class="code" href="a00795.html#082930e01df29335694f363e11df016d">00142</a> <span class="keywordtype">int</span> LocatorMinY; <a name="l00143"></a>00143 <a name="l00144"></a>00144 <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="a01261.html#6b5a43ab1f9bbcb368c7dc83e4afe068">RequestData</a>(<a class="code" href="a00872.html" title="Store vtkAlgorithm input/output information.">vtkInformation</a> *, <a class="code" href="a00895.html" title="Store zero or more vtkInformation instances.">vtkInformationVector</a> **, <a class="code" href="a00895.html" title="Store zero or more vtkInformation instances.">vtkInformationVector</a> *); <a name="l00145"></a>00145 <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="a01261.html#a9084b97ab9c0c8c76e490fa9776a832">FillInputPortInformation</a>(<span class="keywordtype">int</span> <a class="code" href="a03761.html#c6551f7bf833e8254b2b3ecdaea0d210710cb6d12e418b21e8fb3d79ac32f51c">port</a>, <a class="code" href="a00872.html" title="Store vtkAlgorithm input/output information.">vtkInformation</a> *<a class="code" href="a03761.html#c6551f7bf833e8254b2b3ecdaea0d21023da246d4a744e861548382bb79fad81">info</a>); <a name="l00146"></a>00146 <a name="l00147"></a>00147 <span class="keywordtype">void</span> March(<a class="code" href="a00751.html" title="topologically and geometrically regular array of data">vtkImageData</a> *inData, <span class="keywordtype">int</span> chunkMin, <span class="keywordtype">int</span> chunkMax, <a name="l00148"></a>00148 <span class="keywordtype">int</span> numContours, <span class="keywordtype">double</span> *values); <a name="l00149"></a>00149 <span class="keywordtype">void</span> InitializeLocator(<span class="keywordtype">int</span> min0, <span class="keywordtype">int</span> max0, <span class="keywordtype">int</span> min1, <span class="keywordtype">int</span> max1); <a name="l00150"></a>00150 <span class="keywordtype">void</span> DeleteLocator(); <a name="l00151"></a>00151 <span class="keywordtype">int</span> *GetLocatorPointer(<span class="keywordtype">int</span> cellX, <span class="keywordtype">int</span> cellY, <span class="keywordtype">int</span> edge); <a name="l00152"></a>00152 <a name="l00153"></a>00153 <span class="keyword">private</span>: <a name="l00154"></a>00154 <a class="code" href="a00795.html" title="generate isosurface(s) from volume/images">vtkImageMarchingCubes</a>(<span class="keyword">const</span> <a class="code" href="a00795.html" title="generate isosurface(s) from volume/images">vtkImageMarchingCubes</a>&); <span class="comment">// Not implemented.</span> <a name="l00155"></a>00155 <span class="keywordtype">void</span> operator=(<span class="keyword">const</span> <a class="code" href="a00795.html" title="generate isosurface(s) from volume/images">vtkImageMarchingCubes</a>&); <span class="comment">// Not implemented.</span> <a name="l00156"></a>00156 }; <a name="l00157"></a>00157 <a name="l00160"></a><a class="code" href="a00795.html#ddafc501b67639f4910fa858f93bbcae">00160</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00795.html#ddafc501b67639f4910fa858f93bbcae">vtkImageMarchingCubes::SetValue</a>(<span class="keywordtype">int</span> i, <span class="keywordtype">double</span> <a class="code" href="a03761.html#c6551f7bf833e8254b2b3ecdaea0d2106bf5e5151797630e91167caab3f22b9a">value</a>) <a name="l00161"></a>00161 {this-><a class="code" href="a00795.html#649f047889466fbf1c8a191736711eb7">ContourValues</a>-><a class="code" href="a00330.html#c9adf286086d681d6b80da610fd2bc5b">SetValue</a>(i,value);} <a name="l00162"></a>00162 <a name="l00164"></a>00164 <a name="l00165"></a><a class="code" href="a00795.html#8d744757ba4fecf1f1e3d4abb3ad14e4">00165</a> <span class="keyword">inline</span> <span class="keywordtype">double</span> <a class="code" href="a00795.html#8d744757ba4fecf1f1e3d4abb3ad14e4">vtkImageMarchingCubes::GetValue</a>(<span class="keywordtype">int</span> i) <a name="l00166"></a>00166 {<span class="keywordflow">return</span> this-><a class="code" href="a00795.html#649f047889466fbf1c8a191736711eb7">ContourValues</a>-><a class="code" href="a00330.html#e1beb054c144c1eb5c65ef65ce9010dc">GetValue</a>(i);} <a name="l00168"></a>00168 <a name="l00170"></a>00170 <a name="l00172"></a><a class="code" href="a00795.html#b8c9773224547689e25a9620e4dbd0fe">00172</a> <span class="keyword">inline</span> <span class="keywordtype">double</span> *<a class="code" href="a00795.html#b8c9773224547689e25a9620e4dbd0fe">vtkImageMarchingCubes::GetValues</a>() <a name="l00173"></a>00173 {<span class="keywordflow">return</span> this-><a class="code" href="a00795.html#649f047889466fbf1c8a191736711eb7">ContourValues</a>-><a class="code" href="a00330.html#f5488942a61e6465a4e155f956b1b110">GetValues</a>();} <a name="l00175"></a>00175 <a name="l00179"></a><a class="code" href="a00795.html#84f986622e107d7c65d7d81ab7b3611e">00179</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00795.html#b8c9773224547689e25a9620e4dbd0fe">vtkImageMarchingCubes::GetValues</a>(<span class="keywordtype">double</span> *contourValues) <a name="l00180"></a>00180 {this-><a class="code" href="a00795.html#649f047889466fbf1c8a191736711eb7">ContourValues</a>-><a class="code" href="a00330.html#f5488942a61e6465a4e155f956b1b110">GetValues</a>(contourValues);} <a name="l00181"></a>00181 <a name="l00185"></a><a class="code" href="a00795.html#e37a6b815211e3a3350b88e547225582">00185</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00795.html#e37a6b815211e3a3350b88e547225582">vtkImageMarchingCubes::SetNumberOfContours</a>(<span class="keywordtype">int</span> number) <a name="l00186"></a>00186 {this-><a class="code" href="a00795.html#649f047889466fbf1c8a191736711eb7">ContourValues</a>-><a class="code" href="a00330.html#b6ed9a0ad4920ab0202a8f658a1da320">SetNumberOfContours</a>(number);} <a name="l00187"></a>00187 <a name="l00189"></a>00189 <a name="l00190"></a><a class="code" href="a00795.html#7a7eb1deadf4f6a1bccba9e20702f6ce">00190</a> <span class="keyword">inline</span> <span class="keywordtype">int</span> <a class="code" href="a00795.html#7a7eb1deadf4f6a1bccba9e20702f6ce">vtkImageMarchingCubes::GetNumberOfContours</a>() <a name="l00191"></a>00191 {<span class="keywordflow">return</span> this-><a class="code" href="a00795.html#649f047889466fbf1c8a191736711eb7">ContourValues</a>-><a class="code" href="a00330.html#3da80320f6255bb9d32bfb35d2012507">GetNumberOfContours</a>();} <a name="l00193"></a>00193 <a name="l00195"></a>00195 <a name="l00197"></a><a class="code" href="a00795.html#f6dddb0cf6b85eaa4322dafec49ec16a">00197</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00795.html#f6dddb0cf6b85eaa4322dafec49ec16a">vtkImageMarchingCubes::GenerateValues</a>(<span class="keywordtype">int</span> numContours, <span class="keywordtype">double</span> <a class="code" href="a03761.html#c6551f7bf833e8254b2b3ecdaea0d21076786d084c43d32f242990f932679539">range</a>[2]) <a name="l00198"></a>00198 {this-><a class="code" href="a00795.html#649f047889466fbf1c8a191736711eb7">ContourValues</a>-><a class="code" href="a00330.html#a8d5613ee584e38211b8bbced32225e5">GenerateValues</a>(numContours, range);} <a name="l00200"></a>00200 <a name="l00202"></a>00202 <a name="l00204"></a><a class="code" href="a00795.html#74690b61d560012c78be5c529058f8ee">00204</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00795.html#f6dddb0cf6b85eaa4322dafec49ec16a">vtkImageMarchingCubes::GenerateValues</a>(<span class="keywordtype">int</span> numContours, <span class="keywordtype">double</span> <a name="l00205"></a>00205 rangeStart, <span class="keywordtype">double</span> rangeEnd) <a name="l00206"></a>00206 {this-><a class="code" href="a00795.html#649f047889466fbf1c8a191736711eb7">ContourValues</a>-><a class="code" href="a00330.html#a8d5613ee584e38211b8bbced32225e5">GenerateValues</a>(numContours, rangeStart, rangeEnd);} <a name="l00208"></a>00208 <a name="l00209"></a>00209 <span class="preprocessor">#endif</span> </pre></div></div> <hr size="1"><address style="text-align: right;"><small>Generated on Wed Jun 3 18:35:27 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>