org.deegree_impl.model.geometry
Class GM_SurfacePatch_Impl

java.lang.Object
  extended byorg.deegree_impl.model.geometry.GM_SurfacePatch_Impl
All Implemented Interfaces:
GM_GenericSurface, java.io.Serializable
Direct Known Subclasses:
GM_Polygon_Impl

abstract class GM_SurfacePatch_Impl
extends java.lang.Object
implements GM_GenericSurface, java.io.Serializable

default implementation of the GM_SurfacePatch interface from package jago.model. the class is abstract because it should be specialized by derived classes GM_Polygon for example ------------------------------------------------------------

Version:
11.6.2001
Author:
Andreas Poth

Field Summary
protected  double area
           
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
protected GM_SurfacePatch_Impl(GM_SurfaceInterpolation interpolation, GM_Position[] exteriorRing, GM_Position[][] interiorRings, CS_CoordinateSystem crs)
          Creates a new GM_SurfacePatch_Impl object.
 
Method Summary
private  double calculateArea(GM_Position[] point)
          calculates the area of the surface patch taken from gems iv (modified) this method is only valid for the two-dimensional case.
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.
private  void calculateCentroidArea()
          calculates the centroid and area of the surface patch. this method is only valid for the two-dimensional case.
private  void calculateEnvelope()
           
protected  void calculateParam()
          calculates the centroid and the area of the surface patch
 boolean equals(java.lang.Object other)
           
 double getArea()
          The operation "area" shall return the area of this GM_GenericSurface.
 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.
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
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Use serialVersionUID for interoperability.

See Also:
Constant Field Values

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_SurfacePatch_Impl

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

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

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


calculateEnvelope

private void calculateEnvelope()

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


equals

public boolean equals(java.lang.Object other)
Parameters:
other -
Returns:

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

calculateCentroidArea

private void calculateCentroidArea()
calculates the centroid and area of the surface patch. this method is only valid for the two-dimensional case.


calculateParam

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


calculateArea

private double calculateArea(GM_Position[] point)
calculates the area of the surface patch

taken from gems iv (modified)

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


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.


toString

public java.lang.String toString()
Returns: