コード例 #1
0
ファイル: LDUvMesh.cs プロジェクト: johndpope/math
        public bool isHit(LDPoint pt)
        {
            LDPolygon polygon = m_triangles.getOutlinePolygon(m_points);

            //第二引数のFillRuleはQPainterPathのリファレンスがわかりやすい
            return(polygon.containsPoint(pt, FillRule.WindingFill));
        }
コード例 #2
0
ファイル: LDQuadTransform.cs プロジェクト: johndpope/math
        public LDPolygon getPolygon()
        {
            LDPolygon p = new LDPolygon();

            p.Add(m_topLeft);
            p.Add(m_topRight);
            p.Add(m_bottomRight);
            p.Add(m_bottomLeft);
            return(p);
        }
コード例 #3
0
ファイル: LDPolygon.cs プロジェクト: johndpope/math
        public LDPolygon translated(LDPoint offset)
        {
            LDPolygon translated = new LDPolygon();

            foreach (var p in this)
            {
                translated.Add(new LDPoint(p.x() + offset.x(), p.y() + offset.y()));
            }
            return(translated);
        }
コード例 #4
0
ファイル: LDGridTransform.cs プロジェクト: johndpope/math
        public LDPolygon getOutlinePolygon()
        {
            List <int> indices = getOutlinePointIndices();

            LDPolygon result = new LDPolygon();

            foreach (var index in indices)
            {
                result.Add(getPoint(index));
            }
            return(result);
        }
コード例 #5
0
        public LDPolygon toPolygon(LDPointList points)
        {
            Debug.Assert((points.length() > m_index1));
            Debug.Assert(points.length() > m_index2);
            Debug.Assert(points.length() > m_index3);

            LDPolygon v = new LDPolygon();

            v.Add(new LDPoint(points.at(m_index1)));
            v.Add(new LDPoint(points.at(m_index2)));
            v.Add(new LDPoint(points.at(m_index3)));
            return(v);
        }
コード例 #6
0
ファイル: LDTriangleList.cs プロジェクト: johndpope/math
        public LDPolygon getOutlinePolygon(LDPointList points)
        {
            List <int> indices = getOutlinePointIndices(points);

            LDPolygon result = new LDPolygon();

            foreach (var index in indices)
            {
                common.LD_ASSERT_OUT_OF_INDEX(points, index);
                result.Add(points[index]);
            }
            return(result);
        }
コード例 #7
0
ファイル: LDTrianglListTest.cs プロジェクト: johndpope/math
        public void getOutlinePolygonTest_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));

            LDPolygon compare = new LDPolygon();

            compare.Add(new LDPoint(0, 0));
            compare.Add(new LDPoint(0, 100));
            compare.Add(new LDPoint(100, 100));

            LDPolygon result = triangles.getOutlinePolygon(points);

            TestUtil.COMPARE(result, compare);
        }
コード例 #8
0
 public LDPolygon intersected(LDPolygon r)
 {
     throw new NotImplementedException();
 }
コード例 #9
0
 public LDPolygon united(LDPolygon r)
 {
     throw new NotImplementedException();
 }
コード例 #10
0
 public void swap(LDPolygon other)
 {
     throw new NotImplementedException();
 }                                                                          // prevent QVector<LDPoint><->LDPolygon swaps
コード例 #11
0
 public LDPolygon(LDPolygon a) : base(a)
 {
 }
コード例 #12
0
 public LDPolygon subtracted(LDPolygon r)
 {
     throw new NotImplementedException();
 }
コード例 #13
0
ファイル: LDPolygon.cs プロジェクト: johndpope/math
 public void swap(LDPolygon other)
 {
     throw new NotImplementedException();
 }