Пример #1
0
        LDTriangleList simpleTriangle()
        {
            LDTriangleList triangles = new LDTriangleList();
            LDTriangle     t1        = new LDTriangle(0, 1, 2);

            triangles.Add(t1);
            return(triangles);
        }
Пример #2
0
        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);
        }
Пример #3
0
        public void getRelatedTrianglesTest_simple()
        {
            LDTriangleList triangles = simpleTriangle();

            LDTriangleList compare = simpleTriangle();

            LDTriangleList result = triangles.getRelatedTriangles(0);

            TestUtil.COMPARE(result, compare);
        }
Пример #4
0
        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);
        }
Пример #5
0
        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);
        }
Пример #6
0
        public LDTriangleList find(LDIndexLine line)
        {
            LDTriangleList result = new LDTriangleList();

            foreach (var t in this)
            {
                if (t.containsLine(line))
                {
                    result.Add(t);
                }
            }
            return(result);
        }
Пример #7
0
        //その頂点を含む三角形リストを取得
        public LDTriangleList getRelatedTriangles(int pointIndex)
        {
            LDTriangleList result = new LDTriangleList();

            foreach (var t in this)
            {
                if (t.hasIndex(pointIndex))
                {
                    result.Add(t);
                }
            }

            return(result);
        }
Пример #8
0
        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);
        }
Пример #9
0
        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);
        }
Пример #10
0
        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);
        }
Пример #11
0
 public void setTriangles(LDTriangleList value)
 {
     m_triangles = value;
 }