Exemplo n.º 1
0
        /// <summary>
        /// Returns a deep copy of this item.
        /// </summary>
        public override PlotItem Clone()
        {
            FunctionItem item = new FunctionItem();

            item.CopyFrom(this);
            return(item);
        }
Exemplo n.º 2
0
		public SourceForm(GraphControl graph, FunctionItem old, MainForm mainform)
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			this.graph = graph;
			parForm = new ParForm();
			paritem = new FunctionItem();
			oldItem = old;
			this.mainform = mainform;
			lineStyle.DropDownStyle = ComboBoxStyle.DropDownList;
			for (DashStyle s = DashStyle.Solid; s < DashStyle.Custom; s++) {
				lineStyle.Items.Add(s.ToString());
			}
			lineStyle.SelectedIndex = 0;
		}
Exemplo n.º 3
0
		/// <summary>
		/// Returns a deep copy of this item.
		/// </summary>
		public override PlotItem Clone() {
			FunctionItem item = new FunctionItem();
			item.CopyFrom(this);
			return item;
		}
Exemplo n.º 4
0
		private void CreateF() {
			if (oneDimension.Checked) { f = new Function1D(graph.Model); }
			else if (twoDimensions.Checked) {
				f = new Function2D(graph.Model);
				((Function2D)f).rgb = rgb.Checked;
			}	else { f = new FunctionColor(graph.Model); }
			f.name = name.Text;
			f.source = fSource.Text;
			f.Color = colorLabel.BackColor;
			f.lineStyle = (DashStyle)(lineStyle.SelectedIndex);
			try {
				f.lineWidth = float.Parse(lineWidth.Text);
			} catch {f.lineWidth = 1;}
			f.p = paritem.p;
		}
Exemplo n.º 5
0
		public void Reset(FunctionItem item) {
			this.item = item;


			grid.ColumnsCount = 2;
			grid.RowsCount = item.p.Length + 1;
			grid[0,0] = new SourceGrid2.Cells.Real.Header("n");
			grid[0,1] = new SourceGrid2.Cells.Real.ColumnHeader("p[n]");
			for (int r = 0; r < item.p.Length; r++) {
				grid[r+1,0] = new SourceGrid2.Cells.Real.RowHeader(r);
				grid[r+1,1] = new SourceGrid2.Cells.Real.Cell(item.p[r], typeof(double));
			}

			grid.Columns[0].AutoSizeMode = SourceGrid2.AutoSizeMode.MinimumSize;
			grid.Columns[1].AutoSizeMode = SourceGrid2.AutoSizeMode.MinimumSize;
			grid.AutoSize();
		}