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));
        }
        public void UpdatePipeline(PathPointLayout layout, Calculator calculator, VectorBrush brush)
        {
            bool layoutChanged = false;

            if ((Layout == null) || (layout.ChannelMask != Layout.ChannelMask))
            {
                Layout        = layout;
                layoutChanged = true;
            }

            if (mPathProducer == null || calculator != mPathProducer.PathPointCalculator || layoutChanged)
            {
                mPathProducer = new PathProducer(Layout, calculator)
                {
                    KeepAllData = true
                };
            }

            if (mSmoothingFilter == null || layoutChanged)
            {
                mSmoothingFilter = new SmoothingFilter(Layout.Count)
                {
                    KeepAllData = true
                };
            }

            if (SplineProducer == null || layoutChanged)
            {
                SplineProducer = new SplineProducer(Layout)
                {
                    KeepAllData = true
                };
            }

            if (SplineInterpolator == null || layoutChanged)
            {
                SplineInterpolator = new CurvatureBasedInterpolator(Layout)
                {
                    KeepAllData = true
                };
            }

            if (BrushApplier == null || (brush != BrushApplier.Prototype) || layoutChanged)
            {
                BrushApplier = new BrushApplier(Layout, brush)
                {
                    KeepAllData = true
                };
            }

            if (ConvexHullChainProducer == null)
            {
                ConvexHullChainProducer = new ConvexHullChainProducer()
                {
                    KeepAllData = true
                };
            }

            if (mPolygonMerger == null)
            {
                mPolygonMerger = new PolygonMerger()
                {
                    KeepAllData = true
                };
            }

            if (PolygonSimplifier == null)
            {
                PolygonSimplifier = new PolygonSimplifier(0.1f)
                {
                    KeepAllData = true
                };
            }
        }