/// <summary>
        /// </summary>
        /// <exception cref="ArgumentNullException">
        /// <para><paramref name="item"/> is <see langword="null"/>.</para>
        /// </exception>
        public virtual void Add(NuGenFormula item)
        {
            if (item == null)
            {
                throw new ArgumentNullException("item");
            }

            this.InnerList.Add(item);
        }
		/// <summary>
		/// </summary>
		/// <exception cref="ArgumentNullException">
		/// <para><paramref name="item"/> is <see langword="null"/>.</para>
		/// </exception>
		public virtual void Add(NuGenFormula item)
		{
			if (item == null)
			{
				throw new ArgumentNullException("item");
			}

			this.InnerList.Add(item);
		}
Beispiel #3
0
 private void CalculatePathInternalAsy(NuGenFormula fml, bool force)
 {
     if (fml.draw && (force || _forceFormula == i - 1 ||
                      fml.PaintValidate.Start > (double)(-_gitter.X) / w ||
                      fml.PaintValidate.End < (double)(this.Width - _gitter.X) / w))
     {
         if (fml.HasChildren)
         {
             for (int _i = 0; _i < fml.Children.Count; _i++)
             {
                 CalculatePathInternalAsy(fml.Children[_i], force);
             }
             return;
         }
         NuGenInterpreter.SetVariableValue(_vara, fml.Param);
         fml.pth.Reset();
         fml.pthasympt.Reset();
         //intptr.WertändernUS(Math.Max(begin/w,fml.intervall.start));
         ppy = py = GetVal(fml._ve, Math.Max(begin / w, fml.Interval.Start)) * -h;                /////
         SaveLine(fml.pthasympt, -2e5f * h, GetValIS(fml._ve, -2e5f) * -h, 2e5f * h, GetValIS(fml._ve, 2e5f) * -h);
         pcurr = 0;
         for (d = Math.Max(begin, fml.Interval.Start * w) + 1.0;
              d <= Math.Min(end, fml.Interval.End * w); d++, pcurr++)
         {
             //intptr.WertändernUS(d/w);
             y = GetVal(fml._ve, d / w) * -h;                    ///////
             if (SAsymp(ppy, py, y))
             {
                 fml.pthasympt.StartFigure();
                 fml.pthasympt.AddLine((float)d, 2e5f, (float)d, -2e5f);
                 fml.pth.StartFigure();
             }
             else
             {
                 fml.pth.AddLine((float)(d - 1.0), py, (float)d, y);
             }
             ppy = py;
             py  = y;
             if (Success != null)
             {
                 Success(
                     pcurr,
                     pmax,
                     string.Format(
                         Resources.Text_VisiPlot2D_SuccessDescription,
                         i.ToString(CultureInfo.CurrentCulture),
                         _formulas.Count.ToString(CultureInfo.CurrentCulture)
                         )
                     );
             }
         }
         fml.PaintValidate = new NuGenPlotInterval(begin / w, end / w);
         _forceFormula     = -1;
     }
 }
        /// <summary>
        /// </summary>
        public NuGenFormula[] ToArray()
        {
            if (this.InnerList.Count == 0)
            {
                return(new NuGenFormula[] { });
            }

            NuGenFormula[] formulas = new NuGenFormula[this.InnerList.Count];
            this.InnerList.CopyTo(formulas);
            return(formulas);
        }
		private NuGenFormula(string formel, NuGenPlotInterval intervall, Color frb, bool draw, NuGenFormula[] children, double param)
		{
			_formel = formel;
			_children = new NuGenFormulaCollectionBase();
			if (children != null)
				_children.AddRange(children);
			this._param = param;
			this._formulaElement = NuGenInterpreter.ParseInfixExpression(formel);
			this._interval = intervall;
			this.frb = frb;
			this._paintValidate = new NuGenPlotInterval(0.0, 0.0);
			this.draw = draw;
			_pth = new GraphicsPath();
			_pthasympt = new GraphicsPath();
		}
		/// <summary>
		/// </summary>
		/// <exception cref="ArgumentNullException">
		/// <para><paramref name="items"/> is <see langword="null"/>.</para>
		/// </exception>
		public virtual void AddRange(NuGenFormula[] items)
		{
			if (items == null)
			{
				throw new ArgumentNullException("items");
			}

			for (int i = 0; i < items.Length; i++)
			{
				NuGenFormula formula = items[i];

				if (formula != null)
				{
					this.InnerList.Add(formula);
				}
			}
		}
        /// <summary>
        /// </summary>
        /// <exception cref="ArgumentNullException">
        /// <para><paramref name="items"/> is <see langword="null"/>.</para>
        /// </exception>
        public virtual void AddRange(NuGenFormula[] items)
        {
            if (items == null)
            {
                throw new ArgumentNullException("items");
            }

            for (int i = 0; i < items.Length; i++)
            {
                NuGenFormula formula = items[i];

                if (formula != null)
                {
                    this.InnerList.Add(formula);
                }
            }
        }
