管道基础大数据平台系统开发-【CS】-ExportMap
13693261870
2024-01-03 315766f6501751233fddda8a0e876efc74cdcebe
添加坡度分析功能
已添加11个文件
已修改3个文件
792 ■■■■■ 文件已修改
TEWin/FrmTool.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
TEWin/FrmWin.cs 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
TEWin/Resources/SlopeCursor/Images/SlopeCursorIcon.gif 补丁 | 查看 | 原始文档 | blame | 历史
TEWin/Resources/SlopeCursor/Images/StartCursor.gif 补丁 | 查看 | 原始文档 | blame | 历史
TEWin/Resources/SlopeCursor/Lang.js 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
TEWin/Resources/SlopeCursor/Query.png 补丁 | 查看 | 原始文档 | blame | 历史
TEWin/Resources/SlopeCursor/SlopeCursor.html 604 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
TEWin/Resources/SlopeCursor/SlopeCursor.ico 补丁 | 查看 | 原始文档 | blame | 历史
TEWin/Resources/SlopeCursor/ToolIcon.png 补丁 | 查看 | 原始文档 | blame | 历史
TEWin/Resources/SlopeCursor/arrow.png 补丁 | 查看 | 原始文档 | blame | 历史
TEWin/Resources/SlopeCursor/cursor_m.cur 补丁 | 查看 | 原始文档 | blame | 历史
TEWin/Resources/SlopeCursor/cursor_wait.cur 补丁 | 查看 | 原始文档 | blame | 历史
TEWin/Resources/SlopeCursor/help.html 105 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
TEWin/TEWin.csproj 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
TEWin/FrmTool.cs
@@ -26,7 +26,6 @@
            int code = Convert.ToInt32(str, 16);
            win.InvokeProc(code);
        }
    }
TEWin/FrmWin.cs
@@ -88,6 +88,19 @@
        {
            switch (m.Msg)
            {
                case 0x64:
                    InvokeByCode(m.WParam.ToInt32()); break;
                case 0x4A:
                    MessageBox.Show("Test."); break;
                default:
                    base.DefWndProc(ref m); break;
            }
        }
        public void InvokeByCode(int code)
        {
            switch (code)
            {
                case 0xc0: // é‡ç½®é¼ æ ‡æ¨¡å¼
                    SG.Window.SetInputMode(0); break;
                case 0xc1: // æ‰“开数据方案/打开显示场景
@@ -149,15 +162,14 @@
                    SG.Command.Execute(1028, null); break;
                case 0xd6: // ä¼ ç»Ÿ4D产品派生(集成osgblab)
                    InvokeOsgbLab(); break;
                default:
                    base.DefWndProc(ref m); break;
            }
        }
        public void InvokeProc(int code)
        {
            Message m = new Message();
            m.Msg = code;
            m.Msg = 0x4A;
            m.WParam = new IntPtr(code);
            this.DefWndProc(ref m);
        }
