com.hedgehog.geo
Class ConvexHullMethod

java.lang.Object
  extended by com.hedgehog.HObject
      extended by com.hedgehog.geo.ConvexHullMethod
All Implemented Interfaces:
java.lang.Comparable, java.util.Comparator

public class ConvexHullMethod
extends HObject

Title: ConvexHullMethod - Stores the type of method used when generating a convex hull.

Description: Stores the method used when generating a convex hull. Is used by both 2D and 3D point sets and polygons.

Copyright: Copyright (c) Hedgehog Software 2007-2009.

Company: Hedgehog Software

Since:
1.0
Version:
1.1

Field Summary
static int APPROXIMATE_BFP
          Indicates an approximate [Bentley-Faust-Preparata, 1982] BFP O(n) algorithm is used to generate the hull.
static int INCREMENTAL
          Indicates an incremental algorithm is used to generate the hull.
protected  int mHullMethod
          The hull method.
static int UNKNOWN
          Indicates an unknown method.
 
Fields inherited from class com.hedgehog.HObject
mID, mName
 
Constructor Summary
ConvexHullMethod()
          Default constructor.
ConvexHullMethod(ConvexHullMethod object)
          Copy constructor.
ConvexHullMethod(int hullMethod)
          Constructor.
 
Method Summary
 int getHullMethod()
          Returns the hull method.
static java.lang.String hullMethodString(int hullMethod)
          Returns a String representation of the specified hull method.
 boolean isApproximateBFPMethod()
          Tests whether or not this method is APPROXIMATE_BFP.
 boolean isIncrementalMethod()
          Tests whether or not this method is INCREMENTAL.
 boolean isUnknownMethod()
          Tests whether or not this method is UNKNOWN.
 boolean isValid()
          Tests whether or not this is a valid hull method.
static boolean isValid(int hullMethod)
          Tests whether or not the specified hull method is valid.
 void setHullMethod(int hullMethod)
          Sets the hull method.
 java.lang.String toString()
          Returns a String representation of a ConvexHullMethod object.
 
Methods inherited from class com.hedgehog.HObject
clone, compare, compareTo, copy, equals, getID, getName, hashCode, hasID, hasName, setID, setName
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

mHullMethod

protected int mHullMethod
The hull method.


APPROXIMATE_BFP

public static final int APPROXIMATE_BFP
Indicates an approximate [Bentley-Faust-Preparata, 1982] BFP O(n) algorithm is used to generate the hull.

See Also:
Constant Field Values

INCREMENTAL

public static final int INCREMENTAL
Indicates an incremental algorithm is used to generate the hull.

See Also:
Constant Field Values

UNKNOWN

public static final int UNKNOWN
Indicates an unknown method.

See Also:
Constant Field Values
Constructor Detail

ConvexHullMethod

public ConvexHullMethod()
Default constructor. Sets the hull method to UNKNOWN.


ConvexHullMethod

public ConvexHullMethod(int hullMethod)
                 throws java.lang.IllegalArgumentException
Constructor. Specifies the convex hull method to the specified value.

Parameters:
hullMethod - Convex hull method.
Throws:
java.lang.IllegalArgumentException - Thrown if the specified hull method is invalid.

ConvexHullMethod

public ConvexHullMethod(ConvexHullMethod object)
Copy constructor.

Parameters:
object - Object to copy.
Method Detail

getHullMethod

public int getHullMethod()
Returns the hull method.

Returns:
The hull method.

setHullMethod

public void setHullMethod(int hullMethod)
                   throws java.lang.IllegalArgumentException
Sets the hull method.

Parameters:
hullMethod - The new hull method.
Throws:
java.lang.IllegalArgumentException - Thrown if the specified hull method is invalid.

isValid

public boolean isValid()
Tests whether or not this is a valid hull method. Consider UNKNOWN to be valid.

Returns:
Logical-true if this is a valid hull method, else logical-false.

isApproximateBFPMethod

public boolean isApproximateBFPMethod()
Tests whether or not this method is APPROXIMATE_BFP.

Returns:
Logical-true if this method is APPROXIMATE_BFP, else logical-false.

isIncrementalMethod

public boolean isIncrementalMethod()
Tests whether or not this method is INCREMENTAL.

Returns:
Logical-true if this method is INCREMENTAL, else logical-false.

isUnknownMethod

public boolean isUnknownMethod()
Tests whether or not this method is UNKNOWN.

Returns:
Logical-true if this method is UNKNOWN, else logical-false.

toString

public java.lang.String toString()
Returns a String representation of a ConvexHullMethod object.

Overrides:
toString in class java.lang.Object
Returns:
A String representation of a ConvexHullMethod object.

isValid

public static boolean isValid(int hullMethod)
Tests whether or not the specified hull method is valid.

Parameters:
hullMethod - Hull method to test.
Returns:
Logical-true if the specified hull method is valid, else logical-false.

hullMethodString

public static java.lang.String hullMethodString(int hullMethod)
Returns a String representation of the specified hull method.

Parameters:
hullMethod - Hull method.
Returns:
A String representation of the specified hull method.