ForbiddenPattern Class Reference

Forbidden Pattern class. More...

#include <forbiddenPattern.hpp>

Collaboration diagram for ForbiddenPattern:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ForbiddenPattern (int width, int height)
 Constructor.
virtual ~ForbiddenPattern ()
 Destructor.
bool operator== (ForbiddenPattern pattern)
 Equality operator.
int getWidth ()
 Member accessor.
int getHeight ()
 Member accessor.
bool cellChanged (int x, int y)
 Changes the status of a cell of the pattern.
void cellChanged (int x, int y, int status)
 Sets the status of a cell.
Grid getGrid ()
 Member accessor.
void setGrid (Grid newGrid)
 Member changer.
bool equals (ForbiddenPattern *fp)
 Equality comparison.
matrix getMatrix ()
 Matrix accessor.

Private Attributes

Grid grid
 Grid of the forbidden pattern.
int width
 Width of the forbidden pattern.
int height
 Height of the forbidden pattern.

Detailed Description

Forbidden Pattern class.

This class represents the model of a forbidden pattern.

Author:
Bernat Rāfales Mulet <the_bell@users.sourceforge.net>
Version:
Revision
1.10

Definition at line 38 of file forbiddenPattern.hpp.


Constructor & Destructor Documentation

ForbiddenPattern::ForbiddenPattern int  width,
int  height
 

Constructor.

Parameters:
width the forbidden pattern width.
height the forbidden pattern height.

Definition at line 30 of file forbiddenPattern.cpp.

ForbiddenPattern::~ForbiddenPattern  )  [virtual]
 

Destructor.

Definition at line 39 of file forbiddenPattern.cpp.


Member Function Documentation

void ForbiddenPattern::cellChanged int  x,
int  y,
int  status
 

Sets the status of a cell.

This method changes the status of the position x, y of the forbidden pattern.

Parameters:
x x coordinate.
y y coordinate.
status the status to set

Definition at line 140 of file forbiddenPattern.cpp.

References grid.

bool ForbiddenPattern::cellChanged int  x,
int  y
 

Changes the status of a cell of the pattern.

This method changes the status of the cell of the pattern at x, y. The change graph is as follows: don't care -> enabled -> disabled -> don't care.

Parameters:
x x coordinate.
y y coordinate
Returns:
The change was successful.

Definition at line 73 of file forbiddenPattern.cpp.

References grid, nDISABLED, nDONTCARE, and nENABLED.

Referenced by ForbiddenPatternDiskManager::readFP().

bool ForbiddenPattern::equals ForbiddenPattern fp  ) 
 

Equality comparison.

Parameters:
fp the pattern to be compared to.
Returns:
True iif fp has the same width, height and grid.

Definition at line 116 of file forbiddenPattern.cpp.

References Grid::getCells(), getGrid(), and grid.

Here is the call graph for this function:

Grid ForbiddenPattern::getGrid  ) 
 

Member accessor.

Returns:
The forbidden pattern grid.

Definition at line 105 of file forbiddenPattern.cpp.

References grid.

Referenced by equals(), operator==(), and ForbiddenPatternDiskManager::saveFP().

int ForbiddenPattern::getHeight  ) 
 

Member accessor.

Returns:
The forbidden pattern height.

Definition at line 58 of file forbiddenPattern.cpp.

References height.

Referenced by operator==(), and ForbiddenPatternDiskManager::saveFP().

matrix ForbiddenPattern::getMatrix  ) 
 

Matrix accessor.

Returns:
The forbidden pattern grid as a matrix (STL vector of STL vectors).

Definition at line 126 of file forbiddenPattern.cpp.

References Grid::getCells(), and grid.

Here is the call graph for this function:

int ForbiddenPattern::getWidth  ) 
 

Member accessor.

Returns:
The forbidden pattern width.

Definition at line 48 of file forbiddenPattern.cpp.

References width.

Referenced by operator==(), Simulation::patternApplicable(), and ForbiddenPatternDiskManager::saveFP().

bool ForbiddenPattern::operator== ForbiddenPattern  pattern  ) 
 

Equality operator.

Parameters:
pattern the forbidden pattern to be compared to.
Returns:
True iif fp has the same width, height and grid.

Definition at line 151 of file forbiddenPattern.cpp.

References getGrid(), getHeight(), getWidth(), and grid.

Here is the call graph for this function:

void ForbiddenPattern::setGrid Grid  newGrid  ) 
 

Member changer.

Parameters:
newGrid the grid to set.

Definition at line 163 of file forbiddenPattern.cpp.

References Grid::getHeight(), Grid::getWidth(), grid, height, Grid::init(), and width.

Here is the call graph for this function:


Member Data Documentation

Grid ForbiddenPattern::grid [private]
 

Grid of the forbidden pattern.

Definition at line 55 of file forbiddenPattern.hpp.

Referenced by cellChanged(), equals(), getGrid(), getMatrix(), operator==(), and setGrid().

int ForbiddenPattern::height [private]
 

Height of the forbidden pattern.

Definition at line 59 of file forbiddenPattern.hpp.

Referenced by getHeight(), and setGrid().

int ForbiddenPattern::width [private]
 

Width of the forbidden pattern.

Definition at line 57 of file forbiddenPattern.hpp.

Referenced by getWidth(), and setGrid().


The documentation for this class was generated from the following files:
Generated on Fri Sep 1 23:56:44 2006 for NanoComp by  doxygen 1.4.6