TEWin/Resources/SlopeCursor/Images/SlopeCursorIcon.gif
TEWin/Resources/SlopeCursor/Images/StartCursor.gif
TEWin/Resources/SlopeCursor/Lang.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,31 @@
SGLang.lang = $.extend(SGLang.lang,{
    ToolTitle: "SmartEarth, Inc.",
    ToolName: "坡向箭头 ",
    ToolName1: "坡向箭头",
    help: "帮助",
    Text3: "创建",
    Text4: "取消",
    Text5: "坡向箭头信息",
    Text6: "坐标:",
    Text7: "最大正斜率",
    Text8: "最大正斜率朝向",
    Text9: "最大负斜率",
    Text10: "最大负斜率朝向",
    Text11: "量测距离",
    Text12: "警戒坡度",
    Text13: "危险坡度",
    Text14: "显示箭头朝向",
    Text15: "坡度查询工具中出现意外错误",
    Text16: "m",
    Text17: "deg",
    Text18: "显示最大坡度值",
    Text19: "从不",
    Text20: "点击时",
    Text21: "总是",
    Text22: "显示坡向",
    Text23: "显示坐标信息",
    Text24: "",
    Text25: "",
    Text99: "完成"
});
TEWin/Resources/SlopeCursor/Query.png
TEWin/Resources/SlopeCursor/SlopeCursor.html
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,604 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>ToolTitle</title>
    <meta http-equiv="X-UA-Compatible" content="IE=9" />
    <!-- <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> -->
    <link rel="StyleSheet" href="../Style.css" type="text/css">
    <style>
    </style>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" style="border: 0px" id="Body"  class="hideUntillTranslated" onload="Init()">
    <!--oncontextmenu="return false;">  onclick="bHide=true;HideOptionsNow()" > -->
    <table border="0" width="100%" cellspacing="0" cellpadding="2">
        <tr>
            <td class="ToolTopArea" id="TopAreaTD" width="100%" valign="middle" >
                <table border="0" width="100%" cellspacing="0" cellpadding="0">
                    <tr>
                        <td width="55px"><img style="margin-left:5px;" src="ToolIcon.png" alt="" /></td>
                        <td id="TitleTD" align="center" class="s12w i18n">ToolName</td>
                        <td align="right" id="CloseHelpTd"><img style="margin-right:5px;" alt="" src="../CommonImg/help.png" border="0" class="i18n" alt="help" title="help" onclick="DisplayHelpPopup6(SGLang.i18nFile('help.html'),SGLang.i18n('help'))" style="cursor: pointer;"></td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td  class="ToolTopSeperator"></td>
        </tr>        <tr class="s8">
            <td >
                <table class="PropertiesSheet" cellspacing="0" cellpadding="2" >
                  <tr class='TableOtherLine'>
                        <td align="top" class="s8b i18n">
                            <label for="createAs" class="i18n">Text18</label>
                        </td>
                        <td align="left">
                            <select id="DisplayMinMaxSlope"  style="width:100px;" >
                                <option class="i18n" value=0>Text19</option>
                                <option class="i18n" value=1 >Text20</option>
                                <option class="i18n" value=2 selected>Text21</option>
                            </select>
                        </td>
                    </tr>
                  <tr >
                        <td align="top" class="s8b i18n">
                            <label for="createAs" class="i18n">Text22</label>
                        </td>
                        <td align="left">
                            <select id="DisplayHeadingSlope"  style="width:100px;" >
                                <option class="i18n" value=0 selected>Text19</option>
                                <option class="i18n" value=1 >Text20</option>
                                <option class="i18n" value=2 >Text21</option>
                            </select>
                        </td>
                    </tr>
                  <tr class='TableOtherLine'>
                        <td align="top" class="s8b i18n">
                            <label for="createAs" class="i18n">Text23</label>
                        </td>
                        <td align="left">
                            <select id="DisplayCoordinateInfo"  style="width:100px;" >
                                <option class="i18n" value=0 >Text19</option>
                                <option class="i18n" value=1 selected>Text20</option>
                                <option class="i18n" value=2 >Text21</option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td class="s8b">
                            <label for="createAs" class="i18n">Text11</label>
                        </td>
                        <td align="left">
                        <input id="distanceID"  type="text"  value="10" style="width:100px" /> <label for="createAs" class="i18n">Text16</label>
                        </td>
                    </tr>
                   <tr class='TableOtherLine'>
                        <td align="top" class="s8b i18n">
                            <label for="createAs" class="i18n">Text12</label>
                        </td>
                        <td align="left">
                        <input id="warningSlopeID"  type="text"  value="10"  style="width:100px; background-color:#FFD7C1"/> <label for="createAs" class="i18n">Text17</label>
                        </td>
                    </tr>
                    <tr>
                        <td class="s8b">
                            <label for="createAs" class="i18n">Text13</label>
                        </td>
                        <td align="left">
                        <input id="alertSlopeID"  type="text" value="15"  style="width:100px; background-color:#FFD7D7;"/> <label for="createAs" class="i18n">Text17</label>
                        </td>
                    </tr>
                    <tr>
                    <td colspan="2" align="center" class="ToolButtonsArea">
                    <button id="groupButton" class="MenuButton MenuButtonLast" onclick="StartStop()"><img src="./query.png" /><br />         <span id="startstopSpan" class="i18n">Text3</span></button>
                        </td>
                        </tr>
    </table>
 <object id="SGWorld" classid="CLSID:3a4f9197-65a8-11d5-85c1-0001023952c1">    </object>
