GridView
Class MyFace

java.lang.Object
  extended by GridView.MyFace

 class MyFace
extends java.lang.Object

Internal class used in marshalling the face related data and putting things in order before a Face can be constructed. This class takes a edge number based specification of face and converts it to a vertex based spcification.

Since:
1.0

Field Summary
private  int[] mEdges
           
private  int mVt1
           
private  int mVt2
           
private  int mVt3
           
 
Constructor Summary
MyFace(int[] eds)
          Class constructor.
MyFace(int numEd, int[] eds)
          Class constructor.
 
Method Summary
private  void EnumerateVertForEdgePair(MyEdge edge1, MyEdge edge2, boolean onlyVt3Needed)
          (Overloaded) Enumerate vertices for edge pair so that the vertices are in order (clockwise or anticlockwise).
private  void EnumerateVertForEdgePair(MyEdge edge1, MyEdge edge2, java.util.List<MyVertex> vertexList, boolean onlyVt3Needed)
          Enumerate vertices for edge pair so that the vertices are in order (clockwise or anticlockwise).
 int[] GetEdges()
          Get integer array of edge indices that form this face.
 int[] GetVertices(java.util.List<MyEdge> edgeList)
          (Overloaded) Returns an array of vertex numbers that are ordered (clockwise or anticlockwise) for this face.
 int[] GetVertices(java.util.List<MyEdge> edgeList, java.util.List<MyVertex> vertexList)
          Returns an array of vertex numbers that are ordered (clockwise or anticlockwise) for this face.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mEdges

private int[] mEdges

mVt1

private int mVt1

mVt2

private int mVt2

mVt3

private int mVt3
Constructor Detail

MyFace

public MyFace(int[] eds)
Class constructor.

Parameters:
eds - Integer array containing edge index numbers that form the face. Number of elements in the array is equal to the number of edges (or vertices) in the face.

MyFace

public MyFace(int numEd,
              int[] eds)
Class constructor.

Parameters:
numEd - Number of edges in the face.
eds - Integer array containing edge index numbers that form the face.Number of elements in this array is greater than or equal to the number of edges (or vertices) in the face.
Method Detail

EnumerateVertForEdgePair

private void EnumerateVertForEdgePair(MyEdge edge1,
                                      MyEdge edge2,
                                      java.util.List<MyVertex> vertexList,
                                      boolean onlyVt3Needed)
Enumerate vertices for edge pair so that the vertices are in order (clockwise or anticlockwise). Routine puts the result (ordered vertex triplet) in mVt1, mVt2 and mVt3 instance variables.

Parameters:
edge1 - First edge.
edge2 - Second edge.
vertexList - List of MyVertex elements (needed to get new vertex numbers for a given vertex).
onlyVt3Needed - Find only the third vertex in the ordered triplet. The first two are not needed (eg, they may be known from a previous run.

EnumerateVertForEdgePair

private void EnumerateVertForEdgePair(MyEdge edge1,
                                      MyEdge edge2,
                                      boolean onlyVt3Needed)
(Overloaded) Enumerate vertices for edge pair so that the vertices are in order (clockwise or anticlockwise). Routine puts the result (ordered vertex triplet) in mVt1, mVt2 and mVt3 instance variables.

Parameters:
edge1 - First edge.
edge2 - Second edge.
onlyVt3Needed - Find only the third vertex in the ordered triplet. The first two are not needed (eg, they may be known from a previous run.

GetEdges

public int[] GetEdges()
Get integer array of edge indices that form this face.

Returns:
int array having face edge index numbers.

GetVertices

public int[] GetVertices(java.util.List<MyEdge> edgeList,
                         java.util.List<MyVertex> vertexList)
Returns an array of vertex numbers that are ordered (clockwise or anticlockwise) for this face.

Parameters:
edgeList - List of MyEdge objects in the object.
vertexList - List of MyVertex instances in the object.
Returns:
int array of vertex indices that is ordered for the face.

GetVertices

public int[] GetVertices(java.util.List<MyEdge> edgeList)
(Overloaded) Returns an array of vertex numbers that are ordered (clockwise or anticlockwise) for this face.

Parameters:
edgeList - List of MyEdge objects in the object.
Returns:
int array of edge vertex indices that is ordered for the face.