org.jdelaunay.delaunay
Class VerticalList

java.lang.Object
  extended by org.jdelaunay.delaunay.VerticalList

public class VerticalList
extends Object

Store a list that is sorted "vertically", according to an attached VerticalComparator

Author:
Alexis Guéganno

Constructor Summary
VerticalList()
          The default constructor.
VerticalList(double abs)
          Public constructor.
VerticalList(DPoint pt)
          Public constructor.
 
Method Summary
 int addEdge(DEdge constraint)
          Add an edge to the list of constraints that are considered to be linked to the boundary of the current mesh.
 void addEdges(List<DEdge> constraints)
          Add each of the edge in the list given in argument in this vertical list.
 DEdge get(int i)
          retrieve the element at position i in the list.
 double getAbs()
          get the absciss where the comparison is currently performed.
 DEdge getLastLowerEd()
          get the last evaluated lower edge
 DPoint getLastLowerPt()
          get the last point evaluated to perform the getLowerPoint operation
 DEdge getLastUpperEd()
          Get the last evaluated upper edge
 DPoint getLastUpperPt()
          Get the last evaluated upper point
 DEdge getLowerEdge(DPoint point)
          Get the edge that is directly lower to the point in the sorted list.
 DEdge getUpperEdge(DPoint point)
          Search the edge that will be just upper to the point in the sorted list.
 List<DEdge> getVerticallySortedEdges()
          Get the list of constraints linked to the boundary of the current mesh.
 boolean intersectsUpperOrLower(DPoint pRef, DEdge ed)
          Checks if the edges that are upper and lower than pRef in the list of constraints that are linked to the boundary intersect the edge ed given in parameter.
 DEdge remove(int index)
          Remove the edge at index index in this vertical list.
 void removeEdge(DEdge constr)
          Remove an edge in this vertical list.
 void removeEdgeFromRightPoint(DPoint rightPt)
          Sort the list to the x-coordinate of rightPt, and remove the edges of the list whose right point is equal to rightPt.
protected  int searchEdge(DEdge edge)
          Search an edge in the constraints linked to the boundary.
 void setAbs(double abs)
          Change the absciss where we want our edges to be sorted
 void setAbs(DPoint pt)
          Change the absciss where we want our edges to be sorted.
 int size()
          Gets the current size of this vertical list.
protected  void sort()
          This method will sort the list using the abs of the current comparator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VerticalList

public VerticalList()
The default constructor. The inner comparator is instanciated with value 0.


VerticalList

public VerticalList(double abs)
Public constructor. It uses the double abs to instanciate the comparator

Parameters:
abs -

VerticalList

public VerticalList(DPoint pt)
Public constructor. Uses the absciss of the point to instanciate the comparator.

Parameters:
pt -
Method Detail

getAbs

public final double getAbs()
get the absciss where the comparison is currently performed.

Returns:
the current evaluation abs.

setAbs

public final void setAbs(double abs)
                  throws DelaunayError
Change the absciss where we want our edges to be sorted

Parameters:
abs -
Throws:
DelaunayError

setAbs

public final void setAbs(DPoint pt)
                  throws DelaunayError
Change the absciss where we want our edges to be sorted. For this task, we use the absciss of the point given in parameter.

Parameters:
pt -
Throws:
DelaunayError

get

public final DEdge get(int i)
retrieve the element at position i in the list.

Parameters:
i -
Returns:
get the ith element in the list.

addEdges

public final void addEdges(List<DEdge> constraints)
Add each of the edge in the list given in argument in this vertical list.

Parameters:
constraints -

addEdge

public final int addEdge(DEdge constraint)
Add an edge to the list of constraints that are considered to be linked to the boundary of the current mesh.

Parameters:
constraint -
Returns:
the index of constraint in the list.

removeEdge

public final void removeEdge(DEdge constr)
Remove an edge in this vertical list. Do nothing if the edge is not present.

