private void ComboBoxChanged(object sender, SelectionChangedEventArgs e)
 {
     if (CanvasViewer != null)
     {
         CanvasViewer.ComboBoxChanged(sender, e);
     }
 }
        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)
        {
            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); //
        }
 private void CanvasMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
 {
     if (mapImage != null)
     {
         this.Cursor = Cursors.Arrow;
         CanvasViewer.ReleaseMouseCapture();
     }
 }
 private void CanvasMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
 {
     if (mapImage != null)
     {
         var tt = TranslateTransform;
         start       = e.GetPosition(this);
         origin      = new Point(tt.X, tt.Y);
         this.Cursor = Cursors.Hand;
         CanvasViewer.CaptureMouse();
     }
 }
Exemple #7
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 #10
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 #12
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;
            }
        }
        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();
        }
 private void SaveCommandExecuted(object sender, ExecutedRoutedEventArgs e)
 {
     CanvasViewer.SaveExecuted();
 }
 private void ToggleButtonClick(object sender, RoutedEventArgs e)
 {
     CanvasViewer.SelectZoomToggle((sender as ToggleButton).IsChecked.Value);
 }
 private void ZoomOutClick(object sender, RoutedEventArgs e)
 {
     CanvasViewer.ZoomOut();
 }
 private void OpenCommandExecuted(object sender, ExecutedRoutedEventArgs e)
 {
     CanvasViewer.OpenExecuted();
 }