コード例 #1
0
        void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            tabControl.SelectionChanged += new SelectionChangedEventHandler(tabControl_SelectionChanged);

            PotentialField3D field = new PotentialField3D();

            field.AddPotentialPoint(new Point3D(0.5, 0.5, 0.5), 2);
            field.AddPotentialPoint(new Point3D(0.2, 0.2, 0.5), -3);
            field.AddPotentialPoint(new Point3D(0.8, 0.2, 0.9), 10);
            field.AddPotentialPoint(new Point3D(0.3, 0.7, 0.1), 5);

            PotentialFieldChart3D fieldChart = new PotentialFieldChart3D {
                Field = field
            };

            viewport.Children.Insert(0, fieldChart);

            dataSource3D = VectorField3D.CreateTangentPotentialField(field, 200, 200, 200);

            //dataSource3D = VectorField3D.CreatePotentialField(200, 200, 200,
            //    new PotentialPoint3D(new Point3D(0.5, 0.5, 0.5), 2), new PotentialPoint3D(new Point3D(0.2, 0.2, 0.5), -1));

            DataContext           = dataSource3D;
            isoSurface.DataSource = dataSource3D.GetMagnitudeDataSource();


            //var spiralDS = VectorField3D.CreateSpiral(
            //    latticeX: 10, latticeY: 20, latticeZ: 3,
            //    width: 2, height: 2, depth: 1).TransformGrid(transform);

            var filteredDataSource = dataSource3D.Filter(20, 20, 20);

            //vectorChart3D.DataSource = filteredDataSource;
            //gridChart.GridSource = filteredDataSource;

            //timer.Start();

            plotterXY.DataContext = dataSource3D.CreateSectionXY(0.0);
            plotterXZ.DataContext = dataSource3D.CreateSectionXZ(0.0);
            plotterYZ.DataContext = dataSource3D.CreateSectionYZ(0.0);

            sectionChartX.ThirdCoordinate = 0.0001;
            sectionChartY.ThirdCoordinate = 0.0001;
            sectionChartZ.ThirdCoordinate = 0.0001;
            sectionChartX.UpdateUI();
            sectionChartY.UpdateUI();
            sectionChartZ.UpdateUI();

            mainTabControl.SelectedIndex = 3;
            convolutionStack.DataSource  = dataSource3D;

            UpdateSelectedTab();

            progressBar.SetBinding(ProgressBar.ValueProperty, new Binding("RenderingProgress")
            {
                Source = convolutionStack
            });
        }
コード例 #2
0
        private void ySlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs <double> e)
        {
            if (dataSource3D == null)
            {
                return;
            }

            var value = e.NewValue / 100;

            plotterXZ.DataContext = dataSource3D.CreateSectionXZ(value);
            vpXZ.ThirdCoordinate  = value;
        }
コード例 #3
0
		private void MainWindow_Loaded(object sender, RoutedEventArgs e)
		{
			PotentialField3D field = new PotentialField3D();
			field.AddPotentialPoint(new Point3D(0.5, 0.5, 0.5), 2);
			field.AddPotentialPoint(new Point3D(0.2, 0.2, 0.5), -3);
			field.AddPotentialPoint(new Point3D(0.8, 0.2, 0.9), 10);
			field.AddPotentialPoint(new Point3D(0.3, 0.7, 0.1), 5);

			dataSource3D = VectorField3D.CreateTangentPotentialField(field, 200, 200, 200);

			plotterXY.DataContext = dataSource3D.CreateSectionXY(0.0);
			plotterXZ.DataContext = dataSource3D.CreateSectionXZ(0.0);
			plotterYZ.DataContext = dataSource3D.CreateSectionYZ(0.0);
		}
