de.unihalle.informatik.MiToBo.core.datatypes
Class MTBPolygon2D_GeoPolygonsWrapper

java.lang.Object
  extended by de.unihalle.informatik.MiToBo.core.datatypes.MTBPolygon2D_GeoPolygonsWrapper

public class MTBPolygon2D_GeoPolygonsWrapper
extends Object

Wrapper class for C2DPolygon functions from GeoPolygons library.

Webpage: GeoLib Homepage

Author:
moeller

Constructor Summary
MTBPolygon2D_GeoPolygonsWrapper()
           
 
Method Summary
protected static MTBPolygon2D C2DtoMTB(uk.co.geolib.geopolygons.C2DPolygon cPoly)
          Converts a C2D polygon to the MiToBo polygon data type.
protected static boolean containsPoint(MTBPolygon2D p, double x, double y)
          Checks if a point lies inside of the polygon.
protected static boolean isClockwiseOriented(MTBPolygon2D p)
          Checks if polygon is oriented counter-clockwise.
protected static boolean isConvex(MTBPolygon2D p)
          Checks if a polygon is convex.
protected static boolean isCounterClockwiseOriented(MTBPolygon2D p)
          Checks if polygon is oriented counter-clockwise.
protected static boolean isSimple(MTBPolygon2D p)
          Checks if a polygon is simple.
protected static MTBPolygon2D makePolySimple(MTBPolygon2D p)
          Simplifies the given polygon.
protected static uk.co.geolib.geopolygons.C2DPolygon MTBtoC2D(MTBPolygon2D mPoly)
          Converts a MiToBo polygon to C2D data type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MTBPolygon2D_GeoPolygonsWrapper

public MTBPolygon2D_GeoPolygonsWrapper()
Method Detail

isSimple

protected static boolean isSimple(MTBPolygon2D p)
Checks if a polygon is simple.

Parameters:
p - Input polygon.
Returns:
True, if polygon is simple.

isConvex

protected static boolean isConvex(MTBPolygon2D p)
Checks if a polygon is convex.

Parameters:
p - Input polygon.
Returns:
True, if polygon is convex.

isCounterClockwiseOriented

protected static boolean isCounterClockwiseOriented(MTBPolygon2D p)
Checks if polygon is oriented counter-clockwise.

Parameters:
p - Input polygon.
Returns:
True, if polygon is oriented counter-clockwise.

isClockwiseOriented

protected static boolean isClockwiseOriented(MTBPolygon2D p)
Checks if polygon is oriented counter-clockwise.

Parameters:
p - Input polygon.
Returns:
True, if polygon is oriented clockwise.

makePolySimple

protected static MTBPolygon2D makePolySimple(MTBPolygon2D p)
Simplifies the given polygon.

Parameters:
p - Input polygon.
Returns:
Simplified polygon without crossings.

containsPoint

protected static boolean containsPoint(MTBPolygon2D p,
                                       double x,
                                       double y)
Checks if a point lies inside of the polygon.

Note that the boundary does not belong to the interior.

Parameters:
p - Input polygon.
x - x coordinate of point to check.
y - y coordinate of point to check.
Returns:
True if point is inside of the polygon.

MTBtoC2D

protected static uk.co.geolib.geopolygons.C2DPolygon MTBtoC2D(MTBPolygon2D mPoly)
Converts a MiToBo polygon to C2D data type.

Note that the result polygon is always in clockwise ordering, independent of how the input polygon was sorted.

Parameters:
mPoly - Input MiToBo polygon.
Returns:
Resulting C2D polygon.

C2DtoMTB

protected static MTBPolygon2D C2DtoMTB(uk.co.geolib.geopolygons.C2DPolygon cPoly)
Converts a C2D polygon to the MiToBo polygon data type.

Note that the result polygon is always in clockwise ordering.

Parameters:
mPoly - Input C2D polygon.
Returns:
Resulting MiToBo polygon, always sorted clockwise.


Copyright © 2010–2015 Martin Luther University Halle-Wittenberg. All rights reserved.