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() ); }
GleePointToPointF ( Microsoft.Glee.Splines.Point oGleePoint ) { Debug.Assert(oGleePoint != null); AssertValid(); return ( new PointF( (Single)oGleePoint.X, (Single)oGleePoint.Y) ); }
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) ); }
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); }