Пример #1
0
 ////////////////////////////////////////////////////////////////////////////
 //--------------------------------- REVISIONS ------------------------------
 // Date       Name                 Tracking #         Description
 // ---------  -------------------  -------------      ----------------------
 // 13JUN2009  James Shen                 	          Initial Creation
 ////////////////////////////////////////////////////////////////////////////
 internal ArcIterator(Arc a, AffineTransform at)
 {
     _w = a.GetWidth() / 2.0;
     _h = a.GetHeight() / 2.0;
     _x = a.GetX() + _w;
     _y = a.GetY() + _h;
     _angStRad = -MathEx.ToRadians(a.GetAngleStart());
     _affine = at;
     double ext = -a.GetAngleExtent();
     if (ext >= 360.0 || ext <= -360)
     {
         _arcSegs = 4;
         _increment = Math.PI / 2;
         // btan(Math.PI / 2);
         _cv = 0.5522847498307933;
         if (ext < 0)
         {
             _increment = -_increment;
             _cv = -_cv;
         }
     }
     else
     {
         _arcSegs = (int)MathEx.Ceil(MathEx.Abs(ext) / 90.0);
         _increment = MathEx.ToRadians(ext / _arcSegs);
         _cv = Btan(_increment);
         if (_cv == 0)
         {
             _arcSegs = 0;
         }
     }
     switch (a.GetArcType())
     {
         case Arc.OPEN:
             _lineSegs = 0;
             break;
         case Arc.CHORD:
             _lineSegs = 1;
             break;
         case Arc.PIE:
             _lineSegs = 2;
             break;
     }
     if (_w < 0 || _h < 0)
     {
         _arcSegs = _lineSegs = -1;
     }
 }
Пример #2
0
 ////////////////////////////////////////////////////////////////////////////
 //--------------------------------- REVISIONS ------------------------------
 // Date       Name                 Tracking #         Description
 // ---------  -------------------  -------------      ----------------------
 // 13JUN2009  James Shen                 	          Initial Creation
 ////////////////////////////////////////////////////////////////////////////
 /**
  * Sets this arc to be the same as the specified arc.
  *
  * @param a The <CODE>Arc</CODE> to use to set the arc's values.
  */
 public void SetArc(Arc a)
 {
     SetArc(a.GetX(), a.GetY(), a.GetWidth(), a.GetHeight(),
            a.GetAngleStart(), a.GetAngleExtent(), a._type);
 }