Parameters:
constr -

remove

public final DEdge remove(int index)
Remove the edge at index index in this vertical list.

Parameters:
index -
Returns:
the removed DEdge

searchEdge

protected final int searchEdge(DEdge edge)
Search an edge in the constraints linked to the boundary.

Parameters:
edge -

getVerticallySortedEdges

public final List<DEdge> getVerticallySortedEdges()
Get the list of constraints linked to the boundary of the current mesh.

Returns:
the list of constraints linked to the boundary of the current mesh.

getLastLowerEd

public final DEdge getLastLowerEd()
get the last evaluated lower edge

Returns:
the last evaluated lower edge

getLastLowerPt

public final DPoint getLastLowerPt()
get the last point evaluated to perform the getLowerPoint operation

Returns:
the last point evaluated to perform the getLowerPoint operation

getLastUpperEd

public final DEdge getLastUpperEd()
Get the last evaluated upper edge

Returns:
the last evaluated upper edge

getLastUpperPt

public final DPoint getLastUpperPt()
Get the last evaluated upper point

Returns:
the last evaluated upper point

removeEdgeFromRightPoint

public final void removeEdgeFromRightPoint(DPoint rightPt)
                                    throws DelaunayError
Sort the list to the x-coordinate of rightPt, and remove the edges of the list whose right point is equal to rightPt.

Parameters:
rightPt -
Throws:
DelaunayError

sort

protected final void sort()
                   throws DelaunayError
This method will sort the list using the abs of the current comparator. It's a bubble sort, not a merge sort, as it will be more efficient in most cases when using sweep line.

Throws:
DelaunayError

size

public final int size()
Gets the current size of this vertical list.

Returns:
the size of the list.

getUpperEdge

public final DEdge getUpperEdge(DPoint point)
                         throws DelaunayError
Search the edge that will be just upper to the point in the sorted list. The list is sorted according to the abscissa of point. Consequently, this method is able to change the sorting absciss of the list. Note that we don't use the vertical sort here : an DEdge edge is said to be "upper" than point if and only if edge.getPointFromItsX(point.getX())>point.getY() This method is used to determine which points of the mesh boundary are visible from the point to be added. Be careful that the edge returned is the one found using thee verticl sort. It may not be "vertically upper" than point : we can't be sure that there is a point of x-coordinate point.getX() on this edge.

Parameters:
point -
Returns:
The edge of which the ordinate is directly greater that the one of point. Null if such an edge does not exist.
Throws:
DelaunayError

getLowerEdge

public final DEdge getLowerEdge(DPoint point)
                         throws DelaunayError
Get the edge that is directly lower to the point in the sorted list. The list is sorted according to the abscissa of point. Consequently, this method is able to change the sorting absciss of the list. Note that we don't use the vertical sort here : an DEdge edge is said to be "lower" than point if and only if edge.getPointFromItsX(point.getX())<point.getY() This method is used to determine which points of the mesh boundary are visible from the point to be added. Be careful that the edge returned is the one found using the vertical sort. It may not be "vertically upper" than point : we can't be sure that there is a point of x-coordinate point.getX() on this edge.

Parameters:
point -
Returns:
The edge of which the ordinate is directly greater that the one of point. Null if such an edge does not exist.
Throws:
DelaunayError

intersectsUpperOrLower

public final boolean intersectsUpperOrLower(DPoint pRef,
                                            DEdge ed)
                                     throws DelaunayError
Checks if the edges that are upper and lower than pRef in the list of constraints that are linked to the boundary intersect the edge ed given in parameter. Intersection must not be an extremity point of the two evaluated edges. We don't deal with edges that intersect and that are colinear.

Parameters:
pRef -
ed -
Returns:
true if ed intersects with the directly lower or directly upper point.
Throws:
DelaunayError


Copyright © 2014 IRSTV CNRS-FR-2488. All Rights Reserved.