VTK
dox/Filtering/vtkTreeBFSIterator.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkTreeBFSIterator.h,v $
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00015 
00033 #ifndef __vtkTreeBFSIterator_h
00034 #define __vtkTreeBFSIterator_h
00035 
00036 #include "vtkObject.h"
00037 
00038 class vtkTree;
00039 class vtkTreeBFSIteratorInternals;
00040 class vtkIntArray;
00041 class vtkIdList;
00042 
00043 class VTK_FILTERING_EXPORT vtkTreeBFSIterator : public vtkObject
00044 {
00045 public:
00046   static vtkTreeBFSIterator* New();
00047   vtkTypeMacro(vtkTreeBFSIterator, vtkObject);
00048   void PrintSelf(ostream& os, vtkIndent indent);
00049 
00050   //BTX
00051   enum ModeType
00052     {
00053     DISCOVER,
00054     FINISH
00055     };
00056   //ETX
00057 
00059   void SetTree(vtkTree* graph);
00060 
00062 
00067   void SetMode(int mode);
00068   vtkGetMacro(Mode, int);
00070 
00072 
00075   void SetStartVertex(vtkIdType vertex);
00076   vtkGetMacro(StartVertex, vtkIdType);
00078 
00080   vtkIdType Next();
00081 
00083   bool HasNext();
00084 
00085 protected:
00086   vtkTreeBFSIterator();
00087   ~vtkTreeBFSIterator();
00088 
00089   void Initialize();
00090   vtkIdType NextInternal();
00091 
00092   vtkTree* Tree;
00093   int Mode;
00094   vtkIdType StartVertex;
00095   vtkIdType CurRoot;
00096   vtkTreeBFSIteratorInternals* Internals;
00097   vtkIntArray* Color;
00098   vtkIdType NextId;
00099 
00100   //BTX
00101   enum ColorType
00102     {
00103     WHITE,
00104     GRAY,
00105     BLACK
00106     };
00107   //ETX
00108 
00109 private:
00110   vtkTreeBFSIterator(const vtkTreeBFSIterator &);  // Not implemented.
00111   void operator=(const vtkTreeBFSIterator &);        // Not implemented.
00112 };
00113 
00114 #endif