00001 package delaunaypackage; 00002 00003 import java.util.ArrayList; 00004 import java.util.List; 00005 00006 public class Face { 00007 00008 int[] edge_indices; 00009 private boolean isInSpanningTree; 00010 00011 int pointer; 00012 public Face() { 00013 super(); 00014 pointer=0; 00015 edge_indices=new int[3]; 00016 for(int i =0;i!=edge_indices.length;i++){ 00017 edge_indices[i]=Triangulation.Undefined; 00018 } 00019 } 00020 00021 public void addEdge(int eI){ 00022 edge_indices[pointer]=eI; 00023 pointer++; 00024 } 00025 00026 public int getEdge_index(int pointer){ 00027 return edge_indices[pointer]; 00028 } 00029 00030 public boolean isInSpanningTree() { 00031 return isInSpanningTree; 00032 } 00033 00034 public void setInSpanningTree(boolean isInSpanningTree) { 00035 this.isInSpanningTree = isInSpanningTree; 00036 } 00037 00038 00044 public int getCommonEdge(Face f){ 00045 for(int i =0;i!=edge_indices.length;i++){ 00046 for(int j=0;j!=3;j++){ 00047 if(this.getEdge_index(i) == f.getEdge_index(j)) return this.getEdge_index(i); 00048 } 00049 } 00050 return -1; // no common edge 00051 } 00052 00053 00054 00055 }
1.5.5