AddCubicCurveTo() public method

public AddCubicCurveTo ( Vector2 p1, Vector2 p2, Vector2 p ) : void
p1 Vector2
p2 Vector2
p Vector2
return void
示例#1
0
    //-----
    public void CubicCurveTo(Vector2 p1, Vector2 p2, Vector2 p, float width)
    {
        Vector2 _point = new Vector2(0f, 0f);

        _point = this._basicDraw.currentPoint;

        Vector2 _p1 = new Vector2(0f, 0f);
        Vector2 _p2 = new Vector2(0f, 0f);
        Vector2 _p3 = new Vector2(0f, 0f);
        Vector2 _p4 = new Vector2(0f, 0f);

        bool temp;

        temp = this._graphics.GetThickLine(_point, p1, width, ref _p1, ref _p2, ref _p3, ref _p4);
        if (temp == false)
        {
            QuadraticCurveTo(p2, p, width);
            return;
        }

        Vector2 _p5 = new Vector2(0f, 0f);
        Vector2 _p6 = new Vector2(0f, 0f);
        Vector2 _p7 = new Vector2(0f, 0f);
        Vector2 _p8 = new Vector2(0f, 0f);

        this._graphics.GetThickLine(p1, p2, width, ref _p5, ref _p6, ref _p7, ref _p8);

        Vector2 _p9  = new Vector2(0f, 0f);
        Vector2 _p10 = new Vector2(0f, 0f);
        Vector2 _p11 = new Vector2(0f, 0f);
        Vector2 _p12 = new Vector2(0f, 0f);

        this._graphics.GetThickLine(p2, p, width, ref _p9, ref _p10, ref _p11, ref _p12);

        Vector2 _cp1, _cp2, _cp3, _cp4;

        _cp1 = this._graphics.GetCrossPoint(_p1, _p3, _p5, _p7);
        _cp2 = this._graphics.GetCrossPoint(_p2, _p4, _p6, _p8);
        _cp3 = this._graphics.GetCrossPoint(_p5, _p7, _p9, _p11);
        _cp4 = this._graphics.GetCrossPoint(_p6, _p8, _p10, _p12);


        this._basicDraw.MoveTo(_point);
        this._basicDraw.CubicCurveTo(p1, p2, p);

        SVGGraphicsPath _graphicsPath = new SVGGraphicsPath();

        _graphicsPath.AddMoveTo(_p2);
        _graphicsPath.AddCubicCurveTo(_cp2, _cp4, _p12);
        _graphicsPath.AddLineTo(_p11);
        _graphicsPath.AddCubicCurveTo(_cp3, _cp1, _p1);
        _graphicsPath.AddLineTo(_p2);
        this._graphics.FillPath(_graphicsPath);

        MoveTo(p);
    }
示例#2
0
    //--------------------------------------------------------------------------------
    //Method: Render
    //--------------------------------------------------------------------------------
    public void Render(SVGGraphicsPath _graphicsPath)
    {
        Vector2 p, p1, p2;

        p1 = controlPoint1;
        p2 = controlPoint2;
        p  = currentPoint;
        _graphicsPath.AddCubicCurveTo(p1, p2, p);
    }