<script language="javascript" src="../ToolsCommon65.js"></script>
<script language="JavaScript">
function DetectTEMode()
{
var vMode = document.documentMode;
var rMode = 'IE5 Quirks Mode';
if(vMode == 8){
  rMode = 'IE8 Standards Mode';
} else if(vMode == 7){
  rMode = 'IE7 Strict Mode';
} else if(vMode == 9){
  rMode = 'IE9 Strict Mode';
}
//alert('Rendering in: ' + rMode);
}
DetectTEMode();
var isStart = false;
var gDisplayHeadingSlope ;
var gDisplayMinMaxSlope ;
var gDisplayCoordinateInfo;
var gLastClickMouseX;
var gLastClickMouseY;
///var popupMsg;
var timeoutID;
var measureDistance;
var warningSlope;
var alertSlope;
var arrowMaxPositive;
var arrowMaxNegative;
var arrowHeading;
var labelMaxPositive;
var labelMaxNegative;
var labelHeading;
var labelCoordinateInfo;
var groupID;
var colorNormalPositive ;
var colorNormalNegative;
var colorHeading;
var colorLinewarning ;
var colorLineAlert;
var colorLabel;
var colorTextNormal;
var colorTextWarning;
var colorTextAlert;
var gNameIndex = 1;
var cameraClickPos;
var rootId;
//--------------
// Init
function Init() {
    SGWorld.AttachEvent("onFrame", onFrame);
    SGWorld.AttachEvent("onLButtonDown", onLButtonDown);
    SGWorld.AttachEvent("onLButtonUp", onLButtonUp);
    SGWorld.AttachEvent("onRButtonUp", onRButtonUp);
    SGWorld.AttachEvent("OnInputModeChanged", OnInputModeChanged);
    rootId = GetParamValue("rootId", SGWorld.ProjectTree.RootID);
    groupID = -1;
    colorNormalPositive = SGWorld.Creator.CreateColor(255, 255, 255, 255);
    colorNormalNegative = SGWorld.Creator.CreateColor(197, 197, 197, 255);
    colorHeading = SGWorld.Creator.CreateColor(198, 255, 198, 255);
    colorLinewarning = SGWorld.Creator.CreateColor(238, 173, 23, 255);
    colorLineAlert = SGWorld.Creator.CreateColor(255, 117, 117, 255);
    colorLabel = SGWorld.Creator.CreateColor(255, 255, 255, 255);
    colorTextNormal = SGWorld.Creator.CreateColor(230, 230, 230,  0);
    colorTextWarning = SGWorld.Creator.CreateColor(238, 173, 23 , 0 );
    colorTextAlert = SGWorld.Creator.CreateColor(255,117,117, 0);
    Reset(true, false);
}
//------------------
// Reset
//------------------
function Reset(FirstTime, FromMouseInputMode) {
    try {
        startstopSpan.innerHTML = SGLang.i18n("Text3");
        if (isStart && SGWorld.Project.Name != "") {
            ///ClosePopup();
          //  alert(SGWorld.Project.Name);
            isStart = false;
            deleteObjs();
        }
        arrowMaxPositive = null;
        arrowMaxNegative = null;
        labelMaxPositive = null;
        labelMaxNegative = null;
        arrowHeading = null;
        labelHeading = null;
        labelCoordinateInfo = null;
        gLastClickMouseX = -1;
        gLastClickMouseY = -1;
        isStart = false;
        document.getElementById("distanceID").disabled = false;
        document.getElementById("alertSlopeID").disabled = false;
        document.getElementById("warningSlopeID").disabled = false;
        document.getElementById("DisplayHeadingSlope").disabled = false;
        document.getElementById("DisplayMinMaxSlope").disabled = false;
        document.getElementById("DisplayCoordinateInfo").disabled = false;
        if (FirstTime != 1 && FromMouseInputMode == 0) {
            //        alert("input");
            SGWorld.Window.SetInputMode(0);
        }
    }
    catch (err) { isStart = false; }
}
//--------------
// StartStop
function StartStop() {
    if (!isStart) {
        isStart = true;
        document.getElementById("distanceID").disabled = true;
        document.getElementById("alertSlopeID").disabled = true;
        document.getElementById("warningSlopeID").disabled = true;
        document.getElementById("DisplayHeadingSlope").disabled = true;
        document.getElementById("DisplayMinMaxSlope").disabled = true;
        document.getElementById("DisplayCoordinateInfo").disabled = true;
        startstopSpan.innerHTML = SGLang.i18n("Text4");
        measureDistance = document.getElementById("distanceID").value;
        alertSlope = document.getElementById("alertSlopeID").value;
        warningSlope = document.getElementById("warningSlopeID").value;
        gDisplayHeadingSlope = document.getElementById("DisplayHeadingSlope").value ;
        gDisplayMinMaxSlope = document.getElementById("DisplayMinMaxSlope").value ;
        gDisplayCoordinateInfo = document.getElementById("DisplayCoordinateInfo").value ;
        createObjs(false);
        SGWorld.Window.SetInputMode(1, abspath() + "/cursor_m.cur", true);
    }
    else {
        //        clearInterval (timeoutID);
        Reset(false,false);
    }
}
//------------
//onFrame
function onFrame() {
    if (isStart == false)
        return;
    displaySlopeInfo(false);
    }
//------------
//onLButtonDown
function onLButtonDown(Flag, X, Y) {
    if (isStart == false)
        return;
    SGWorld.Window.SetInputMode(1, abspath()+"/cursor_wait.cur", true);
    // Save camera location to identify dragging
    cameraClickPos = SGWorld.Navigate.GetPosition();
}
 //------------
