|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfdubath.entrelacs.BackgroundGeometry
public class BackgroundGeometry
This class define a zone on which one can define Vertex and Rope. It also contains methodes to instanciate and use the Vertex and Rope. Part of the methodes are though to be overrided by specific geometry.
Field Summary | |
---|---|
boolean |
verbose
When set to 'true' cause the Vertex and Rope manipulating methodes to output to the console when they annot comlete a request. |
Constructor Summary | |
---|---|
BackgroundGeometry()
|
Method Summary | |
---|---|
Rope |
addLoopRope(Vertex startVertex,
Vertex endVertex)
Create a closed loop Rope between two vertexes. |
Rope |
addRopeOnMirorBorder(Vertex startVertex,
Vertex endVertex)
Create a Rope between two vertexes on mirror borders. |
Vertex |
addVertex(int type,
double[] position)
Try to add a vertex to the current VertexList. |
boolean |
addVertexToRope(Rope rope,
Vertex newVertex,
Vertex previusVertex)
On an existing rope, add a vertex after a given rope vertex. |
boolean |
deleteRope(Rope rope,
boolean deleteAlsoVertices)
Remove a Rope from the Rope list. |
boolean |
deleteVertex(Vertex vertex)
Remove a vertex from the vertex list. |
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[] |
getBorderTangentVector(Vertex vertex)
When a vertex is on a miror border, this methode allows to get the direction of the border at the vertex position. |
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. |
java.util.List |
getReadOnlyRopexList()
Exposes the list of rope. |
java.util.List |
getReadOnlyVertexList()
Exposes the list of vertices. |
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. |
void |
moveVertex(Vertex vertex,
double[] newPosition)
Change the position of a vertex, the input position will be processed using the placeInside()/placeOn*Border() methodes according to the Vertex type. |
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 |
double[] |
placeOnMirorBorder(double[] position)
Compute the closest position on a mirror border of the zone |
boolean |
removeVertexfromRope(Rope rope,
Vertex vertexToBeRemoved)
On an existing rope, remove a vertex. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public boolean verbose
Constructor Detail |
---|
public BackgroundGeometry()
Method Detail |
---|
public java.util.List getReadOnlyVertexList()
Vertex
public java.util.List getReadOnlyRopexList()
Rope
public Vertex addVertex(int type, double[] position)
type
- 0 - bulk vertex, 1 - Vertex on a Miror border, 2 - Vertex on an Identified border.position
- the input position use to determine the final vertex position.
public void moveVertex(Vertex vertex, double[] newPosition)
vertex
- the vertex to be moved.newPosition
- input position to be processed in order to obtain the vertex new position.public Rope addRopeOnMirorBorder(Vertex startVertex, Vertex endVertex)
startVertex
- a vertexOnAMirrorBorder to be the first point of the rope.endVertex
- a vertexOnAMirrorBorder to be the last point of the rope.
public Rope addLoopRope(Vertex startVertex, Vertex endVertex)
startVertex
- a vertex to be the first point of the rope.endVertex
- a vertex to be the last point of the rope.
public boolean addVertexToRope(Rope rope, Vertex newVertex, Vertex previusVertex)
rope
- The rope which recives a new vertexnewVertex
- the vertex to be added on the ropepreviusVertex
- a vertex of the rope which define where the new vertex has to be inserted.
public boolean removeVertexfromRope(Rope rope, Vertex vertexToBeRemoved)
rope
- The rope containig the vertex to remove.vertexToBeRemoved
- the vertex to be removed of the rope
public boolean deleteVertex(Vertex vertex)
vertex
- the vertex to be deleted/removed of the vertex list.
public boolean deleteRope(Rope rope, boolean deleteAlsoVertices)
rope
- the rope to be deleted/removed of the rope list.deleteAlsoVertices
- if true, remove the rope's vertex from the vertex list.
public java.lang.String geometryName()
CustomFileReader
public boolean hasMirorBorder()
public boolean hasIdentifiedBorder()
public boolean isInside(double[] position)
public double[] placeInside(double[] position)
public double[] placeOnMirorBorder(double[] position)
public double[] placeOnIdentifiedBorder(double[] position)
public int numberOfVertexImages(Vertex vertex)
vertex
- the vertex for which one want to determine the numberof image
public double[] getVertexImagePosition(int imageNumber, Vertex vertex)
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
public double[] getBorderTangentVector(Vertex vertex)
vertex
- the Vertex determining a position on a miror border
public double getIdentifiedBorderRotationAngle(Vertex vertex)
vertex
- the Vertex determining two positions (the second one is the vertex' image position) on identified borders.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |