org.gvsig.fmap.geom.aggregate.impl
Class BaseMultiPrimitive

java.lang.Object
  extended by org.gvsig.fmap.geom.primitive.impl.AbstractPrimitive
      extended by org.gvsig.fmap.geom.aggregate.impl.BaseMultiPrimitive
All Implemented Interfaces:
Shape, Serializable, Comparable, Aggregate, MultiPrimitive, Geometry, FShape, Primitive
Direct Known Subclasses:
BaseMultiPrimitive2D, MultiCurve2D, MultiCurve2DZ, MultiPoint2D, MultiSolid2DZ, MultiSurface2D

public abstract class BaseMultiPrimitive
extends AbstractPrimitive
implements MultiPrimitive

Author:
Jorge Piera LlodrĂ¡ (jorge.piera@iver.es)
See Also:
Serialized Form

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  ArrayList geometries
           
 
Fields inherited from class org.gvsig.fmap.geom.primitive.impl.AbstractPrimitive
geometryType, geomManager, id, 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
BaseMultiPrimitive(GeometryType geometryType)
          The constructor with the GeometryType like and argument is used by the GeometryType#create() to create the geometry
 
Method Summary
 void addPrimitive(Primitive primitive)
          Adds a new primitive to the primitive
 FShape cloneFShape()
          Creates and returns a shape equal and independent of this one.
 boolean contains(double x, double y)
           
 boolean contains(double x, double y, double w, double h)
           
 boolean contains(Point2D p)
           
 boolean contains(Rectangle2D r)
           
 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.
 Rectangle getBounds()
           
 Rectangle2D getBounds2D()
          Returns this geometry's boundary rectangle.
 int getDimension()
          Returns the largest number n such that each direct position in a geometric set can be associated with a subset that has the direct position in its interior and is similar (isomorphic) to Rn, Euclidean n-space.
 Envelope getEnvelope()
           Returns the minimum bounding box for this Geometry.
 GeneralPathX getGeneralPath()
          Get GeneralPathIterator, to do registered operations to it.
 Geometry[] getGeometries()
          Deprecated.  
 Handler[] getHandlers(int type)
          It returns the handlers of the geometry, these they can be of two types is straightening and of selection.
 Shape getInternalShape()
          (non-Javadoc)
 PathIterator getPathIterator(AffineTransform at)
          If applies an affine transformation and returns the GeneralPathXIterator with this geometry's information.
 PathIterator getPathIterator(AffineTransform at, double flatness)
          If applies an affine transformation and returns the GeneralPathXIterator with this geometry's information.
 Primitive getPrimitiveAt(int i)
          Returns one of the Primitive's that is in a concrete position.
 int getPrimitivesNumber()
          Returns the number of Primitive's that composes this multi geometry.
 Handler[] getSelectHandlers()
          Returns the handlers used to select the geometries.
 Handler[] getStretchingHandlers()
          Returns the handlers they utilized to stretch the geometries.
 boolean intersects(double x, double y, double w, double h)
           
 boolean intersects(Rectangle2D r)
          Returns true if this geometry intersects the rectangle passed as parameter.
 boolean isSimple()
          Returns true if this Geometry has no interior point of self-intersection or self-tangency.
 void reProject(org.cresques.cts.ICoordTrans ct)
          Reprojects this geometry by the coordinate transformer passed as parameter.
 void transform(AffineTransform at)
          It applies an affine transformation to the geometry.
 
Methods inherited from class org.gvsig.fmap.geom.primitive.impl.AbstractPrimitive
area, buffer, centroid, cloneGeometry, compareTo, contains, containsPoint, containsRectangle, convertToWKB, convertToWKT, convexHull, coveredBy, crosses, difference, disjoint, distance, equals, getGeometryType, getId, getShape, getShape, getShapeType, getSRS, getType, intersection, intersects, intersectsRectangle, invokeOperation, invokeOperation, moveGeom, overlaps, perimeter, rotateGeom, scaleGeom, toString, touches, transform, union, within
 
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
area, buffer, centroid, cloneGeometry, contains, convertToWKB, convertToWKT, convexHull, coveredBy, crosses, difference, disjoint, distance, getGeometryType, getShape, getShape, getType, intersection, intersects, invokeOperation, invokeOperation, overlaps, perimeter, touches, union, within
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

geometries

protected ArrayList geometries
Constructor Detail

BaseMultiPrimitive

public BaseMultiPrimitive(GeometryType geometryType)
The constructor with the GeometryType like and argument is used by the GeometryType#create() to create the geometry

Parameters:
type - The geometry type
Method Detail

contains

public boolean contains(double x,
                        double y)
Specified by:
contains in interface Shape

contains

public boolean contains(double x,
                        double y,
                        double w,
                        double h)
Specified by:
contains in interface Shape

contains

public boolean contains(Point2D p)
Specified by:
contains in interface Shape

contains

public boolean contains(Rectangle2D r)
Specified by:
contains in interface Shape

getDimension

public int getDimension()
Description copied from interface: Geometry
Returns the largest number n such that each direct position in a geometric set can be associated with a subset that has the direct position in its interior and is similar (isomorphic) to Rn, Euclidean n-space.

Specified by:
getDimension in interface Geometry
Returns:
The dimension.

fastIntersects

public boolean fastIntersects(double x,
                              double y,
                              double w,
                              double h)
Description copied from interface: Geometry
Used by the drawing strategies to quickly test whether this geometry intersects with the visible rectangle.

