Beispiel #1
0
    GleeCurveToPointFArray
    (
        Microsoft.Glee.Splines.Curve oCurve
    )
    {
        Debug.Assert(oCurve != null);
        AssertValid();

        // This is based on code in Microsoft.Glee.GraphViewerGdi.GViewer.
        // TransferGeometryFromGleeGraphToGraph() in the GLEE source code,

        System.Collections.Generic.List<PointF> oPointFList =
            new System.Collections.Generic.List<PointF>();

        Microsoft.Glee.Splines.Point oGleePoint =
            (oCurve.Segs[0] as Microsoft.Glee.Splines.CubicBezierSeg).B(0);

        oPointFList.Add( GleePointToPointF(oGleePoint) );

        foreach (Microsoft.Glee.Splines.CubicBezierSeg oCubicBezierSeg in
            oCurve.Segs)
        {
            oPointFList.Add( GleePointToPointF(oCubicBezierSeg.B(1) ) );
            oPointFList.Add( GleePointToPointF(oCubicBezierSeg.B(2) ) );
            oPointFList.Add( GleePointToPointF(oCubicBezierSeg.B(3) ) );
        }

        return ( oPointFList.ToArray() );
    }
Beispiel #2
0
    GleePointToPointF
    (
        Microsoft.Glee.Splines.Point oGleePoint
    )
    {
        Debug.Assert(oGleePoint != null);
        AssertValid();

        return ( new PointF( (Single)oGleePoint.X,  (Single)oGleePoint.Y) );
    }
Beispiel #3
0
    GleePointToTransformedPointF
    (
        Microsoft.Glee.Splines.Point oGleePoint,
        Matrix oTransformationMatrix
    )
    {
        Debug.Assert(oGleePoint != null);
        Debug.Assert(oTransformationMatrix != null);
        AssertValid();

        PointF oPointF =
            new PointF( (Single)oGleePoint.X,  (Single)oGleePoint.Y );

        return ( LayoutUtil.TransformPointF(oPointF, oTransformationMatrix) );
    }
Beispiel #4
0
    GleeCurveToTransformedPointFArray
    (
        Microsoft.Glee.Splines.Curve oCurve,
        Matrix oTransformationMatrix
    )
    {
        Debug.Assert(oCurve != null);
        Debug.Assert(oTransformationMatrix != null);
        AssertValid();

        // Load the curve points into a list.

        System.Collections.Generic.List<PointF> oPointFList =
            new System.Collections.Generic.List<PointF>();

        Microsoft.Glee.Splines.Point oGleePoint =
            (oCurve.Segs[0] as Microsoft.Glee.Splines.CubicBezierSeg).B(0);

        oPointFList.Add( GleePointToPointF(oGleePoint) );

        foreach (Microsoft.Glee.Splines.CubicBezierSeg oCubicBezierSeg in
            oCurve.Segs)
        {
            oPointFList.Add( GleePointToPointF(oCubicBezierSeg.B(1) ) );
            oPointFList.Add( GleePointToPointF(oCubicBezierSeg.B(2) ) );
            oPointFList.Add( GleePointToPointF(oCubicBezierSeg.B(3) ) );
        }

        // Convert the list to an array and transform it to NodeXL coordinates.

        PointF [] aoCurvePoints = oPointFList.ToArray();

        oTransformationMatrix.TransformPoints(aoCurvePoints);

        return (aoCurvePoints);
    }