void Window1_Loaded(object sender, RoutedEventArgs e) { var vectorField = //VectorField2D.CreateCheckerboard(200, 200); VectorField2D.CreateTangentPotentialField(256, 256, new PotentialPoint(new Point(20, 10), 1), new PotentialPoint(new Point(128, 128), -2), new PotentialPoint(new Point(65, 85), 3), new PotentialPoint(new Point(150, 30), 10), new PotentialPoint(new Point(100, 100), -5)); DataContext = vectorField; streamlineChart.DataSource = vectorField; horizontalSection.SetBinding(HorizontalCrossSectionChart.SectionCoordinateProperty, new Binding("Position.Y") { Source = point }); horizontalSection.Palette = convolutionChart.MagnitudeFilter.Palette; horizontalSection.DataSource = vectorField; verticalSection.SetBinding(VerticalCrossSectionChart.SectionCoordinateProperty, new Binding("Position.X") { Source = point }); verticalSection.Palette = convolutionChart.MagnitudeFilter.Palette; verticalSection.DataSource = vectorField; }
private void MainWindow_Loaded(object sender, RoutedEventArgs e) { var dataSource = VectorField2D.CreateTangentPotentialField(256, 256, new PotentialPoint(new Point(20, 10), 1), new PotentialPoint(new Point(128, 128), -2), new PotentialPoint(new Point(65, 85), 3), new PotentialPoint(new Point(150, 30), 10), new PotentialPoint(new Point(100, 100), -5)); meshChart.DataSource = dataSource; meshChart.Plotter.DataContext = dataSource; }
void MainWindow_Loaded(object sender, RoutedEventArgs e) { const double xDelta = width / xCount; const double yDelta = height / yCount; PotentialField field = new PotentialField(); for (int ix = 0; ix < xCount; ix++) { for (int iy = 0; iy < yCount; iy++) { field.AddPotentialPoint(new Point(ix * xDelta, iy * yDelta), (ix + iy) % 2 == 0 ? 1 : -1); } } DataContext = VectorField2D.CreateTangentPotentialField(field, (int)width, (int)height); }
private void MainWindow_Loaded(object sender, RoutedEventArgs e) { const int size = 200; var dataSource = VectorField2D.CreateTangentPotentialField(size, size, new PotentialPoint(10, 170, 1), new PotentialPoint(100, 30, -1), new PotentialPoint(150, 130, 2) ); Stopwatch timer = Stopwatch.StartNew(); convolutionChart.AddHandler(BackgroundRenderer.RenderingFinished, new RoutedEventHandler((s, args) => { timer.Stop(); Debug.WriteLine(timer.Elapsed); })); DataContext = dataSource; }