示例#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;
            }
        }
示例#2
0
        private void BuildByPOints(object sender, EventArgs e)
        {
            switch (type)
            {
            case FunctionType.ONE_ARGUMENT_FUNCTION:

                drawer2D.AddGraphic(1, Function2D, "Исходная функция", typeView.Line);
                drawer2D.AddGraphic(2, Function2DWithMiss, "Выборка", typeView.Rectangle);
                drawer2D.Functions[1].PointsCount = Int32.Parse(PointCountX.Text);
                drawer2D.EnableCreatingBuffer();
                drawer2D.Redraw();
                break;

            case FunctionType.TWO_ARGUMENT_FUNCTION:

                drawer3D.AddGraphic(missFunction);
                drawer3D.EnableCreateBuffers();
                drawer3D.RecreateGraphic();
                break;
            }

            pointsCreated = true;
        }