00001 package commandline.baseMeshGeneration.delaunaypackage; 00002 00003 /* 00004 * Edge class. Edges have two vertices, s and t, and two faces, 00005 * l (left) and r (right). The triangulation representation and 00006 * the Delaunay triangulation algorithms require edges. 00007 */ 00008 public class Edge { 00009 int beginPunt, eindPunt; 00010 int leftTriangle, rightTriangle; 00011 00012 public Edge() { 00013 beginPunt = eindPunt = 0; 00014 } 00015 00016 public Edge(int s, int t) { this.beginPunt =s; this.eindPunt = t; } 00017 00018 public int getBeginPunt() { 00019 return beginPunt; 00020 } 00021 00022 public boolean containsboth(int index_1,int index_2){ 00023 return (index_1==this.beginPunt && index_2==this.eindPunt) || (this.eindPunt==index_1 && this.beginPunt== index_2); 00024 } 00025 00026 public boolean contains(int index){ 00027 return (index==this.beginPunt || index==this.eindPunt); 00028 } 00029 00030 public void setBeginPunt(int beginPunt) { 00031 this.beginPunt = beginPunt; 00032 } 00033 00034 public int getEindPunt() { 00035 return eindPunt; 00036 } 00037 00038 public void setEindPunt(int eindPunt) { 00039 this.eindPunt = eindPunt; 00040 } 00041 00042 public int getLeftTriangle() { 00043 return leftTriangle; 00044 } 00045 00046 public void setLeftTriangle(int leftTriangle) { 00047 this.leftTriangle = leftTriangle; 00048 } 00049 00050 public int getRightTriangle() { 00051 return rightTriangle; 00052 } 00053 00054 public void setRightTriangle(int rightTriangle) { 00055 this.rightTriangle = rightTriangle; 00056 } 00057 00058 public int getCommonPointIndex(Edge o){ 00059 if(this.beginPunt==o.beginPunt || this.beginPunt==o.getEindPunt()){return this.beginPunt;} 00060 if(this.eindPunt==o.beginPunt || this.eindPunt==o.getEindPunt()) {return this.eindPunt;} 00061 00062 return -1; 00063 } 00064 00065 // int s() { 00066 // return this.beginPunt; } 00067 // int t() { return this.eindPunt; 00068 // } 00069 // int l() { return this.leftTriangle; 00070 // } 00071 // int r() { return this.rightTriangle; 00072 // } 00073 }
1.5.5