//onLButtonUp
function onLButtonUp(Flag, X, Y) {
    if (isStart == false)
        return;
    // Creating objects only if not dragging the terrain
    if (cameraClickPos.IsEqual (SGWorld.Navigate.GetPosition()))
        createObjs(true);
    SGWorld.Window.SetInputMode(1, abspath() + "/cursor_m.cur", true);
}
//------------
//onRButtonUp
function onRButtonUp(Flag, X, Y) {
    if (isStart == false)
        return;
        Reset (0,0);
    return true;
}
//------------
//OnInputModeChanged
function OnInputModeChanged (newMode) {
    Reset(0, 1);
}
//------------
//createObjs
function createObjs(fromClick) {
    var subGroupID;
   // try {
        var tmpGroup = SGWorld.ProjectTree.CreateGroup(SGLang.i18n("ToolName"), SGWorld.ProjectTree.HiddenGroupID);
        if (fromClick) {
            displaySlopeInfo(true);  // Add tooltips to the objects
            if (groupID == -1)
                groupID = SGWorld.ProjectTree.CreateGroup(SGLang.i18n("ToolName"), rootId);
            try {
                subGroupID = SGWorld.ProjectTree.CreateGroup(SGLang.i18n("ToolName") + gNameIndex, groupID);
            }
            catch (err) {
                groupID = SGWorld.ProjectTree.CreateGroup(SGLang.i18n("ToolName"), rootId);
                subGroupID = SGWorld.ProjectTree.CreateGroup(SGLang.i18n("ToolName")+gNameIndex, groupID);
            }
            if (gDisplayMinMaxSlope > 0) {
                SGWorld.ProjectTree.SetParent(arrowMaxPositive.ID, subGroupID);
                SGWorld.ProjectTree.SetParent(arrowMaxNegative.ID, subGroupID);
                SGWorld.ProjectTree.SetParent(labelMaxPositive.ID, subGroupID);
                SGWorld.ProjectTree.SetParent(labelMaxNegative.ID, subGroupID);
            }
            if (gDisplayHeadingSlope > 0) {
                SGWorld.ProjectTree.SetParent(arrowHeading.ID, subGroupID);
                SGWorld.ProjectTree.SetParent(labelHeading.ID, subGroupID);
            }
            if (gDisplayCoordinateInfo > 0) {
                SGWorld.ProjectTree.SetParent(labelCoordinateInfo.ID, subGroupID);
            }
            gNameIndex += 1;
        }
        var pos = SGWorld.Creator.CreatePosition(1.0, 1.0, 2.0, 3, 0, 0, 0);
        var labelStyle = SGWorld.Creator.CreateLabelStyle(0);
        labelStyle.Bold = true;
        labelStyle.LineToGround = false;
        labelStyle.Scale = measureDistance / 20;
        labelStyle.FontSize = 10;
        labelStyle.BackgroundColor = SGWorld.Creator.CreateColor(15, 15, 15, 0);
        var arrowStyle = SGWorld.Creator.CreateLabelStyle(0);
        arrowStyle.LimitScreenSize = false;
        arrowStyle.Scale =  measureDistance / 100;
        arrowStyle.LockMode = 1;
        // Min/Max slopes arrows and labels
        if (gDisplayMinMaxSlope > 0) {
            arrowMaxPositive = SGWorld.Creator.CreateImageLabel(pos, abspath() + "./arrow.png", arrowStyle, tmpGroup, "max positive");
            // Max negative Arrow
            arrowMaxNegative = SGWorld.Creator.CreateImageLabel(pos, abspath() + "./arrow.png", arrowStyle, tmpGroup, "max negative");
            // Labels
            labelMaxPositive = SGWorld.Creator.CreateLabel(pos, "positive", "", labelStyle, tmpGroup, "max positive label");
            labelMaxNegative = SGWorld.Creator.CreateLabel(pos, "negative", "", labelStyle, tmpGroup, "max negative label");
        }
        // Heading arrow and label
        if (gDisplayHeadingSlope > 0) {
            arrowStyle.Scale = measureDistance / 50;
            arrowHeading = SGWorld.Creator.CreateImageLabel(pos, abspath() + "./arrow.png", arrowStyle, tmpGroup, "Heading");
            labelHeading = SGWorld.Creator.CreateLabel(pos, "Heading", "", labelStyle, tmpGroup, "Heading label");
        }
        if (gDisplayCoordinateInfo > 0) {
            labelStyle.LineToGround = true;
            labelStyle.MultilineJustification = "Left";
            labelCoordinateInfo = SGWorld.Creator.CreateLabel(pos, "Info", "", labelStyle, tmpGroup, "Coordinate Info label");
        }
//    }
//    catch (err) { alert(SGLang.i18n("Text15") + err); Reset(0, 0); }
}
//------------
//deleteObjs
function deleteObjs() {
    try {
        if (arrowMaxPositive != null)
            SGWorld.Creator.DeleteObject(arrowMaxPositive.ID);
        if (arrowMaxNegative != null)
            SGWorld.Creator.DeleteObject(arrowMaxNegative.ID);
        if (labelMaxPositive != null)
            SGWorld.Creator.DeleteObject(labelMaxPositive.ID);
        if (labelMaxNegative != null)
            SGWorld.Creator.DeleteObject(labelMaxNegative.ID);
        if (arrowHeading != null)
            SGWorld.Creator.DeleteObject(arrowHeading.ID);
        if (labelHeading != null)
            SGWorld.Creator.DeleteObject(labelHeading.ID);
        if (labelCoordinateInfo != null)
            SGWorld.Creator.DeleteObject(labelCoordinateInfo.ID);
    }
    catch (err) { alert(SGLang.i18n("Text15") + err); Reset(0, 0); }
}
//------------
//displaySlopeInfo
function displaySlopeInfo(fromClick) {
    if (!isStart) {
        return false;
    }
    try {
        var slopeSampling = 10;
        var getGroundHeighType = 0;
        if (fromClick) {
            slopeSampling = 1;
            getGroundHeighType = 2;
        }
        var mouseInfo = SGWorld.Window.GetMouseInfo();
        var CursorInfo = SGWorld.Window.PixelToWorld(mouseInfo.X, mouseInfo.Y, 0 + 1 + 8192);
        // After clicking the left mouse and recalculate the slopes with better accuracy do not recalculate until the mouse is moved
        if (fromClick == false && gLastClickMouseX != -1 && gLastClickMouseX == mouseInfo.X && gLastClickMouseY == mouseInfo.Y)
            return false;
        if (fromClick) {
            gLastClickMouseX = mouseInfo.X;
            gLastClickMouseY = mouseInfo.Y;
        }
        /*Arik
         if (CursorInfo.Type != 0)
            return false;    */
        //Groud height in mouse location
        var groundInfo = SGWorld.Terrain.GetGroundHeightInfo(CursorInfo.Position.X, CursorInfo.Position.Y, getGroundHeighType, true);
        //Ground Height around mouse location
        var i;
        var maxPositiveAlt = -9999999;
        var maxPositivePos;
        var maxNegativeAlt = 9999999;
        var maxNegativePos;
        var destGroundInfo;
        var headingPos;
        var newPos = CursorInfo.Position.Copy();
        // find min/max slopes
        if (gDisplayMinMaxSlope == 2 || (gDisplayMinMaxSlope == 1 && fromClick)) {
            for (i = 0; i < 360; i = i + slopeSampling) {
                newPos = CursorInfo.Position.Copy();
                newPos.Yaw = i;
                SGWorld.CoordServices.MoveCoordEx(newPos, measureDistance, 0, 0);
                destGroundInfo = SGWorld.Terrain.GetGroundHeightInfo(newPos.X, newPos.Y, getGroundHeighType, true);
                if (destGroundInfo.Position.Altitude > maxPositiveAlt) {
                    maxPositiveAlt = destGroundInfo.Position.Altitude;
                    maxPositivePos = destGroundInfo.Position.Copy();
                }
                if (destGroundInfo.Position.Altitude < maxNegativeAlt) {
                    maxNegativeAlt = destGroundInfo.Position.Altitude;
                    maxNegativePos = destGroundInfo.Position.Copy();
                }
                //   measureDistance
            }
            if (maxPositiveAlt == maxNegativeAlt) {  // flat area - make sure not to position both arrows on the same position
                newPos = CursorInfo.Position.Copy();
                newPos.Yaw = 180;
                SGWorld.CoordServices.MoveCoordEx(newPos, measureDistance, 0, 0);
                destGroundInfo = SGWorld.Terrain.GetGroundHeightInfo(newPos.X, newPos.Y, getGroundHeighType, true);
                maxPositiveAlt = destGroundInfo.Position.Altitude;
                maxPositivePos = destGroundInfo.Position.Copy();
            }
        }
        // heading arrow
        if (gDisplayHeadingSlope == 2 || (gDisplayHeadingSlope == 1 && fromClick)) {
            newPos = CursorInfo.Position.Copy();
            newPos.Yaw = SGWorld.Navigate.GetPosition().Yaw;
            SGWorld.CoordServices.MoveCoordEx(newPos, measureDistance * 2, 0, 0);
            destGroundInfo = SGWorld.Terrain.GetGroundHeightInfo(newPos.X, newPos.Y, 2, true);
            headingPos = destGroundInfo.Position.Copy();
        }
        // Set the object properties according to the new values
        setObjsPosition(CursorInfo.Position, maxPositivePos, maxNegativePos, headingPos, fromClick);
        // Send information to the Information Dialog
        ///  SGWorld.Window.ShowMessageBarText("##SlopeCursor## X:" + CursorInfo.Position.X.toFixed(6) + "<br/>Y: " + CursorInfo.Position.Y.toFixed(6) + "<br/> Ground elevation: " + groundInfo.Position.Altitude.toFixed(2) + " m AMSL" + "<br/>Max elevation in range: = " + maxPositiveAlt.toFixed(2) + "<br/>Min elevation in range = " + maxNegativeAlt.toFixed(2), 0, 1);
    }
    catch (err) {        alert(SGLang.i18n("Text15") + err);   Reset(0, 0); }
}
//-----------------
// setObjsPosition
function setObjsPosition(CursorPosition, maxPositivePos, maxNegativePos, headingPos, fromClick) {
 try {
    // Set Min/Max slope arrows and labels
     if (gDisplayMinMaxSlope == 2 || (gDisplayMinMaxSlope == 1 && fromClick)) {
         // Max positive angle
         CursorPosition = CursorPosition.AimTo(maxPositivePos);
         //arrowMaxPositive.Position = CursorPosition.Copy().MoveToward(maxPositivePos, measureDistance );
         arrowMaxPositive.Position = CursorPosition.Copy().AimTo(maxPositivePos);
         labelMaxPositive.Position = maxPositivePos.Copy();
         labelMaxPositive.Position.Altitude = labelMaxPositive.Position.Altitude + measureDistance / 2;
         if (CursorPosition.Pitch > alertSlope) {
             labelMaxPositive.Style.TextColor = colorTextAlert;
             arrowMaxPositive.Style.IconColor = colorLineAlert;
         }
         else if (CursorPosition.Pitch > warningSlope) {
             labelMaxPositive.Style.TextColor = colorTextWarning;
             arrowMaxPositive.Style.IconColor = colorLinewarning;
         }
         else {
             labelMaxPositive.Style.TextColor = colorTextNormal;
             arrowMaxPositive.Style.IconColor = colorNormalPositive;
         }
         var positiveAltDiff = maxPositivePos.Altitude - CursorPosition.Altitude;
         if (fromClick)
             labelMaxPositive.Tooltip.Text = "Max positive slope altitude = " + maxPositivePos.Altitude.toFixed(2) + " m AMSL (+" + positiveAltDiff.toFixed(2) + "m)";
         labelMaxPositive.Text = "+" + CursorPosition.Pitch.toFixed(2) + String.fromCharCode(186);//  degree sign;
         // Max negative angle
         CursorPosition = CursorPosition.AimTo(maxNegativePos);
         //arrowMaxNegative.Position = CursorPosition.Copy().MoveToward(maxNegativePos, measureDistance );
         arrowMaxNegative.Position = CursorPosition.Copy().AimTo(maxNegativePos);
         labelMaxNegative.Position = maxNegativePos.Copy();
         labelMaxNegative.Position.Altitude = labelMaxNegative.Position.Altitude + measureDistance / 2;
         if (CursorPosition.Pitch < -alertSlope) {
             labelMaxNegative.Style.TextColor = colorTextAlert;
             arrowMaxNegative.Style.IconColor = colorLineAlert;
         }
         else if (CursorPosition.Pitch < -warningSlope) {
             labelMaxNegative.Style.TextColor = colorTextWarning;
             arrowMaxNegative.Style.IconColor = colorLinewarning;
         } else {
             labelMaxNegative.Style.TextColor = colorTextNormal;
             arrowMaxNegative.Style.IconColor = colorNormalNegative;
         }
         var negativeAltDiff = maxNegativePos.Altitude - CursorPosition.Altitude;
         if (fromClick)
             labelMaxNegative.Tooltip.Text = "Max negative slope altitude: " + maxNegativePos.Altitude.toFixed(2) + " m AMSL (" + negativeAltDiff.toFixed(2) + "m)";
         labelMaxNegative.Text = CursorPosition.Pitch.toFixed(2) + String.fromCharCode(186); // degree sign;
     }
    // heading
    if (gDisplayHeadingSlope == 2 || (gDisplayHeadingSlope == 1 && fromClick)) {
        CursorPosition = CursorPosition.AimTo(headingPos);
        //arrowHeading.Position = CursorPosition.Copy().MoveToward(headingPos, measureDistance*2 );
        arrowHeading.Position = CursorPosition.Copy().AimTo(headingPos);
        labelHeading.Position = headingPos.Copy();
        labelHeading.Position.Altitude = labelHeading.Position.Altitude + measureDistance / 2;
        arrowHeading.Style.IconColor = colorNormalPositive;
        if (Math.abs(CursorPosition.Pitch) > alertSlope) {
            labelHeading.Style.TextColor = colorTextAlert;
        }
        else if (Math.abs(CursorPosition.Pitch) > warningSlope) {
            labelHeading.Style.TextColor= colorTextWarning;
        } else {
            labelHeading.Style.TextColor = colorTextNormal;
        }
        var headingAltDiff = headingPos.Altitude - CursorPosition.Altitude;
        if (fromClick)
            labelHeading.Tooltip.Text = "Heading slope altitude: " + headingPos.Altitude.toFixed(2) + " m AMSL (" + headingAltDiff.toFixed(2) + "m)";
        if (CursorPosition.Pitch.toFixed(2) > 0 )
            labelHeading.Text = "+" + CursorPosition.Pitch.toFixed(2) + String.fromCharCode(186); //degree sign;
        else
            labelHeading.Text = CursorPosition.Pitch.toFixed(2) + String.fromCharCode(186); //degree sign;
    }
    // Coordinate information
    if (gDisplayCoordinateInfo == 2 || (gDisplayCoordinateInfo == 1 && fromClick)) {
        labelCoordinateInfo.Position = CursorPosition.Copy();
        labelCoordinateInfo.Position.Altitude = labelCoordinateInfo.Position.Altitude + measureDistance*1;
        //labelCoordinateInfo.Position.AltitudeType = 0;
        ///labelHeading.Style.BackgroundColor = colorTextNormal;
        labelCoordinateInfo.Text = "X: " + CursorPosition.X.toFixed(6) + "\r\nY: " + CursorPosition.Y.toFixed(6) + "\r\nAlt: " + CursorPosition.Altitude.toFixed(2) + " m AMSL ";
    }
}
catch (err) { alert(SGLang.i18n("Text15") + err); Reset(0, 0); }
}
//--------------
// ClosePopup
function ClosePopup() {
    try {
    SGWorld.Window.RemovePopup(popupMsg);
    }
    catch (err) { }
}
</script>
</body>
</html>
<!--Sig:00000040nuHMf1X22o3RTIYLzstK4pR9lnp3fIXFjHzi6jZqBuGn#IpBNFBrjWjF1UjdIGs2c6x8a40lKqIavlWVIElrXDJJ-->
TEWin/Resources/SlopeCursor/SlopeCursor.ico
TEWin/Resources/SlopeCursor/ToolIcon.png
TEWin/Resources/SlopeCursor/arrow.png
TEWin/Resources/SlopeCursor/cursor_m.cur
Binary files differ
TEWin/Resources/SlopeCursor/cursor_wait.cur
Binary files differ
TEWin/Resources/SlopeCursor/help.html
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,105 @@
<html>
<HEAD>
<TITLE>TerraExplorer Pro - Skyline Software Systems, Inc.</TITLE>
<LINK REL=StyleSheet HREF="../Style.css" TYPE="text/css">
</head>
<body>
        <table border=0 cellPadding=0 CELLSPACING=0 class="s9" width=100%>
        <tr><td class="s12b" align=center>
            Slope Cursor tool
        </tD></tr>
        <tr><td>
        <br>
