Class LineSegmentContainer
java.lang.Object
com.treemap.swing.voronoi.smoothing.LineSegmentContainer
This class is a container for LineSegments. LineSegments are smooth connecting splines between corners (or vertexes)
of voronoi cell outline shapes. If a LineSegment in the opposite direction (exchanged start and end points) already
exists in the container it will not be added again.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddIfNotContained
(LineSegment lineSegmentToAdd) Adds a line segment only if a line segment in the opposite direction (exchanged start and end points) not already exists in the container.getReference
(LineSegment currentSegment) Returns the reference to the corresponding line segment in the container.
-
Constructor Details
-
LineSegmentContainer
public LineSegmentContainer()
-
-
Method Details
-
addIfNotContained
Adds a line segment only if a line segment in the opposite direction (exchanged start and end points) not already exists in the container.- Parameters:
lineSegmentToAdd
- the line segment to be added- Returns:
- the dorection with which the segement further can be used. Forward if the segent has not yet existed or already exists in the same direction as the line segment to add. Reverse if the segment already exist in the opposite direction.
-
getReference
Returns the reference to the corresponding line segment in the container. If it has to be use forward or backwards tells the addIfNotContained() method. Can but does not have to be the same object as the currentSegment parameter.- Parameters:
currentSegment
- segment of which a reference from the container is returned.- Returns:
- the reference to the corresponding line segment in the container. If it has to be use forward or backwards tells the addIfNotContained() method. Can but does not have to be the same object as the currentSegment parameter.
-