deegree 2.2 (2008/12/22 11:33 build-3038-official)

org.deegree.model.spatialschema
Class CurveImpl

java.lang.Object
  extended by org.deegree.model.spatialschema.GeometryImpl
      extended by org.deegree.model.spatialschema.PrimitiveImpl
          extended by org.deegree.model.spatialschema.OrientablePrimitiveImpl
              extended by org.deegree.model.spatialschema.OrientableCurveImpl
                  extended by org.deegree.model.spatialschema.CurveImpl
All Implemented Interfaces:
Serializable, Curve, GenericCurve, Geometry, OrientableCurve, OrientablePrimitive, Primitive

 class CurveImpl
extends OrientableCurveImpl
implements Curve, GenericCurve, Serializable

default implementation of

Version:
$Revision: 9343 $ $Date: 2007-12-27 14:30:32 +0100 (Do, 27 Dez 2007) $
Author:
Andreas Poth
See Also:
Curve

Field Summary
protected  ArrayList<CurveSegment> segments
           
 
Fields inherited from class org.deegree.model.spatialschema.OrientablePrimitiveImpl
orientation
 
Fields inherited from class org.deegree.model.spatialschema.GeometryImpl
boundary, centroid, convexHull, crs, empty, envelope, mute, valid
 
Constructor Summary
CurveImpl(char orientation, CurveSegment[] segments)
          initialize the curve by submitting a spatial reference system, an array of curve segments and the orientation of the curve
CurveImpl(CurveSegment segments)
          initialize the curve by submitting a spatial reference system and an array of curve segments.
CurveImpl(CurveSegment[] segments)
          initialize the curve by submitting a spatial reference system and an array of curve segments.
CurveImpl(CurveSegment[] segments, CoordinateSystem crs)
          initialize the curve by submitting a spatial reference system and an array of curve segments.
 
Method Summary
protected  void calculateParam()
          recalculates internal parameters
 Object clone()
          returns a shallow copy of the geometry
 boolean equals(Object other)
          checks if this curve is completly equal to the submitted geometry
 LineString getAsLineString()
          returns the curve as LineString. if there isn't a curve segment within the curve null will be returned
 int getCoordinateDimension()
          The operation "coordinateDimension" shall return the dimension of the coordinates that define this Geometry, which must be the same as the coordinate dimension of the coordinate reference system for this Geometry.
 CurveBoundary getCurveBoundary()
          returns the boundary of the curve
 CurveSegment getCurveSegmentAt(int index)
          returns the curve segment at the submitted index
 CurveSegment[] getCurveSegments()
           
 int getDimension()
          The operation "dimension" shall return the inherent dimension of this Geometry, which shall be less than or equal to the coordinate dimension.
 Point getEndPoint()
          returns the last point of the curve.if the curve doesn't contain a segment or the last segment doesn't contain a point null will be returned
 double getLength()
          returns the length of the curve in units of the related spatial reference system
 int getNumberOfCurveSegments()
          returns the number of segments building the curve
 Point getStartPoint()
          returns the first point of the curve. if the curve doesn't contain a segment or the first segment doesn't contain a point null will be returned
 boolean intersects(Geometry gmo)
          The Boolean valued operation "intersects" shall return TRUE if this Geometry intersects another Geometry.
 boolean isEmpty()
          returns true if no segment is within the curve
 String toString()
           
 void translate(double[] d)
          translate each point of the curve with the values of the submitted double array.
 
Methods inherited from class org.deegree.model.spatialschema.OrientablePrimitiveImpl
getOrientation, setOrientation
 
Methods inherited from class org.deegree.model.spatialschema.GeometryImpl
contains, contains, difference, distance, getBoundary, getBuffer, getCentroid, getConvexHull, getCoordinateSystem, getEnvelope, getTolerance, intersection, isValid, isWithinDistance, setCoordinateSystem, setEmpty, setTolerance, setValid, union
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.deegree.model.spatialschema.OrientablePrimitive
getOrientation, setOrientation
 
Methods inherited from interface org.deegree.model.spatialschema.Geometry
contains, contains, difference, distance, getBoundary, getBuffer, getCentroid, getConvexHull, getCoordinateSystem, getEnvelope, getTolerance, intersection, isWithinDistance, setTolerance, union
 

Field Detail

segments

protected ArrayList<CurveSegment> segments
Constructor Detail

CurveImpl

public CurveImpl(CurveSegment segments)
          throws GeometryException
initialize the curve by submitting a spatial reference system and an array of curve segments. the orientation of the curve is '+'

Parameters:
segments - array of CurveSegment
Throws:
GeometryException

CurveImpl

public CurveImpl(CurveSegment[] segments)
          throws GeometryException
initialize the curve by submitting a spatial reference system and an array of curve segments. the orientation of the curve is '+'

Parameters:
segments - array of CurveSegment
Throws:
GeometryException

CurveImpl

public CurveImpl(CurveSegment[] segments,
                 CoordinateSystem crs)
          throws GeometryException
initialize the curve by submitting a spatial reference system and an array of curve segments. the orientation of the curve is '+'

Parameters:
segments - array of CurveSegment
crs -
Throws:
GeometryException

CurveImpl

public CurveImpl(char orientation,
                 CurveSegment[] segments)
          throws GeometryException
initialize the curve by submitting a spatial reference system, an array of curve segments and the orientation of the curve

Parameters:
segments - array of CurveSegment
orientation - of the curve
Throws:
GeometryException
Method Detail

calculateParam

protected void calculateParam()
Description copied from class: GeometryImpl
recalculates internal parameters

Specified by:
calculateParam in class GeometryImpl

getCurveBoundary

public CurveBoundary getCurveBoundary()
returns the boundary of the curve

Specified by:
getCurveBoundary in interface OrientableCurve

getDimension

public int getDimension()
The operation "dimension" shall return the inherent dimension of this Geometry, which shall be less than or equal to the coordinate dimension. The dimension of a collection of geometric objects shall be the largest dimension of any of its pieces. Points are 0-dimensional, curves are 1-dimensional, surfaces are 2-dimensional, and solids are 3-dimensional.

Specified by:
getDimension in interface Geometry

getCoordinateDimension

public int getCoordinateDimension()
The operation "coordinateDimension" shall return the dimension of the coordinates that define this Geometry, which must be the same as the coordinate dimension of the coordinate reference system for this Geometry.

Specified by:
getCoordinateDimension in interface Geometry

intersects

public boolean intersects(Geometry gmo)
The Boolean valued operation "intersects" shall return TRUE if this Geometry intersects another Geometry. Within a Complex, the Primitives do not intersect one another. In general, topologically structured data uses shared geometric objects to capture intersection information.

dummy implementation

Specified by:
intersects in interface Geometry
Overrides:
intersects in class GeometryImpl
Parameters:
gmo - the Geometry to intersect with
Returns:
true if the objects intersects, else false

getLength

public double getLength()
returns the length of the curve in units of the related spatial reference system

Specified by:
getLength in interface GenericCurve

getNumberOfCurveSegments

public int getNumberOfCurveSegments()
returns the number of segments building the curve

Specified by:
getNumberOfCurveSegments in interface Curve
Returns:
number of segments

getStartPoint

public Point getStartPoint()
returns the first point of the curve. if the curve doesn't contain a segment or the first segment doesn't contain a point null will be returned

Specified by:
getStartPoint in interface GenericCurve

getEndPoint

public Point getEndPoint()
returns the last point of the curve.if the curve doesn't contain a segment or the last segment doesn't contain a point null will be returned

Specified by:
getEndPoint in interface GenericCurve

getAsLineString

public LineString getAsLineString()
                           throws GeometryException
returns the curve as LineString. if there isn't a curve segment within the curve null will be returned

Specified by:
getAsLineString in interface GenericCurve
Throws:
GeometryException

getCurveSegmentAt

public CurveSegment getCurveSegmentAt(int index)
                               throws GeometryException
returns the curve segment at the submitted index

Specified by:
getCurveSegmentAt in interface Curve
Parameters:
index - index of the curve segment that should be returned
Returns:
segment at passed index position
Throws:
GeometryException - a exception will be thrown if index is smaller than '0' or larger than getNumberOfCurveSegments()-1

getCurveSegments

public CurveSegment[] getCurveSegments()
                                throws GeometryException
Specified by:
getCurveSegments in interface Curve
Returns:
all segments of a Curve
Throws:
GeometryException

isEmpty

public boolean isEmpty()
returns true if no segment is within the curve

Specified by:
isEmpty in interface Geometry
Overrides:
isEmpty in class GeometryImpl
Returns:
true if no geometry values resp. points stored within the geometry.

translate

public void translate(double[] d)
translate each point of the curve with the values of the submitted double array.

Specified by:
translate in interface Geometry
Overrides:
translate in class GeometryImpl

equals

public boolean equals(Object other)
checks if this curve is completly equal to the submitted geometry

Overrides:
equals in class GeometryImpl
Parameters:
other - object to compare to
Returns:
true if the objects are equal, else false

clone

public Object clone()
returns a shallow copy of the geometry

Overrides:
clone in class GeometryImpl
Returns:
a shallow copy of the geometry. this isn't realized at this level so a CloneNotSupportedException will be thrown.

toString

public String toString()
Overrides:
toString in class GeometryImpl
Returns:

deegree 2.2 (2008/12/22 11:33 build-3038-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://deegree.sourceforge.net