|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.gvsig.fmap.geom.primitive.impl.AbstractPrimitive
public abstract class AbstractPrimitive
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.gvsig.fmap.geom.Geometry |
---|
Geometry.DIMENSIONS, Geometry.OPERATIONS, Geometry.SUBTYPES, Geometry.TYPES |
Field Summary | |
---|---|
protected GeometryType |
geometryType
|
protected static GeometryManager |
geomManager
|
protected String |
id
|
protected org.cresques.cts.IProjection |
projection
|
Fields inherited from interface org.gvsig.fmap.geom.Geometry |
---|
BEST, E, EXTENDED_GEOMSUBTYPE_OFFSET, EXTENDED_GEOMTYPE_OFFSET, N, NE, NW, S, SE, SELECTHANDLER, STRETCHINGHANDLER, SW, W |
Constructor Summary | |
---|---|
AbstractPrimitive(GeometryType geometryType)
The constructor with the GeometryType like and argument is used by the GeometryType #create()
to create the geometry |
|
AbstractPrimitive(GeometryType geometryType,
org.cresques.cts.IProjection projection)
|
|
AbstractPrimitive(GeometryType geometryType,
String id,
org.cresques.cts.IProjection projection)
|
Method Summary | |
---|---|
double |
area()
|
Geometry |
buffer(double distance)
Computes a buffer area around this geometry having the given width This is a utility method to wrap the invocation to the operation Geometry.OPERATIONS.BUFFER . |
Point |
centroid()
|
Geometry |
cloneGeometry()
Creates a clone of this geometry. |
int |
compareTo(Object arg0)
|
boolean |
contains(Geometry geometry)
Tests whether this geometry contains the specified geometry. |
protected boolean |
containsPoint(Geometry geom,
double x,
double y)
Utility method |
protected boolean |
containsRectangle(Geometry geom,
double x,
double y,
double w,
double h)
|
byte[] |
convertToWKB()
Return a byte array with the equivalent in WKB format of the Geometry. |
String |
convertToWKT()
Return a string with the equivalent in WKT format of the Geometry. |
Geometry |
convexHull()
|
boolean |
coveredBy(Geometry geometry)
|
boolean |
crosses(Geometry geometry)
|
Geometry |
difference(Geometry other)
|
boolean |
disjoint(Geometry geometry)
|
double |
distance(Geometry geometry)
Returns the minimum distance between this Geometry and the specified geometry. |
boolean |
equals(Object obj)
|
boolean |
fastIntersects(double x,
double y,
double w,
double h)
Used by the drawing strategies to quickly test whether this geometry intersects with the visible rectangle. |
GeometryType |
getGeometryType()
Instance of the GeometryType associated to this geometry. |
Handler[] |
getHandlers(int type)
It returns the handlers of the geometry, these they can be of two types is straightening and of selection. |
String |
getId()
|
Shape |
getInternalShape()
Deprecated. this Geometry is a Shape. |
Shape |
getShape()
|
Shape |
getShape(AffineTransform affineTransform)
|
int |
getShapeType()
Gets the geometry type of this shape. |
org.cresques.cts.IProjection |
getSRS()
|
int |
getType()
If this geometry is a predefined interface then this method returns one of Geometry.TYPES contants. |
Geometry |
intersection(Geometry other)
|
boolean |
intersects(Geometry geometry)
|
protected boolean |
intersectsRectangle(Geometry geom,
double x,
double y,
double w,
double h)
|
Object |
invokeOperation(int index,
GeometryOperationContext ctx)
Invokes a geometry operation given its index and context. |
Object |
invokeOperation(String oppName,
GeometryOperationContext ctx)
Invokes a geometry operation given its name and context. |
boolean |
isSimple()
Returns true if this Geometry has no interior point of
self-intersection or self-tangency. |
static void |
moveGeom(Geometry geometry,
double dx,
double dy)
|
boolean |
overlaps(Geometry geometry)
Tests whether this geometry overlaps the specified geometry. |
double |
perimeter()
|
static void |
rotateGeom(Geometry geometry,
double radAngle,
double basex,
double basey)
|
static void |
scaleGeom(Geometry geometry,
Point2D basePoint,
double sx,
double sy)
|
String |
toString()
|
boolean |
touches(Geometry geometry)
|
AbstractPrimitive |
transform(org.cresques.cts.IProjection newProjection)
|
Geometry |
union(Geometry other)
|
boolean |
within(Geometry geometry)
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.gvsig.fmap.geom.Geometry |
---|
getBounds2D, getDimension, getEnvelope, getGeneralPath, getPathIterator, getPathIterator, intersects, reProject, transform |
Methods inherited from interface java.awt.Shape |
---|
contains, contains, contains, contains, getBounds, intersects |
Methods inherited from interface org.gvsig.fmap.geom.primitive.FShape |
---|
cloneFShape, getSelectHandlers, getStretchingHandlers, reProject, transform |
Field Detail |
---|
protected String id
protected org.cresques.cts.IProjection projection
protected GeometryType geometryType
protected static GeometryManager geomManager
Constructor Detail |
---|
public AbstractPrimitive(GeometryType geometryType)
GeometryType
#create()
to create the geometry
type
- The geometry typepublic AbstractPrimitive(GeometryType geometryType, String id, org.cresques.cts.IProjection projection)
public AbstractPrimitive(GeometryType geometryType, org.cresques.cts.IProjection projection)
Method Detail |
---|
public GeometryType getGeometryType()
Geometry
getGeometryType
in interface Geometry
public int getType()
Geometry
Geometry.TYPES
contants.
getType
in interface Geometry
Geometry.TYPES
or a runtime constant if it is an extended
type.public Shape getInternalShape()
getInternalShape
in interface Geometry
com.iver.cit.gvsig.fmap.core.Geometry#getInternalShape()
public String getId()
public org.cresques.cts.IProjection getSRS()
public AbstractPrimitive transform(org.cresques.cts.IProjection newProjection)
public static void rotateGeom(Geometry geometry, double radAngle, double basex, double basey)
public static void moveGeom(Geometry geometry, double dx, double dy)
public static void scaleGeom(Geometry geometry, Point2D basePoint, double sx, double sy)
public boolean fastIntersects(double x, double y, double w, double h)
Geometry
fastIntersects
in interface Geometry
x
- The minimum X coordinate.y
- The minimum Y coordinate.w
- The width of the envelope.h
- The height of the envelope.
this
intersects the rectangle defined by the
parameters.public Geometry cloneGeometry()
Geometry
cloneGeometry
in interface Geometry
public Handler[] getHandlers(int type)
Geometry
getHandlers
in interface Geometry
type
- Type of handlers.
public boolean isSimple()
Geometry
true
if this Geometry has no interior point of
self-intersection or self-tangency. In mathematical formalisms, this
means that every point in the interior of the object must have a metric
neighborhood whose intersection with the object is isomorphic to an
n-sphere, where n is the dimension of this Geometry.
isSimple
in interface Geometry
public Object invokeOperation(int index, GeometryOperationContext ctx) throws GeometryOperationNotSupportedException, GeometryOperationException
Geometry
invokeOperation
in interface Geometry
index
- Unique index of the operation. Operation code.ctx
- The context of the geometry operation.
GeometryOperationNotSupportedException
- It is thrown when the operation has been not registered for
this geometry.
GeometryOperationException
- It is thrown when there is an error executing the operation.public Object invokeOperation(String oppName, GeometryOperationContext ctx) throws GeometryOperationNotSupportedException, GeometryOperationException
Geometry
invokeOperation
in interface Geometry
oppName
- Operation name.ctx
- The context of the geometry operation.
GeometryOperationNotSupportedException
- It is thrown when the operation has been not registered for
this geometry.
GeometryOperationException
- It is thrown when there is an error executing the operation.public int compareTo(Object arg0)
compareTo
in interface Comparable
public String toString()
toString
in class Object
public boolean equals(Object obj)
equals
in class Object
public int getShapeType()
FShape
getShapeType
in interface FShape
protected boolean containsPoint(Geometry geom, double x, double y) throws GeometryOperationException
geometry
- x
- y
-
GeometryOperationException
protected boolean containsRectangle(Geometry geom, double x, double y, double w, double h) throws GeometryOperationException
geometry
- x
- y
- w
- h
-
GeometryOperationException
protected boolean intersectsRectangle(Geometry geom, double x, double y, double w, double h) throws GeometryOperationException
geom
- x
- y
- w
- h
-
GeometryOperationException
public byte[] convertToWKB() throws GeometryOperationNotSupportedException, GeometryOperationException
Geometry
Geometry.OPERATIONS.CONVERTTOWKB
.
convertToWKB
in interface Geometry
GeometryOperationNotSupportedException
GeometryOperationException
public String convertToWKT() throws GeometryOperationNotSupportedException, GeometryOperationException
Geometry
Geometry.OPERATIONS.CONVERTTOWKT
.
convertToWKT
in interface Geometry
GeometryOperationNotSupportedException
GeometryOperationException
public Geometry buffer(double distance) throws GeometryOperationNotSupportedException, GeometryOperationException
Geometry
Geometry.OPERATIONS.BUFFER
.
buffer
in interface Geometry
distance
- the width of the buffer
GeometryOperationNotSupportedException
GeometryOperationException
public boolean contains(Geometry geometry) throws GeometryOperationNotSupportedException, GeometryOperationException
Geometry
Geometry.OPERATIONS.CONTAINS
.
contains
in interface Geometry
geometry
- the Geometry with which to compare this Geometry
GeometryOperationNotSupportedException
GeometryOperationException
public double distance(Geometry geometry) throws GeometryOperationNotSupportedException, GeometryOperationException
Geometry
Geometry.OPERATIONS.DISTANCE
.
distance
in interface Geometry
geometry
- the Geometry from which to compute the distance
GeometryOperationNotSupportedException
GeometryOperationException
public boolean overlaps(Geometry geometry) throws GeometryOperationNotSupportedException, GeometryOperationException
Geometry
Geometry.OPERATIONS.OVERLAPS
.
overlaps
in interface Geometry
geometry
- the Geometry with which to compare this Geometry
GeometryOperationNotSupportedException
GeometryOperationException
public Geometry convexHull() throws GeometryOperationNotSupportedException, GeometryOperationException
convexHull
in interface Geometry
GeometryOperationNotSupportedException
GeometryOperationException
public boolean coveredBy(Geometry geometry) throws GeometryOperationNotSupportedException, GeometryOperationException
coveredBy
in interface Geometry
GeometryOperationNotSupportedException
GeometryOperationException
public boolean crosses(Geometry geometry) throws GeometryOperationNotSupportedException, GeometryOperationException
crosses
in interface Geometry
GeometryOperationNotSupportedException
GeometryOperationException
public Geometry difference(Geometry other) throws GeometryOperationNotSupportedException, GeometryOperationException
difference
in interface Geometry
GeometryOperationNotSupportedException
GeometryOperationException
public Geometry intersection(Geometry other) throws GeometryOperationNotSupportedException, GeometryOperationException
intersection
in interface Geometry
GeometryOperationNotSupportedException
GeometryOperationException
public boolean intersects(Geometry geometry) throws GeometryOperationNotSupportedException, GeometryOperationException
intersects
in interface Geometry
GeometryOperationNotSupportedException
GeometryOperationException
public boolean touches(Geometry geometry) throws GeometryOperationNotSupportedException, GeometryOperationException
touches
in interface Geometry
GeometryOperationNotSupportedException
GeometryOperationException
public Geometry union(Geometry other) throws GeometryOperationNotSupportedException, GeometryOperationException
union
in interface Geometry
GeometryOperationNotSupportedException
GeometryOperationException
public boolean disjoint(Geometry geometry) throws GeometryOperationNotSupportedException, GeometryOperationException
disjoint
in interface Geometry
GeometryOperationNotSupportedException
GeometryOperationException
public boolean within(Geometry geometry) throws GeometryOperationNotSupportedException, GeometryOperationException
within
in interface Geometry
GeometryOperationNotSupportedException
GeometryOperationException
public Point centroid() throws GeometryOperationNotSupportedException, GeometryOperationException
centroid
in interface Geometry
GeometryOperationNotSupportedException
GeometryOperationException
public double area() throws GeometryOperationNotSupportedException, GeometryOperationException
area
in interface Geometry
GeometryOperationNotSupportedException
GeometryOperationException
public double perimeter() throws GeometryOperationNotSupportedException, GeometryOperationException
perimeter
in interface Geometry
GeometryOperationNotSupportedException
GeometryOperationException
public Shape getShape()
getShape
in interface Geometry
public Shape getShape(AffineTransform affineTransform)
getShape
in interface Geometry
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |