org.shapelogic.polygon
Class MultiLine
java.lang.Object
org.shapelogic.polygon.BaseAnnotatedShape
org.shapelogic.polygon.MultiLine
- All Implemented Interfaces:
- java.lang.Comparable<ILine2D>, Calc<MultiLine>, LazyCalc<MultiLine>, AnnotatedShape, GeometricShape2D, ILine2D, PointReplacable<MultiLine>
public class MultiLine
- extends BaseAnnotatedShape
- implements ILine2D, LazyCalc<MultiLine>, PointReplacable<MultiLine>, AnnotatedShape
A list of point on a continues line that does not have any intersections.
But it can contain turns.
Should this be mutable or immutable?
This is just a list of already existing point so immutable should be fine.
I can change this later.
- Author:
- Sami Badawi
Field Summary |
protected BBox |
_bBox
|
protected IPoint2D |
_centerForCircle
Should be set if the multi line turns out to be a circle |
protected java.lang.Boolean |
_closedLineClockWise
|
protected boolean |
_dirty
|
protected LineType |
_lineType
|
protected java.util.ArrayList<IPoint2D> |
_points
UNKNOWN means not tested for round, but treat as a multi line
NOT_ROUND means that it is tested for any of the round categories and it is not, treat it as a multi line
STRAIGHT lines combined to a straight line, say for an F
CIRCLE_ARCH_FORWARDS, from the first point move in increasing angle to get to second point |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_points
protected java.util.ArrayList<IPoint2D> _points
- UNKNOWN means not tested for round, but treat as a multi line
NOT_ROUND means that it is tested for any of the round categories and it is not, treat it as a multi line
STRAIGHT lines combined to a straight line, say for an F
CIRCLE_ARCH_FORWARDS, from the first point move in increasing angle to get to second point
_centerForCircle
protected IPoint2D _centerForCircle
- Should be set if the multi line turns out to be a circle
_bBox
protected BBox _bBox
_dirty
protected boolean _dirty
_lineType
protected LineType _lineType
_closedLineClockWise
protected java.lang.Boolean _closedLineClockWise
MultiLine
public MultiLine(AnnotatedShapeImplementation annotatedShape)
getEnd
public IPoint2D getEnd()
- Specified by:
getEnd
in interface ILine2D
getStart
public IPoint2D getStart()
- Specified by:
getStart
in interface ILine2D
addBeforeStart
public void addBeforeStart(IPoint2D newPoint)
addAfterEnd
public void addAfterEnd(IPoint2D newPoint)
compareTo
public int compareTo(ILine2D other)
- Specified by:
compareTo
in interface java.lang.Comparable<ILine2D>
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in class java.lang.Object
getPoints
public java.util.List<? extends IPoint2D> getPoints()
setPoints
public void setPoints(java.util.List<? extends IPoint2D> points)
split
public MultiLine[] split(IPoint2D splitPoint)
- Not sure what to return.
Maybe an array of CMultiLine
- Parameters:
splitPoint
-
split
public MultiLine[] split(int splitIndex)
- Not sure what to return.
Maybe an array of CMultiLine
- Parameters:
splitIndex
-
getCenterForCircle
public IPoint2D getCenterForCircle()
setCenterForCircle
public void setCenterForCircle(IPoint2D forCircle)
isDirty
public boolean isDirty()
- Specified by:
isDirty
in interface LazyCalc<MultiLine>
setup
public void setup()
- Specified by:
setup
in interface LazyCalc<MultiLine>
- Specified by:
setup
in interface AnnotatedShape
- Overrides:
setup
in class BaseAnnotatedShape
calc
public MultiLine calc()
- Specified by:
calc
in interface Calc<MultiLine>
getCalcValue
public MultiLine getCalcValue()
- Description copied from interface:
Calc
- If dirty do calc() else return cached value.
This should maybe be moved up in the hierarchy
- Specified by:
getCalcValue
in interface Calc<MultiLine>
getBBox
public BBox getBBox()
toCLine
public CLine toCLine()
getLineType
public LineType getLineType()
isClosed
public boolean isClosed()
replacePointsInMap
public MultiLine replacePointsInMap(java.util.Map<IPoint2D,IPoint2D> pointReplacementMap,
AnnotatedShapeImplementation annotatedShape)
- Specified by:
replacePointsInMap
in interface PointReplacable<MultiLine>
getCenter
public IPoint2D getCenter()
- Specified by:
getCenter
in interface GeometricShape2D
getDiameter
public double getDiameter()
- Specified by:
getDiameter
in interface GeometricShape2D
isClosedLineClockWise
public java.lang.Boolean isClosedLineClockWise()
setClosedLineClockWise
public void setClosedLineClockWise(java.lang.Boolean lineClockWise)
Copyright © 2007. All Rights Reserved.