nl.tudelft.simulation.language.d2
Class DirectionalShape

java.lang.Object
  extended by nl.tudelft.simulation.language.d2.DirectionalShape

public final class DirectionalShape
extends java.lang.Object

DirectionalShape is used to create a shape out of vertices and find out whether a certain point is inside or outside of the shape.

(c) copyright 2002-2005 Delft University of Technology , the Netherlands.

See for project information www.simulation.tudelft.nl/language
License of use: Lesser General Public License (LGPL) , no warranty

Version:
$Revision: 1.7 $ $Date: 2005/07/04 12:21:25 $
Author:
Roy Chin

Field Summary
static int DEFAULT_LAST_SIDE
          the default last side.
 
Constructor Summary
DirectionalShape()
          constructs a new directional line.
 
Method Summary
 void addPoint(double x, double y)
          add a point to the shape.
 void determineSegments()
          determine the line segments between the points.
 boolean getInside(double x, double y)
          determine whether a point (x,y) is inside this shape or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_LAST_SIDE

public static final int DEFAULT_LAST_SIDE
the default last side.

See Also:
Constant Field Values
Constructor Detail

DirectionalShape

public DirectionalShape()
constructs a new directional line.

Method Detail

addPoint

public void addPoint(double x,
                     double y)
add a point to the shape.

Parameters:
x - X coordinate
y - Y coordinate

determineSegments

public void determineSegments()
determine the line segments between the points.


getInside

public boolean getInside(double x,
                         double y)
determine whether a point (x,y) is inside this shape or not.

Parameters:
x - X coordinate
y - Y coodinate
Returns:
True if (x,y) is inside this shape


Copyright © 2002-2005 Delft University of Technology, the Netherlands. All Rights Reserved.