<div class=WordSection1>
<p class=MsoNormal>The Slope Cursor tool displays information about a selected location including: its coordinates, altitude, and maximum positive/maximum negative slope values in a specified radius around the selected point.  </p>
<h3>To use the Slope Cursor tool:</h3>
<p class=MsoNormal>&nbsp;1. Set the Slope Cursor properties</p>
<table class=SkyTable border=1 cellspacing=0 cellpadding=0 width=535
 style='width:401.0pt;margin-left:.35in;border-collapse:collapse;border:none'>
 <tr>
  <td width=115 valign=top style='width:86.05pt;border:solid #4BACC6 1.0pt;
  background:#D2EAF1;padding:1.45pt 5.75pt 4.3pt 5.75pt'>
  <p class=MsoNormal style='margin-left:.25in;text-indent:-.25in'>Display Max Slope Values</p>
  </td>
  <td width=420 valign=top style='width:314.95pt;border:solid #4BACC6 1.0pt;
  border-left:none;background:#D2EAF1;padding:1.45pt 5.75pt 4.3pt 5.75pt'>
  <p class=MsoNormal style='margin-left:.25in;text-indent:-.25in'>Defines whether the maximum positive and maximum negative slope values are displayed. Choose between <b>Never, On Click</b> and <b>Always</b>.</p>
  </td>
 </tr>
 <tr>
  <td width=115 valign=top style='width:86.05pt;border:solid #4BACC6 1.0pt;
  background:white;padding:1.45pt 5.75pt 4.3pt 5.75pt'>
  <p class=MsoNormal style='margin-left:.25in;text-indent:-.25in'>Display Heading Slope</p>
  </td>
  <td width=420 valign=top style='width:314.95pt;border:solid #4BACC6 1.0pt;
  border-left:none;background:white;padding:1.45pt 5.75pt 4.3pt 5.75pt'>
  <p class=MsoNormal style='margin-left:.25in;text-indent:-.25in'>Defines whether the heading slope value is displayed. Choose between <b>Never, On Click</b> and <b>Always</b>. The heading is the current direction of the camera.
