Пример #1
0
        public override void WriteGroupCodes()
        {
            WriteGroupCodeValue(2, ViewportName.Trim());

            WriteGroupCodeValue(10, LowerLeftX.ToString().Trim());
            WriteGroupCodeValue(20, LowerLeftY.ToString().Trim());

            WriteGroupCodeValue(11, UpperRightX.ToString().Trim());
            WriteGroupCodeValue(21, UpperRightY.ToString().Trim());

            WriteGroupCodeValue(12, CenterX.ToString().Trim());
            WriteGroupCodeValue(22, CenterY.ToString().Trim());

            WriteGroupCodeValue(13, SnapBaseX.ToString().Trim());
            WriteGroupCodeValue(23, SnapBaseY.ToString().Trim());

            WriteGroupCodeValue(14, SnapSpacingX.ToString().Trim());
            WriteGroupCodeValue(24, SnapSpacingY.ToString().Trim());

            WriteGroupCodeValue(15, GridSpacingX.ToString().Trim());
            WriteGroupCodeValue(25, GridSpacingY.ToString().Trim());

            WriteGroupCodeValue(16, ViewDirectionX.ToString().Trim());
            WriteGroupCodeValue(26, ViewDirectionY.ToString().Trim());
            WriteGroupCodeValue(36, ViewDirectionZ.ToString().Trim());

            WriteGroupCodeValue(17, ViewTargetX.ToString().Trim());
            WriteGroupCodeValue(27, ViewTargetY.ToString().Trim());
            WriteGroupCodeValue(37, ViewTargetZ.ToString().Trim());

            WriteGroupCodeValue(40, ViewHeight.ToString().Trim());

            WriteGroupCodeValue(41, ViewportAspectRatio.ToString().Trim());

            WriteGroupCodeValue(42, LensLength.ToString().Trim());

            WriteGroupCodeValue(43, FrontClippingPlaneOffset.ToString().Trim());
            WriteGroupCodeValue(44, BackClippingPlaneOffset.ToString().Trim());

            WriteGroupCodeValue(50, SnapRotationAngle.ToString().Trim());

            WriteGroupCodeValue(51, TwistAngle.ToString().Trim());

            WriteGroupCodeValue(70, GetStandardFlags().ToString().Trim());
        }
Пример #2
0
        void WorldWindow_MouseUp(object sender, MouseEventArgs e)
        {
            if (e.Button != MouseButtons.Right)
            {
                return;
            }

            if (m_Form == null)
            {
                return;
            }

            if (!m_Form.Visible)
            {
                return;
            }

            if (m_Form.KeyLayer == null)
            {
                return;
            }

            QuadTileSet qts = m_Form.KeyLayer;

            WorldWind.Net.Wms.WmsImageStore wms = (WorldWind.Net.Wms.WmsImageStore)qts.ImageStores[0];

            string requestUrl = wms.ServerGetMapUrl;

            string[] layerNameParts = wms.WMSLayerName.Split('&');
            string   layerName      = layerNameParts[0];
            string   getMapParts    =
                requestUrl += "?QUERY_LAYERS=" + layerName + "&SERVICE=WMS&VERSION=" + wms.Version + "&REQUEST=GetFeatureInfo&SRS=EPSG:4326&FEATURE_COUNT=10&INFO_FORMAT=text/plain&EXCEPTIONS=text/plain";

            // From Servir-Viz...
            Angle  LowerLeftX;
            Angle  LowerLeftY;
            Angle  UpperRightX;
            Angle  UpperRightY;
            string minx, miny, maxx, maxy;

            char[] degreeChar = { '°' };

            int mouseX = e.X;
            int mouseY = e.Y;

            int queryBoxWidth  = 2 * queryBoxOffset + 1;
            int queryBoxHeight = 2 * queryBoxOffset + 1;

            int queryX = queryBoxOffset + 1;
            int queryY = queryBoxOffset + 1;

            drawArgs.WorldCamera.PickingRayIntersectionWithTerrain(mouseX - queryBoxOffset, mouseY + queryBoxOffset, out LowerLeftY, out LowerLeftX, drawArgs.CurrentWorld);
            drawArgs.WorldCamera.PickingRayIntersectionWithTerrain(mouseX + queryBoxOffset, mouseY - queryBoxOffset, out UpperRightY, out UpperRightX, drawArgs.CurrentWorld);

            //drawArgs.WorldCamera.PickingRayIntersectionWithTerrain(0, 0 + drawArgs.screenHeight, out LowerLeftY, out LowerLeftX, drawArgs.CurrentWorld);
            //drawArgs.WorldCamera.PickingRayIntersectionWithTerrain(drawArgs.screenWidth, 0, out UpperRightY, out UpperRightX, drawArgs.CurrentWorld);

            minx = LowerLeftX.ToString().Contains("NaN") ? "-180.0" : LowerLeftX.ToString().TrimEnd(degreeChar);
            miny = LowerLeftY.ToString().Contains("NaN") ? "-90.0" : LowerLeftY.ToString().TrimEnd(degreeChar);
            maxx = UpperRightX.ToString().Contains("NaN") ? "180.0" : UpperRightX.ToString().TrimEnd(degreeChar);
            maxy = UpperRightY.ToString().Contains("NaN") ? "90.0" : UpperRightY.ToString().TrimEnd(degreeChar);

            // request has to include a bbox and the requested pixel coords relative to that box...
            requestUrl += "&layers=" + wms.WMSLayerName;
            requestUrl += "&WIDTH=" + queryBoxWidth.ToString() + "&HEIGHT=" + queryBoxHeight.ToString();
            requestUrl += "&BBOX=" + minx + "," + miny + "," + maxx + "," + maxy;
            requestUrl += "&X=" + queryX.ToString() + "&Y=" + queryY.ToString();

            if (!World.Settings.WorkOffline)
            {
                WorldWind.Net.WebDownload dl = new WorldWind.Net.WebDownload(requestUrl);
                System.IO.FileInfo        fi = new System.IO.FileInfo("GetFeatureInfo_response.txt");
                dl.DownloadFile(fi.FullName);
                //dl.SavedFilePath = fi.FullName;
                //dl.BackgroundDownloadFile(GetFeatureDlComplete);


                if (World.Settings.UseInternalBrowser)
                {
                    SplitContainer          sc      = (SplitContainer)drawArgs.parentControl.Parent.Parent;
                    InternalWebBrowserPanel browser = (InternalWebBrowserPanel)sc.Panel1.Controls[0];
                    browser.NavigateTo(fi.FullName);
                }
                else
                {
                    System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo();
                    psi.FileName        = fi.FullName;
                    psi.Verb            = "open";
                    psi.UseShellExecute = true;

                    psi.CreateNoWindow = true;
                    System.Diagnostics.Process.Start(psi);
                }
            }
        }