edu.unh.sdb.lattice
Class TriangleCell

java.lang.Object
  extended by edu.unh.sdb.lattice.Cell
      extended by edu.unh.sdb.lattice.UnstructuredCell
          extended by edu.unh.sdb.lattice.TriangleCell
Direct Known Subclasses:
Borrowed2DTriangleCell, TriangleCellIterator

public class TriangleCell
extends UnstructuredCell


Field Summary
 
Fields inherited from class edu.unh.sdb.lattice.Cell
coords, data, dimensionality, numVertices
 
Constructor Summary
protected TriangleCell()
           
  TriangleCell(DataSource vIndicesDS, DataSource coordsDS, RecordSpec vIndicesRS, RecordSpec coordsRS, RecordSpec dataRS, int dimensionality, IndexSpaceID cellID)
           
  TriangleCell(float[] coordFloats, float[] dataFloats, int numDataAttributes, int dimensionality, int triangleIndex)
           
  TriangleCell(int[] vIndices, float[] coordFloats, float[] dataFloats, int numDataAttributes, int dimensionality, int triangleIndex)
           
  TriangleCell(int numAttributes, int dimensionality)
           
  TriangleCell(Point[] coords, Datum[] data)
           
  TriangleCell(Point p1, Point p2, Point p3)
          For debugging.
 
Method Summary
 void assign(int[] vIndices, float[] coordFloats, float[] dataFloats, int numDataAttributes, int dimensionality, int triangleIndex)
           
 GBounds boundingBox()
           
static GBounds boundingBox(int[] vIndices, float[] coords, int dimensionality, int triangleIndex)
           
 boolean containedBy(GBounds bounds)
          Returns true if this TriangleCell is contained by the GBounds argument, false otherwise.
 boolean inside(Point p)
          Returns true if the Point p is inside the TriangleCell, false otherwise.
static boolean inside(Point p, float[] coords, int startIndex)
          Returns true if the Point p is inside the TriangleCell, false otherwise.
static boolean inside(Point p, int[] vIndices, float[] coords, int triangleIndex)
          Returns true if the Point p is inside the TriangleCell, false otherwise.
 boolean intersects(Cell c)
           
 boolean intersects(GBounds b)
           
static boolean intersects(GBounds b, int[] vIndices, float[] coords, int triangleIndex)
           
static void main(java.lang.String[] argv)
           
 java.lang.String toString()
          Return a String representing the object.
 java.lang.String toString(java.lang.String indent)
          Return a String representing the object indented by the argument string.
 
Methods inherited from class edu.unh.sdb.lattice.UnstructuredCell
assign
 
Methods inherited from class edu.unh.sdb.lattice.Cell
datum, dim, getData, getNumVertices, getVertexCoords, setData, setDimensionality, setVertexCoords
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TriangleCell

public TriangleCell(Point p1,
                    Point p2,
                    Point p3)
For debugging.


TriangleCell

protected TriangleCell()

TriangleCell

public TriangleCell(int numAttributes,
                    int dimensionality)

TriangleCell

public TriangleCell(Point[] coords,
                    Datum[] data)

TriangleCell

public TriangleCell(float[] coordFloats,
                    float[] dataFloats,
                    int numDataAttributes,
                    int dimensionality,
                    int triangleIndex)

TriangleCell

public TriangleCell(int[] vIndices,
                    float[] coordFloats,
                    float[] dataFloats,
                    int numDataAttributes,
                    int dimensionality,
                    int triangleIndex)

TriangleCell

public TriangleCell(DataSource vIndicesDS,
                    DataSource coordsDS,
                    RecordSpec vIndicesRS,
                    RecordSpec coordsRS,
                    RecordSpec dataRS,
                    int dimensionality,
                    IndexSpaceID cellID)
Method Detail

assign

public void assign(int[] vIndices,
                   float[] coordFloats,
                   float[] dataFloats,
                   int numDataAttributes,
                   int dimensionality,
                   int triangleIndex)

intersects

public boolean intersects(Cell c)
Specified by:
intersects in class Cell

inside

public boolean inside(Point p)
Returns true if the Point p is inside the TriangleCell, false otherwise. Assumes 2D space for now.


inside

public static boolean inside(Point p,
                             float[] coords,
                             int startIndex)
Returns true if the Point p is inside the TriangleCell, false otherwise. This static method expects the points to be stored in an interleaved array of floats. P0x, P0y, P1x, P1y, P2x, P2y... the last argument specifies the index of the TriangleCell's zero'th vertex. Assumes 2D space for now.


inside

public static boolean inside(Point p,
                             int[] vIndices,
                             float[] coords,
                             int triangleIndex)
Returns true if the Point p is inside the TriangleCell, false otherwise. This static method expects the point coords to be stored in an interleaved array of floats. P0x, P0y, P1x, P1y, P2x, P2y... the third argument is an array of integers that specifies the location of coordinate pairs in the coords array for a collection of cells. The last argument specifies the location of a particular cell's vertex indices in the index array. Assumes 2D space for now.


boundingBox

public GBounds boundingBox()

boundingBox

public static GBounds boundingBox(int[] vIndices,
                                  float[] coords,
                                  int dimensionality,
                                  int triangleIndex)

containedBy

public boolean containedBy(GBounds bounds)
Returns true if this TriangleCell is contained by the GBounds argument, false otherwise.


intersects

public boolean intersects(GBounds b)

intersects

public static boolean intersects(GBounds b,
                                 int[] vIndices,
                                 float[] coords,
                                 int triangleIndex)

toString

public java.lang.String toString()
Return a String representing the object.

Overrides:
toString in class Cell

toString

public java.lang.String toString(java.lang.String indent)
Return a String representing the object indented by the argument string.

Overrides:
toString in class Cell

main

public static void main(java.lang.String[] argv)