private void CreateCanvasViewer(string fname)
        {
            CanvasViewer cv = new CanvasViewer(OpenFileFactory.GetTextByFileName(fname), _session);

            _session.SmartWindowManager.DisplayWindow(cv);
            RasterLayerBuilder.CreateAndLoadRasterLayerForHJ(_session, cv.Canvas, fname);
        }
 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);
         }
     }
 }
        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);
        }
Exemple #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); //
        }
Exemple #5
0
        private ICanvasViewer CreateCanvasViewer(string fname, int[] rightBands, IRasterDrawing drawing1)
        {
            CanvasViewer cv = null;

            cv = new CanvasViewer(OpenFileFactory.GetTextByFileName(fname), _smartSession);
            _smartSession.SmartWindowManager.DisplayWindow(cv);
            RasterLayerBuilder.CreateAndLoadRasterLayer(_smartSession, cv.Canvas, fname, drawing1.RgbStretcherProvider);
            return(cv);
        }
Exemple #6
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);
            }
        }
 private void CreateVectorViewer(string fname)
 {
     using (frmMicapsDataTypeSelect frm = new frmMicapsDataTypeSelect())
     {
         if (frm.DialogResult == DialogResult.OK)
         {
             string       dataTypeId = "GroundObserveData";
             CanvasViewer cv         = new CanvasViewer(OpenFileFactory.GetTextByFileName(fname), _session);
             _session.SmartWindowManager.DisplayWindow(cv);
             MicapsVectorLayerBuilder.CreateAndLoadVectorLayerForMicaps(_session, cv.Canvas, fname, dataTypeId);
         }
     }
 }
 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);//
         }
     }
 }
Exemple #9
0
 private void CreateCanvasViewer(string fname)
 {
     using (frmComponentFileSelect frm = new frmComponentFileSelect())
     {
         frm.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
         frm.Apply(fname);
         if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             string cid = "ComponentID=" + frm.ComponentID;
             if (cid == null)
             {
                 return;
             }
             CanvasViewer cv = new CanvasViewer(OpenFileFactory.GetTextByFileName(fname), _session);
             _session.SmartWindowManager.DisplayWindow(cv);
             RasterLayerBuilder.CreateAndLoadRasterLayerForGeoEye(_session, cv.Canvas, fname, cid);
         }
     }
 }
        public override bool Open(string fname, out bool memoryIsNotEnough)
        {
            memoryIsNotEnough = false;
            if (!MemoryIsEnoughChecker.MemoryIsEnouggWithMsgBoxForVector(fname))
            {
                memoryIsNotEnough = true;
                return(false);
            }
            bool isSpatial = IsCanAddToView(fname);

            //string mcd = TryGetMcd(fname);//不能在这里用mcd替换
            //if (!string.IsNullOrWhiteSpace(mcd))
            //    fname = mcd;

            if (_session.SmartWindowManager.ActiveViewer is ICanvasViewer && isSpatial)
            {
                AddVectorDataToCanvasViewer(fname, true);
            }
            else if (_session.SmartWindowManager.ActiveViewer is ILayoutViewer)
            {
                AddVectorDataToLayoutViewer(fname, true);
            }
            else
            {
                CanvasViewer cv = new CanvasViewer(OpenFileFactory.GetTextByFileName(fname), _session);
                _session.SmartWindowManager.DisplayWindow(cv);
                IVectorHostLayer host = cv.Canvas.LayerContainer.VectorHost as IVectorHostLayer;
                if (host != null)
                {
                    host.Set(cv.Canvas);
                    AddVectorDataToCanvasViewer(fname, false);
                    CodeCell.AgileMap.Core.IMap         map  = host.Map as CodeCell.AgileMap.Core.IMap;
                    CodeCell.AgileMap.Core.FeatureLayer fetL = map.LayerContainer.Layers[0] as CodeCell.AgileMap.Core.FeatureLayer;
                    CodeCell.AgileMap.Core.FeatureClass fetc = fetL.Class as CodeCell.AgileMap.Core.FeatureClass;
                    CodeCell.AgileMap.Core.Envelope     evp  = fetc.FullEnvelope.Clone() as CodeCell.AgileMap.Core.Envelope;
                    CoordEnvelope cvEvp = new CoordEnvelope(evp.MinX, evp.MaxX, evp.MinY, evp.MaxY);
                    cv.Canvas.CurrentEnvelope = cvEvp;
                    cv.Canvas.Refresh(enumRefreshType.All);
                }
            }
            RefreshLayerManager();
            return(true);
        }
Exemple #11
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;
            }
        }
Exemple #12
0
 private bool CreateVectorViewer(string fname)
 {
     using (frmMicapsDataTypeSelect frm = new frmMicapsDataTypeSelect())
     {
         frm.StartPosition = FormStartPosition.CenterScreen;
         if (frm.ShowDialog() == DialogResult.OK)
         {
             bool   isSpatial  = IsCanAddToView(fname);
             string dataTypeId = GetDataTypeIdByName(frm.SelectDataType);
             CanvasViewer.CanvasViewer            cv    = null;
             CodeCell.AgileMap.Core.IFeatureLayer layer = null;
             if (_session.SmartWindowManager.ActiveViewer is ICanvasViewer && isSpatial)
             {
                 cv = GetCanvasViewer(fname);
             }
             if (cv == null && (_session.SmartWindowManager.ActiveViewer is ILayoutViewer))
             {
                 ICanvas canvas = GetCanvas(fname);
                 layer = MicapsVectorLayerBuilder.CreateAndLoadVectorLayerForMicaps(_session, canvas, fname, dataTypeId);
             }
             else if (layer == null && cv == null)
             {
                 cv = new CanvasViewer.CanvasViewer(OpenFileFactory.GetTextByFileName(fname), _session);
             }
             if (layer == null)
             {
                 _session.SmartWindowManager.DisplayWindow(cv);
                 layer = MicapsVectorLayerBuilder.CreateAndLoadVectorLayerForMicaps(_session, cv.Canvas, fname, dataTypeId);
             }
             if (layer != null)
             {
                 return(true);
             }
             else
             {
                 return(false);
             }
         }
         return(true);
     }
 }
 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);
         }
     }
 }
Exemple #14
0
        public override bool Open(string fname, out bool memoryIsNotEnough)
        {
            memoryIsNotEnough = false;
            string        text   = OpenFileFactory.GetTextByFileName(fname);
            ILayoutViewer viewer = new LayoutViewer(text);

            (viewer as LayoutViewer).Tag = fname;
            (viewer as LayoutViewer).SetSession(_session);
            _session.SmartWindowManager.DisplayWindow(viewer);
            if (viewer != null)
            {
                string extName = Path.GetExtension(fname).ToUpper();
                switch (extName)
                {
                case ".GXT":
                    ILayoutTemplate template = LayoutTemplate.LoadTemplateFrom(fname);
                    if (template != null)
                    {
                        viewer.LayoutHost.ApplyTemplate(template);
                        viewer.LayoutHost.ToSuitedSize();
                        AnsynRefreshData(viewer);
                        _session.UIFrameworkHelper.ActiveTab("专题制图");
                    }
                    break;

                case ".GXD":
                    IGxdDocument doc = GxdDocument.LoadFrom(fname);
                    if (doc != null)
                    {
                        viewer.LayoutHost.ApplyGxdDocument(doc);
                        viewer.LayoutHost.ToSuitedSize();
                        AnsynRefreshData(viewer);
                        //_session.UIFrameworkHelper.ActiveTab("专题制图");
                    }
                    break;
                }
            }
            return(true);
        }
        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();
        }