00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkTreeDFSIterator.h 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 /*------------------------------------------------------------------------- 00016 Copyright 2008 Sandia Corporation. 00017 Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, 00018 the U.S. Government retains certain rights in this software. 00019 -------------------------------------------------------------------------*/ 00036 #ifndef __vtkTreeDFSIterator_h 00037 #define __vtkTreeDFSIterator_h 00038 00039 #include "vtkObject.h" 00040 00041 class vtkTree; 00042 class vtkTreeDFSIteratorInternals; 00043 class vtkIntArray; 00044 class vtkIdList; 00045 00046 class VTK_FILTERING_EXPORT vtkTreeDFSIterator : public vtkObject 00047 { 00048 public: 00049 static vtkTreeDFSIterator* New(); 00050 vtkTypeMacro(vtkTreeDFSIterator, vtkObject); 00051 void PrintSelf(ostream& os, vtkIndent indent); 00052 00053 //BTX 00054 enum ModeType 00055 { 00056 DISCOVER, 00057 FINISH 00058 }; 00059 //ETX 00060 00062 void SetTree(vtkTree* graph); 00063 00065 00070 void SetMode(int mode); 00071 vtkGetMacro(Mode, int); 00073 00075 00078 void SetStartVertex(vtkIdType vertex); 00079 vtkGetMacro(StartVertex, vtkIdType); 00081 00083 vtkIdType Next(); 00084 00086 bool HasNext(); 00087 00088 protected: 00089 vtkTreeDFSIterator(); 00090 ~vtkTreeDFSIterator(); 00091 00092 void Initialize(); 00093 vtkIdType NextInternal(); 00094 00095 vtkTree* Tree; 00096 int Mode; 00097 vtkIdType StartVertex; 00098 vtkIdType CurRoot; 00099 vtkTreeDFSIteratorInternals* Internals; 00100 vtkIntArray* Color; 00101 vtkIdType NextId; 00102 00103 //BTX 00104 enum ColorType 00105 { 00106 WHITE, 00107 GRAY, 00108 BLACK 00109 }; 00110 //ETX 00111 00112 private: 00113 vtkTreeDFSIterator(const vtkTreeDFSIterator &); // Not implemented. 00114 void operator=(const vtkTreeDFSIterator &); // Not implemented. 00115 }; 00116 00117 00118 #endif 00119