示例#3
0
    //-----
    public void CubicCurveTo(Vector2 p1, Vector2 p2, Vector2 p, float width)
    {
        Vector2 _point = Vector2.zero;
        _point = _basicDraw.currentPoint;

        Vector2 _p1 = Vector2.zero;
        Vector2 _p2 = Vector2.zero;
        Vector2 _p3 = Vector2.zero;
        Vector2 _p4 = Vector2.zero;

        bool temp;
        temp = _graphics.GetThickLine(_point, p1, width, ref _p1, ref _p2, ref _p3, ref _p4);
        if (temp == false)
        {
            QuadraticCurveTo(p2, p, width);
            return;
        }

        Vector2 _p5 = Vector2.zero;
        Vector2 _p6 = Vector2.zero;
        Vector2 _p7 = Vector2.zero;
        Vector2 _p8 = Vector2.zero;

        _graphics.GetThickLine(p1, p2, width, ref _p5, ref _p6, ref _p7, ref _p8);

        Vector2 _p9 = Vector2.zero;
        Vector2 _p10 = Vector2.zero;
        Vector2 _p11 = Vector2.zero;
        Vector2 _p12 = Vector2.zero;

        _graphics.GetThickLine(p2, p, width, ref _p9, ref _p10, ref _p11, ref _p12);

        Vector2 _cp1, _cp2, _cp3, _cp4;
        _cp1 = _graphics.GetCrossPoint(_p1, _p3, _p5, _p7);
        _cp2 = _graphics.GetCrossPoint(_p2, _p4, _p6, _p8);
        _cp3 = _graphics.GetCrossPoint(_p5, _p7, _p9, _p11);
        _cp4 = _graphics.GetCrossPoint(_p6, _p8, _p10, _p12);

        _basicDraw.MoveTo(_point);
        _basicDraw.CubicCurveTo(p1, p2, p);

        SVGGraphicsPath _graphicsPath = new SVGGraphicsPath();
        _graphicsPath.AddMoveTo(_p2);
        _graphicsPath.AddCubicCurveTo(_cp2, _cp4, _p12);
        _graphicsPath.AddLineTo(_p11);
        _graphicsPath.AddCubicCurveTo(_cp3, _cp1, _p1);
        _graphicsPath.AddLineTo(_p2);
        _graphics.FillPath(_graphicsPath);

        MoveTo(p);
    }
 public void Render(SVGGraphicsPath _graphicsPath)
 {
     _graphicsPath.AddCubicCurveTo(controlPoint1, controlPoint2, currentPoint);
 }
 //--------------------------------------------------------------------------------
 //Method: Render
 //--------------------------------------------------------------------------------
 public void Render(SVGGraphicsPath _graphicsPath)
 {
     SVGPoint p, p1, p2;
     p1 = controlPoint1;
     p2 = controlPoint2;
     p = currentPoint;
     _graphicsPath.AddCubicCurveTo(p1, p2, p);
 }
示例#6
0
    //-----
    public void CubicCurveTo(SVGPoint p1, SVGPoint p2, SVGPoint p, float width)
    {
        SVGPoint _point = new SVGPoint(0f, 0f);
        _point.SetValue(this._basicDraw.currentPoint);

        SVGPoint _p1 = new SVGPoint(0f, 0f);
        SVGPoint _p2 = new SVGPoint(0f, 0f);
        SVGPoint _p3 = new SVGPoint(0f, 0f);
        SVGPoint _p4 = new SVGPoint(0f, 0f);

        bool temp;
        temp = this._graphics.GetThickLine(_point, p1, width, ref _p1, ref _p2, ref _p3, ref _p4);
        if(temp == false) {
          QuadraticCurveTo(p2, p, width);
          return;
        }

        SVGPoint _p5 = new SVGPoint(0f, 0f);
        SVGPoint _p6 = new SVGPoint(0f, 0f);
        SVGPoint _p7 = new SVGPoint(0f, 0f);
        SVGPoint _p8 = new SVGPoint(0f, 0f);

        this._graphics.GetThickLine(p1, p2, width, ref _p5, ref _p6, ref _p7, ref _p8);

        SVGPoint _p9 = new SVGPoint(0f, 0f);
        SVGPoint _p10 = new SVGPoint(0f, 0f);
        SVGPoint _p11 = new SVGPoint(0f, 0f);
        SVGPoint _p12 = new SVGPoint(0f, 0f);

        this._graphics.GetThickLine(p2, p, width, ref _p9, ref _p10, ref _p11, ref _p12);

        SVGPoint _cp1, _cp2, _cp3, _cp4;
        _cp1 = this._graphics.GetCrossPoint(_p1, _p3, _p5, _p7);
        _cp2 = this._graphics.GetCrossPoint(_p2, _p4, _p6, _p8);
        _cp3 = this._graphics.GetCrossPoint(_p5, _p7, _p9, _p11);
        _cp4 = this._graphics.GetCrossPoint(_p6, _p8, _p10, _p12);

        this._basicDraw.MoveTo(_point);
        this._basicDraw.CubicCurveTo(p1, p2, p);

        SVGGraphicsPath _graphicsPath = new SVGGraphicsPath();
        _graphicsPath.AddMoveTo(_p2);
        _graphicsPath.AddCubicCurveTo(_cp2, _cp4, _p12);
        _graphicsPath.AddLineTo(_p11);
        _graphicsPath.AddCubicCurveTo(_cp3, _cp1, _p1);
        _graphicsPath.AddLineTo(_p2);
        this._graphics.FillPath(_graphicsPath);

        MoveTo(p);
    }
示例#7
0
 public void Render(SVGGraphicsPath _graphicsPath)
 {
     _graphicsPath.AddCubicCurveTo(controlPoint1, controlPoint2, currentPoint);
 }