コード例 #1
0
ファイル: GEMI.cs プロジェクト: tiger-box/GISControl
 public GEMI()
 {
     double[] values = new double[] { 0, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3,
                                      0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1 };
     colorPalette = new MapValue.ColorPalette(values);
     plotValue    = new PlotValue(values);
 }
コード例 #2
0
 public MSAVI()
 {
     double[] values = new double[] { -1, -0.9, -0.8, -0.7, -0.6, -0.5, -0.4,
                                      -0.3, -0.2, -0.1, 0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1 };
     colorPalette = new MapValue.ColorPalette(values);
     plotValue    = new PlotValue(values);
 }
コード例 #3
0
ファイル: NDVI.cs プロジェクト: tiger-box/GISControl
 public NDVI()
 {
     double[] values = new double[] { -1, 0, 0.033, 0.066, 0.1, 0.133, 0.166,
                                      0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 1 };
     colorPalette = new MapValue.ColorPalette(values);
     plotValue    = new PlotValue(values);
 }
コード例 #4
0
        public SeriesViewModel(XYPlotValue value)
        {
            var index = 1;

            _value    = value;
            _children = new ObservableCollection <SeriesElementViewModel>();

            for (var i = 0; i < value.Count; i++)
            {
                var series = value.GetSeries(i);
                var child  = new SeriesElementViewModel(series, index++);
                _children.Add(child);
            }

            SelectedItem = Children.FirstOrDefault();

            _save = new RelayCommand(x =>
            {
                var window = x as Window;

                foreach (var series in Children)
                {
                    series.Save();
                }

                _value.UpdateProperties();

                if (window != null)
                {
                    window.Close();
                }
            });
        }
コード例 #5
0
        private void graph_PlotAreaMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            if (graph.Plots.Count() == 0)
            {
                return;
            }
            Point     screenPosition   = e.GetPosition(graph);
            Point     relativePosition = graph.ScreenToRelative(screenPosition);
            PlotValue nearestValue     = graph.FindNearestValue(graph.Plots[0], relativePosition, query);
            IPlot     plot1            = nearestValue.PlotObserver;
            var       plot             = (Plot)graph.Plots[plot1.Index];

            if (plot == null || plot == _SelectedPlot)
            {
                return;
            }
            _SelectedPlot = plot;
            foreach (Plot p in graph.Plots)
            {
                ((LinePlotRenderer)p.Renderer).StrokeThickness = 1.0;
            }
            ((LinePlotRenderer)_SelectedPlot.Renderer).StrokeThickness = 2.0;
            int index = graph.Plots.IndexOf(plot);

            lstYxis.SelectedIndex = index;
        }
コード例 #6
0
        static void Print(PlotValue plot, IPlotSerializer plotter)
        {
            var printDialog = new PrintDialog();
            var result      = printDialog.ShowDialog();

            if (result.HasValue && result.Value)
            {
                plotter.Print(printDialog, plot.Title ?? "Sumerics Plot");
            }
        }
コード例 #7
0
 public PlotViewModel(PlotValue plot, IVisualizer visualizer, IConsole console)
 {
     _controller = ControllerFactory.Create(plot);
     _console    = new RelayCommand(_ => ShowConsole(console));
     _settings   = new RelayCommand(_ => ShowSettings(plot));
     _series     = new RelayCommand(_ => ShowSeries(plot));
     _grid       = new RelayCommand(_ => _controller.ToggleGrid());
     _center     = new RelayCommand(_ => _controller.CenterPlot());
     _dock       = new RelayCommand(_ => visualizer.Dock(this));
     _undock     = new RelayCommand(_ => visualizer.Undock());
     _print      = new RelayCommand(obj => Print(plot, obj as IPlotSerializer));
     _save       = new RelayCommand(obj => Save(plot, obj as IPlotSerializer));
 }
コード例 #8
0
 static void ShowSettings(PlotValue plot)
 {
     if (plot is XYPlotValue)
     {
         var context = new PlotSettingsViewModel((XYPlotValue)plot);
         ShowDialog <PlotSettingsWindow>(context);
     }
     else if (plot is SubPlotValue)
     {
         var context = new SubPlotSettingsViewModel((SubPlotValue)plot);
         ShowDialog <SubPlotSettingsWindow>(context);
     }
 }
コード例 #9
0
 static void ShowSeries(PlotValue plot)
 {
     if (plot is ContourPlotValue)
     {
         var context = new ContourViewModel((ContourPlotValue)plot);
         ShowDialog <ContourSeriesWindow>(context);
     }
     else if (plot is HeatmapPlotValue)
     {
         var context = new HeatmapViewModel((HeatmapPlotValue)plot);
         ShowDialog <HeatSeriesWindow>(context);
     }
     else if (plot is XYPlotValue)
     {
         var context = new SeriesViewModel((XYPlotValue)plot);
         ShowDialog <PlotSeriesWindow>(context);
     }
 }
コード例 #10
0
        static void Save(PlotValue plot, IPlotSerializer plotter)
        {
            var context = new SaveImageViewModel();

            context.ImageWidth  = 640;
            context.ImageHeight = 480;
            var window = new SaveImageWindow {
                DataContext = context
            };

            window.Title = Messages.SavePlotAs;

            if (!String.IsNullOrEmpty(plot.Title))
            {
                context.SelectedFile = new FileModel(plot.Title);
            }

            window.ShowDialog();

            if (context.Accepted)
            {
                var path     = context.SelectedFile.FullName;
                var filename = Path.GetFileName(path);
                var message  = String.Format(Messages.PlotSavedMessage, filename);
                var output   = new OutputViewModel
                {
                    Title   = Messages.FileCreated,
                    Message = message
                };

                using (var fs = File.Create(path))
                {
                    plotter.Save(fs, context.ImageWidth, context.ImageHeight);
                }

                output.ShowWindow();
            }
        }
コード例 #11
0
        public void Function(PlotValue plot)
        {
            var visualizer = _application.Get <IVisualizer>();

            visualizer.Dock(plot);
        }
コード例 #12
0
ファイル: SumericsPlot.cs プロジェクト: csuffyy/Sumerics
 public SumericsPlot(PlotValue plot)
 {
     _plot = plot;
     _plot.OnPlotChanged += PlotValueChanged;
 }