|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object texturesynthesis.wangtilesynthesizer.wangtiles.WangTileSet
public class WangTileSet
This class represents a collection of Wang tiles. It contains zero or more Wang tiles with similiar coloring. It contains at most one of each kind of a Wang tile.
Field Summary | |
---|---|
private int |
horizontalColoring
Number of possible colors in the horizontal direction. |
private java.util.Vector<WangTile> |
tileSet
Space for the tiles. |
private int |
verticalColoring
Number of possible colors in the vertical direction. |
Constructor Summary | |
---|---|
WangTileSet(int horizontal,
int vertical)
Constructs a Wang tile set that contains tiles with the given coloring limits. |
Method Summary | |
---|---|
void |
add(WangTile wt)
Adds a new Wang tile to this tile set if it isn't there yet. |
boolean |
canFillPlane()
Checks if this tile set can fill a plane. |
void |
generateTileSet(int nTiles)
Generates a tile set. |
WangTile |
get(int index)
Returns the tile at the specified position in this tile set. |
int |
getHorizontalColoring()
Gets the number of colors in the horizontal direction. |
int |
getMaximumNumberOfTiles()
Returns the maximum number of tiles this kind of set can contain. |
int |
getVerticalColoring()
Gets the number of colors in the vertical direction. |
boolean |
isInSet(WangTile wt)
Tests if a similiar tile is in the set. |
int |
size()
Returns the number of tiles in this tile set. |
java.lang.String |
toString()
A string representation of this tile set. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private java.util.Vector<WangTile> tileSet
private int horizontalColoring
private int verticalColoring
Constructor Detail |
---|
public WangTileSet(int horizontal, int vertical) throws java.lang.IllegalArgumentException
horizontal
- the number of colors in horizontal direction.vertical
- the number of colors in vertical direction.
java.lang.IllegalArgumentException
- if at least one of the arguments
is less than two.Method Detail |
---|
public int getHorizontalColoring()
public int getVerticalColoring()
public void add(WangTile wt)
wt
- the new Wang tile.public void generateTileSet(int nTiles)
nTiles
- the number of tiles to be generatedpublic boolean isInSet(WangTile wt)
wt
- the tile
public int getMaximumNumberOfTiles()
public int size()
public WangTile get(int index)
index
- index of tile to return.
public boolean canFillPlane()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |