|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.shapelogic.polygon.PolygonEndPointAdjuster
public class PolygonEndPointAdjuster
Take a polygon as input and a list of sets of point that potentially can be combined. Create a new polygon. I think that if there have been no changes then just return the original polygon. I think that polygons are supposed to be immutable.
| Field Summary | |
|---|---|
protected java.util.Map<IPoint2D,IPoint2D> |
_clusterPointToCommonPointMapping
|
protected java.util.Map<java.util.Set<IPoint2D>,IPoint2D> |
_clustersToPointMapping
|
protected boolean |
_createdNewVersion
|
protected boolean |
_dirty
|
protected java.util.List<java.util.Set<IPoint2D>> |
_endPointsMultiClusters
|
protected Polygon |
_inputPolygon
|
protected Polygon |
_value
|
| Constructor Summary | |
|---|---|
PolygonEndPointAdjuster()
|
|
PolygonEndPointAdjuster(Polygon inputPolygon)
|
|
| Method Summary | |
|---|---|
boolean |
adjustmentPointOkForLine(CLine line,
IPoint2D newPoint)
|
boolean |
createdNewVersion()
|
static IPoint2D |
extendLine(CLine line,
IPoint2D clusterPoint)
|
java.util.List<java.util.Set<IPoint2D>> |
getEndPointsMultiClusters()
|
Polygon |
getInput()
|
Polygon |
getValue()
Starts a lazy calculation. |
Polygon |
invoke()
|
boolean |
isDirty()
When dirty is false that means that the calculated value can be used |
void |
setInput(Polygon input)
|
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. |
static boolean |
startPointIsClosest(CLine line,
IPoint2D clusterPoint)
|
protected IPoint2D |
testCluster(java.util.Set<IPoint2D> cluster)
If all the points in a cluster can be combined to a single point |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Polygon _inputPolygon
protected Polygon _value
protected boolean _dirty
protected java.util.List<java.util.Set<IPoint2D>> _endPointsMultiClusters
protected java.util.Map<java.util.Set<IPoint2D>,IPoint2D> _clustersToPointMapping
protected java.util.Map<IPoint2D,IPoint2D> _clusterPointToCommonPointMapping
protected boolean _createdNewVersion
| Constructor Detail |
|---|
public PolygonEndPointAdjuster()
public PolygonEndPointAdjuster(Polygon inputPolygon)
| Method Detail |
|---|
public Polygon getInput()
getInput in interface Improver<Polygon>public boolean isDirty()
LazyCalc
isDirty in interface LazyCalc<Polygon>public void setup()
LazyCalc
setup in interface LazyCalc<Polygon>public Polygon invoke()
invoke in interface Calc0<Polygon>public Polygon getValue()
CalcValue
getValue in interface CalcValue<Polygon>protected IPoint2D testCluster(java.util.Set<IPoint2D> cluster)
public static boolean startPointIsClosest(CLine line,
IPoint2D clusterPoint)
public static IPoint2D extendLine(CLine line,
IPoint2D clusterPoint)
public boolean adjustmentPointOkForLine(CLine line,
IPoint2D newPoint)
public java.util.List<java.util.Set<IPoint2D>> getEndPointsMultiClusters()
public boolean createdNewVersion()
createdNewVersion in interface Improver<Polygon>public void setInput(Polygon input)
setInput in interface Improver<Polygon>
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||