</p>
  </td>
 </tr>
 <tr>
  <td width=115 valign=top style='width:86.05pt;border:solid #4BACC6 1.0pt;
  background:#D2EAF1;padding:1.45pt 5.75pt 4.3pt 5.75pt'>
  <p class=MsoNormal style='margin-left:.25in;text-indent:-.25in'>Display Coordinate Info</p>
  </td>
  <td width=420 valign=top style='width:314.95pt;border:solid #4BACC6 1.0pt;
  border-left:none;background:#D2EAF1;padding:1.45pt 5.75pt 4.3pt 5.75pt'>
  <p class=MsoNormal style='margin-left:.25in;text-indent:-.25in'>Defines whether the selected coordinate information is displayed. Choose between <b>Never, On Click</b> and <b>Always</b>.</p>
  </td>
 </tr>
 <tr>
  <td width=115 valign=top style='width:86.05pt;border:solid #4BACC6 1.0pt;
  background:white;padding:1.45pt 5.75pt 4.3pt 5.75pt'>
  <p class=MsoNormal style='margin-left:.25in;text-indent:-.25in'>Measure Distance</p>
  </td>
  <td width=420 valign=top style='width:314.95pt;border:solid #4BACC6 1.0pt;
  border-left:none;background:white;padding:1.45pt 5.75pt 4.3pt 5.75pt'>
  <p class=MsoNormal style='margin-left:.25in;text-indent:-.25in'>Defines the measurement radius around the center point.</p>
  </td>
 </tr>
 <tr>
  <td width=115 valign=top style='width:86.05pt;border:solid #4BACC6 1.0pt;
  border-top:none;background:#D2EAF1;padding:1.45pt 5.75pt 4.3pt 5.75pt'>
  <p class=MsoNormal style='margin-left:.25in;text-indent:-.25in'>Alert Slope</p>
  </td>
  <td width=420 valign=top style='width:314.95pt;border-top:none;border-left:
  none;border-bottom:solid #4BACC6 1.0pt;border-right:solid #4BACC6 1.0pt;
  background:#D2EAF1;padding:1.45pt 5.75pt 4.3pt 5.75pt'>
  <p class=MsoNormal style='margin-left:.25in;text-indent:-.25in'>Apply colors to slope based on Alert rating levels.</p>
  </td>
 </tr>
 <tr>
  <td width=115 valign=top style='width:86.05pt;border:solid #4BACC6 1.0pt;
  border-top:none;background:white;padding:1.45pt 5.75pt 4.3pt 5.75pt'>
  <p class=MsoNormal style='margin-left:.25in;text-indent:-.25in'>Danger Slope</p>
  </td>
  <td width=420 valign=top style='width:314.95pt;border-top:none;border-left:
  none;border-bottom:solid #4BACC6 1.0pt;border-right:solid #4BACC6 1.0pt;
  background:white;padding:1.45pt 5.75pt 4.3pt 5.75pt'>
  <p class=MsoNormal style='margin-left:.25in;text-indent:-.25in'>Apply colors to slope based on Danger rating levels.</p>
  </td>
 </tr>
