/** * ************************************************************************* The method for * converting to String */ public void toStringa() { // return ("TriangleDT: " + A.toString() + B.toString() + C.toString()+" KEY "+key[0]+" // "+key[1]+" neighbour>"+neighbour_idx[0][0]+ " "); System.out.println("--------------------------------------------------------------------"); System.out.println("TDT: " + A.toString() + B.toString() + C.toString()); System.out.println(" k:" + key[0] + " " + key[1]); System.out.println(); System.out.println(" Soused0 " + neighbour_idx[0][0] + " " + neighbour_idx[0][1]); System.out.println(" Soused0 " + neighbour_idx[1][0] + " " + neighbour_idx[1][1]); System.out.println(" Soused0 " + neighbour_idx[2][0] + " " + neighbour_idx[2][1]); System.out.println(); System.out.println("--------------------------------------------------------------------"); }
/** * **************************************************************** The method which compare * points * * @param P - points for comparing * @return index A,B,C which point is same or N if point P not exist in triangle */ public char compareReturnIndex(PointDT P) { if (P.compare(A)) return 'A'; if (P.compare(B)) return 'B'; if (P.compare(C)) return 'C'; return 'N'; }
/** * ************************************************************************* The method which * testing two triangles, if the triangles have two same points * * @param P1 - point for testing * @param P2 - point for testing * @return boolean true - the triangles have two same point false - the triangles haven't two same * point */ public boolean containsTwoPoints(PointDT P1, PointDT P2) { if ((A.compare(P1) || B.compare(P1) || C.compare(P1)) && (A.compare(P2) || B.compare(P2) || C.compare(P2))) return true; return false; }
/** * ************************************************************************* The method which * testing, if the triangle contains the point * * @param P - point which will be tested * @return boolean true - the triangle contains the point false - the triangle doesn't contains * point */ public boolean containsPointAsVertex(PointDT P) { if (A.compare(P) || B.compare(P) || C.compare(P)) return true; else return false; }