コード例 #4
0
		void MainWindow_Loaded(object sender, RoutedEventArgs e)
		{
			tabControl.SelectionChanged += new SelectionChangedEventHandler(tabControl_SelectionChanged);

			PotentialField3D field = new PotentialField3D();
			field.AddPotentialPoint(new Point3D(0.5, 0.5, 0.5), 2);
			field.AddPotentialPoint(new Point3D(0.2, 0.2, 0.5), -3);
			field.AddPotentialPoint(new Point3D(0.8, 0.2, 0.9), 10);
			field.AddPotentialPoint(new Point3D(0.3, 0.7, 0.1), 5);

			PotentialFieldChart3D fieldChart = new PotentialFieldChart3D { Field = field };
			viewport.Children.Insert(0, fieldChart);

			dataSource3D = VectorField3D.CreateTangentPotentialField(field, 200, 200, 200);

			//dataSource3D = VectorField3D.CreatePotentialField(200, 200, 200,
			//    new PotentialPoint3D(new Point3D(0.5, 0.5, 0.5), 2), new PotentialPoint3D(new Point3D(0.2, 0.2, 0.5), -1));

			DataContext = dataSource3D;
			isoSurface.DataSource = dataSource3D.GetMagnitudeDataSource();


			//var spiralDS = VectorField3D.CreateSpiral(
			//    latticeX: 10, latticeY: 20, latticeZ: 3,
			//    width: 2, height: 2, depth: 1).TransformGrid(transform);

			var filteredDataSource = dataSource3D.Filter(20, 20, 20);
			//vectorChart3D.DataSource = filteredDataSource;
			//gridChart.GridSource = filteredDataSource;

			//timer.Start();

			plotterXY.DataContext = dataSource3D.CreateSectionXY(0.0);
			plotterXZ.DataContext = dataSource3D.CreateSectionXZ(0.0);
			plotterYZ.DataContext = dataSource3D.CreateSectionYZ(0.0);

			sectionChartX.ThirdCoordinate = 0.0001;
			sectionChartY.ThirdCoordinate = 0.0001;
			sectionChartZ.ThirdCoordinate = 0.0001;
			sectionChartX.UpdateUI();
			sectionChartY.UpdateUI();
			sectionChartZ.UpdateUI();

			mainTabControl.SelectedIndex = 3;
			convolutionStack.DataSource = dataSource3D;

			UpdateSelectedTab();

			progressBar.SetBinding(ProgressBar.ValueProperty, new Binding("RenderingProgress") { Source = convolutionStack });
		}
コード例 #5
0
		private IDataSource2D<Vector> CreateSection(IUniformDataSource3D<Vector3D> dataSource, double ratio)
		{
			switch (Variable)
			{
				case SectionVariable.X:
					return dataSource.CreateSectionYZ(ratio);
				case SectionVariable.Y:
					return dataSource.CreateSectionXZ(ratio);
				case SectionVariable.Z:
					return dataSource.CreateSectionXY(ratio);
				default:
					throw new NotImplementedException();
			}
		}
コード例 #6
0
        private void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            PotentialField3D field = new PotentialField3D();

            field.AddPotentialPoint(new Point3D(0.5, 0.5, 0.5), 2);
            field.AddPotentialPoint(new Point3D(0.2, 0.2, 0.5), -3);
            field.AddPotentialPoint(new Point3D(0.8, 0.2, 0.9), 10);
            field.AddPotentialPoint(new Point3D(0.3, 0.7, 0.1), 5);

            dataSource3D = VectorField3D.CreateTangentPotentialField(field, 200, 200, 200);

            plotterXY.DataContext = dataSource3D.CreateSectionXY(0.0);
            plotterXZ.DataContext = dataSource3D.CreateSectionXZ(0.0);
            plotterYZ.DataContext = dataSource3D.CreateSectionYZ(0.0);
        }
コード例 #7
0
        private IDataSource2D <Vector> CreateSection(IUniformDataSource3D <Vector3D> dataSource, double ratio)
        {
            switch (Variable)
            {
            case SectionVariable.X:
                return(dataSource.CreateSectionYZ(ratio));

            case SectionVariable.Y:
                return(dataSource.CreateSectionXZ(ratio));

            case SectionVariable.Z:
                return(dataSource.CreateSectionXY(ratio));

            default:
                throw new NotImplementedException();
            }
        }