Exemplo n.º 1
0
        private void CreateVisualisationControl()
        {
            switch (type)
            {
            case FunctionType.ONE_ARGUMENT_FUNCTION:
                Z0.Enabled         = ZN.Enabled = PointCountZ.Enabled = false;
                Text               = "F(X) = " + FunctionTxt.Text;
                parser.InputString = FunctionTxt.Text;
                variables[0]       = parser.GetVariable("x");
                drawer2D           = new Drawer(DrawerContainer.Panel1, DrawerContainer.Panel1.ClientRectangle);
                drawer2D.Dock      = DockStyle.Fill;
                drawer2D.AddGraphic(1, Function2D, "Исходная функция", typeView.Line);
                drawer2D.Redraw();
                break;

            case FunctionType.TWO_ARGUMENT_FUNCTION:
                Z0.Enabled         = ZN.Enabled = PointCountZ.Enabled = true;
                Text               = "F(X,Y) = " + FunctionTxt.Text;
                parser.InputString = FunctionTxt.Text;
                variables[0]       = parser.GetVariable("x");
                variables[1]       = parser.GetVariable("y");
                drawer3D           = new Graphics3D();
                drawer3D.AddGraphic(mainFunction);
                drawer3D.Parent = DrawerContainer.Panel1;
                break;
            }
        }