|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bbn.openmap.omGraphics.geom.BasicGeometry com.bbn.openmap.omGraphics.geom.PolygonGeometry
public abstract class PolygonGeometry
Graphic object that represents a polygon.
All of the OMGraphics are moving to having their internal representation as java.awt.Shape objects. Unfortunately, this has the side effect of slowing OMPolys down, because the way that the projection classes handle transformations cause more objects to be allocated and more loops to be run through. So, by default, the OMPoly does NOT use Shape objects internally, to keep layers that throw down many, many polys running quickly. If you want to do some spatial analysis on an OMPoly, call setDoShapes(true) on it, then generate(Projection), and then call getShapes() to get the java.awt.Shape objects for the poly. You can then run the different Shape spatial analysis methods on the Shape objects.
Nested Class Summary | |
---|---|
static class |
PolygonGeometry.LL
|
static class |
PolygonGeometry.Offset
|
static class |
PolygonGeometry.XY
|
Field Summary | |
---|---|
protected boolean |
doShapes
Flag for telling the PolygonGeometry to use the Shape objects to represent itself internally. |
protected boolean |
isPolygon
Whether it is a polygon, as opposed to a polyline. |
protected float[][] |
xpoints
Internal array of projected x coordinate arrays. |
protected float[][] |
ypoints
Internal array of projected y coordinate arrays. |
Fields inherited from class com.bbn.openmap.omGraphics.geom.BasicGeometry |
---|
attributes, lineType, needToRegenerate, shape, visible |
Constructor Summary | |
---|---|
protected |
PolygonGeometry()
|
Method Summary | |
---|---|
protected abstract java.awt.geom.GeneralPath |
createShape()
Since OMPoly has the option to not create a Shape, this method is here to create it if it is asked for. |
float |
distance(double x,
double y)
Return the shortest distance from the graphic to an XY-point. |
boolean |
getDoShapes()
|
boolean |
getIsPolygon()
|
java.awt.geom.GeneralPath |
getShape()
Get the array of java.awt.Shape objects that represent the projected graphic. |
void |
setDoShapes(boolean set)
|
protected void |
setIsPolygon(boolean set)
|
Methods inherited from class com.bbn.openmap.omGraphics.geom.BasicGeometry |
---|
_distance, appendShapeEdge, appendShapeEdge, appendShapeEdge, appendShapeEdge, clearAttributes, contains, createAttributeMap, createBoxShape, createShape, createShape, describeShapeDetail, describeShapeDetail, deselect, distanceToEdge, distanceToEdge, draw, draw, fill, fill, generate, getAppObject, getAttribute, getAttributes, getDescription, getLineType, getNeedToRegenerate, getRenderType, isRenderable, isRenderable, isVisible, putAttribute, regenerate, removeAttribute, render, restore, select, setAppObject, setAttributes, setLineType, setNeedToRegenerate, setShape, setVisible |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.bbn.openmap.omGraphics.OMGeometry |
---|
clearAttributes, contains, deselect, distanceToEdge, draw, draw, fill, fill, generate, getAppObject, getAttribute, getAttributes, getDescription, getLineType, getNeedToRegenerate, getRenderType, isRenderable, isRenderable, isVisible, putAttribute, regenerate, removeAttribute, render, restore, select, setAppObject, setAttributes, setLineType, setNeedToRegenerate, setShape, setVisible |
Field Detail |
---|
protected float[][] xpoints
protected float[][] ypoints
protected boolean isPolygon
protected boolean doShapes
Constructor Detail |
---|
protected PolygonGeometry()
Method Detail |
---|
public void setDoShapes(boolean set)
public boolean getDoShapes()
protected void setIsPolygon(boolean set)
public boolean getIsPolygon()
protected abstract java.awt.geom.GeneralPath createShape()
public float distance(double x, double y)
distance
in interface OMGeometry
distance
in class BasicGeometry
x
- horizontal pixel location.y
- vertical pixel location.
public java.awt.geom.GeneralPath getShape()
The java.awt.Shape object gives you the ability to do a little spatial analysis on the graphics.
getShape
in interface OMGeometry
getShape
in class BasicGeometry
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |