public PipelineData AddWholePath(Spline path, PathPointLayout layout, Wacom.Ink.Geometry.VectorBrush vectorBrush) { var splineInterpolator = new CurvatureBasedInterpolator(layout); var brushApplier = new BrushApplier(layout, vectorBrush); var points = splineInterpolator.Add(true, true, path, null); var polys = brushApplier.Add(true, true, points.Addition, points.Prediction); var hulls = mConvexHullChainProducer.Add(true, true, polys.Addition, polys.Prediction); var merged = mPolygonMerger.Add(true, true, hulls.Addition, hulls.Prediction); return(new PipelineData(polys, merged)); }
/// <summary> /// Transform accumulated pointer input to ink geometry /// </summary> /// <param name="defaultSize">Default size for SplineInterpolator and BrushApplier</param> /// <param name="defaultScale">Default Scale for BrushApplier</param> /// <param name="defaultOffset">Default Offset for BrushApplier</param> /// <param name="defaultRotation">Default Rotation for BrushApplier</param> /// <returns>Tuple containing added data (Item1) and predicted or preliminary data (Item2)</returns> /// <remarks>Passes accumulated path segment (from PathProducer) through remaining stages of /// the vector ink pipeline - Smoother, SplineProducer, SplineInterpolator, BrushApplier, ConvexHullChainProducer, /// PolygonMerger and PolygonSimplifier</remarks> public ProcessorResult <List <PolygonVertices> > GetPolygons() { var smoothPath = mSmoothingFilter.Add(mPathSegment.IsFirst, mPathSegment.IsLast, mPathSegment.AccumulatedAddition, mPathSegment.LastPrediction); var spline = SplineProducer.Add(mPathSegment.IsFirst, mPathSegment.IsLast, smoothPath.Addition, smoothPath.Prediction); var points = SplineInterpolator.Add(mPathSegment.IsFirst, mPathSegment.IsLast, spline.Addition, spline.Prediction); var polys = BrushApplier.Add(mPathSegment.IsFirst, mPathSegment.IsLast, points.Addition, points.Prediction); var hulls = mConvexHullChainProducer.Add(mPathSegment.IsFirst, mPathSegment.IsLast, polys.Addition, polys.Prediction); var merged = mPolygonMerger.Add(mPathSegment.IsFirst, mPathSegment.IsLast, hulls.Addition, hulls.Prediction); var simplified = PolygonSimplifier.Add(mPathSegment.IsFirst, mPathSegment.IsLast, merged.Addition, merged.Prediction); mPathSegment.Reset(); mPointerDataUpdateCount = 0; return(simplified); }