LDTriangleList simpleTriangle() { LDTriangleList triangles = new LDTriangleList(); LDTriangle t1 = new LDTriangle(0, 1, 2); triangles.Add(t1); return(triangles); }
public void findTest_simple() { LDTriangleList triangles = simpleTriangle(); LDTriangleList compare = simpleTriangle(); LDIndexLine line = new LDIndexLine(0, 2); LDTriangleList resulut = triangles.find(line); TestUtil.COMPARE(resulut, compare); }
public void getRelatedTrianglesTest_simple() { LDTriangleList triangles = simpleTriangle(); LDTriangleList compare = simpleTriangle(); LDTriangleList result = triangles.getRelatedTriangles(0); TestUtil.COMPARE(result, compare); }
public void getRelatedPointIndicesTest_simple() { LDTriangleList triangles = simpleTriangle(); List <int> compare = new List <int>(); compare.Add(1); compare.Add(2); List <int> result = triangles.getRelatedPointIndices(0); TestUtil.COMPARELIST(result, compare); }
public void getRelatedLinesTest_simple() { LDTriangleList triangles = simpleTriangle(); LDIndexLineList compare = new LDIndexLineList(); compare.Add(new LDIndexLine(0, 1)); compare.Add(new LDIndexLine(0, 2)); LDIndexLineList result = triangles.getRelatedLines(0); TestUtil.COMPARE(result, compare); }
public LDTriangleList find(LDIndexLine line) { LDTriangleList result = new LDTriangleList(); foreach (var t in this) { if (t.containsLine(line)) { result.Add(t); } } return(result); }
//その頂点を含む三角形リストを取得 public LDTriangleList getRelatedTriangles(int pointIndex) { LDTriangleList result = new LDTriangleList(); foreach (var t in this) { if (t.hasIndex(pointIndex)) { result.Add(t); } } return(result); }
public void getOutlinePointsTest_simple() { LDTriangleList triangles = simpleTriangle(); LDPointList points = new LDPointList(); points.Add(new LDPoint(0, 0)); points.Add(new LDPoint(0, 100)); points.Add(new LDPoint(100, 100)); LDPointList compare = points; LDPointList result = triangles.getOutlinePoints(points); TestUtil.COMPARE(result, compare); }
public void toIndexLineListTest_simple() { LDTriangleList triangles = simpleTriangle(); LDIndexLineList compare = new LDIndexLineList(); LDIndexLine line_1 = new LDIndexLine(0, 1); LDIndexLine line_2 = new LDIndexLine(1, 2); LDIndexLine line_3 = new LDIndexLine(2, 0); compare.Add(line_1); compare.Add(line_2); compare.Add(line_3); LDIndexLineList result = triangles.toIndexLineList(); TestUtil.COMPARE(result, compare); }
public void getOutlinePointIndicesTest_simple() { LDTriangleList triangles = simpleTriangle(); LDPointList points = new LDPointList(); points.Add(new LDPoint(0, 0)); points.Add(new LDPoint(0, 100)); points.Add(new LDPoint(100, 100)); List <int> compare = new List <int>(); compare.Add(0); compare.Add(1); compare.Add(2); List <int> result = triangles.getOutlinePointIndices(points); TestUtil.COMPARELIST(result, compare); }
public void setTriangles(LDTriangleList value) { m_triangles = value; }