Specified by:
fastIntersects in interface Geometry
Overrides:
fastIntersects in class AbstractPrimitive
Parameters:
x - The minimum X coordinate.
y - The minimum Y coordinate.
w - The width of the envelope.
h - The height of the envelope.
Returns:
true if this intersects the rectangle defined by the parameters.

getBounds

public Rectangle getBounds()
Specified by:
getBounds in interface Shape

getBounds2D

public Rectangle2D getBounds2D()
Description copied from interface: Geometry
Returns this geometry's boundary rectangle.

Specified by:
getBounds2D in interface Shape
Specified by:
getBounds2D in interface Geometry
Returns:
Boundary rectangle.

getHandlers

public Handler[] getHandlers(int type)
Description copied from interface: Geometry
It returns the handlers of the geometry, these they can be of two types is straightening and of selection.

Specified by:
getHandlers in interface Geometry
Overrides:
getHandlers in class AbstractPrimitive
Parameters:
type - Type of handlers.
Returns:
The handlers.

getInternalShape

public Shape getInternalShape()
Description copied from class: AbstractPrimitive
(non-Javadoc)

Specified by:
getInternalShape in interface Geometry
Overrides:
getInternalShape in class AbstractPrimitive
Returns:
The awt shape
See Also:
com.iver.cit.gvsig.fmap.core.Geometry#getInternalShape()

getPathIterator

public PathIterator getPathIterator(AffineTransform at)
Description copied from interface: Geometry
If applies an affine transformation and returns the GeneralPathXIterator with this geometry's information.

Specified by:
getPathIterator in interface Shape
Specified by:
getPathIterator in interface Geometry
Parameters:
at - The transformation to apply.
Returns:
The GeneralPathXIterator with this geometry's information.

getPathIterator

public PathIterator getPathIterator(AffineTransform at,
                                    double flatness)
Description copied from interface: Geometry
If applies an affine transformation and returns the GeneralPathXIterator with this geometry's information.

Specified by:
getPathIterator in interface Shape
Specified by:
getPathIterator in interface Geometry
Parameters:
at - The affine transformation.
Returns:
The GeneralPathXIterator with this geometry's information.

getPrimitiveAt

public Primitive getPrimitiveAt(int i)
Description copied from interface: Aggregate
Returns one of the Primitive's that is in a concrete position.

Specified by:
getPrimitiveAt in interface Aggregate
Parameters:
i - Geometry position.
Returns:
A simple geometry.

getPrimitivesNumber

public int getPrimitivesNumber()
Description copied from interface: Aggregate
Returns the number of Primitive's that composes this multi geometry.

Specified by:
getPrimitivesNumber in interface Aggregate
Returns:
the number of Primitive's that composes this multi geometry.

intersects

public boolean intersects(double x,
                          double y,
                          double w,
                          double h)
Specified by:
intersects in interface Shape

intersects

public boolean intersects(Rectangle2D r)
Description copied from interface: Geometry
Returns true if this geometry intersects the rectangle passed as parameter.

Specified by:
intersects in interface Shape
Specified by:
intersects in interface Geometry
Parameters:
r - Rectangle.
Returns:
True, if this intersects r.

isSimple

public boolean isSimple()
Description copied from interface: Geometry
Returns 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.

Specified by:
isSimple in interface Geometry
Overrides:
isSimple in class AbstractPrimitive
Returns:
If the geometry is simple.

reProject

public void reProject(org.cresques.cts.ICoordTrans ct)
Description copied from interface: Geometry
Reprojects this geometry by the coordinate transformer passed as parameter.

Specified by:
reProject in interface Geometry
Specified by:
reProject in interface FShape
Parameters:
ct - Coordinate Transformer.

transform

public void transform(AffineTransform at)
Description copied from interface: Geometry
It applies an affine transformation to the geometry.

Specified by:
transform in interface Geometry
Specified by:
transform in interface FShape
Parameters:
at - The transformation to apply.
See Also:
AffineTransform

getEnvelope

public Envelope getEnvelope()
Description copied from interface: Geometry

Returns the minimum bounding box for this Geometry. This shall be the coordinate region spanning the minimum and maximum value for each ordinate taken on by DirectPositions in this Geometry. The simplest representation for an envelope consists of two DirectPositions, the first one containing all the minimums for each ordinate, and second one containing all the maximums.

Specified by:
getEnvelope in interface Geometry
Returns:
The minimum bounding box for this Geometry.

getGeometries

public Geometry[] getGeometries()
Deprecated. 

Returns:
the geometries

cloneFShape

public FShape cloneFShape()
Description copied from interface: FShape
Creates and returns a shape equal and independent of this one.

Specified by:
cloneFShape in interface FShape
Returns:
the new shape.

getSelectHandlers

public Handler[] getSelectHandlers()
Description copied from interface: FShape
Returns the handlers used to select the geometries.

Specified by:
getSelectHandlers in interface FShape
Returns:
Handlers the handlers used to select the geometries

getStretchingHandlers

public Handler[] getStretchingHandlers()
Description copied from interface: FShape
Returns the handlers they utilized to stretch the geometries.

Specified by:
getStretchingHandlers in interface FShape
Returns:
Handlers the handlers used to stretch the geometries

getGeneralPath

public GeneralPathX getGeneralPath()
Description copied from interface: Geometry
Get GeneralPathIterator, to do registered operations to it.

Specified by:
getGeneralPath in interface Geometry
Returns:
The GeneralPathX.

addPrimitive

public void addPrimitive(Primitive primitive)
Description copied from interface: MultiPrimitive
Adds a new primitive to the primitive

Specified by:
addPrimitive in interface MultiPrimitive
Parameters:
primitive - The primitive to add


Copyright © 2004-2012 gvSIG. All Rights Reserved.