motris.model
Class ShadowHull

java.lang.Object
  extended bymotris.data.Description
      extended bymotris.model.Convex3DPolygon
          extended bymotris.model.ShadowHull

public class ShadowHull
extends Convex3DPolygon

Creates a shadow hull of the vertices supplied using a gift-wrapping algorithm. Basically, a shadow hull is very similar to a convex hull except that the hull is built only from those edges that are already present in the edge list.

Author:
Hendrik Dahlkamp

Nested Class Summary
private  class ShadowHull.AngleComparator
          Sorts Points by Angle
private  class ShadowHull.ByXComparator
          Sorts Points by X direction.
static class ShadowHull.ShadowHullVertex
          Helper class encapsulating point with its connections in a graph
 
Field Summary
(package private)  int lastIndexInEdgeList
           
(package private)  ShadowHull.ShadowHullVertex[] pts
           
 
Fields inherited from class motris.model.Convex3DPolygon
normalVector, parent, vertices
 
Fields inherited from class motris.data.Description
 
Constructor Summary
ShadowHull()
          While computing this hull, only X- and Y-Coordinates of the points are considered, i.e.
 
Method Summary
 void computeRelevantVertices()
           
private  double leftTurn(ShadowHull.ShadowHullVertex p, ShadowHull.ShadowHullVertex q, ShadowHull.ShadowHullVertex r)
          Returns the degree by which the curve specified by the points p,q,r turns left
 
Methods inherited from class motris.model.Convex3DPolygon
collideWithLine, computeNormal, getBoundingBox, getDistanceFromCameraOrigin, getEdges, project, toString, transform
 
Methods inherited from class motris.data.Description
getDescription, getIdentifier, getName, setDescription, setIdentifier, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

pts

ShadowHull.ShadowHullVertex[] pts

lastIndexInEdgeList

int lastIndexInEdgeList
Constructor Detail

ShadowHull

public ShadowHull()
While computing this hull, only X- and Y-Coordinates of the points are considered, i.e. we create a 2-dimensional convex hull. Naturally, this only makes sense if all points supplied lie in one plane. Also, this is NOT necessarily a )convex_ polygon although the inheritance suggests it

Method Detail

computeRelevantVertices

public void computeRelevantVertices()

leftTurn

private double leftTurn(ShadowHull.ShadowHullVertex p,
                        ShadowHull.ShadowHullVertex q,
                        ShadowHull.ShadowHullVertex r)
Returns the degree by which the curve specified by the points p,q,r turns left

Parameters:
p -
q -
r -
Returns:
angle (in rad)