Beispiel #1
0
        public BlurCurve(BaseCurve oriCurve, double blurRange)
        {
            this.OriginalCurve = oriCurve;
            this.BlurRange     = blurRange;

            this.MinT = oriCurve.MinT;
            this.MaxT = oriCurve.MaxT;
        }
Beispiel #2
0
        public void AddCurve(double startt, double endt, BaseCurve curve)
        {
            CompositeCurve_Element elem = new CompositeCurve_Element {
                StartT = startt, EndT = endt, Curve = curve
            };

            Curves.Add(elem);
            if (Curves_MaxT < endt)
            {
                Curves_MaxT = endt;
                Curves_Max  = elem;
            }
            if (Curves_MinT > startt)
            {
                Curves_MinT = startt;
                Curves_Min  = elem;
            }
        }
        public override ASSPointF GetPointF(double t)
        {
            ASSPointF pt = new ASSPointF {
                X = 0, Y = 0, T = t
            };

            foreach (CompositeCurve_Element elem in Curves)
            {
                BaseCurve curve = elem.Curve;
                ASSPointF pt0   = elem.Curve.GetPointF((t - MinT) / (MaxT - MinT) * (curve.MaxT - curve.MinT) + curve.MinT);
                if (pt0 == null)
                {
                    return(null);
                }
                pt.X += pt0.X;
                pt.Y += pt0.Y;
            }
            return(pt);
        }
Beispiel #4
0
        public override ASSPointF GetPointF(double t)
        {
            foreach (CompositeCurve_Element elem in Curves)
            {
                if (Common.InRange(elem.StartT, elem.EndT, t))
                {
                    BaseCurve curve = elem.Curve;
                    ASSPointF pt    = curve.GetPointF((t - elem.StartT) / (elem.EndT - elem.StartT) * (curve.MaxT - curve.MinT) + curve.MinT);
                    pt.T = (pt.T - curve.MinT) / (curve.MaxT - curve.MinT) * (elem.EndT - elem.StartT) + elem.StartT;
                    return(pt);
                }
            }
            return(null);

            if (t < Curves_MinT)
            {
                return(Curves_Min.Curve.GetMinPointF());
            }
            if (t > Curves_MaxT)
            {
                return(Curves_Max.Curve.GetMaxPointF());
            }
            throw new Exception();
        }