Class BooleanMatrix

java.lang.Object
  extended byBooleanMatrix

public class BooleanMatrix
extends java.lang.Object

BooleanMatrix Class

This class represents a two-dimensional array of boolean.


Field Summary
static boolean isLeft
          tells if the line goes on the left side of the rectangle (setBooleanMatrix method)
static boolean isUp
          tells if the line goes over the rectangle (setBooleanMatrix method)
 
Constructor Summary
BooleanMatrix(int N)
          Creates a N wide boolean matrix
 
Method Summary
 boolean get(int i, int j)
          Returns the value of the square at (i,j)
 void init()
          Sets every squares to false
 void setBooleanMatrix(int i, int j, double g, RectDouble rect, double boxWidth, double boxHeight)
          Calculates the intersections between a line and the squares of a rectangle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

isUp

public static boolean isUp
tells if the line goes over the rectangle (setBooleanMatrix method)


isLeft

public static boolean isLeft
tells if the line goes on the left side of the rectangle (setBooleanMatrix method)

Constructor Detail

BooleanMatrix

public BooleanMatrix(int N)
Creates a N wide boolean matrix

Method Detail

init

public void init()
Sets every squares to false


get

public boolean get(int i,
                   int j)
Returns the value of the square at (i,j)


setBooleanMatrix

public void setBooleanMatrix(int i,
                             int j,
                             double g,
                             RectDouble rect,
                             double boxWidth,
                             double boxHeight)
Calculates the intersections between a line and the squares of a rectangle. Sets "true" to each square of the matrix associated with a rectangle square crossing by the line

Parameters:
i - X-coordinate of a line point
j - Y-coordinate of a line point
g - the angle of the line in radians
rect - the coordinate of the rectangle
boxWidth - the squares width
boxHeight - the squares height