mp_traversals
Terrible Traversals
DFS Class Reference

A depth-first ImageTraversal. More...

#include <DFS.h>

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

Public Member Functions

 DFS (const PNG &png, const Point &start, double tolerance)
 Initializes a depth-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 depth-first ImageTraversal.

Derived from base class ImageTraversal

Constructor & Destructor Documentation

◆ DFS()

DFS::DFS ( const PNG &  png,
const Point start,
double  tolerance 
)

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

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

Member Function Documentation

◆ add()

void DFS::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 DFS::begin ( )
virtual

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

Todo:
[Part 1]

Implements ImageTraversal.

◆ empty()

bool DFS::empty ( ) const
virtual

Returns true if the traversal is empty.

Todo:
[Part 1]

Implements ImageTraversal.

◆ end()

ImageTraversal::Iterator DFS::end ( )
virtual

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

Todo:
[Part 1]

Implements ImageTraversal.

◆ peek()

Point DFS::peek ( ) const
virtual

Returns the current Point in the traversal.

Todo:
[Part 1]

Implements ImageTraversal.

◆ pop()

Point DFS::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: