org.deegree_impl.model.geometry
Class GM_Polygon_Impl

java.lang.Object
  extended byorg.deegree_impl.model.geometry.GM_SurfacePatch_Impl
      extended byorg.deegree_impl.model.geometry.GM_Polygon_Impl
All Implemented Interfaces:
GM_GenericSurface, GM_Polygon, GM_SurfacePatch, java.io.Serializable

class GM_Polygon_Impl
extends GM_SurfacePatch_Impl
implements GM_Polygon, java.io.Serializable

default implementierung of the GM_Polygon interface from package jago.model. ------------------------------------------------------------

Version:
11.6.2001
Author:
Andreas Poth

Field Summary
protected  double area
           
private  GM_SurfaceBoundary boundary
           
protected  GM_Point centroid
           
protected  CS_CoordinateSystem crs
           
protected  GM_Envelope envelope
           
protected  GM_Position[] exteriorRing
           
protected  GM_Position[][] interiorRings
           
protected  GM_SurfaceInterpolation interpolation
           
private static long serialVersionUID
          Use serialVersionUID for interoperability.
protected  boolean valid
           
 
Constructor Summary
GM_Polygon_Impl(GM_SurfaceInterpolation interpolation, GM_Position[] exteriorRing, GM_Position[][] interiorRings, CS_CoordinateSystem crs)
          Creates a new GM_Polygon_Impl object.
 
Method Summary
protected  GM_Position calculateCentroid(GM_Position[] point)
          calculates the centroid of the surface patch taken from gems iv (modified) this method is only valid for the two-dimensional case.
protected  void calculateParam()
          calculates the centroid and the area of the surface patch
 java.lang.Object clone()
          returns a shallow copy of the geometry
 boolean contains(GM_Object gmo)
          The Boolean valued operation "contains" shall return TRUE if this GM_Object contains another GM_Object.
private  boolean containsMultiObject(GM_Aggregate gmo)
           
 boolean equals(java.lang.Object other)
          checks if this curve is completly equal to the submitted geometry
 double getArea()
          The operation "area" shall return the area of this GM_GenericSurface.
 GM_SurfaceBoundary getBoundary()
          The operation "boundary" shall return the boundary of this GM_SurfacePatch represented as a collection of GM_Curves organized as a GM_SurfaceBoundary, consisting of GM_Curve instances along the boundary of the aggregate GM_Surface, and interior to the GM_Surface where GM_SurfacePatches are adjacent.
 GM_Point getCentroid()
          The operation "centroid" shall return the mathematical centroid for this GM_Object.
 CS_CoordinateSystem getCoordinateSystem()
          returns the coordinate system of the surface patch
 GM_Envelope getEnvelope()
          returns the bounding box of the surface patch
 GM_Position[] getExteriorRing()
          returns a reference to the exterior ring of the surface
 GM_Position[][] getInteriorRings()
          returns a reference to the interior rings of the surface
 GM_SurfaceInterpolation getInterpolation()
          The interpolation determines the surface interpolation mechanism used for this GM_SurfacePatch.
 double getPerimeter()
          returns the length of all boundaries of the surface in a reference system appropriate for measuring distances.
 boolean intersects(GM_Object gmo)
          The Boolean valued operation "intersects" shall return TRUE if this GM_Object intersects another GM_Object.
private  boolean intersectsMultiObject(GM_Aggregate mprim)
          the operations returns true if the submitted multi primitive intersects with the curve segment
protected  boolean isValid()
          returns true if the calculated parameters of the GM_Object are valid and false if they must be recalculated
protected  void setValid(boolean valid)
          invalidates the calculated parameters of the GM_Object
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.deegree.model.geometry.GM_SurfacePatch
getArea, getCentroid, getCoordinateSystem, getExteriorRing, getInteriorRings, getInterpolation
 
Methods inherited from interface org.deegree.model.geometry.GM_GenericSurface
getEnvelope, getPerimeter
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Use serialVersionUID for interoperability.

See Also:
Constant Field Values

