|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.shapelogic.polygon.BaseAnnotatedShape org.shapelogic.polygon.MultiLine
public class MultiLine
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.
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 |
Fields inherited from class org.shapelogic.polygon.BaseAnnotatedShape |
---|
_annotatedShape |
Constructor Summary | |
---|---|
MultiLine(AnnotatedShapeImplementation annotatedShape)
|
Method Summary | |
---|---|
void |
addAfterEnd(IPoint2D newPoint)
|
void |
addBeforeStart(IPoint2D newPoint)
|
int |
compareTo(ILine2D other)
|
boolean |
equals(java.lang.Object obj)
|
BBox |
getBBox()
|
IPoint2D |
getCenter()
|
IPoint2D |
getCenterForCircle()
|
double |
getDiameter()
|
IPoint2D |
getEnd()
|
LineType |
getLineType()
|
java.util.List<? extends IPoint2D> |
getPoints()
|
IPoint2D |
getStart()
|
MultiLine |
getValue()
Starts a lazy calculation. |
java.lang.String |
internalInfo(java.lang.StringBuffer sb)
|
MultiLine |
invoke()
|
boolean |
isClosed()
|
java.lang.Boolean |
isClosedLineClockWise()
|
boolean |
isDirty()
When dirty is false that means that the calculated value can be used |
MultiLine |
replacePointsInMap(java.util.Map<IPoint2D,IPoint2D> pointReplacementMap,
AnnotatedShapeImplementation annotatedShape)
|
void |
setCenterForCircle(IPoint2D forCircle)
|
void |
setClosedLineClockWise(java.lang.Boolean lineClockWise)
|
void |
setPoints(java.util.List<? extends IPoint2D> points)
|
void |
setup()
Currently not super well define used for 2 purposes: Reset: called from the outside if you want to reuse it init: Called from the inside when calculation start to have everything setup maybe the semantic could work for both? TODO: This should be separated better. |
MultiLine[] |
split(int splitIndex)
Not sure what to return. |
MultiLine[] |
split(IPoint2D splitPoint)
Not sure what to return. |
CLine |
toCLine()
|
Methods inherited from class org.shapelogic.polygon.BaseAnnotatedShape |
---|
getAnnotatedShape, getAnnotationForShapes, getMap, getShapesForAnnotation, putAllAnnotation, putAnnotation |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.shapelogic.polygon.AnnotatedShape |
---|
getAnnotatedShape, getAnnotationForShapes, getMap, getShapesForAnnotation, putAllAnnotation, putAnnotation |
Field Detail |
---|
protected java.util.ArrayList<IPoint2D> _points
protected IPoint2D _centerForCircle
protected BBox _bBox
protected boolean _dirty
protected LineType _lineType
protected java.lang.Boolean _closedLineClockWise
Constructor Detail |
---|
public MultiLine(AnnotatedShapeImplementation annotatedShape)
Method Detail |
---|
public IPoint2D getEnd()
getEnd
in interface ILine2D
public IPoint2D getStart()
getStart
in interface ILine2D
public void addBeforeStart(IPoint2D newPoint)
public void addAfterEnd(IPoint2D newPoint)
public int compareTo(ILine2D other)
compareTo
in interface java.lang.Comparable<ILine2D>
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.util.List<? extends IPoint2D> getPoints()
public void setPoints(java.util.List<? extends IPoint2D> points)
public MultiLine[] split(IPoint2D splitPoint)
splitPoint
- public MultiLine[] split(int splitIndex)
splitIndex
- public IPoint2D getCenterForCircle()
public void setCenterForCircle(IPoint2D forCircle)
public boolean isDirty()
LazyCalc
isDirty
in interface LazyCalc<MultiLine>
public void setup()
LazyCalc
setup
in interface LazyCalc<MultiLine>
setup
in interface AnnotatedShape
setup
in class BaseAnnotatedShape
public MultiLine invoke()
invoke
in interface Calc0<MultiLine>
public MultiLine getValue()
CalcValue
getValue
in interface CalcValue<MultiLine>
public BBox getBBox()
public CLine toCLine()
public LineType getLineType()
public boolean isClosed()
public MultiLine replacePointsInMap(java.util.Map<IPoint2D,IPoint2D> pointReplacementMap, AnnotatedShapeImplementation annotatedShape)
replacePointsInMap
in interface PointReplacable<MultiLine>
public IPoint2D getCenter()
getCenter
in interface GeometricShape2D
public double getDiameter()
getDiameter
in interface GeometricShape2D
public java.lang.Boolean isClosedLineClockWise()
public void setClosedLineClockWise(java.lang.Boolean lineClockWise)
public java.lang.String internalInfo(java.lang.StringBuffer sb)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |