<!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/vtkMarchingCubes.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/vtkMarchingCubes.h</h1><a href="a02590.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: vtkMarchingCubes.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="l00035"></a>00035 <span class="preprocessor">#ifndef __vtkMarchingCubes_h</span> <a name="l00036"></a>00036 <span class="preprocessor"></span><span class="preprocessor">#define __vtkMarchingCubes_h</span> <a name="l00037"></a>00037 <span class="preprocessor"></span> <a name="l00038"></a>00038 <span class="preprocessor">#include "<a class="code" href="a02331.html">vtkPolyDataAlgorithm.h</a>"</span> <a name="l00039"></a>00039 <a name="l00040"></a>00040 <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="l00041"></a>00041 <a name="l00042"></a>00042 <span class="keyword">class </span><a class="code" href="a01247.html" title="quickly locate points in 3-space">vtkPointLocator</a>; <a name="l00043"></a>00043 <a name="l00044"></a><a class="code" href="a00988.html">00044</a> <span class="keyword">class </span><a class="code" href="a02170.html#c3c1ffe2fe47b9b70ba90182b7860cce">VTK_GRAPHICS_EXPORT</a> <a class="code" href="a00988.html" title="generate isosurface(s) from volume">vtkMarchingCubes</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="l00045"></a>00045 { <a name="l00046"></a>00046 <span class="keyword">public</span>: <a name="l00047"></a>00047 <span class="keyword">static</span> <a class="code" href="a00988.html" title="generate isosurface(s) from volume">vtkMarchingCubes</a> *<a class="code" href="a01261.html#cf785ac526132296ff652c636f713b5e">New</a>(); <a name="l00048"></a><a class="code" href="a00988.html#73f65820e4ca7d2a3d6b8c8d7bff4822">00048</a> vtkTypeRevisionMacro(<a class="code" href="a00988.html" title="generate isosurface(s) from volume">vtkMarchingCubes</a>,<a class="code" href="a01261.html" title="Superclass for algorithms that produce only polydata as output.">vtkPolyDataAlgorithm</a>); <a name="l00049"></a>00049 <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="l00050"></a>00050 <a name="l00051"></a>00051 <span class="comment">// Methods to set contour values</span> <a name="l00052"></a>00052 <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="l00053"></a>00053 <span class="keywordtype">double</span> GetValue(<span class="keywordtype">int</span> i); <a name="l00054"></a>00054 <span class="keywordtype">double</span> *GetValues(); <a name="l00055"></a>00055 <span class="keywordtype">void</span> GetValues(<span class="keywordtype">double</span> *contourValues); <a name="l00056"></a>00056 <span class="keywordtype">void</span> SetNumberOfContours(<span class="keywordtype">int</span> number); <a name="l00057"></a>00057 <span class="keywordtype">int</span> GetNumberOfContours(); <a name="l00058"></a>00058 <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="l00059"></a>00059 <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="l00060"></a>00060 <a name="l00061"></a>00061 <span class="comment">// Because we delegate to vtkContourValues</span> <a name="l00062"></a>00062 <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="l00063"></a>00063 <a name="l00065"></a>00065 <a name="l00069"></a>00069 vtkSetMacro(ComputeNormals,<span class="keywordtype">int</span>); <a name="l00070"></a>00070 vtkGetMacro(ComputeNormals,<span class="keywordtype">int</span>); <a name="l00071"></a>00071 vtkBooleanMacro(ComputeNormals,<span class="keywordtype">int</span>); <a name="l00073"></a>00073 <a name="l00075"></a>00075 <a name="l00081"></a>00081 vtkSetMacro(ComputeGradients,<span class="keywordtype">int</span>); <a name="l00082"></a>00082 vtkGetMacro(ComputeGradients,<span class="keywordtype">int</span>); <a name="l00083"></a>00083 vtkBooleanMacro(ComputeGradients,<span class="keywordtype">int</span>); <a name="l00085"></a>00085 <a name="l00087"></a>00087 <a name="l00088"></a>00088 vtkSetMacro(ComputeScalars,<span class="keywordtype">int</span>); <a name="l00089"></a>00089 vtkGetMacro(ComputeScalars,<span class="keywordtype">int</span>); <a name="l00090"></a>00090 vtkBooleanMacro(ComputeScalars,<span class="keywordtype">int</span>); <a name="l00092"></a>00092 <a name="l00094"></a>00094 <a name="l00096"></a>00096 <span class="keywordtype">void</span> SetLocator(<a class="code" href="a01247.html" title="quickly locate points in 3-space">vtkPointLocator</a> *locator); <a name="l00097"></a>00097 vtkGetObjectMacro(Locator,<a class="code" href="a01247.html" title="quickly locate points in 3-space">vtkPointLocator</a>); <a name="l00099"></a>00099 <a name="l00102"></a>00102 <span class="keywordtype">void</span> CreateDefaultLocator(); <a name="l00103"></a>00103 <a name="l00104"></a>00104 <span class="keyword">protected</span>: <a name="l00105"></a>00105 <a class="code" href="a00988.html" title="generate isosurface(s) from volume">vtkMarchingCubes</a>(); <a name="l00106"></a>00106 ~<a class="code" href="a00988.html" title="generate isosurface(s) from volume">vtkMarchingCubes</a>(); <a name="l00107"></a>00107 <a name="l00108"></a>00108 <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="l00109"></a>00109 <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="l00110"></a>00110 <a name="l00111"></a><a class="code" href="a00988.html#c792953ffe02b8fa0d079b59ae3a4f43">00111</a> <a class="code" href="a00330.html" title="helper object to manage setting and generating contour values">vtkContourValues</a> *ContourValues; <a name="l00112"></a><a class="code" href="a00988.html#0b4098ead85825192f89db09411bb510">00112</a> <span class="keywordtype">int</span> ComputeNormals; <a name="l00113"></a><a class="code" href="a00988.html#61e2d13dcfca2053290663fd683b0690">00113</a> <span class="keywordtype">int</span> ComputeGradients; <a name="l00114"></a><a class="code" href="a00988.html#7cf4572549b3d77e5faed8314bfd78af">00114</a> <span class="keywordtype">int</span> ComputeScalars; <a name="l00115"></a><a class="code" href="a00988.html#068c62e1c14b382438fe823acc836028">00115</a> <a class="code" href="a01247.html" title="quickly locate points in 3-space">vtkPointLocator</a> *Locator; <a name="l00116"></a>00116 <span class="keyword">private</span>: <a name="l00117"></a>00117 <a class="code" href="a00988.html" title="generate isosurface(s) from volume">vtkMarchingCubes</a>(<span class="keyword">const</span> <a class="code" href="a00988.html" title="generate isosurface(s) from volume">vtkMarchingCubes</a>&); <span class="comment">// Not implemented.</span> <a name="l00118"></a>00118 <span class="keywordtype">void</span> operator=(<span class="keyword">const</span> <a class="code" href="a00988.html" title="generate isosurface(s) from volume">vtkMarchingCubes</a>&); <span class="comment">// Not implemented.</span> <a name="l00119"></a>00119 }; <a name="l00120"></a>00120 <a name="l00123"></a><a class="code" href="a00988.html#fd541e392d09571aac3a58ac2abee287">00123</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00988.html#fd541e392d09571aac3a58ac2abee287">vtkMarchingCubes::SetValue</a>(<span class="keywordtype">int</span> i, <span class="keywordtype">double</span> <a class="code" href="a03761.html#c6551f7bf833e8254b2b3ecdaea0d2106bf5e5151797630e91167caab3f22b9a">value</a>) <a name="l00124"></a>00124 {this-><a class="code" href="a00988.html#c792953ffe02b8fa0d079b59ae3a4f43">ContourValues</a>-><a class="code" href="a00330.html#c9adf286086d681d6b80da610fd2bc5b">SetValue</a>(i,value);} <a name="l00125"></a>00125 <a name="l00127"></a>00127 <a name="l00128"></a><a class="code" href="a00988.html#c3c1caae6b9c2727a72f9bbe787d6860">00128</a> <span class="keyword">inline</span> <span class="keywordtype">double</span> <a class="code" href="a00988.html#c3c1caae6b9c2727a72f9bbe787d6860">vtkMarchingCubes::GetValue</a>(<span class="keywordtype">int</span> i) <a name="l00129"></a>00129 {<span class="keywordflow">return</span> this-><a class="code" href="a00988.html#c792953ffe02b8fa0d079b59ae3a4f43">ContourValues</a>-><a class="code" href="a00330.html#e1beb054c144c1eb5c65ef65ce9010dc">GetValue</a>(i);} <a name="l00131"></a>00131 <a name="l00133"></a>00133 <a name="l00135"></a><a class="code" href="a00988.html#a7ff877c85f45e608b4f6ec19025cd95">00135</a> <span class="keyword">inline</span> <span class="keywordtype">double</span> *<a class="code" href="a00988.html#a7ff877c85f45e608b4f6ec19025cd95">vtkMarchingCubes::GetValues</a>() <a name="l00136"></a>00136 {<span class="keywordflow">return</span> this-><a class="code" href="a00988.html#c792953ffe02b8fa0d079b59ae3a4f43">ContourValues</a>-><a class="code" href="a00330.html#f5488942a61e6465a4e155f956b1b110">GetValues</a>();} <a name="l00138"></a>00138 <a name="l00142"></a><a class="code" href="a00988.html#e57f91d966b91eb4e3edf7025ceb7d19">00142</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00988.html#a7ff877c85f45e608b4f6ec19025cd95">vtkMarchingCubes::GetValues</a>(<span class="keywordtype">double</span> *contourValues) <a name="l00143"></a>00143 {this-><a class="code" href="a00988.html#c792953ffe02b8fa0d079b59ae3a4f43">ContourValues</a>-><a class="code" href="a00330.html#f5488942a61e6465a4e155f956b1b110">GetValues</a>(contourValues);} <a name="l00144"></a>00144 <a name="l00148"></a><a class="code" href="a00988.html#e03509d1392e483051ebf24f1792abf5">00148</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00988.html#e03509d1392e483051ebf24f1792abf5">vtkMarchingCubes::SetNumberOfContours</a>(<span class="keywordtype">int</span> number) <a name="l00149"></a>00149 {this-><a class="code" href="a00988.html#c792953ffe02b8fa0d079b59ae3a4f43">ContourValues</a>-><a class="code" href="a00330.html#b6ed9a0ad4920ab0202a8f658a1da320">SetNumberOfContours</a>(number);} <a name="l00150"></a>00150 <a name="l00152"></a>00152 <a name="l00153"></a><a class="code" href="a00988.html#af75337c020de859b36eb8ede9922782">00153</a> <span class="keyword">inline</span> <span class="keywordtype">int</span> <a class="code" href="a00988.html#af75337c020de859b36eb8ede9922782">vtkMarchingCubes::GetNumberOfContours</a>() <a name="l00154"></a>00154 {<span class="keywordflow">return</span> this-><a class="code" href="a00988.html#c792953ffe02b8fa0d079b59ae3a4f43">ContourValues</a>-><a class="code" href="a00330.html#3da80320f6255bb9d32bfb35d2012507">GetNumberOfContours</a>();} <a name="l00156"></a>00156 <a name="l00158"></a>00158 <a name="l00160"></a><a class="code" href="a00988.html#92ce26bc315f9746ba00ac653d390603">00160</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00988.html#92ce26bc315f9746ba00ac653d390603">vtkMarchingCubes::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="l00161"></a>00161 {this-><a class="code" href="a00988.html#c792953ffe02b8fa0d079b59ae3a4f43">ContourValues</a>-><a class="code" href="a00330.html#a8d5613ee584e38211b8bbced32225e5">GenerateValues</a>(numContours, range);} <a name="l00163"></a>00163 <a name="l00165"></a>00165 <a name="l00167"></a><a class="code" href="a00988.html#816f38edbca32ae62fb6b1ac4b4d0a81">00167</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00988.html#92ce26bc315f9746ba00ac653d390603">vtkMarchingCubes::GenerateValues</a>(<span class="keywordtype">int</span> numContours, <span class="keywordtype">double</span> <a name="l00168"></a>00168 rangeStart, <span class="keywordtype">double</span> rangeEnd) <a name="l00169"></a>00169 {this-><a class="code" href="a00988.html#c792953ffe02b8fa0d079b59ae3a4f43">ContourValues</a>-><a class="code" href="a00330.html#a8d5613ee584e38211b8bbced32225e5">GenerateValues</a>(numContours, rangeStart, rangeEnd);} <a name="l00171"></a>00171 <a name="l00172"></a>00172 <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>