boundary

private GM_SurfaceBoundary boundary

crs

protected CS_CoordinateSystem crs

envelope

protected GM_Envelope envelope

centroid

protected GM_Point centroid

interpolation

protected GM_SurfaceInterpolation interpolation

exteriorRing

protected GM_Position[] exteriorRing

interiorRings

protected GM_Position[][] interiorRings

area

protected double area

valid

protected boolean valid
Constructor Detail

GM_Polygon_Impl

public GM_Polygon_Impl(GM_SurfaceInterpolation interpolation,
                       GM_Position[] exteriorRing,
                       GM_Position[][] interiorRings,
                       CS_CoordinateSystem crs)
                throws GM_Exception
Creates a new GM_Polygon_Impl object.

Parameters:
interpolation -
exteriorRing -
interiorRings -
crs -
Throws:
GM_Exception
Method Detail

getBoundary

public GM_SurfaceBoundary getBoundary()
The operation "boundary" shall return the boundary of this GM_SurfacePatch represented as a collection of GM_Curves organized as a GM_SurfaceBoundary, consisting of GM_Curve instances along the boundary of the aggregate GM_Surface, and interior to the GM_Surface where GM_SurfacePatches are adjacent.


equals

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

Overrides:
equals in class GM_SurfacePatch_Impl
Parameters:
other - object to compare to
Returns:

toString

public java.lang.String toString()
Overrides:
toString in class GM_SurfacePatch_Impl
Returns:

clone

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


intersects

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

Specified by:
intersects in interface GM_SurfacePatch

intersectsMultiObject

private boolean intersectsMultiObject(GM_Aggregate mprim)
                               throws java.lang.Exception
the operations returns true if the submitted multi primitive intersects with the curve segment

Throws:
java.lang.Exception

contains

public boolean contains(GM_Object gmo)
The Boolean valued operation "contains" shall return TRUE if this GM_Object contains another GM_Object.

Specified by:
contains in interface GM_SurfacePatch

containsMultiObject

private boolean containsMultiObject(GM_Aggregate gmo)
Parameters:
gmo -
Returns:

setValid

protected void setValid(boolean valid)
invalidates the calculated parameters of the GM_Object


isValid

protected boolean isValid()
returns true if the calculated parameters of the GM_Object are valid and false if they must be recalculated


getInterpolation

public GM_SurfaceInterpolation getInterpolation()
The interpolation determines the surface interpolation mechanism used for this GM_SurfacePatch. This mechanism uses the control points and control parameters defined in the various subclasses to determine the position of this GM_ SurfacePatch.


getEnvelope

public GM_Envelope getEnvelope()
returns the bounding box of the surface patch

Specified by:
getEnvelope in interface GM_GenericSurface

getExteriorRing

public GM_Position[] getExteriorRing()
returns a reference to the exterior ring of the surface


getInteriorRings

public GM_Position[][] getInteriorRings()
returns a reference to the interior rings of the surface


getPerimeter

public double getPerimeter()
returns the length of all boundaries of the surface in a reference system appropriate for measuring distances.

Specified by:
getPerimeter in interface GM_GenericSurface

getCoordinateSystem

public CS_CoordinateSystem getCoordinateSystem()
returns the coordinate system of the surface patch


getCentroid

public GM_Point getCentroid()
The operation "centroid" shall return the mathematical centroid for this GM_Object. The result is not guaranteed to be on the object.


getArea

public double getArea()
The operation "area" shall return the area of this GM_GenericSurface. The area of a 2 dimensional geometric object shall be a numeric measure of its surface area Since area is an accumulation (integral) of the product of two distances, its return value shall be in a unit of measure appropriate for measuring distances squared.

Specified by:
getArea in interface GM_GenericSurface

calculateParam

protected void calculateParam()
calculates the centroid and the area of the surface patch


calculateCentroid

protected GM_Position calculateCentroid(GM_Position[] point)
calculates the centroid of the surface patch

taken from gems iv (modified)

this method is only valid for the two-dimensional case.