Package gov.nih.mipav.model.structures
Class PointStack
- java.lang.Object
- 
- gov.nih.mipav.model.structures.PointStack
 
- 
 public class PointStack extends java.lang.ObjectPointStack is a structure used specifically in ViewComponentEditImage for use in the active level set generation and was built for speed. However, I have included it in the model package in the hope that it can be used elsewhere.- Version:
- 0.1 April 7, 1998
- Author:
- Matthew J. McAuliffe
 
- 
- 
Constructor SummaryConstructors Constructor Description PointStack(int capacity)PointStack.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPoint(int x, int y)Adds a point to the arrays.java.awt.PolygonexportPolygon()Repackages arrays into a java polygon returns points in polygon form.voidgetPoint(int index, int[] x, int[] y)Get a point and stores it in the two input arrays.intgetPointX(int index)Gets the x coordinate of a point.intgetPointY(int index)Gets the y coordinate of a point.voidreset()Removes all elements in array by setting data pointer to zero.intsetIndex(int index)Sets the pointer to specific location return -1 if index exceeds location of valid data.intsize()Returns the number of points.
 
- 
- 
- 
Method Detail- 
addPointpublic void addPoint(int x, int y)Adds a point to the arrays. Allocates more memory if necessary.- Parameters:
- x- x coordinate
- y- y coordinate
 
 - 
exportPolygonpublic java.awt.Polygon exportPolygon() Repackages arrays into a java polygon returns points in polygon form.- Returns:
- DOCUMENT ME!
 
 - 
getPointpublic void getPoint(int index, int[] x, int[] y)Get a point and stores it in the two input arrays.- Parameters:
- index- pointer into array
- x- x coordinate
- y- y coordinate
 
 - 
getPointXpublic int getPointX(int index) Gets the x coordinate of a point.- Parameters:
- index- pointer into array
- Returns:
- x coordinate of point
 
 - 
getPointYpublic int getPointY(int index) Gets the y coordinate of a point.- Parameters:
- index- pointer into array
- Returns:
- y coordinate of point
 
 - 
resetpublic void reset() Removes all elements in array by setting data pointer to zero.
 - 
setIndexpublic int setIndex(int index) Sets the pointer to specific location return -1 if index exceeds location of valid data.- Parameters:
- index- DOCUMENT ME!
- Returns:
- DOCUMENT ME!
 
 - 
sizepublic int size() Returns the number of points.- Returns:
- the size of the array (i.e., the number of points)
 
 
- 
 
-