Exemplo n.º 1
0
        public void AddDataToLayoutViewer(ILayoutViewer viewer, string fname, params object[] options)
        {
            if (viewer == null)
            {
                return;
            }
            IDataFrame df = viewer.LayoutHost.ActiveDataFrame;

            if (df == null)
            {
                return;
            }
            IDataFrameDataProvider provider = df.Provider as IDataFrameDataProvider;

            if (provider == null)
            {
                return;
            }
            ICanvas canvas = provider.Canvas;

            if (canvas == null)
            {
                return;
            }
            RasterLayerBuilder.CreateAndLoadRasterLayer(_session, canvas, fname, options);
            viewer.LayoutHost.Render();
        }
Exemplo n.º 2
0
 private void CreateCanvasViewer(string fname)
 {
     L2ProductDefind[] l2Pros = L2ProductDefindParser.GetL2ProductDefs(fname);
     if (l2Pros == null || l2Pros.Length == 0)
     {
         return;
     }
     if (l2Pros.Length == 1)
     {
         CanvasView cv = new CanvasView(OpenFileFactory.GetTextByFileName(fname), _session);
         _session.SmartWindowManager.DisplayWindow(cv);
         RasterLayerBuilder.CreateAndLoadRasterLayer(_session, cv.Canvas, fname, null);
         return;
     }
     using (frmFY3L2ProDataSelect frm = new frmFY3L2ProDataSelect(l2Pros))
     {
         frm.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
         if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             string proDesc = frm.ProDesc;
             if (string.IsNullOrEmpty(proDesc))
             {
                 return;
             }
             CanvasView cv = new CanvasView(OpenFileFactory.GetTextByFileName(fname), _session);
             _session.SmartWindowManager.DisplayWindow(cv);
             object[] args = new object[] { new string[] { proDesc } };
             RasterLayerBuilder.CreateAndLoadRasterLayer(_session, cv.Canvas, fname, args);
         }
     }
 }
Exemplo n.º 3
0
        private void CreateCanvasViewer(string fname)
        {
            CanvasViewer cv = new CanvasViewer(OpenFileFactory.GetTextByFileName(fname), _session);

            _session.SmartWindowManager.DisplayWindow(cv);
            //_session.SmartWindowManager.DisplayWindow(cv, new WindowPosition(DockStyle.Right, false));
            RasterLayerBuilder.CreateAndLoadRasterLayer(_session, cv.Canvas, fname);
        }
Exemplo n.º 4
0
        private void CreateCanvasViewer(string fname)
        {
            CanvasViewer cv = new CanvasViewer(OpenFileFactory.GetTextByFileName(fname), _session);

            _session.SmartWindowManager.DisplayWindow(cv); //如果不加载,则cv.Canvas为空,但此时上没有加载新的Layer
            RasterLayerBuilder.CreateAndLoadRasterLayer(_session, cv.Canvas, fname, new RgbStretcherProvider());
            _session.SmartWindowManager.DisplayWindow(cv); //
        }
Exemplo n.º 5
0
        private void OpenDataProvider(IGeoDataProvider provider)
        {
            if (provider is IRasterDataProvider)
            {
                string fname = (provider as IRasterDataProvider).fileName;

                CanvasViewer cv = new CanvasViewer(OpenFileFactory.GetTextByFileName(fname), _session);
                cv.Tag = fname;
                _session.SmartWindowManager.DisplayWindow(cv);
                RasterLayerBuilder.CreateAndLoadRasterLayer(_session, cv.Canvas, fname);
            }
        }
Exemplo n.º 6
0
 private void CreateCanvasViewer(string filename)
 {
     using (Hdf5DatasetSelection frm = new Hdf5DatasetSelection())
     {
         frm.LoadFile(filename);
         if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             filename = frm.FileName;
             string[]     hdfOptions = frm.GetOpenOptions();
             CanvasViewer cv         = new CanvasViewer(OpenFileFactory.GetTextByFileName(filename), _session);
             _session.SmartWindowManager.DisplayWindow(cv);
             RasterLayerBuilder.CreateAndLoadRasterLayer(_session, cv.Canvas, filename, hdfOptions, new RgbStretcherProvider());
             _session.SmartWindowManager.DisplayWindow(cv);//
         }
     }
 }
Exemplo n.º 7
0
        private void AddData2CanvasViewer(ICanvasViewer cv, string fname)
        {
            ISmartSession        session   = _smartSession;
            ICanvas              canvas    = cv.Canvas;
            RgbStretcherProvider stretcher = null;
            bool isRaster = false;

            TryGetRasterStretcher(fname, out stretcher, out isRaster);
            if (isRaster)
            {
                RasterLayerBuilder.CreateAndLoadRasterLayer(session, canvas, fname, stretcher);
            }
            else
            {
                TryAddAsVector(fname);
            }
        }
Exemplo n.º 8
0
        private void CreateCanvasViewer(string fname)
        {
            CanvasViewer cv = null;

            try
            {
                cv = new CanvasViewer(OpenFileFactory.GetTextByFileName(fname), _session);
                _session.SmartWindowManager.AddDocument(cv);
                RasterLayerBuilder.CreateAndLoadRasterLayer(_session, cv.Canvas, fname, GetRgbStretcherProvider(fname));
                _session.SmartWindowManager.ActivateWindow(cv);
            }
            catch
            {
                if (cv != null)
                {
                    cv.Close();
                }
                throw;
            }
        }
Exemplo n.º 9
0
 private void CreateCanvasViewer(string fname)
 {
     using (frmFYSnowPrdDataSelecte frm = new frmFYSnowPrdDataSelecte())
     {
         string[] slec = new string[] { "EASE-Grid North", "EASE-Grid South" };
         frm.Apply(slec);
         frm.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
         if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             string[] cid = new string[] { frm.ComponentID };
             if (cid == null || cid[0] == null)
             {
                 return;
             }
             CanvasView cv = new CanvasView(OpenFileFactory.GetTextByFileName(fname), _session);
             _session.SmartWindowManager.DisplayWindow(cv);
             object[] args = new object[] { cid };
             RasterLayerBuilder.CreateAndLoadRasterLayer(_session, cv.Canvas, fname, args);
         }
     }
 }
Exemplo n.º 10
0
        private void CreateCanvasViewer(string fname)
        {
            CanvasViewer cv = new CanvasViewer(OpenFileFactory.GetTextByFileName(fname), _session);

            cv.Tag = fname;
            _session.SmartWindowManager.DisplayWindow(cv);
            RasterLayerBuilder.CreateAndLoadRasterLayer(_session, cv.Canvas, fname);
            //自动翻转升轨数据
            RasterDrawing drawing = cv.ActiveObject as RasterDrawing;

            if (drawing != null && drawing.DataProvider != null)
            {
                DataIdentify idt = drawing.DataProvider.DataIdentify;
                if (idt != null && idt.IsOrbit && idt.IsAscOrbitDirection)
                {
                    cv.Canvas.IsReverseDirection = true;
                    cv.Canvas.Refresh(Core.DrawEngine.enumRefreshType.RasterLayer);
                }
            }
            //轨道数据自动全屏显示
            (cv.Canvas as Canvas).SetToFitWidth();
        }