示例#1
0
        public CircleWindow()
        {
            viewModel   = new PlotWindowModel(CanonicalDomain.Circular);
            DataContext = viewModel;
            InitializeComponent();
            Settings.PlotGeomParams.hVertical         = 0.5;
            Settings.PlotGeomParamsConstant.hVertical = 0.5;
#if !HELP_FOR_GROUP_LEADER
            w = new Hydrodynamics_Sources.Potential(1, 0, 1, 0, new Hydrodynamics_Sources.Conformal_Maps.IdentityTransform());
            s = new Hydrodynamics_Sources.CircleStreamLinesBuilder(w, viewModel);
#endif
            mapsList.SelectionChanged += MapsList_SelectionChanged;
#if !HELP_FOR_GROUP_LEADER
            mapsList.Items.Add("Тождественное отображение");
            mapsList.Items.Add("Обтекание пластины");
            mapsList.Items.Add("Профиль Жуковского");
#else
            mapsList.Items.Add("Help");
#endif
            mapsList.SelectedIndex         = 0;
            viewModel.PlotModel.MouseMove += PlotModel_MouseMove;
            viewModel.PlotModel.MouseDown += PlotModel_MouseDown;
            plot.Controller = new PlotController();
            plot.Controller.UnbindMouseDown(OxyMouseButton.Left);
        }
        protected StreamLinesBuilder(Potential w, PlotWindowModel g, CanonicalDomain domain)
        {
            this.w      = w;
            this.g      = g;
            this.domain = domain;
            switch (domain)
            {
            case CanonicalDomain.HalfPlane:
                x_min = Settings.PlotGeomParams.XMin;
                x_max = Settings.PlotGeomParams.XMax;
                y_max = Settings.PlotGeomParams.YMax;
                y_min = 0;
                break;

            case CanonicalDomain.Zone:
                x_min = Settings.PlotGeomParams.XMin;
                x_max = Settings.PlotGeomParams.XMax;
                y_max = Math.PI;
                y_min = -Settings.PlotGeomParams.hVertical;
                break;

            case CanonicalDomain.Circular:
                x_min = Settings.PlotGeomParams.XMin;
                x_max = Settings.PlotGeomParams.XMax;
                y_max = Settings.PlotGeomParams.YMax;
                y_min = 0;
                break;

            default: throw new ArgumentException();
            }
            h_mrk           = Settings.PlotGeomParams.MRKh;
            h               = Settings.PlotGeomParams.hVertical;
            StreamLinesBase = new List <List <DataPoint> >();
        }
 public ZoneWindow()
 {
     viewModel   = new PlotWindowModel(CanonicalDomain.Zone);
     DataContext = viewModel;
     InitializeComponent();
     Settings.PlotGeomParams.hVertical         = 2 * Math.PI / 16.0;
     Settings.PlotGeomParamsConstant.hVertical = Settings.PlotGeomParams.hVertical;
     w = new Hydrodynamics_Sources.Potential(1, 0, 0, 0, new Hydrodynamics_Sources.Conformal_Maps.IdentityTransform());
     s = new Hydrodynamics_Sources.HalfPlaneAndZoneStreamLinesBuilder(w, viewModel, CanonicalDomain.Zone);
     mapsList.SelectionChanged += MapsList_SelectionChanged;
     mapsList.Items.Add("Тождественное\nотображение");
     mapsList.Items.Add("Плоскость с двумя\nотброшенными лучами");
     mapsList.Items.Add("Диффузор");
     mapsList.SelectedIndex         = 0;
     viewModel.PlotModel.MouseMove += PlotModel_MouseMove;
     viewModel.PlotModel.MouseDown += PlotModel_MouseDown;
     plot.Controller = new PlotController();
     plot.Controller.UnbindMouseDown(OxyMouseButton.Left);
 }
 public HalfPlane()
 {
     viewModel   = new PlotWindowModel(CanonicalDomain.HalfPlane);
     DataContext = viewModel;
     InitializeComponent();
     Settings.PlotGeomParams.hVertical         = 0.5;
     Settings.PlotGeomParamsConstant.hVertical = 0.5;
     w = new Hydrodynamics_Sources.Potential(1, 0, 0, 0, new Hydrodynamics_Sources.Conformal_Maps.IdentityTransform());
     s = new Hydrodynamics_Sources.HalfPlaneAndZoneStreamLinesBuilder(w, viewModel, CanonicalDomain.HalfPlane);
     mapsList.SelectionChanged += MapsList_SelectionChanged;
     mapsList.Items.Add("Тождественное\nотображение");
     mapsList.Items.Add("Треугольник 1");
     mapsList.Items.Add("Полуплоскость с\nвыброшенным\nотрезком");
     mapsList.Items.Add("Треугольник 2");
     mapsList.Items.Add("Треугольник 3");
     mapsList.Items.Add("Четырёхугольник 1");
     mapsList.Items.Add("Полуплоскость с\nвыброшенным\nравнобедренным\nтреугольником");
     mapsList.Items.Add("Треугольник 4");
     mapsList.SelectedIndex         = 0;
     viewModel.PlotModel.MouseMove += PlotModel_MouseMove;
     viewModel.PlotModel.MouseDown += PlotModel_MouseDown;
     plot.Controller = new PlotController();
     plot.Controller.UnbindMouseDown(OxyMouseButton.Left);
 }
 public CircleStreamLinesBuilder(Potential w, PlotWindowModel g) : base(w, g, CanonicalDomain.Circular)
 {
     InitialBuild();
 }
