public GraphEquationControl(CartesianFieldController controller, FunctionGraph graph)
 {
     InitializeComponent();
     Controller = controller;
     Graph      = graph;
     Controller.EnableGraph(Graph);
     EnabledCheckBox.Checked = true;
     InvalidateFunction();
 }
 private void EnabledCheckBox_CheckedChanged(object sender, EventArgs e)
 {
     if (EnabledCheckBox.Checked)
     {
         Controller.EnableGraph(Graph);
     }
     else
     {
         Controller.DisableGraph(Graph);
     }
 }
Ejemplo n.º 3
0
 public GraphOptionsForm(FunctionGraph graph)
 {
     InitializeComponent();
     TestField           = new CartesianField();
     Renderer            = new CartesianFieldRenderer(TestField, GraphWindow);
     Controller          = new CartesianFieldController(TestField, Renderer);
     K                   = Controller.CreateVariable("k");
     Graph               = Controller.CreateGraph(Controller.CreateFunction("sin ( x + k )"));
     WidthTrackBar.Value = (int)(Graph.Width * 10);
     WidthLabel.Text     = "Width: " + Graph.Width.ToString();
     Controller.EnableGraph(Graph);
     GraphWindow.FieldRenderer = Renderer;
     GraphWindow.SetCameraBounds(new RectangleD(new Vector2(-5, -2), new Vector2(10, 4)));
     GraphWindow.OnUpdate += OnGraphUpdate;
     GraphWindow.Run(24);
 }