Exemple #1
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="Other">Other polygon to set this to.</param>
 public C2DHoledPolyArc(C2DHoledPolyArc Other)
 {
     _Rim = new C2DPolyArc(Other.Rim);
     for (int i = 0; i < Other.HoleCount; i++)
     {
         _Holes.Add(new C2DPolyArc(Other.GetHole(i)));
     }
 }
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="Other">Other polygon to set this to.</param> 
 public C2DHoledPolyArc(C2DHoledPolyBase Other)
 {
     _Rim = new C2DPolyArc(Other.Rim);
     for (int i = 0; i < Other.HoleCount; i++)
     {
         _Holes.Add(new C2DPolyArc(Other.GetHole(i)));
     }
 }
Exemple #3
0
        /// <summary>
        /// Gets the overlaps of the 2 shapes.
        /// </summary>
        /// <param name="Other">The other shape.</param>
        /// <param name="Polygons">The set to recieve the result.</param>
        /// <param name="grid">The degenerate settings.</param>
        public void GetOverlaps(C2DPolyArc Other, List <C2DHoledPolyArc> Polygons,
                                CGrid grid)
        {
            List <C2DHoledPolyBase> NewPolys = new List <C2DHoledPolyBase>();

            base.GetOverlaps(Other, NewPolys, grid);

            for (int i = 0; i < NewPolys.Count; i++)
            {
                Polygons.Add(new C2DHoledPolyArc(NewPolys[i]));
            }
        }
Exemple #4
0
        /// <summary>
        /// Gets the union of the 2 shapes.
        /// </summary>
        /// <param name="Other">The other shape.</param>
        /// <param name="Polygons">The set to recieve the result.</param>
        /// <param name="grid">The degenerate settings.</param>
        public void GetUnion(C2DPolyArc Other, List <C2DHoledPolyArc> Polygons,
                             CGrid grid)
        {
            var NewPolys = new List <C2DHoledPolyBase>();

            base.GetUnion(Other, NewPolys, grid);

            for (var i = 0; i < NewPolys.Count; i++)
            {
                Polygons.Add(new C2DHoledPolyArc(NewPolys[i]));
            }
        }
    C2DHoledPolyArc makeCircle(C2DPoint pos, float radius)
    {
        C2DPolyArc shape = new C2DPolyArc ();

        shape.SetStartPoint (new C2DPoint(pos.x+radius,pos.y));

        for (int i = 0; i < 16; i++) {
            shape.LineTo(new C2DPoint (pos.x + Mathf.Cos(Mathf.PI*2*i/16)*radius, pos.y+ Mathf.Sin(Mathf.PI*2*i/16)*radius), radius, false, true);
        }
        shape.Close (radius, false, true);

        C2DHoledPolyArc result = new C2DHoledPolyArc ();
        result.Rim = shape;
        return result;
    }
Exemple #6
0
 /// <summary>
 /// Constructor.
 /// </summary>
 public C2DPolyArc(C2DPolyArc Other) : base(Other)
 {
 }
 /// <summary>
 /// Constructor.
 /// </summary>
 public C2DPolyArc(C2DPolyArc Other)
     : base(Other)
 {
 }
        /// <summary>
        /// Gets the union of the 2 shapes.
        /// </summary>
        /// <param name="Other">The other shape.</param> 
        /// <param name="Polygons">The set to recieve the result.</param> 
        /// <param name="grid">The degenerate settings.</param> 
        public void GetUnion(C2DPolyArc Other, List<C2DHoledPolyArc> Polygons,
										    CGrid grid)
        {
            List<C2DHoledPolyBase> NewPolys = new List<C2DHoledPolyBase>();

            base.GetUnion(Other, NewPolys, grid);

            for (int i = 0; i < NewPolys.Count; i++)
                Polygons.Add(new C2DHoledPolyArc(NewPolys[i]));
        }
Exemple #9
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="Other">Other polygon to set this to.</param>
 public C2DHoledPolyArc(C2DPolyArc Other)
 {
     _Rim = new C2DPolyArc(Other);
 }
Exemple #10
0
 /// <summary>
 /// Hole addition.
 /// </summary>
 public void AddHole(C2DPolyArc Poly)
 {
     _Holes.Add(Poly);
 }
Exemple #11
0
 /// <summary>
 /// Hole assignment.
 /// </summary>
 public void SetHole(int i, C2DPolyArc Poly)
 {
     _Holes[i] = Poly;
 }
Exemple #12
0
 /// <summary>
 /// Constructor.
 /// </summary>
 public C2DHoledPolyArc()
 {
     _Rim = new C2DPolyArc();
 }
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="Other">Other polygon to set this to.</param> 
 public C2DHoledPolyArc(C2DPolyArc Other)
 {
     _Rim = new C2DPolyArc(Other);
 }
 /// <summary>
 /// Hole addition.
 /// </summary>
 public void AddHole(C2DPolyArc Poly)
 {
     _Holes.Add(Poly);
 }
 /// <summary>
 /// Hole assignment.
 /// </summary>
 public void SetHole(int i, C2DPolyArc Poly)
 {
     _Holes[i] = Poly;
 }
 /// <summary>
 /// Constructor.
 /// </summary>
 public C2DHoledPolyArc()
 {
     _Rim = new C2DPolyArc();
 }