You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
70 lines
1.8 KiB
C
70 lines
1.8 KiB
C
3 weeks ago
|
/*=========================================================================
|
||
|
|
||
|
Program: Visualization Toolkit
|
||
|
Module: vtkTreeBFSIterator.h
|
||
|
|
||
|
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
|
||
|
All rights reserved.
|
||
|
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
|
||
|
|
||
|
This software is distributed WITHOUT ANY WARRANTY; without even
|
||
|
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||
|
PURPOSE. See the above copyright notice for more information.
|
||
|
|
||
|
=========================================================================*/
|
||
|
|
||
|
/**
|
||
|
* @class vtkTreeBFSIterator
|
||
|
* @brief breadth first search iterator through a vtkTree
|
||
|
*
|
||
|
*
|
||
|
* vtkTreeBFSIterator performs a breadth first search traversal of a tree.
|
||
|
*
|
||
|
* After setting up the iterator, the normal mode of operation is to
|
||
|
* set up a <code>while(iter->HasNext())</code> loop, with the statement
|
||
|
* <code>vtkIdType vertex = iter->Next()</code> inside the loop.
|
||
|
*
|
||
|
* @par Thanks:
|
||
|
* Thanks to David Doria for submitting this class.
|
||
|
*/
|
||
|
|
||
|
#ifndef vtkTreeBFSIterator_h
|
||
|
#define vtkTreeBFSIterator_h
|
||
|
|
||
|
#include "vtkCommonDataModelModule.h" // For export macro
|
||
|
#include "vtkTreeIterator.h"
|
||
|
|
||
|
class vtkTreeBFSIteratorInternals;
|
||
|
class vtkIntArray;
|
||
|
|
||
|
class VTKCOMMONDATAMODEL_EXPORT vtkTreeBFSIterator : public vtkTreeIterator
|
||
|
{
|
||
|
public:
|
||
|
static vtkTreeBFSIterator* New();
|
||
|
vtkTypeMacro(vtkTreeBFSIterator, vtkTreeIterator);
|
||
|
void PrintSelf(ostream& os, vtkIndent indent) override;
|
||
|
|
||
|
protected:
|
||
|
vtkTreeBFSIterator();
|
||
|
~vtkTreeBFSIterator() override;
|
||
|
|
||
|
void Initialize() override;
|
||
|
vtkIdType NextInternal() override;
|
||
|
|
||
|
vtkTreeBFSIteratorInternals* Internals;
|
||
|
vtkIntArray* Color;
|
||
|
|
||
|
enum ColorType
|
||
|
{
|
||
|
WHITE,
|
||
|
GRAY,
|
||
|
BLACK
|
||
|
};
|
||
|
|
||
|
private:
|
||
|
vtkTreeBFSIterator(const vtkTreeBFSIterator&) = delete;
|
||
|
void operator=(const vtkTreeBFSIterator&) = delete;
|
||
|
};
|
||
|
|
||
|
#endif
|