Sophie

Sophie

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

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/Common/vtkCollection.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/Common/vtkCollection.h</h1><a href="a01997.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: vtkCollection.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="l00030"></a>00030 <span class="preprocessor">#ifndef __vtkCollection_h</span>
<a name="l00031"></a>00031 <span class="preprocessor"></span><span class="preprocessor">#define __vtkCollection_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="comment">//BTX - begin tcl exclude</span>
<a name="l00036"></a><a class="code" href="a00286.html">00036</a> <span class="keyword">class </span><a class="code" href="a00286.html">vtkCollectionElement</a> <span class="comment">//;prevents pick-up by man page generator</span>
<a name="l00037"></a>00037 {
<a name="l00038"></a>00038  <span class="keyword">public</span>:
<a name="l00039"></a><a class="code" href="a00286.html#76005ac8ef782f09232b3031f7c1c4b2">00039</a>   <a class="code" href="a00286.html#db786f57837a129bb3e09e3f6fc67bf8">vtkCollectionElement</a>():<a class="code" href="a00286.html#76005ac8ef782f09232b3031f7c1c4b2">Item</a>(NULL),<a class="code" href="a00286.html#3b4d49675400a7da0f136338a18e3549">Next</a>(NULL) {};
<a name="l00040"></a>00040   <a class="code" href="a01084.html" title="abstract base class for most VTK objects">vtkObject</a> *<a class="code" href="a00286.html#76005ac8ef782f09232b3031f7c1c4b2">Item</a>;
<a name="l00041"></a><a class="code" href="a00286.html#3b4d49675400a7da0f136338a18e3549">00041</a>   <a class="code" href="a00286.html">vtkCollectionElement</a> *<a class="code" href="a00286.html#3b4d49675400a7da0f136338a18e3549">Next</a>;
<a name="l00042"></a>00042 };
<a name="l00043"></a><a class="code" href="a01997.html#e6d08cf20cab6c3fff58d3854486e9e4">00043</a> <span class="keyword">typedef</span> <span class="keywordtype">void</span> * <a class="code" href="a01997.html#e6d08cf20cab6c3fff58d3854486e9e4">vtkCollectionSimpleIterator</a>;
<a name="l00044"></a>00044 <span class="comment">//ETX end tcl exclude</span>
<a name="l00045"></a>00045 
<a name="l00046"></a>00046 <span class="keyword">class </span><a class="code" href="a00287.html" title="iterator through a vtkCollection.">vtkCollectionIterator</a>;
<a name="l00047"></a>00047 
<a name="l00048"></a><a class="code" href="a00285.html">00048</a> <span class="keyword">class </span><a class="code" href="a02170.html#873ca0b83d0838a1df577536068a1730">VTK_COMMON_EXPORT</a> <a class="code" href="a00285.html" title="create and manipulate unsorted lists of objects">vtkCollection</a> : <span class="keyword">public</span> <a class="code" href="a01084.html" title="abstract base class for most VTK objects">vtkObject</a>
<a name="l00049"></a>00049 {
<a name="l00050"></a>00050 <span class="keyword">public</span>:
<a name="l00051"></a><a class="code" href="a00285.html#6f58f8e81f0bf6117532fded21d224ec">00051</a>   vtkTypeRevisionMacro(<a class="code" href="a00285.html" title="create and manipulate unsorted lists of objects">vtkCollection</a>,<a class="code" href="a01084.html" title="abstract base class for most VTK objects">vtkObject</a>);
<a name="l00052"></a>00052   <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="l00053"></a>00053 
<a name="l00055"></a>00055   <span class="keyword">static</span> <a class="code" href="a00285.html" title="create and manipulate unsorted lists of objects">vtkCollection</a> *<a class="code" href="a01084.html#4d5b227267c076d6f9e38483370b6612">New</a>();
<a name="l00056"></a>00056 
<a name="l00058"></a>00058   <span class="keywordtype">void</span> AddItem(<a class="code" href="a01084.html" title="abstract base class for most VTK objects">vtkObject</a> *);
<a name="l00059"></a>00059 
<a name="l00063"></a>00063   <span class="keywordtype">void</span> InsertItem(<span class="keywordtype">int</span> i, <a class="code" href="a01084.html" title="abstract base class for most VTK objects">vtkObject</a> *);
<a name="l00064"></a>00064 
<a name="l00066"></a>00066   <span class="keywordtype">void</span> ReplaceItem(<span class="keywordtype">int</span> i, <a class="code" href="a01084.html" title="abstract base class for most VTK objects">vtkObject</a> *);
<a name="l00067"></a>00067 
<a name="l00073"></a>00073   <span class="keywordtype">void</span> RemoveItem(<span class="keywordtype">int</span> i);
<a name="l00074"></a>00074 
<a name="l00078"></a>00078   <span class="keywordtype">void</span> RemoveItem(<a class="code" href="a01084.html" title="abstract base class for most VTK objects">vtkObject</a> *);
<a name="l00079"></a>00079 
<a name="l00081"></a>00081   <span class="keywordtype">void</span> RemoveAllItems();
<a name="l00082"></a>00082 
<a name="l00086"></a>00086   <span class="keywordtype">int</span> IsItemPresent(<a class="code" href="a01084.html" title="abstract base class for most VTK objects">vtkObject</a> *a);
<a name="l00087"></a>00087 
<a name="l00089"></a>00089   <span class="keywordtype">int</span>  GetNumberOfItems();
<a name="l00090"></a>00090 
<a name="l00093"></a><a class="code" href="a00285.html#b32673bd7df9bf87451952ac4aaacb30">00093</a>   <span class="keywordtype">void</span> InitTraversal() { this-&gt;Current = this-&gt;Top;};
<a name="l00094"></a>00094 
<a name="l00095"></a>00095   <span class="comment">//BTX</span>
<a name="l00097"></a>00097 <span class="comment"></span>
<a name="l00099"></a><a class="code" href="a00285.html#dc2aeccc68b0c9794ee444be53f00828">00099</a>   <span class="keywordtype">void</span> InitTraversal(<a class="code" href="a01997.html#e6d08cf20cab6c3fff58d3854486e9e4">vtkCollectionSimpleIterator</a> &amp;cookie) {
<a name="l00100"></a>00100     cookie = <span class="keyword">static_cast&lt;</span><a class="code" href="a01997.html#e6d08cf20cab6c3fff58d3854486e9e4">vtkCollectionSimpleIterator</a><span class="keyword">&gt;</span>(this-&gt;Top);};
<a name="l00101"></a>00101   <span class="comment">//ETX</span>
<a name="l00103"></a>00103 <span class="comment"></span>
<a name="l00106"></a>00106   <a class="code" href="a01084.html" title="abstract base class for most VTK objects">vtkObject</a> *GetNextItemAsObject();  
<a name="l00107"></a>00107 
<a name="l00110"></a>00110   <a class="code" href="a01084.html" title="abstract base class for most VTK objects">vtkObject</a> *GetItemAsObject(<span class="keywordtype">int</span> i);
<a name="l00111"></a>00111 
<a name="l00112"></a>00112   <span class="comment">//BTX</span>
<a name="l00114"></a>00114 <span class="comment"></span>
<a name="l00116"></a>00116   <a class="code" href="a01084.html" title="abstract base class for most VTK objects">vtkObject</a> *GetNextItemAsObject(<a class="code" href="a01997.html#e6d08cf20cab6c3fff58d3854486e9e4">vtkCollectionSimpleIterator</a> &amp;cookie);
<a name="l00117"></a>00117   <span class="comment">//ETX</span>
<a name="l00119"></a>00119 <span class="comment"></span>  
<a name="l00121"></a>00121   <a class="code" href="a00287.html" title="iterator through a vtkCollection.">vtkCollectionIterator</a>* NewIterator();
<a name="l00122"></a>00122 
<a name="l00124"></a>00124 
<a name="l00125"></a>00125   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="a01085.html#830c927684d2b23593ec447f1c274f57">Register</a>(<a class="code" href="a01085.html" title="abstract base class for most VTK objects">vtkObjectBase</a>* o);
<a name="l00126"></a>00126   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="a01085.html#2f77b7beccf178c43570367c50c41567">UnRegister</a>(<a class="code" href="a01085.html" title="abstract base class for most VTK objects">vtkObjectBase</a>* o);
<a name="l00128"></a>00128 <span class="keyword">protected</span>:
<a name="l00129"></a>00129   <a class="code" href="a00285.html" title="create and manipulate unsorted lists of objects">vtkCollection</a>();
<a name="l00130"></a>00130   ~<a class="code" href="a00285.html" title="create and manipulate unsorted lists of objects">vtkCollection</a>();
<a name="l00131"></a>00131 
<a name="l00132"></a>00132   <span class="keyword">virtual</span> <span class="keywordtype">void</span> DeleteElement(<a class="code" href="a00286.html">vtkCollectionElement</a> *); 
<a name="l00133"></a><a class="code" href="a00285.html#98deba6fde0f78b021beef8977f4f394">00133</a>   <span class="keywordtype">int</span> NumberOfItems;
<a name="l00134"></a><a class="code" href="a00285.html#a0dccbfb7a6f62d090f2829fae6b5398">00134</a>   <a class="code" href="a00286.html">vtkCollectionElement</a> *Top;
<a name="l00135"></a><a class="code" href="a00285.html#9480ecd2de244222c1d4fd3b627e61b3">00135</a>   <a class="code" href="a00286.html">vtkCollectionElement</a> *Bottom;
<a name="l00136"></a><a class="code" href="a00285.html#f4f3d176db0eb0147fd6b37d6443598d">00136</a>   <a class="code" href="a00286.html">vtkCollectionElement</a> *Current;
<a name="l00137"></a>00137 
<a name="l00138"></a>00138   <span class="comment">//BTX</span>
<a name="l00139"></a><a class="code" href="a00285.html#797970247d74d0e9d049187b06715728">00139</a>   <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="a00287.html" title="iterator through a vtkCollection.">vtkCollectionIterator</a>;
<a name="l00140"></a>00140   <span class="comment">//ETX</span>
<a name="l00141"></a>00141 
<a name="l00142"></a>00142   <span class="comment">// See vtkGarbageCollector.h:</span>
<a name="l00143"></a>00143   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="a01085.html#c6aa962bedb220056f91add33044f24e">ReportReferences</a>(<a class="code" href="a00572.html" title="Detect and break reference loops.">vtkGarbageCollector</a>* collector);
<a name="l00144"></a>00144 <span class="keyword">private</span>:
<a name="l00145"></a>00145   <a class="code" href="a00285.html" title="create and manipulate unsorted lists of objects">vtkCollection</a>(<span class="keyword">const</span> <a class="code" href="a00285.html" title="create and manipulate unsorted lists of objects">vtkCollection</a>&amp;); <span class="comment">// Not implemented</span>
<a name="l00146"></a>00146   <span class="keywordtype">void</span> operator=(<span class="keyword">const</span> <a class="code" href="a00285.html" title="create and manipulate unsorted lists of objects">vtkCollection</a>&amp;); <span class="comment">// Not implemented</span>
<a name="l00147"></a>00147 };
<a name="l00148"></a>00148 
<a name="l00149"></a>00149 
<a name="l00150"></a><a class="code" href="a00285.html#edfc4ec55e787ee7fd1620fd70259282">00150</a> <span class="keyword">inline</span> <a class="code" href="a01084.html" title="abstract base class for most VTK objects">vtkObject</a> *<a class="code" href="a00285.html#edfc4ec55e787ee7fd1620fd70259282">vtkCollection::GetNextItemAsObject</a>()
<a name="l00151"></a>00151 {
<a name="l00152"></a>00152   <a class="code" href="a00286.html">vtkCollectionElement</a> *elem=this-&gt;<a class="code" href="a00285.html#f4f3d176db0eb0147fd6b37d6443598d">Current</a>;
<a name="l00153"></a>00153 
<a name="l00154"></a>00154   <span class="keywordflow">if</span> ( elem != NULL )
<a name="l00155"></a>00155     {
<a name="l00156"></a>00156     this-&gt;<a class="code" href="a00285.html#f4f3d176db0eb0147fd6b37d6443598d">Current</a> = elem-&gt;<a class="code" href="a00286.html#3b4d49675400a7da0f136338a18e3549">Next</a>;
<a name="l00157"></a>00157     <span class="keywordflow">return</span> elem-&gt;<a class="code" href="a00286.html#76005ac8ef782f09232b3031f7c1c4b2">Item</a>;
<a name="l00158"></a>00158     }
<a name="l00159"></a>00159   <span class="keywordflow">else</span>
<a name="l00160"></a>00160     {
<a name="l00161"></a>00161     <span class="keywordflow">return</span> NULL;
<a name="l00162"></a>00162     }
<a name="l00163"></a>00163 }
<a name="l00164"></a>00164 
<a name="l00165"></a><a class="code" href="a00285.html#dab5339e47188f1d94a3a8b114f09be7">00165</a> <span class="keyword">inline</span> <a class="code" href="a01084.html" title="abstract base class for most VTK objects">vtkObject</a> *<a class="code" href="a00285.html#edfc4ec55e787ee7fd1620fd70259282">vtkCollection::GetNextItemAsObject</a>(<span class="keywordtype">void</span> *&amp;cookie)
<a name="l00166"></a>00166 {
<a name="l00167"></a>00167   <a class="code" href="a00286.html">vtkCollectionElement</a> *elem=<span class="keyword">static_cast&lt;</span><a class="code" href="a00286.html">vtkCollectionElement</a> *<span class="keyword">&gt;</span>(cookie);
<a name="l00168"></a>00168 
<a name="l00169"></a>00169   <span class="keywordflow">if</span> ( elem != NULL )
<a name="l00170"></a>00170     {
<a name="l00171"></a>00171     cookie = <span class="keyword">static_cast&lt;</span><span class="keywordtype">void</span> *<span class="keyword">&gt;</span>(elem-&gt;<a class="code" href="a00286.html#3b4d49675400a7da0f136338a18e3549">Next</a>);
<a name="l00172"></a>00172     <span class="keywordflow">return</span> elem-&gt;<a class="code" href="a00286.html#76005ac8ef782f09232b3031f7c1c4b2">Item</a>;
<a name="l00173"></a>00173     }
<a name="l00174"></a>00174   <span class="keywordflow">else</span>
<a name="l00175"></a>00175     {
<a name="l00176"></a>00176     <span class="keywordflow">return</span> NULL;
<a name="l00177"></a>00177     }
<a name="l00178"></a>00178 }
<a name="l00179"></a>00179 
<a name="l00180"></a>00180 <span class="preprocessor">#endif</span>
<a name="l00181"></a>00181 <span class="preprocessor"></span>
<a name="l00182"></a>00182 
<a name="l00183"></a>00183 
<a name="l00184"></a>00184 
<a name="l00185"></a>00185 
</pre></div></div>
<hr size="1"><address style="text-align: right;"><small>Generated on Wed Jun 3 18:35:09 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>