示例#6
0
 public HalfPlaneAndZoneStreamLinesBuilder(Potential w, PlotWindowModel g, CanonicalDomain domain)
 {
     InitialBuild();
 }
 /// <summary>
 /// Перемещение созданного вектора (и его создание, если таковой отсутствует) для области окружности
 /// </summary>
 /// <param name="start">Начало вектора</param>
 /// <param name="end">Конец вектора</param>
 /// <param name="V">Значение скорости</param>
 /// <param name="domain">Вид канонической области</param>
 /// <param name="w">Комплексный потенциал</param>
 public void RedrawArrow(Complex start, Complex end, Complex V, CanonicalDomain domain, Hydrodynamics_Sources.Potential w)
 {
     if (IsMouseClickedInPolygon || Complex.IsNaN(V))
     {
         if (start.Abs < w.R || Complex.IsNaN(V))
         {
             DeleteArrow();
             IsMouseClickedInPolygon = false;
         }
         else
         {
             if (!HasArrow())
             {
                 CreateArrow();
             }
             arrow.StartPoint = start;
             arrow.EndPoint   = end;
             arrowText.Text   = $"X: {start.Re.ToString(Settings.Format)}; Y: {start.Im.ToString(Settings.Format)};".Replace(',', '.') +
                                $"\nVx: {V.Re.ToString(Settings.Format)}; Vy: {V.Im.ToString(Settings.Format)};".Replace(',', '.');
             arrowText.TextPosition = (start + (V.Im >= 0 ? -1 : 0.2) * 1.2 * Complex.I);
         }
     }
     else
     {
         if (!HasArrow())
         {
             CreateArrow();
         }
         arrow.StartPoint = start;
         arrow.EndPoint   = end;
         arrowText.Text   = $"X: {start.Re.ToString(Settings.Format)}; Y: {start.Im.ToString(Settings.Format)};".Replace(',', '.') +
                            $"\nVx: {V.Re.ToString(Settings.Format)}; Vy: {V.Im.ToString(Settings.Format)};".Replace(',', '.');
         arrowText.TextPosition = (start + (V.Im >= 0 ? -1 : 0.2) * 1.2 * Complex.I);
     }
 }
 protected StreamLinesBuilderCircle(Potential w, PlotWindowModel g, CanonicalDomain domain) : base(w, g, domain)
 {
 }