fdubath.entrelacs.tilling
Class TillingP3BackgroundGeometry

java.lang.Object
  extended by fdubath.entrelacs.BackgroundGeometry
      extended by fdubath.entrelacs.tilling.TillingBackgroundGeometry
          extended by fdubath.entrelacs.tilling.TillingP3BackgroundGeometry

public class TillingP3BackgroundGeometry
extends TillingBackgroundGeometry

This geometry has a fundamental zone which is a losange. The first two border ((0,0)-(1,0)) and ((3/2,sqrt(3)/2)-(1,0)) are identified. the two other borders ((0,0)-(1/2,sqrt(3)/2)) and ((3/2,sqrt(3)/2)-(1/2,sqrt(3)/2)) are identified. 3 zones glued together by the first identified borders form an exagone used to fill the plane.


Field Summary
 
Fields inherited from class fdubath.entrelacs.tilling.TillingBackgroundGeometry
drawer
 
Fields inherited from class fdubath.entrelacs.BackgroundGeometry
verbose
 
Constructor Summary
TillingP3BackgroundGeometry()
           
 
Method Summary
 void draw(int[] origine, int[] clipSize, double geometryUnit)
          Call to this method cause the computation of the intersections and segments and the drawing of the ropes.
 java.lang.String geometryName()
          Get the name of the Geometry, use for the CustomFileReader in order to ensure it can extract the content of a file and assigne it to the geometry.
 double getIdentifiedBorderRotationAngle(Vertex vertex)
          When a vertex is on a shared border, this methode allows to get the angle between the two identified border between the vertex/vertex' image positions.
 double[] getVertexImagePosition(int imageNumber, Vertex vertex)
          Compute the position of a vertex image.
 boolean hasIdentifiedBorder()
          Define if the geometry has identified border - that is borders on which a Vertex has two image, causing the rope to jump from the first to the second image accross the geometry zone.
 boolean hasMirorBorder()
          Define if the geometry has mirror border - that is border on which a Rope can end.
 boolean isInside(double[] position)
          Compute if a given position is inside the geometry zone.
 int numberOfVertexImages(Vertex vertex)
          Compute the number of image of a given vertex (1 in general 2 on a identified border).
 double[] placeInside(double[] position)
          If a given position is inside the geometry zone.
 double[] placeOnIdentifiedBorder(double[] position)
          Compute the closest position on an identified border of the zone
 
Methods inherited from class fdubath.entrelacs.tilling.TillingBackgroundGeometry
computeSegments
 
Methods inherited from class fdubath.entrelacs.BackgroundGeometry
addLoopRope, addRopeOnMirorBorder, addVertex, addVertexToRope, deleteRope, deleteVertex, getBorderTangentVector, getReadOnlyRopexList, getReadOnlyVertexList, moveVertex, placeOnMirorBorder, removeVertexfromRope
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TillingP3BackgroundGeometry

public TillingP3BackgroundGeometry()
Method Detail

geometryName

public java.lang.String geometryName()
Description copied from class: BackgroundGeometry
Get the name of the Geometry, use for the CustomFileReader in order to ensure it can extract the content of a file and assigne it to the geometry.

Overrides:
geometryName in class BackgroundGeometry
See Also:
CustomFileReader

getIdentifiedBorderRotationAngle

public double getIdentifiedBorderRotationAngle(Vertex vertex)
Description copied from class: BackgroundGeometry
When a vertex is on a shared border, this methode allows to get the angle between the two identified border between the vertex/vertex' image positions.

Overrides:
getIdentifiedBorderRotationAngle in class BackgroundGeometry
Parameters:
vertex - the Vertex determining two positions (the second one is the vertex' image position) on identified borders.
Returns:
the angle between the two image of the border.

getVertexImagePosition

public double[] getVertexImagePosition(int imageNumber,
                                       Vertex vertex)
Description copied from class: BackgroundGeometry
Compute the position of a vertex image.

Overrides:
getVertexImagePosition in class BackgroundGeometry
Parameters:
imageNumber - identify the image: 0 is the curent vertex, 1 is its other image (if it exist).
vertex - the vertex for which one want to determine the images position
Returns:
a position in geometry zone units.

numberOfVertexImages

public int numberOfVertexImages(Vertex vertex)
Description copied from class: BackgroundGeometry
Compute the number of image of a given vertex (1 in general 2 on a identified border).

Overrides:
numberOfVertexImages in class BackgroundGeometry
Parameters:
vertex - the vertex for which one want to determine the numberof image
Returns:
the number of vertex's image(s).

hasMirorBorder

public boolean hasMirorBorder()
Description copied from class: BackgroundGeometry
Define if the geometry has mirror border - that is border on which a Rope can end.

Overrides:
hasMirorBorder in class BackgroundGeometry
Returns:
true if mirror border exists

hasIdentifiedBorder

public boolean hasIdentifiedBorder()
Description copied from class: BackgroundGeometry
Define if the geometry has identified border - that is borders on which a Vertex has two image, causing the rope to jump from the first to the second image accross the geometry zone.

Overrides:
hasIdentifiedBorder in class BackgroundGeometry
Returns:
true if identified border exists

isInside

public boolean isInside(double[] position)
Description copied from class: BackgroundGeometry
Compute if a given position is inside the geometry zone.

Overrides:
isInside in class BackgroundGeometry
Returns:
true if the position is inside the geometry zone.

placeInside

public double[] placeInside(double[] position)
Description copied from class: BackgroundGeometry
If a given position is inside the geometry zone. returns the position, otherwise compute the closest position inside the zone

Overrides:
placeInside in class BackgroundGeometry
Returns:
a position inside the geometry zone.

placeOnIdentifiedBorder

public double[] placeOnIdentifiedBorder(double[] position)
Description copied from class: BackgroundGeometry
Compute the closest position on an identified border of the zone

Overrides:
placeOnIdentifiedBorder in class BackgroundGeometry
Returns:
a position on an identified border.

draw

public void draw(int[] origine,
                 int[] clipSize,
                 double geometryUnit)
Description copied from class: TillingBackgroundGeometry
Call to this method cause the computation of the intersections and segments and the drawing of the ropes. The geometry zone is replicated (according to its symetry) in order to fill the clipSize. Note that the direction of the drawing has vertical axis inverted with respect to screen coordinate (that is if you have a window with size(100,200) you should set the clip size to (100,200) and set the origine to (0,200)). Note also that the effective drawing fill the clip zone but is not restricted to it (some drawing are done outside of this sone).

Overrides:
draw in class TillingBackgroundGeometry