private void buttonCalc_Click(object sender, EventArgs e) { // try // { MathFormula f = new MathFormula(panel.Performer.Formula, UndrawableConverter.Object); // MathFormula f = MathFormula.FromString(panel.Performer.Formula.Sizes, fs); f = f.FullTransform(null); /*FormulaTree tree = new FormulaTree(f); * FormulaTree der = tree.Deriv(textBoxDerivType.Text); * der.SimplifyAll(); * derivFormula = der.GetFormula(0, FormulaEditorPanel.sizes);*/ ObjectFormulaTree tree = ObjectFormulaTree.CreateTree(f, ElementaryFunctionsCreator.Object); ObjectFormulaTree der = tree.Derivation(textBoxDerivType.Text); //der = ElementaryFormulaSimplification.Object.Simplify(der);//der.SimplifyAll(); MathFormula form = FormulaCreator.CreateFormula(der, (byte)0, MathSymbolFactory.Sizes); form.Simplify(); derivFormula = new MathFormulaDrawable(form, DrawableConverter.Object); derivFormula.Position = pointDeriv; derivFormula.CalculateFullRelativeRectangle(); derivFormula.CalculatePositions(); paintDeriv(); Refresh(); /* } * catch (System.Exception ex) * { * WindowsExtensions.ControlExtensions.ShowMessageBoxModal(this, ex.Message); * }*/ }
public void InsertFormulaCreater(FormulaCreator formulaCreator, int countToCall) { CreatorSetting settting = new CreatorSetting(); settting.formulaCreator = formulaCreator; settting.count = countToCall; creatorSettings.Add(settting); }