Exemplo n.º 1
0
        public GraphicEllipse(Point center, double lr, double sr, double rotateAngle, bool isClockwise = false)
        {
            if (lr <= 0 || sr <= 0)
            {
                throw new ArgumentOutOfRangeException();
            }

            _center      = center;
            _lr          = lr;
            _sr          = sr;
            _rotateAngle = rotateAngle;
            _isReverse   = isClockwise;
            _length      = GraphicHelper.ComputeArcLength(_lr, _sr, 0, Math.PI * 2, Math.PI / 4);
        }
Exemplo n.º 2
0
        public GraphicBezier(int degree, IEnumerable <Point> controlPoints, bool isReverse = false)
        {
            if (controlPoints == null)
            {
                throw new ArgumentNullException();
            }

            _degree        = degree;
            _controlPoints = controlPoints.ToArray();
            if (_controlPoints.Length < 2)
            {
                throw new ArgumentException();
            }
            _isReverse = isReverse;

            _length = GraphicHelper.ComputeArcLength(_controlPoints, _degree, 0, 1, 0.1);
        }
Exemplo n.º 3
0
        public GraphicEllipticalArc(Point center, double lr, double sr, double startAngle, double endAngle, double rotateAngle, bool isClockwise = false)
        {
            if (lr < 0 || sr < 0)
            {
                throw new ArgumentOutOfRangeException();
            }
            if (startAngle > endAngle)
            {
                throw new ArgumentOutOfRangeException();
            }
            if (endAngle - startAngle > 360)
            {
                throw new ArgumentException();
            }

            _center      = center;
            _lr          = lr;
            _sr          = sr;
            _startAngle  = startAngle;
            _endAngle    = endAngle;
            _rotateAngle = rotateAngle;
            _isReverse   = isClockwise;
            _length      = GraphicHelper.ComputeArcLength(_lr, _sr, Utilities.AngleToRadian(_startAngle), Utilities.AngleToRadian(_endAngle), Math.PI / 4);
        }
Exemplo n.º 4
0
 private void _Init()
 {
     _length = GraphicHelper.ComputeArcLength(_degree, _knots, _controlPoints, _weights, _startParameter, _endParameter, 0.1);
     _start  = GraphicHelper.ComputePoint(_degree, _knots, _controlPoints, _weights, _startParameter);
     _end    = GraphicHelper.ComputePoint(_degree, _knots, _controlPoints, _weights, _endParameter);
 }