<!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/Common/vtkStructuredVisibilityConstraint.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/Common/vtkStructuredVisibilityConstraint.h</h1><a href="a02138.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: vtkStructuredVisibilityConstraint.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="l00028"></a>00028 <span class="preprocessor">#ifndef __vtkStructuredVisibilityConstraint_h</span> <a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define __vtkStructuredVisibilityConstraint_h</span> <a name="l00030"></a>00030 <span class="preprocessor"></span> <a name="l00031"></a>00031 <span class="preprocessor">#include "<a class="code" href="a02079.html">vtkObject.h</a>"</span> <a name="l00032"></a>00032 <a name="l00033"></a>00033 <span class="preprocessor">#include "<a class="code" href="a02154.html">vtkUnsignedCharArray.h</a>"</span> <span class="comment">// Needed for inline methods.</span> <a name="l00034"></a>00034 <a name="l00035"></a><a class="code" href="a01644.html">00035</a> <span class="keyword">class </span><a class="code" href="a02170.html#873ca0b83d0838a1df577536068a1730">VTK_COMMON_EXPORT</a> <a class="code" href="a01644.html" title="helper object to manage the visibility of points and cells">vtkStructuredVisibilityConstraint</a> : <span class="keyword">public</span> <a class="code" href="a01084.html" title="abstract base class for most VTK objects">vtkObject</a> <a name="l00036"></a>00036 { <a name="l00037"></a>00037 <span class="keyword">public</span>: <a name="l00038"></a>00038 <span class="keyword">static</span> <a class="code" href="a01644.html" title="helper object to manage the visibility of points and cells">vtkStructuredVisibilityConstraint</a> *<a class="code" href="a01084.html#4d5b227267c076d6f9e38483370b6612">New</a>(); <a name="l00039"></a>00039 <a name="l00040"></a><a class="code" href="a01644.html#234cd94d5fb64cd9f772fd73840082af">00040</a> vtkTypeRevisionMacro(<a class="code" href="a01644.html" title="helper object to manage the visibility of points and cells">vtkStructuredVisibilityConstraint</a>,<a class="code" href="a01084.html" title="abstract base class for most VTK objects">vtkObject</a>); <a name="l00041"></a>00041 <span class="keywordtype">void</span> <a class="code" href="a01084.html#bf3dbb4154289b56a12483eee3866263">PrintSelf</a>(ostream& os, <a class="code" href="a00869.html" title="a simple class to control print indentation">vtkIndent</a> indent); <a name="l00042"></a>00042 <a name="l00044"></a>00044 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> IsVisible(<a class="code" href="a02149.html#20bd6b6dedfe1bbb096c50354d52cc7e">vtkIdType</a> <span class="keywordtype">id</span>); <a name="l00045"></a>00045 <a name="l00049"></a>00049 <span class="keywordtype">void</span> Blank(<a class="code" href="a02149.html#20bd6b6dedfe1bbb096c50354d52cc7e">vtkIdType</a> <span class="keywordtype">id</span>); <a name="l00050"></a>00050 <a name="l00052"></a>00052 <span class="keywordtype">void</span> UnBlank(<a class="code" href="a02149.html#20bd6b6dedfe1bbb096c50354d52cc7e">vtkIdType</a> <span class="keywordtype">id</span>); <a name="l00053"></a>00053 <a name="l00055"></a>00055 <a name="l00056"></a>00056 vtkGetVectorMacro(Dimensions,<span class="keywordtype">int</span>,3); <a name="l00058"></a>00058 <a name="l00061"></a>00061 <span class="keywordtype">void</span> Initialize(<span class="keywordtype">int</span> dims[3]); <a name="l00062"></a>00062 <a name="l00064"></a>00064 <a name="l00065"></a>00065 <span class="keywordtype">void</span> SetVisibilityById(<a class="code" href="a01784.html" title="dynamic, self-adjusting array of unsigned char">vtkUnsignedCharArray</a>* vis); <a name="l00066"></a>00066 vtkGetObjectMacro(VisibilityById, <a class="code" href="a01784.html" title="dynamic, self-adjusting array of unsigned char">vtkUnsignedCharArray</a>); <a name="l00068"></a>00068 <a name="l00071"></a>00071 <span class="keywordtype">void</span> ShallowCopy(<a class="code" href="a01644.html" title="helper object to manage the visibility of points and cells">vtkStructuredVisibilityConstraint</a>* src); <a name="l00072"></a>00072 <a name="l00074"></a>00074 <span class="keywordtype">void</span> DeepCopy(<a class="code" href="a01644.html" title="helper object to manage the visibility of points and cells">vtkStructuredVisibilityConstraint</a>* src); <a name="l00075"></a>00075 <a name="l00077"></a>00077 <a name="l00079"></a><a class="code" href="a01644.html#cfe04c06cc249df357683101b07dad2c">00079</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> IsConstrained() <a name="l00080"></a>00080 { <a name="l00081"></a>00081 <span class="keywordflow">return</span> this->VisibilityById ? 1 : 0; <a name="l00082"></a>00082 } <a name="l00084"></a>00084 <a name="l00085"></a>00085 <span class="keyword">protected</span>: <a name="l00086"></a>00086 <a class="code" href="a01644.html" title="helper object to manage the visibility of points and cells">vtkStructuredVisibilityConstraint</a>(); <a name="l00087"></a>00087 ~<a class="code" href="a01644.html" title="helper object to manage the visibility of points and cells">vtkStructuredVisibilityConstraint</a>(); <a name="l00088"></a>00088 <a name="l00089"></a><a class="code" href="a01644.html#870a7f65d86a81d1e26116282fdfbe7e">00089</a> <a class="code" href="a01784.html" title="dynamic, self-adjusting array of unsigned char">vtkUnsignedCharArray</a>* VisibilityById; <a name="l00090"></a><a class="code" href="a01644.html#3728c75891fa7c1c317a64503818ef6b">00090</a> <span class="keywordtype">int</span> Dimensions[3]; <a name="l00091"></a><a class="code" href="a01644.html#2fe4bc1a7b659b388d89ed03080e57ca">00091</a> <a class="code" href="a02149.html#20bd6b6dedfe1bbb096c50354d52cc7e">vtkIdType</a> NumberOfIds; <a name="l00092"></a><a class="code" href="a01644.html#1c1b9bbb6525da24be630c9ba3d7375f">00092</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> Initialized; <a name="l00093"></a>00093 <a name="l00094"></a>00094 <span class="keyword">private</span>: <a name="l00095"></a>00095 <a class="code" href="a01644.html" title="helper object to manage the visibility of points and cells">vtkStructuredVisibilityConstraint</a>(<span class="keyword">const</span> <a class="code" href="a01644.html" title="helper object to manage the visibility of points and cells">vtkStructuredVisibilityConstraint</a>&); <span class="comment">// Not implemented.</span> <a name="l00096"></a>00096 <span class="keywordtype">void</span> operator=(<span class="keyword">const</span> <a class="code" href="a01644.html" title="helper object to manage the visibility of points and cells">vtkStructuredVisibilityConstraint</a>&); <span class="comment">// Not implemented.</span> <a name="l00097"></a>00097 }; <a name="l00098"></a>00098 <a name="l00099"></a>00099 <span class="comment">//----------------------------------------------------------------------------</span> <a name="l00100"></a>00100 <span class="comment">// These methods are inline for efficiency.</span> <a name="l00101"></a>00101 <a name="l00102"></a>00102 <span class="comment">//----------------------------------------------------------------------------</span> <a name="l00103"></a><a class="code" href="a01644.html#63875565fe1c0ac3cda7c9ab9802fe1b">00103</a> <span class="keyword">inline</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> <a class="code" href="a01644.html#63875565fe1c0ac3cda7c9ab9802fe1b">vtkStructuredVisibilityConstraint::IsVisible</a>( <a name="l00104"></a>00104 <a class="code" href="a02149.html#20bd6b6dedfe1bbb096c50354d52cc7e">vtkIdType</a> <span class="keywordtype">id</span>) <a name="l00105"></a>00105 { <a name="l00106"></a>00106 <a class="code" href="a01784.html" title="dynamic, self-adjusting array of unsigned char">vtkUnsignedCharArray</a>* vis = this-><a class="code" href="a01644.html#870a7f65d86a81d1e26116282fdfbe7e">VisibilityById</a>; <a name="l00107"></a>00107 <span class="keywordflow">return</span> vis ? vis-><a class="code" href="a01784.html#7d0de62b4e403c59d8fe45e989340c3c">GetValue</a>(<span class="keywordtype">id</span>) : 1; <a name="l00108"></a>00108 } <a name="l00109"></a>00109 <a name="l00110"></a>00110 <span class="comment">//----------------------------------------------------------------------------</span> <a name="l00111"></a><a class="code" href="a01644.html#bafc8710ba22eb06ea2c74a5dc0b942b">00111</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a01644.html#bafc8710ba22eb06ea2c74a5dc0b942b">vtkStructuredVisibilityConstraint::Blank</a>(<a class="code" href="a02149.html#20bd6b6dedfe1bbb096c50354d52cc7e">vtkIdType</a> <span class="keywordtype">id</span>) <a name="l00112"></a>00112 { <a name="l00113"></a>00113 <a class="code" href="a01784.html" title="dynamic, self-adjusting array of unsigned char">vtkUnsignedCharArray</a>* vis = this-><a class="code" href="a01644.html#870a7f65d86a81d1e26116282fdfbe7e">VisibilityById</a>; <a name="l00114"></a>00114 <span class="keywordflow">if</span> (!vis) <a name="l00115"></a>00115 { <a name="l00116"></a>00116 this-><a class="code" href="a01644.html#870a7f65d86a81d1e26116282fdfbe7e">VisibilityById</a> = <a class="code" href="a01784.html#05d70c61ce6f26110f31810d60f0b94c">vtkUnsignedCharArray::New</a>(); <a name="l00117"></a>00117 vis = this-><a class="code" href="a01644.html#870a7f65d86a81d1e26116282fdfbe7e">VisibilityById</a>; <a name="l00118"></a>00118 this-><a class="code" href="a01644.html#870a7f65d86a81d1e26116282fdfbe7e">VisibilityById</a>-><a class="code" href="a00081.html#32fada05de0585fa2d16e9aea8932719">SetNumberOfTuples</a>(this-><a class="code" href="a01644.html#2fe4bc1a7b659b388d89ed03080e57ca">NumberOfIds</a>); <a name="l00119"></a>00119 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i=0; i<this-><a class="code" href="a01644.html#2fe4bc1a7b659b388d89ed03080e57ca">NumberOfIds</a>; ++i) <a name="l00120"></a>00120 { <a name="l00121"></a>00121 this-><a class="code" href="a01644.html#870a7f65d86a81d1e26116282fdfbe7e">VisibilityById</a>-><a class="code" href="a01784.html#1715de5ed54ad4c97d3eaf78b4c6c25f">SetValue</a>(i, 1); <a name="l00122"></a>00122 } <a name="l00123"></a>00123 } <a name="l00124"></a>00124 vis-><a class="code" href="a01784.html#1715de5ed54ad4c97d3eaf78b4c6c25f">SetValue</a>(<span class="keywordtype">id</span>, 0); <a name="l00125"></a>00125 } <a name="l00126"></a>00126 <a name="l00127"></a>00127 <span class="comment">//----------------------------------------------------------------------------</span> <a name="l00128"></a><a class="code" href="a01644.html#8d12d87893076b9f8145aea70b8da14a">00128</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a01644.html#8d12d87893076b9f8145aea70b8da14a">vtkStructuredVisibilityConstraint::UnBlank</a>(<a class="code" href="a02149.html#20bd6b6dedfe1bbb096c50354d52cc7e">vtkIdType</a> <span class="keywordtype">id</span>) <a name="l00129"></a>00129 { <a name="l00130"></a>00130 <a class="code" href="a01784.html" title="dynamic, self-adjusting array of unsigned char">vtkUnsignedCharArray</a>* vis = this-><a class="code" href="a01644.html#870a7f65d86a81d1e26116282fdfbe7e">VisibilityById</a>; <a name="l00131"></a>00131 <span class="keywordflow">if</span> (!vis) <a name="l00132"></a>00132 { <a name="l00133"></a>00133 <span class="keywordflow">return</span>; <a name="l00134"></a>00134 } <a name="l00135"></a>00135 vis-><a class="code" href="a01784.html#1715de5ed54ad4c97d3eaf78b4c6c25f">SetValue</a>(<span class="keywordtype">id</span>, 1); <a name="l00136"></a>00136 } <a name="l00137"></a>00137 <a name="l00138"></a>00138 <span class="comment">//----------------------------------------------------------------------------</span> <a name="l00139"></a><a class="code" href="a01644.html#efddeafe845888523a84f105b6bb8824">00139</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a01644.html#efddeafe845888523a84f105b6bb8824">vtkStructuredVisibilityConstraint::Initialize</a>(<span class="keywordtype">int</span> dims[3]) <a name="l00140"></a>00140 { <a name="l00141"></a>00141 <span class="keywordflow">if</span> (this-><a class="code" href="a01644.html#1c1b9bbb6525da24be630c9ba3d7375f">Initialized</a>) <a name="l00142"></a>00142 { <a name="l00143"></a>00143 <span class="keywordflow">return</span>; <a name="l00144"></a>00144 } <a name="l00145"></a>00145 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i=0; i<3; i++) <a name="l00146"></a>00146 { <a name="l00147"></a>00147 this-><a class="code" href="a01644.html#3728c75891fa7c1c317a64503818ef6b">Dimensions</a>[i] = dims[i]; <a name="l00148"></a>00148 } <a name="l00149"></a>00149 this-><a class="code" href="a01644.html#2fe4bc1a7b659b388d89ed03080e57ca">NumberOfIds</a> = <span class="keyword">static_cast<</span><a class="code" href="a02149.html#20bd6b6dedfe1bbb096c50354d52cc7e">vtkIdType</a><span class="keyword">></span>(dims[0])* <a name="l00150"></a>00150 static_cast<vtkIdType>(dims[1])* <a name="l00151"></a>00151 <span class="keyword">static_cast<</span><a class="code" href="a02149.html#20bd6b6dedfe1bbb096c50354d52cc7e">vtkIdType</a><span class="keyword">></span>(dims[2]); <a name="l00152"></a>00152 this-><a class="code" href="a01644.html#1c1b9bbb6525da24be630c9ba3d7375f">Initialized</a> = 1; <a name="l00153"></a>00153 } <a name="l00154"></a>00154 <a name="l00155"></a>00155 <span class="preprocessor">#endif</span> <a name="l00156"></a>00156 <span class="preprocessor"></span> </pre></div></div> <hr size="1"><address style="text-align: right;"><small>Generated on Wed Jun 3 18:35:13 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>