mp_traversals
Terrible Traversals
BFS Class Reference

A breadth-first ImageTraversal. More...

#include <BFS.h>

Inheritance diagram for BFS:
[legend]
Collaboration diagram for BFS:
[legend]

Public Member Functions

 BFS (const PNG &png, const Point &start, double tolerance)
 Initializes a breadth-first ImageTraversal on a given png image, starting at start, and with a given tolerance. More...
 
ImageTraversal::Iterator begin ()
 Returns an iterator for the traversal starting at the first point. More...
 
ImageTraversal::Iterator end ()
 Returns an iterator for the traversal one past the end of the traversal. More...
 
void add (const Point &point)
 Adds a Point for the traversal to visit at some point in the future. More...
 
Point pop ()
 Removes and returns the current Point in the traversal. More...
 
Point peek () const
 Returns the current Point in the traversal. More...
 
bool empty () const
 Returns true if the traversal is empty. More...
 

Detailed Description

A breadth-first ImageTraversal.

Derived from base class ImageTraversal

Constructor & Destructor Documentation

◆ BFS()

BFS::BFS ( const PNG png,
const Point start,
double  tolerance 
)

Initializes a breadth-first ImageTraversal on a given png image, starting at start, and with a given tolerance.

Parameters
pngThe image this BFS is going to traverse
startThe start point of this BFS
toleranceIf the current point is too different (difference larger than tolerance) with the start point, it will not be included in this BFS
Todo:
[Part 1]

Member Function Documentation

◆ add()

void BFS::add ( const Point point)
virtual

Adds a Point for the traversal to visit at some point in the future.

Todo:
[Part 1]

Implements ImageTraversal.

◆ begin()

ImageTraversal::Iterator BFS::begin ( )
virtual

Returns an iterator for the traversal starting at the first point.

Todo:
[Part 1]

Implements ImageTraversal.

◆ empty()

bool BFS::empty ( ) const
virtual

Returns true if the traversal is empty.

Todo:
[Part 1]

Implements ImageTraversal.

◆ end()

ImageTraversal::Iterator BFS::end ( )
virtual

Returns an iterator for the traversal one past the end of the traversal.

Todo:
[Part 1]

Implements ImageTraversal.

◆ peek()

Point BFS::peek ( ) const
virtual

Returns the current Point in the traversal.

Todo:
[Part 1]

Implements ImageTraversal.

◆ pop()

Point BFS::pop ( )
virtual

Removes and returns the current Point in the traversal.

Todo:
[Part 1]

Implements ImageTraversal.


The documentation for this class was generated from the following files: