|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object texturesynthesis.wangtilesynthesizer.wangtiles.WangTiling
public class WangTiling
This class represents a Wang tiling of a plane. The tiling is rectangular. The size of the plane can not be modified after it is set.
Field Summary | |
---|---|
private int |
horizontalTiles
Number of tiles in the horizontal direction. |
private int[][] |
tiles
The indexes to the tiles. |
private WangTileSet |
tileSet
The tile set that is used for this tiling. |
private int |
verticalTiles
Number of tiles in the vertical direction. |
Constructor Summary | |
---|---|
WangTiling(int horizontal,
int vertical)
Constructs a wang tiling instance of a given size. |
Method Summary | |
---|---|
private boolean |
fitsTo(WangTile tmpTile,
int x,
int y)
Checks if a tile fits to a position in this tiling. |
void |
generateWangTiling(WangTileSet tileSet)
Fills this Wang tiling with tiles from the given set. |
private int |
getMatchingTileFromSet(int x,
int y)
Returns a tile that fits to a position x, y in this tiling. |
int |
getNumHorizontalTiles()
Returns the number of tiles in the horizontal direction. |
int |
getNumVerticalTiles()
Returns the number of tiles in the vertical direction. |
WangTile |
getTileAt(int x,
int y)
Returns the Wang tile at position x,y |
int |
getTileIndexAt(int x,
int y)
Returns the Wang tile index at position x,y |
boolean |
isReadyForTiling()
Checks if this tiling is ready for filling. |
void |
setTileAt(int index,
int x,
int y)
Sets a Wang tile index at position x,y. |
java.lang.String |
toString()
A string representation of this Wang tiling. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private int horizontalTiles
private int verticalTiles
private WangTileSet tileSet
private int[][] tiles
Constructor Detail |
---|
public WangTiling(int horizontal, int vertical) throws java.lang.IllegalArgumentException
horizontal
- Number of tiles in the horizontal direction.vertical
- Number of tiles in the vertical direction.
java.lang.IllegalArgumentException
- if an invalid size attribute
is given.Method Detail |
---|
public int getNumHorizontalTiles()
public int getNumVerticalTiles()
public boolean isReadyForTiling()
public void setTileAt(int index, int x, int y)
index
- the Wang tile index.x
- horizontal position coordinate.y
- vertical position coordinate.public WangTile getTileAt(int x, int y)
x
- horizontal position coordinatey
- vertical position coordinate
public int getTileIndexAt(int x, int y)
x
- horizontal position coordinatey
- vertical position coordinate
public void generateWangTiling(WangTileSet tileSet)
tileSet
- the tile set.private int getMatchingTileFromSet(int x, int y)
x
- horizontal position.y
- vertical position.
private boolean fitsTo(WangTile tmpTile, int x, int y)
tmpTile
- the tile to be tested.x
- the horizontal position.y
- the vertical position.
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 |