Beispiel #8
0
 private void DrawPath(Graphics gr, NuGenFormula fml)
 {
     if (fml.HasChildren)
     {
         for (int i = 0; i < fml.Children.Count; i++)
         {
             DrawPath(gr, fml.Children[i]);
         }
         return;
     }
     if (fml.draw)
     {
         _pen.Color = fml.frb;
         gr.DrawPath(_pen, fml.pth);
         if (_flags[(int)Flags.Asymptotes])
         {
             gr.DrawPath(_hatchPen, fml.pthasympt);
         }
     }
 }
 /// <summary>
 /// </summary>
 /// <param name="item">Can be <see langword="null"/>.</param>
 public int IndexOf(NuGenFormula item)
 {
     return(this.InnerList.IndexOf(item));
 }
		/// <summary>
		/// </summary>
		/// <exception cref="ArgumentNullException">
		/// <para><paramref name="items"/> is <see langword="null"/>.</para>
		/// </exception>
		public override void AddRange(NuGenFormula[] vals)
		{
			base.AddRange(vals);
			_owner.Reload();
		}
		/// <summary>
		/// </summary>
		/// <param name="item">Can be <see langword="null"/>.</param>
		public int IndexOf(NuGenFormula item)
		{
			return this.InnerList.IndexOf(item);
		}
		/// <summary>
		/// </summary>
		/// <param name="item">Can be <see langword="null"/>.</param>
		public virtual void Remove(NuGenFormula item)
		{
			this.InnerList.Remove(item);
		}
 /// <summary>
 /// </summary>
 /// <param name="item">Can be <see langword="null"/>.</param>
 public virtual void Remove(NuGenFormula item)
 {
     this.InnerList.Remove(item);
 }
		/// <summary>
		/// </summary>
		/// <exception cref="ArgumentNullException">
		/// <para><paramref name="item"/> is <see langword="null"/>.</para>
		/// </exception>
		public override void Add(NuGenFormula val)
		{
			base.Add(val);
			_owner.Reload();
		}
Beispiel #15
0
 /// <summary>
 /// </summary>
 /// <param name="fml"></param>
 public override void Remove(NuGenFormula fml)
 {
     base.Remove(fml);
     _owner.Reload();
 }
Beispiel #16
0
		/// <summary>
		/// Initializes a new instance of the <see cref="NuGenFormula"/> class.
		/// </summary>
		public NuGenFormula(string formel, NuGenPlotInterval intervall, Color frb, bool draw, NuGenFormula[] children)
			: this(formel, intervall, frb, draw, children, 0.0)
		{
			this.isparam = children == null;
		}
		private void DrawPath(Graphics gr, NuGenFormula fml)
		{
			if (fml.HasChildren)
			{
				for (int i = 0; i < fml.Children.Count; i++)
					DrawPath(gr, fml.Children[i]);
				return;
			}
			if (fml.draw)
			{
				_pen.Color = fml.frb;
				gr.DrawPath(_pen, fml.pth);
				if (_flags[(int)Flags.Asymptotes])
					gr.DrawPath(_hatchPen, fml.pthasympt);
			}
		}
		private void CalculatePathInternalAsy(NuGenFormula fml, bool force)
		{
			if (fml.draw && (force || _forceFormula == i - 1
				|| fml.PaintValidate.Start > (double)(-_gitter.X) / w
				|| fml.PaintValidate.End < (double)(this.Width - _gitter.X) / w))
			{
				if (fml.HasChildren)
				{
					for (int _i = 0; _i < fml.Children.Count; _i++)
					{
						CalculatePathInternalAsy(fml.Children[_i], force);
					}
					return;
				}
				NuGenInterpreter.SetVariableValue(_vara, fml.Param);
				fml.pth.Reset();
				fml.pthasympt.Reset();
				//intptr.WertändernUS(Math.Max(begin/w,fml.intervall.start));
				ppy = py = GetVal(fml._ve, Math.Max(begin / w, fml.Interval.Start)) * -h;/////
				SaveLine(fml.pthasympt, -2e5f * h, GetValIS(fml._ve, -2e5f) * -h, 2e5f * h, GetValIS(fml._ve, 2e5f) * -h);
				pcurr = 0;
				for (d = Math.Max(begin, fml.Interval.Start * w) + 1.0;
					d <= Math.Min(end, fml.Interval.End * w); d++, pcurr++)
				{
					//intptr.WertändernUS(d/w);
					y = GetVal(fml._ve, d / w) * -h;///////
					if (SAsymp(ppy, py, y))
					{
						fml.pthasympt.StartFigure();
						fml.pthasympt.AddLine((float)d, 2e5f, (float)d, -2e5f);
						fml.pth.StartFigure();
					}
					else
						fml.pth.AddLine((float)(d - 1.0), py, (float)d, y);
					ppy = py;
					py = y;
					if (Success != null)
					{
						Success(
							pcurr,
							pmax,
							string.Format(
								Resources.Text_VisiPlot2D_SuccessDescription,
								i.ToString(CultureInfo.CurrentCulture),
								_formulas.Count.ToString(CultureInfo.CurrentCulture)
							)
						);
					}
				}
				fml.PaintValidate = new NuGenPlotInterval(begin / w, end / w);
				_forceFormula = -1;
			}
		}
		/// <summary>
		/// </summary>
		/// <param name="fml"></param>
		public override void Remove(NuGenFormula fml)
		{
			base.Remove(fml);
			_owner.Reload();
		}
		/// <summary>
		/// </summary>
		public NuGenFormula[] ToArray()
		{
			if (this.InnerList.Count == 0)
			{
				return new NuGenFormula[] { };
			}

			NuGenFormula[] formulas = new NuGenFormula[this.InnerList.Count];
			this.InnerList.CopyTo(formulas);
			return formulas;
		}
Beispiel #21
0
 /// <summary>
 /// </summary>
 /// <exception cref="ArgumentNullException">
 /// <para><paramref name="item"/> is <see langword="null"/>.</para>
 /// </exception>
 public override void Add(NuGenFormula val)
 {
     base.Add(val);
     _owner.Reload();
 }