</table>
<p >&nbsp;2. Click <b>Start</b> to initiate the Slope Cursor tool.</p>
<p >&nbsp;3. Hover over the terrain to view slope arrows showing the maximum positive and maximum negative slope angles for the selected point.</p>
<p >&nbsp;4. Left-click to recalculate slope values using a more precise method. The calculation may take a few seconds.</p>
<p >&nbsp;5. Right-click or click Stop to exit Slope Cursor mode.</p>
</div>
            </td></tr>
        </table>
</body>
</html>
<!--Sig:00000040xWUdKq6k50ffNTVUrP6taKuX5.VPFLazlZMdtqhtD9VNuDEVRZjYltUyWgLn68Rb5pC1G1zIkRJzDRL3IlCZXQJJ-->
TEWin/TEWin.csproj
@@ -170,6 +170,39 @@
    </COMReference>
  </ItemGroup>
  <ItemGroup>
    <EmbeddedResource Include="Resources\SlopeCursor\arrow.png">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </EmbeddedResource>
    <EmbeddedResource Include="Resources\SlopeCursor\cursor_m.cur">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </EmbeddedResource>
    <EmbeddedResource Include="Resources\SlopeCursor\cursor_wait.cur">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </EmbeddedResource>
    <EmbeddedResource Include="Resources\SlopeCursor\help.html">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </EmbeddedResource>
    <EmbeddedResource Include="Resources\SlopeCursor\Images\SlopeCursorIcon.gif">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </EmbeddedResource>
    <EmbeddedResource Include="Resources\SlopeCursor\Images\StartCursor.gif">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </EmbeddedResource>
    <EmbeddedResource Include="Resources\SlopeCursor\Lang.js">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </EmbeddedResource>
    <EmbeddedResource Include="Resources\SlopeCursor\Query.png">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </EmbeddedResource>
    <EmbeddedResource Include="Resources\SlopeCursor\SlopeCursor.html">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </EmbeddedResource>
    <EmbeddedResource Include="Resources\SlopeCursor\SlopeCursor.ico">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </EmbeddedResource>
    <EmbeddedResource Include="Resources\SlopeCursor\ToolIcon.png">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </EmbeddedResource>
    <EmbeddedResource Include="Resources\AreaMeasurement\area.html">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </EmbeddedResource>