From b138834384e977cfc93cff1c66f70676cd4e7e18 Mon Sep 17 00:00:00 2001
From: 13693261870 <252740454@qq.com>
Date: 星期三, 03 一月 2024 11:23:11 +0800
Subject: [PATCH] 添加大量的资源文件~

---
 TEWin/Resources/CrossSection/help.html                        |  112 +
 TEWin/Resources/DistanceMeasurement/height.html               |  435 ++++
 TEWin/Resources/CrossSection/ToolIcon.png                     |    0 
 TEWin/Resources/SlopeMapQuery/img/point.gif                   |    0 
 TEWin/Resources/TerrainProfile/2052/help.html                 |   84 
 TEWin/Resources/Volume/img/Calculate.png                      |    0 
 TEWin/Resources/CrossSection/img/SaveObject.png               |    0 
 TEWin/Resources/SlopeMapQuery/ToolIcon.png                    |    0 
 TEWin/Resources/CrossSection/CrossSectionPopup.html           |  161 +
 TEWin/Resources/CrossSection/cursor_m.cur                     |    0 
 TEWin/Resources/AreaMeasurement/img/surface.png               |    0 
 TEWin/Resources/DistanceMeasurement/Lang.js                   |   25 
 TEWin/Resources/AreaMeasurement/img/snap.png                  |    0 
 TEWin/Resources/TerrainProfile/img/minmaxSlope.jpg            |    0 
 TEWin/Resources/DistanceMeasurement/Hourglass.cur             |    0 
 TEWin/Resources/AreaMeasurement/AreaMeasurement.html          |  365 +++
 TEWin/Resources/AreaMeasurement/Lang.js                       |   25 
 TEWin/Resources/Volume/img/ModifyTerrain.png                  |    0 
 TEWin/Resources/SlopeMapQuery/arrow.png                       |    0 
 TEWin/Resources/TerrainProfile/cursor_m.cur                   |    0 
 TEWin/Resources/DistanceMeasurement/img/delete_last_point.png |    0 
 TEWin/Resources/TerrainProfile/Hourglass.cur                  |    0 
 TEWin/Resources/TerrainProfile/img/point.gif                  |    0 
 TEWin/Resources/Volume/Hourglass.cur                          |    0 
 TEWin/Resources/Volume/img/VolumeBlack.png                    |    0 
 TEWin/Resources/SlopeMapQuery/cursor_m.cur                    |    0 
 TEWin/Resources/TerrainProfile/help.html                      |  108 +
 TEWin/Resources/Volume/help.html                              |  115 +
 TEWin/Resources/SlopeMapQuery/2052/Lang.js                    |   35 
 TEWin/Resources/TerrainProfile/TerrainProfile.ico             |    0 
 TEWin/Resources/CrossSection/img/SaveObjectDisabled.png       |    0 
 TEWin/Resources/SlopeMapQuery/help.html                       |  112 +
 TEWin/Resources/AreaMeasurement/img/delete_last_point.png     |    0 
 TEWin/Resources/TerrainProfile/img/zoomin.png                 |    0 
 TEWin/Resources/Volume/Lang.js                                |   61 
 TEWin/Resources/AreaMeasurement/area.html                     |  380 +++
 TEWin/Resources/DistanceMeasurement/dis.html                  |  435 ++++
 TEWin/Resources/SlopeMapQuery/SlopeMapQuery.html              |  621 +++++
 TEWin/Resources/TerrainProfile/img/waypoint.jpg               |    0 
 TEWin/Resources/DistanceMeasurement/img/TerrainProfile.png    |    0 
 TEWin/Resources/DistanceMeasurement/cursor_m.cur              |    0 
 TEWin/Resources/TerrainProfile/TerrainProfile.html            |  333 +++
 TEWin/Resources/Volume/ToolIcon.png                           |    0 
 TEWin/Resources/Volume/img/point.png                          |    0 
 TEWin/Resources/TerrainProfile/1033/help.html                 |  103 
 TEWin/Resources/TerrainProfile/img/minmaxAlt.jpg              |    0 
 TEWin/Resources/DistanceMeasurement/img/delete.png            |    0 
 TEWin/Resources/Volume/Volume.html                            |  647 ++++++
 TEWin/Resources/TerrainProfile/2052/Lang.js                   |   62 
 TEWin/Resources/DistanceMeasurement/distanceMeasurement.html  |  384 +++
 TEWin/Resources/AreaMeasurement/img/delete.png                |    0 
 TEWin/FrmWin.cs                                               |   57 
 TEWin/Resources/CrossSection/CrossSection.html                |  408 +++
 TEWin/Resources/TerrainProfile/Lang.js                        |   62 
 TEWin/Resources/DistanceMeasurement/img/snap.png              |    0 
 TEWin/Resources/CrossSection/img/Add.png                      |    0 
 TEWin/Resources/TerrainProfile/TerrainProfilePopup.html       |  919 ++++++++
 TEWin/Resources/TerrainProfile/img/zoomout.png                |    0 
 TEWin/Resources/AreaMeasurement/img/3d_palne_area.png         |    0 
 TEWin/Resources/TerrainProfile/ToolIcon.png                   |    0 
 TEWin/Resources/DistanceMeasurement/img/aerial.png            |    0 
 TEWin/Resources/Volume/cursor_m.cur                           |    0 
 TEWin/Resources/DistanceMeasurement/img/horizontal.png        |    0 
 TEWin/Resources/TerrainProfile/img/ButtonBackground.jpg       |    0 
 TEWin/TEWin.csproj                                            |  204 +
 TEWin/Resources/CrossSection/Lang.js                          |   27 
 TEWin/Resources/DistanceMeasurement/img/verticle.png          |    0 
 TEWin/Resources/TerrainProfile/1033/Lang.js                   |   62 
 TEWin/Resources/TerrainProfile/img/zoomall.png                |    0 
 TEWin/Resources/AreaMeasurement/img/horizontal.png            |    0 
 70 files changed, 6,333 insertions(+), 9 deletions(-)

diff --git a/TEWin/FrmWin.cs b/TEWin/FrmWin.cs
index 5112be1..4b04207 100644
--- a/TEWin/FrmWin.cs
+++ b/TEWin/FrmWin.cs
@@ -21,15 +21,9 @@
 
         FrmTool tool;
 
-        public SGWorld74 SG = null;
+        string mainUrl;
 
-        public static string StartupPath
-        {
-            get
-            {
-                return System.Windows.Forms.Application.StartupPath;
-            }
-        }
+        public SGWorld74 SG = null;
 
         public FrmWin()
         {
@@ -43,8 +37,9 @@
             try
             {
                 LogOut.Info("寮�濮嬭繍琛�..");
+                mainUrl = Application.StartupPath.Replace("\\", "/");
 
-                string fly = Path.Combine(StartupPath, "Resources\\sample.fly");
+                string fly = Path.Combine(Application.StartupPath, "Resources\\sample.fly");
                 if (!File.Exists(fly))
                 {
                     LogOut.Error("Fly鏂囦欢涓嶅瓨鍦細" + fly);
@@ -61,6 +56,8 @@
                 string isTest = ConfigurationManager.AppSettings["isTest"];
                 if ("1".Equals(isTest))
                 {
+                    this.FormBorderStyle = FormBorderStyle.FixedSingle;
+                    tree.FormBorderStyle = FormBorderStyle.FixedSingle;
                     tool = new FrmTool(this);
                     tool.Show();
                 }
@@ -225,5 +222,47 @@
         {
 
         }
+
+        public void ShowHtmlByid(int id, int arg)
+        {
+            switch (id)
+            {
+                case 1034:
+                    this.ShowHtml("璺濈娴嬮噺", mainUrl + "/Resources/DistanceMeasurement/distanceMeasurement.html", 20, 20, 400, 245);
+                    break;
+                case 1037:
+                    this.ShowHtml("闈㈢Н娴嬮噺", mainUrl + "/Resources/AreaMeasurement/AreaMeasurement.html", 20, 20, 400, 245);
+                    break;
+                case 1149:
+                    if (28 == arg)
+                        this.ShowHtml("鍓栭潰鍒嗘瀽", mainUrl + "/Resources/TerrainProfile/TerrainProfile.html", 20, 20, 400, 290);
+                    else
+                        this.ShowHtml("鍓栧垏鍒嗘瀽", mainUrl + "/Resources/CrossSection/CrossSection.html", 20, 20, 400, 225);
+                    break;
+                case 1093:
+                    this.ShowHtml("鍧″害鍒嗘瀽", mainUrl + "/Resources/SlopeMapQuery/SlopeMapQuery.html", 20, 20, 350, 365);
+                    break;
+                case 1045:
+                    this.ShowHtml("浣撶Н鍒嗘瀽", mainUrl + "/Resources/Volume/Volume.html", 20, 20, 350, 225);
+                    break;
+            }
+        }
+
+        public void ShowHtml(string tile, string url, int left, int top, int width, int height)
+        {
+            if (SG.Window.GetPopupByCaption(tile) != null)
+            {
+                SG.Window.RemovePopupByCaption(tile);
+            }
+
+            var popup = SG.Creator.CreatePopupMessage(tile, url, left, top, width, height);
+            popup.AllowResize = true;
+            popup.ShowCaption = true;
+            popup.AllowDrag = true;
+            popup.Width = width;
+            popup.Height = height;
+
+            SG.Window.ShowPopup(popup);
+        }
     }
 }
diff --git a/TEWin/Resources/AreaMeasurement/AreaMeasurement.html b/TEWin/Resources/AreaMeasurement/AreaMeasurement.html
new file mode 100644
index 0000000..9e9d2d3
--- /dev/null
+++ b/TEWin/Resources/AreaMeasurement/AreaMeasurement.html
@@ -0,0 +1,365 @@
+锘�<!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">
+</head>
+<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" style="border: 0px; overflow: hidden;" id="Body" class="hideUntillTranslated ToolButtonsArea" onload="Init()" onunload="OnUnload()">
+    <!--oncontextmenu="return false;">  onclick="bHide=true;HideOptionsNow()" > -->
+    <table border="0" width="100%" class="s8w" cellspacing="0" cellpadding="0">
+        <tr>
+            <td>
+                <table class="PropertiesSheet" cellspacing="0" cellpadding="0"></table>
+            </td>
+            <tr>
+                <td colspan="2" align="left" class="ToolButtonsArea" style="border-bottom: 2px solid #ffffff;">
+                    <button id="deleteMeasure" class="MenuButton2" style="border: none;" onclick="OnDeleteMeasure();">
+                        <img src="./img/delete.png" /></button>
+                    <button id="deleteLastPoint" class="MenuButton2" style="border: none;" onclick="OnDeleteLastPoint()">
+                        <img src="./img/delete_last_point.png" /></button>
+                    <button id="snapping" class="MenuButton2" style="border-right: 2px solid #ffffff;" onclick="OnSnapping()">
+                        <img src="./img/snap.png" /><br />
+                    </button>
+                    <button id="horizontalSurface" class="MenuButton2" style="border: none;" onclick="OnHorizontalSurface()">
+                        <img src="./img/horizontal.png" /><br />
+                    </button>
+                    <button id="3dPlane" class="MenuButton2" style="border: none;" onclick="On3DPlane()">
+                        <img src="./img/3d_palne_area.png" /><br />
+                    </button>
+                    <button id="terrainSurface" class="MenuButton2" style="border-left: 2px solid #ffffff; border-right: none;" onclick="OnTerrainSurface()">
+                        <img src="./img/surface.png" /><br />
+                    </button>
+                </td>
+            </tr>
+    </table>
+    <table border="0" width="100%" class="s8w ToolButtonsArea" cellspacing="0" cellpadding="3pt">
+        <tr id="createTRId" style="display: none;">
+            <td>
+                <span class="i18n s8w" style="vertical-align: top;">Text6</span>
+                <input type="checkbox" align="bottom" id="createMeasurementObject" style="width: 25px;" onclick="CreateMeasurementObject();" />
+            </td>
+        </tr>
+        <tr>
+            <td class="textarea-container">
+                <div class="textarea-size s8w"></div>
+            </td>
+        </tr>
+        <!--<tr id="sampleIntervalTR">
+		<td align="left">
+			<span class="i18n s8w">Text5</span>
+			<input type="text" id="sampleInterval" style="width:25px; height:13px;  background-color:#000000; color:#FFFFFF; padding:1px; margin-left: 2px;margin-right: 2px;" onkeypress="OnSampleInterval(event)" />
+			<span class="i18n s8w">Text18</span>
+		</td>
+		</tr>-->
+        <tr id="sampleIntervalTR">
+            <td align="left">
+                <span class="i18n s8w">Text5</span>
+                <input type="text" id="sampleInterval" style="width: 25px; height: 13px; background-color: #000000; color: #FFFFFF; padding: 1px; margin-left: 2px; margin-right: 2px;" onkeypress="OnSampleInterval(event)" />
+                <span class="i18n s8w">Text18</span>
+            </td>
+        </tr>
+        <tr id="surfaceResultTR">
+            <td class="textarea-container_surface">
+                <div class="textarea-size_surface s8w"></div>
+            </td>
+        </tr>
+        <tr id="unitTRId" style="display: none;">
+            <!--<td  align="right" >-->
+            <td>
+                <u><a class="btn btn-primary" href="#" role="button" id="changeMeasurementUnits" onclick="OnChangeMeasurementUnits()"><span class="i18n s8w" style="padding-right: 5px;">Text17</span></a></u>
+            </td>
+        </tr>
+    </table>
+    <object id="SGWorld" style="display: none" classid="CLSID:3a4f919d-65a8-11d5-85c1-0001023952c1"></object>
+    <script language="javascript" src="../jquery/jquery-3.1.1.min.js"></script>
+    <script language="javascript" src="../ToolsCommon71.js"></script>
+    <script language="JavaScript">
+        var DISABLE = "gray";
+        var gGeometry = null;
+        var g_bCalculateTerrainArea;
+        var _3D_PLANE_NAME = "plane";
+        var _HORIZONTAL_NAME = "horizontal";
+
+        function Init() {
+            document.getElementById("changeMeasurementUnits").value = SGLang.i18n("Text17");
+            document.getElementById("sampleInterval").value = 5;
+
+            var isPM = GetParamValue("pm", "0"); // when opening this tool in PM we want to hide several options
+            if (isPM == "1") {
+                $("#unitTRId").hide();
+                $("#createTRId").hide();
+                $("#terrainSurface").hide();
+                $("#sampleIntervalTR").hide();
+                $("#surfaceResultTR").hide();
+            }
+
+            $("#deleteMeasure").attr('title', SGLang.i18n("Text19"));
+            $("#deleteLastPoint").attr('title', SGLang.i18n("Text20"));
+            $("#snapping").attr('title', SGLang.i18n("Text21"));
+            $("#horizontalSurface").attr('title', SGLang.i18n("Text22"));
+            $("#3dPlane").attr('title', SGLang.i18n("Text23"));
+            $("#terrainSurface").attr('title', SGLang.i18n("Text24"));
+
+            textContainer = document.querySelector('.textarea-container');
+            textareaSize = textContainer.querySelector('.textarea-size');
+            textareaSize.innerText = SGLang.i18n("Text25");
+
+            textContainer = document.querySelector('.textarea-container_surface');
+            textareaSize = textContainer.querySelector('.textarea-size_surface');
+            textareaSize.innerText = SGLang.i18n("Text26");
+
+            SGWorld.AttachEvent("OnMeasurementAreaResult", OnMeasurementResult);
+            SGWorld.AttachEvent("OnInputModeChanged", OnInputModeChanged);
+            SGWorld.AttachEvent("OnEndDrawMeasurement", OnEndDrawMeasurement);
+
+            var bCreateMeasurementObject = (isPM == "1") ? false : SGWorld.GetOptionParam("CreateMeasurementObjects");
+            document.getElementById("createMeasurementObject").checked = bCreateMeasurementObject;
+            CreateMeasurementObject();
+
+            Reset(1, 0);
+            if (SGWorld.GetOptionParam("AreaMeasurementDefaultMode") == _3D_PLANE_NAME)
+                document.getElementById("3dPlane").click();
+            else
+                document.getElementById("horizontalSurface").click();
+        }
+
+        //---------------------------------
+        function Reset(FirstTime, FromMouseInputMode) {
+            ResetButtons();
+            SGWorld.Window.SetInputMode(0);
+            gGeometry = null;
+        }
+
+        //---------------------------------
+        function OnSampleInterval(evt) {
+            var theEvent = evt || window.event;
+
+            // Handle paste
+            if (theEvent.type === 'paste') {
+                key = event.clipboardData.getData('text/plain');
+            }
+            else {
+                // Handle key press
+                var key = theEvent.keyCode || theEvent.which;
+                key = String.fromCharCode(key);
+            }
+
+            var regex = /[0-9]|\./;
+            if (!regex.test(key) || document.getElementById("sampleInterval").style.color == DISABLE) {
+                theEvent.returnValue = false;
+                if (theEvent.preventDefault)
+                    theEvent.preventDefault();
+            }
+        }
+
+        //---------------------------------
+        function OnDeleteMeasure() {
+            var is3dPlane = $("#3dPlane").hasClass("MenuButtonHighlight");
+            var isHorizontalSurface = $("#horizontalSurface").hasClass("MenuButtonHighlight");
+
+            Reset(0, 0);
+
+            if (is3dPlane) {
+                document.getElementById("3dPlane").click();
+            }
+            else
+                if (isHorizontalSurface) {
+                    document.getElementById("horizontalSurface").click();
+                }
+
+            EnableDisableButtons();
+        }
+
+        //---------------------------------
+        function OnUnload() {
+            var measurementMode = SGWorld.GetParam(9916);
+            if (measurementMode == 33351/*ID_MEASURE_TERRAIN_AREA*/ || measurementMode == 33350/*ID_MEASURE_AREA*/)
+                SGWorld.Window.SetInputMode(0);
+        }
+
+        //---------------------------------
+        function OnEndDrawMeasurement(geometry) {
+            gGeometry = geometry;
+            EnableDisableButtons();
+        }
+
+        //---------------------------------
+        function OnInputModeChanged(mode) {
+            if (mode == 0) {
+                ResetButtons();
+            }
+        }
+
+        //---------------------------------
+        function OnMeasurementResult(rs, SounrceID) {
+            rs = rs.replace("N/A", "涓嶉�傜敤")
+                .replace("Surface Area:", "琛ㄩ潰绉細")
+                .replace("Area:", "闈㈢Н锛�")
+                .replace("Square Meter", "骞虫柟绫�")
+                .replace("Square km", "骞虫柟鍗冪背")
+                .replace("Perimeter: ", "鍛ㄩ暱锛�")
+                .replace(/Km/g, " 鍗冪背")
+                .replace(/m/g, " 绫�");
+
+            if (!g_bCalculateTerrainArea) {
+                textContainer = document.querySelector('.textarea-container');
+                textareaSize = textContainer.querySelector('.textarea-size');
+                textareaSize.innerText = rs;
+
+                textContainer = document.querySelector('.textarea-container_surface');
+                textareaSize = textContainer.querySelector('.textarea-size_surface');
+                textareaSize.innerText = SGLang.i18n("Text26");
+            }
+            else {
+                textContainer = document.querySelector('.textarea-container_surface');
+                textareaSize = textContainer.querySelector('.textarea-size_surface');
+                textareaSize.innerText = rs;
+            }
+
+            EnableDisableButtons();
+
+            return true;
+        }
+
+        //---------------------------------
+        function OnChangeMeasurementUnits() {
+            SGWorld.Command.Execute(1011, 3);
+        }
+
+        //---------------------------------
+        function CreateMeasurementObject() {
+            var bCreateMeasurementObject = document.getElementById("createMeasurementObject").checked == true;
+            SGWorld.SetOptionParam("CreateMeasurementObjects", bCreateMeasurementObject);
+        }
+
+        //---------------------------------
+        function EnableDisableButtons() {
+            var bEnableTerrainSurface = $("#horizontalSurface").hasClass("MenuButtonHighlight") && gGeometry != null;
+            if (!bEnableTerrainSurface)
+                document.getElementById("sampleInterval").style.color = DISABLE;
+            else
+                document.getElementById("sampleInterval").style.color = "#FFFFFF";
+
+            document.getElementById("terrainSurface").disabled = !bEnableTerrainSurface;
+
+            if (bEnableTerrainSurface)
+                document.getElementById("terrainSurface").style.opacity = 1;
+            else
+                document.getElementById("terrainSurface").style.opacity = 0.3;
+
+            var numPoints = SGWorld.GetParam(9915);
+            if (numPoints < 3) {
+                gGeometry = null;
+            }
+
+            if (numPoints > 0) {
+                document.getElementById("deleteMeasure").style.opacity = 1;
+            }
+            else {
+                document.getElementById("deleteMeasure").style.opacity = 0.3;
+            }
+
+            if (numPoints > 2 && gGeometry == null) {
+                document.getElementById("deleteLastPoint").style.opacity = 1;
+            }
+            else {
+                document.getElementById("deleteLastPoint").style.opacity = 0.3;
+            }
+        }
+
+        //---------------------------------
+        function ResetButtons() {
+            $("#horizontalSurface").removeClass("MenuButtonHighlight");
+            $("#terrainSurface").removeClass("MenuButtonHighlight");
+            $("#3dPlane").removeClass("MenuButtonHighlight");
+            EnableDisableButtons();
+        }
+
+        //---------------------------------
+        function SetSnapping() {
+            if ($("#snapping").hasClass("MenuButtonHighlight"))
+                SGWorld.SetParam(9912, 1);
+            else
+                SGWorld.SetParam(9912, 0);
+        }
+
+        //---------------------------------
+        function OnSnapping() {
+            //$("#snapping").removeClass("MenuButtonHighlight");
+
+            if ($(event.srcElement).hasClass("MenuButtonHighlight")) {
+                $("#snapping").removeClass("MenuButtonHighlight");
+                SGWorld.SetParam(9912, 0);
+            }
+            else {
+                SGWorld.SetParam(9912, 1);
+                $(event.srcElement).addClass("MenuButtonHighlight");
+            }
+        }
+
+        //---------------------------------
+        function On3DPlane() {
+            if ($(event.srcElement).hasClass("MenuButtonHighlight")) {
+                Reset(0, 0);
+                return;
+            }
+
+            Reset(0, 0);
+            $(event.srcElement).addClass("MenuButtonHighlight");
+            //SGWorld.Command.Execute(2358, 0);//__TEC_MEASURE_AREA
+            SGWorld.Command.Execute(1037, 0);
+
+            textContainer = document.querySelector('.textarea-container');
+            textareaSize = textContainer.querySelector('.textarea-size');
+            textareaSize.innerText = SGLang.i18n("Text25");
+
+            SetSnapping();
+
+            SGWorld.SetOptionParam("AreaMeasurementDefaultMode", _3D_PLANE_NAME);
+
+            EnableDisableButtons();
+        }
+
+        //---------------------------------
+        function OnTerrainSurface() {
+            //Reset(0,0);
+            g_bCalculateTerrainArea = true;
+            if (document.getElementById("sampleInterval").value > 0.0)
+              SGWorld.Command.Execute(1165/*__TEC_MEASURE_TERRAIN_AREA*/, document.getElementById("sampleInterval").value); // 2359
+            g_bCalculateTerrainArea = false;
+
+            SetSnapping();
+        }
+
+        //---------------------------------
+        function OnHorizontalSurface() {
+            if ($(event.srcElement).hasClass("MenuButtonHighlight")) {
+                Reset(0, 0);
+                return;
+            }
+
+            Reset(0, 0);
+            $(event.srcElement).addClass("MenuButtonHighlight");
+            SGWorld.Command.Execute(1165/*__TEC_MEASURE_TERRAIN_AREA*/, 0); // 2359
+
+            textContainer = document.querySelector('.textarea-container');
+            textareaSize = textContainer.querySelector('.textarea-size');
+            textareaSize.innerText = SGLang.i18n("Text25");
+
+            SetSnapping();
+
+            SGWorld.SetOptionParam("AreaMeasurementDefaultMode", _HORIZONTAL_NAME);
+            EnableDisableButtons();
+        }
+        
+        function OnDeleteLastPoint() {
+            SGWorld.SetParam(9914, 0);
+            EnableDisableButtons();
+        }
+    </script>
+</body>
+</html>
+
+<!--Sig:00000040au6WjiNW.uqyaxQdPdCltSVnmGMYOWXEgBB9yrqQ.Kyq91MhWbUupggV5yi1GRel4nJZMYQa3tOFAX56jNS8XmJJ-->
diff --git a/TEWin/Resources/AreaMeasurement/Lang.js b/TEWin/Resources/AreaMeasurement/Lang.js
new file mode 100644
index 0000000..021dfe2
--- /dev/null
+++ b/TEWin/Resources/AreaMeasurement/Lang.js
@@ -0,0 +1,25 @@
+锘縎GLang.lang = $.extend(SGLang.lang, {
+	ToolTitle: "娴嬮噺宸ュ叿",
+	ToolName: "鍦板舰鍓栭潰",
+	help: "甯姪",
+	Text0: "鍙栨秷",
+	Text1: "鍒犻櫎鏈�鍚庤妭鐐�",
+	Text2: "姘村钩闈�",
+	Text3: "鍦拌〃",
+	Text4: "鍦板舰鍦拌〃",
+	Text5: "閲囨牱闂撮殧锛�",
+	Text6: "鍒涘缓娴嬮噺瀵硅薄",
+	Text7: "鎹曟崏",
+	Text19: "",
+	Text17: "鍗曚綅",
+	Text18: " 绫�",
+	Text19: "鍒犻櫎娴嬮噺鍊笺��",
+	Text20: "鍒犻櫎鏈�鍚庝竴涓祴閲忕偣銆�",
+	Text21: "灏嗘祴閲忕偣鎹曟崏鍒拌竟銆佸璞″拰椤剁偣銆�",
+	Text22: "璁$畻鍦ㄥ湴褰笂鐨勬按骞虫姇褰遍潰绉��",
+	Text23: "璁$畻浠绘剰骞抽潰涓婄殑闈㈢Н銆傝澶氳竟褰㈢殑鏂瑰悜鐢遍�夊畾鐨勫墠涓変釜鐐瑰喅瀹氥��",
+	Text24: "鑰冭檻鍦板舰璧蜂紡锛岃绠楅�夊畾鍖哄煙鐨勮〃闈㈢Н銆�",
+	Text25: "闈㈢Н锛歕n鍛ㄩ暱锛�",
+	Text26: "琛ㄩ潰绉細",
+	Text999: ""
+});
\ No newline at end of file
diff --git a/TEWin/Resources/AreaMeasurement/area.html b/TEWin/Resources/AreaMeasurement/area.html
new file mode 100644
index 0000000..7142e7e
--- /dev/null
+++ b/TEWin/Resources/AreaMeasurement/area.html
@@ -0,0 +1,380 @@
+锘�<!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">
+</head>
+<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" style="border: 0px; overflow: hidden;" id="Body" class="hideUntillTranslated ToolButtonsArea" onload="Init()" onunload="OnUnload()">
+  <!--oncontextmenu="return false;">  onclick="bHide=true;HideOptionsNow()" > -->
+  <table border="0" width="100%" class="s8w" cellspacing="0" cellpadding="0">
+    <tr>
+      <td>
+        <table class="PropertiesSheet" cellspacing="0" cellpadding="0"></table>
+      </td>
+      <tr>
+        <td colspan="2" align="left" class="ToolButtonsArea" style="border-bottom: 2px solid #ffffff;">
+          <button id="deleteMeasure" class="MenuButton2" style="border: none;" onclick="OnDeleteMeasure();">
+            <img src="./img/delete.png" /></button>
+          <button id="deleteLastPoint" class="MenuButton2" style="border: none;" onclick="OnDeleteLastPoint()">
+            <img src="./img/delete_last_point.png" /></button>
+          <button id="snapping" class="MenuButton2" style="border-right: 2px solid #ffffff;" onclick="OnSnapping()">
+            <img src="./img/snap.png" /><br />
+          </button>
+          <button id="horizontalSurface" class="MenuButton2" style="border: none;" onclick="OnHorizontalSurface()">
+            <img src="./img/horizontal.png" /><br />
+          </button>
+          <button id="3dPlane" class="MenuButton2" style="border: none;" onclick="On3DPlane()">
+            <img src="./img/3d_palne_area.png" /><br />
+          </button>
+          <button id="terrainSurface" class="MenuButton2" style="border-left: 2px solid #ffffff; border-right: none;" onclick="OnTerrainSurface()">
+            <img src="./img/surface.png" /><br />
+          </button>
+        </td>
+      </tr>
+  </table>
+  <table border="0" width="100%" class="s8w ToolButtonsArea" cellspacing="0" cellpadding="3pt">
+    <tr id="createTRId" style="display: none;">
+      <td>
+        <span class="i18n s8w" style="vertical-align: top;">Text6</span>
+        <input type="checkbox" align="bottom" id="createMeasurementObject" style="width: 25px;" onclick="CreateMeasurementObject();" />
+      </td>
+    </tr>
+    <tr>
+      <td class="textarea-container">
+        <div class="textarea-size s8w"></div>
+      </td>
+    </tr>
+    <!--<tr id="sampleIntervalTR">
+		<td align="left">
+			<span class="i18n s8w">Text5</span>
+			<input type="text" id="sampleInterval" style="width:25px; height:13px;  background-color:#000000; color:#FFFFFF; padding:1px; margin-left: 2px;margin-right: 2px;" onkeypress="OnSampleInterval(event)" />
+			<span class="i18n s8w">Text18</span>
+		</td>
+		</tr>-->
+    <tr id="sampleIntervalTR">
+      <td align="left">
+        <span class="i18n s8w">Text5</span>
+        <input type="text" id="sampleInterval" style="width: 25px; height: 13px; background-color: #000000; color: #FFFFFF; padding: 1px; margin-left: 2px; margin-right: 2px;" onkeypress="OnSampleInterval(event)" />
+        <span class="i18n s8w">Text18</span>
+      </td>
+    </tr>
+    <tr id="surfaceResultTR">
+      <td class="textarea-container_surface">
+        <div class="textarea-size_surface s8w"></div>
+      </td>
+    </tr>
+    <tr id="unitTRId" style="display: none;">
+      <!--<td  align="right" >-->
+      <td>
+        <u><a class="btn btn-primary" href="#" role="button" id="changeMeasurementUnits" onclick="OnChangeMeasurementUnits()"><span class="i18n s8w" style="padding-right: 5px;">Text17</span></a></u>
+      </td>
+    </tr>
+  </table>
+  <object id="SGWorld" style="display: none" classid="CLSID:3a4f919d-65a8-11d5-85c1-0001023952c1"></object>
+  <script language="javascript" src="../jquery/jquery-3.1.1.min.js"></script>
+  <script language="javascript" src="../ToolsCommon71.js"></script>
+  <script language="JavaScript">
+    var DISABLE = "gray";
+    var gGeometry = null;
+    var g_bCalculateTerrainArea;
+    var _3D_PLANE_NAME = "plane";
+    var _HORIZONTAL_NAME = "horizontal";
+
+    function Init() {
+      document.getElementById("changeMeasurementUnits").value = SGLang.i18n("Text17");
+      document.getElementById("sampleInterval").value = 5;
+
+      var isPM = GetParamValue("pm", "0"); // when opening this tool in PM we want to hide several options
+      if (isPM == "1") {
+        $("#unitTRId").hide();
+        $("#createTRId").hide();
+        $("#terrainSurface").hide();
+        $("#sampleIntervalTR").hide();
+        $("#surfaceResultTR").hide();
+      }
+
+      $("#deleteMeasure").attr('title', SGLang.i18n("Text19"));
+      $("#deleteLastPoint").attr('title', SGLang.i18n("Text20"));
+      $("#snapping").attr('title', SGLang.i18n("Text21"));
+      $("#horizontalSurface").attr('title', SGLang.i18n("Text22"));
+      $("#3dPlane").attr('title', SGLang.i18n("Text23"));
+      $("#terrainSurface").attr('title', SGLang.i18n("Text24"));
+
+      textContainer = document.querySelector('.textarea-container');
+      textareaSize = textContainer.querySelector('.textarea-size');
+      textareaSize.innerText = SGLang.i18n("Text25");
+
+      textContainer = document.querySelector('.textarea-container_surface');
+      textareaSize = textContainer.querySelector('.textarea-size_surface');
+      textareaSize.innerText = SGLang.i18n("Text26");
+
+      SGWorld.AttachEvent("OnMeasurementAreaResult", OnMeasurementResult);
+      SGWorld.AttachEvent("OnInputModeChanged", OnInputModeChanged);
+      SGWorld.AttachEvent("OnEndDrawMeasurement", OnEndDrawMeasurement);
+
+      //var bCreateMeasurementObject = (isPM == "1") ? false : SGWorld.GetOptionParam("CreateMeasurementObjects");
+      //document.getElementById("createMeasurementObject").checked = bCreateMeasurementObject;
+      document.getElementById("createMeasurementObject").checked = true;
+      CreateMeasurementObject();
+
+      Reset(1, 0);
+      if (SGWorld.GetOptionParam("AreaMeasurementDefaultMode") == _3D_PLANE_NAME)
+        document.getElementById("3dPlane").click();
+      else
+        document.getElementById("horizontalSurface").click();
+    }
+
+    function setText(idx, val) {
+      var txtId = SGWorld.ProjectTree.FindItem("瀹氫綅鐐筡\Text");
+      if (txtId) {
+        var obj = SGWorld.ProjectTree.GetObject(txtId);
+        var strs = obj.Text.split(","); // 0,0,0,0,0,0,0
+        strs[idx] = val;
+        obj.Text = strs.join(",");
+      }
+    }
+
+    //---------------------------------
+    function Reset(FirstTime, FromMouseInputMode) {
+      ResetButtons();
+      SGWorld.Window.SetInputMode(0);
+      gGeometry = null;
+    }
+
+    //---------------------------------
+    function OnSampleInterval(evt) {
+      var theEvent = evt || window.event;
+
+      // Handle paste
+      if (theEvent.type === 'paste') {
+        key = event.clipboardData.getData('text/plain');
+      }
+      else {
+        // Handle key press
+        var key = theEvent.keyCode || theEvent.which;
+        key = String.fromCharCode(key);
+      }
+
+      var regex = /[0-9]|\./;
+      if (!regex.test(key) || document.getElementById("sampleInterval").style.color == DISABLE) {
+        theEvent.returnValue = false;
+        if (theEvent.preventDefault)
+          theEvent.preventDefault();
+      }
+    }
+
+    //---------------------------------
+    function OnDeleteMeasure() {
+      var is3dPlane = $("#3dPlane").hasClass("MenuButtonHighlight");
+      var isHorizontalSurface = $("#horizontalSurface").hasClass("MenuButtonHighlight");
+
+      Reset(0, 0);
+
+      if (is3dPlane) {
+        document.getElementById("3dPlane").click();
+      }
+      else
+        if (isHorizontalSurface) {
+          document.getElementById("horizontalSurface").click();
+        }
+
+      EnableDisableButtons();
+    }
+
+    //---------------------------------
+    function OnUnload() {
+      var measurementMode = SGWorld.GetParam(9916);
+      if (measurementMode == 33351/*ID_MEASURE_TERRAIN_AREA*/ || measurementMode == 33350/*ID_MEASURE_AREA*/)
+        SGWorld.Window.SetInputMode(0);
+    }
+
+    //---------------------------------
+    function OnEndDrawMeasurement(geometry) {
+      gGeometry = geometry;
+      EnableDisableButtons();
+    }
+
+    //---------------------------------
+    function OnInputModeChanged(mode) {
+      if (mode == 0) {
+        ResetButtons();
+      }
+    }
+
+    //---------------------------------
+    function OnMeasurementResult(rs, SounrceID) {
+      rs = rs.replace("N/A", "涓嶉�傜敤")
+          .replace("Surface Area:", "琛ㄩ潰绉細")
+          .replace("Area:", "闈㈢Н锛�")
+          .replace("Square Meter", "骞虫柟绫�")
+          .replace("Square km", "骞虫柟鍗冪背")
+          .replace("Perimeter: ", "鍛ㄩ暱锛�")
+          .replace(/Km/g, " 鍗冪背")
+          .replace(/m/g, " 绫�");
+
+      window.strs = rs.replace(/\t/g, "").replace(/s+/g, "").split("\n");
+      var area = strs[0].split("锛�")[1].replace("\r", "").trim().replace(" 骞虫柟绫�", "");
+      setText(6, area);
+
+      if (!g_bCalculateTerrainArea) {
+        textContainer = document.querySelector('.textarea-container');
+        textareaSize = textContainer.querySelector('.textarea-size');
+        textareaSize.innerText = rs;
+
+        textContainer = document.querySelector('.textarea-container_surface');
+        textareaSize = textContainer.querySelector('.textarea-size_surface');
+        textareaSize.innerText = SGLang.i18n("Text26");
+      }
+      else {
+        textContainer = document.querySelector('.textarea-container_surface');
+        textareaSize = textContainer.querySelector('.textarea-size_surface');
+        textareaSize.innerText = rs;
+      }
+
+      EnableDisableButtons();
+
+      return true;
+    }
+
+    //---------------------------------
+    function OnChangeMeasurementUnits() {
+      SGWorld.Command.Execute(1011, 3);
+    }
+
+    //---------------------------------
+    function CreateMeasurementObject() {
+      var bCreateMeasurementObject = document.getElementById("createMeasurementObject").checked == true;
+      SGWorld.SetOptionParam("CreateMeasurementObjects", bCreateMeasurementObject);
+    }
+
+    //---------------------------------
+    function EnableDisableButtons() {
+      var bEnableTerrainSurface = $("#horizontalSurface").hasClass("MenuButtonHighlight") && gGeometry != null;
+      if (!bEnableTerrainSurface)
+        document.getElementById("sampleInterval").style.color = DISABLE;
+      else
+        document.getElementById("sampleInterval").style.color = "#FFFFFF";
+
+      document.getElementById("terrainSurface").disabled = !bEnableTerrainSurface;
+
+      if (bEnableTerrainSurface)
+        document.getElementById("terrainSurface").style.opacity = 1;
+      else
+        document.getElementById("terrainSurface").style.opacity = 0.3;
+
+      var numPoints = SGWorld.GetParam(9915);
+      if (numPoints < 3) {
+        gGeometry = null;
+      }
+
+      if (numPoints > 0) {
+        document.getElementById("deleteMeasure").style.opacity = 1;
+      }
+      else {
+        document.getElementById("deleteMeasure").style.opacity = 0.3;
+      }
+
+      if (numPoints > 2 && gGeometry == null) {
+        document.getElementById("deleteLastPoint").style.opacity = 1;
+      }
+      else {
+        document.getElementById("deleteLastPoint").style.opacity = 0.3;
+      }
+    }
+
+    //---------------------------------
+    function ResetButtons() {
+      $("#horizontalSurface").removeClass("MenuButtonHighlight");
+      $("#terrainSurface").removeClass("MenuButtonHighlight");
+      $("#3dPlane").removeClass("MenuButtonHighlight");
+      EnableDisableButtons();
+    }
+
+    //---------------------------------
+    function SetSnapping() {
+      if ($("#snapping").hasClass("MenuButtonHighlight"))
+        SGWorld.SetParam(9912, 1);
+      else
+        SGWorld.SetParam(9912, 0);
+    }
+
+    //---------------------------------
+    function OnSnapping() {
+      //$("#snapping").removeClass("MenuButtonHighlight");
+
+      if ($(event.srcElement).hasClass("MenuButtonHighlight")) {
+        $("#snapping").removeClass("MenuButtonHighlight");
+        SGWorld.SetParam(9912, 0);
+      }
+      else {
+        SGWorld.SetParam(9912, 1);
+        $(event.srcElement).addClass("MenuButtonHighlight");
+      }
+    }
+
+    //---------------------------------
+    function On3DPlane() {
+      if ($(event.srcElement).hasClass("MenuButtonHighlight")) {
+        Reset(0, 0);
+        return;
+      }
+
+      Reset(0, 0);
+      $(event.srcElement).addClass("MenuButtonHighlight");
+      //SGWorld.Command.Execute(2358, 0);//__TEC_MEASURE_AREA
+      SGWorld.Command.Execute(1037, 0);
+
+      textContainer = document.querySelector('.textarea-container');
+      textareaSize = textContainer.querySelector('.textarea-size');
+      textareaSize.innerText = SGLang.i18n("Text25");
+
+      SetSnapping();
+
+      SGWorld.SetOptionParam("AreaMeasurementDefaultMode", _3D_PLANE_NAME);
+
+      EnableDisableButtons();
+    }
+
+    //---------------------------------
+    function OnTerrainSurface() {
+      //Reset(0,0);
+      g_bCalculateTerrainArea = true;
+      if (document.getElementById("sampleInterval").value > 0.0)
+        SGWorld.Command.Execute(1165/*__TEC_MEASURE_TERRAIN_AREA*/, document.getElementById("sampleInterval").value); // 2359
+      g_bCalculateTerrainArea = false;
+
+      SetSnapping();
+    }
+
+    //---------------------------------
+    function OnHorizontalSurface() {
+      if ($(event.srcElement).hasClass("MenuButtonHighlight")) {
+        Reset(0, 0);
+        return;
+      }
+
+      Reset(0, 0);
+      $(event.srcElement).addClass("MenuButtonHighlight");
+      SGWorld.Command.Execute(1165/*__TEC_MEASURE_TERRAIN_AREA*/, 0); // 2359
+
+      textContainer = document.querySelector('.textarea-container');
+      textareaSize = textContainer.querySelector('.textarea-size');
+      textareaSize.innerText = SGLang.i18n("Text25");
+
+      SetSnapping();
+
+      //SGWorld.SetOptionParam("AreaMeasurementDefaultMode", _HORIZONTAL_NAME);
+      EnableDisableButtons();
+    }
+
+    function OnDeleteLastPoint() {
+      SGWorld.SetParam(9914, 0);
+      EnableDisableButtons();
+    }
+  </script>
+</body>
+</html>
+
+<!--Sig:00000040au6WjiNW.uqyaxQdPdCltSVnmGMYOWXEgBB9yrqQ.Kyq91MhWbUupggV5yi1GRel4nJZMYQa3tOFAX56jNS8XmJJ-->
diff --git a/TEWin/Resources/AreaMeasurement/img/3d_palne_area.png b/TEWin/Resources/AreaMeasurement/img/3d_palne_area.png
new file mode 100644
index 0000000..d34afe8
--- /dev/null
+++ b/TEWin/Resources/AreaMeasurement/img/3d_palne_area.png
Binary files differ
diff --git a/TEWin/Resources/AreaMeasurement/img/delete.png b/TEWin/Resources/AreaMeasurement/img/delete.png
new file mode 100644
index 0000000..816806b
--- /dev/null
+++ b/TEWin/Resources/AreaMeasurement/img/delete.png
Binary files differ
diff --git a/TEWin/Resources/AreaMeasurement/img/delete_last_point.png b/TEWin/Resources/AreaMeasurement/img/delete_last_point.png
new file mode 100644
index 0000000..92b1e82
--- /dev/null
+++ b/TEWin/Resources/AreaMeasurement/img/delete_last_point.png
Binary files differ
diff --git a/TEWin/Resources/AreaMeasurement/img/horizontal.png b/TEWin/Resources/AreaMeasurement/img/horizontal.png
new file mode 100644
index 0000000..0da733b
--- /dev/null
+++ b/TEWin/Resources/AreaMeasurement/img/horizontal.png
Binary files differ
diff --git a/TEWin/Resources/AreaMeasurement/img/snap.png b/TEWin/Resources/AreaMeasurement/img/snap.png
new file mode 100644
index 0000000..ce82070
--- /dev/null
+++ b/TEWin/Resources/AreaMeasurement/img/snap.png
Binary files differ
diff --git a/TEWin/Resources/AreaMeasurement/img/surface.png b/TEWin/Resources/AreaMeasurement/img/surface.png
new file mode 100644
index 0000000..480258c
--- /dev/null
+++ b/TEWin/Resources/AreaMeasurement/img/surface.png
Binary files differ
diff --git a/TEWin/Resources/CrossSection/CrossSection.html b/TEWin/Resources/CrossSection/CrossSection.html
new file mode 100644
index 0000000..07afd35
--- /dev/null
+++ b/TEWin/Resources/CrossSection/CrossSection.html
@@ -0,0 +1,408 @@
+锘�<!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 href="../Style.css" type="text/css" rel="StyleSheet">
+    <link href="../jquery/slider.css" type="text/css" rel="StyleSheet" />
+    <link href="../jquery/css/dark-hive/jquery-ui-1.10.4.custom.css" rel="stylesheet" />
+    <link href="../jquery/jquery-ui-Override.css" rel="stylesheet" />
+
+    <script src="../jquery/jquery-1.10.2.js" type="text/javascript"></script>
+    <script src="../jquery/jquery-ui-1.10.4.custom.js" type="text/javascript"></script>
+    <script src="../jquery/slider.js" type="text/javascript"></script>
+    <script src="../ToolsCommon70.js" language="javascript"></script>
+    <style>
+    </style>
+</head>
+<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" style="border: 0px" id="Body" class="hideUntillTranslated" onload="Init()" onunload="Reset(false,false);">
+    <!--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="left" class="s12w i18n">ToolName</td>
+                        <td align="right" id="CloseHelpTd"><!--<img style="margin-right:5px;cursor: pointer;" alt="" src="../CommonImg/help.png" border="0" class="i18n" alt="help" title="help" onclick="DisplayHelpPopup6(SGLang.i18nFile('help.html'),SGLang.i18n('help'))">--></td>
+                    </tr>
+                </table>
+            </td>
+        </tr>
+        <tr>
+            <td class="ToolTopSeperator"></td>
+        </tr>
+        <tr class="s8">
+            <td>
+                <table class="PropertiesSheet" cellspacing="0" cellpadding="2">
+                    <tr>
+                        <td class="s8b" style="width: 100px;">
+                            <label for="Mode" class="i18n">Mode</label>
+                        </td>
+                        <td align="left">
+                            &nbsp;<select id="DirectionMode" onchange="ChangeMode();" style="width: 185px;">
+                                <option class="i18n" value="0" selected="selected">Auto</option>
+                                <option class="i18n" value="1">Horizontal</option>
+                                <option class="i18n" value="2">Vertical</option>
+                            </select>
+                        </td>
+                    </tr>
+
+                    <tr>
+                        <td class="s8b">
+                            <label for="Mode" class="i18n">Size</label>
+                        </td>
+                        <td align="left">
+                            <div id="SizeSlider" style="display:block; width:180px;height:1px; margin:3px;"></div>
+                        </td>
+                    </tr>
+                    <tr>
+                        <td class="s8b">
+                            <label for="Mode" class="i18n">Direction</label>
+                        </td>
+                        <td align="left">
+                            <div id="DirectionSlider" style="display:block; width:180px;height:1px; margin:3px;"></div>
+                        </td>
+                    </tr>
+                    <!--<tr>
+                        <td class="s8b">
+                            <label for="Mode" class="i18n">SaveTitle</label>
+                        </td>
+                        <td align="left">
+                            <button id="Button1" class="MenuButtonSmall MenuButtonLast" onclick="SavePlane();">   <span class="i18n">Save</span></button>
+                        </td>
+                    </tr>-->
+                </table>
+            </td>
+        </tr>
+        <tr class="s8">
+            <td colspan="2" align="center" class="ToolButtonsArea">
+                <button id="AddRemoveBtn" class="MenuButton MenuButtonLast" onclick="Start();">    <img src="./img/Add.png" /><br /> <span id="StartStop" class="i18n">Add</span></button>
+            </td>
+        </tr>
+    </table>
+    <script language="JavaScript">
+        var gDebug = false;
+        var rootId;
+        var gBoxObj = null;
+        var gCrossActivate = 0;
+        var bEditOn = false;
+        var bFirstTime;
+        var gCursorPos = null;
+        var gOriginBoxSize = 0;
+        var gOrigPos = null;
+        //    var TransparencySlider;
+        var SizeSlider;
+        var DirectionSlider;
+        //    var MoveSlider;
+        var gDeletePlane = true;
+        var gPopup = null;
+        var gDoubleSide = -1;
+
+        var SGWorld = new ActiveXObject("TerraExplorerX.SGWorld70");
+
+        //--------------
+        // Init
+        function Init() {
+            //  debugger
+            rootId = GetParamValue("rootId", SGWorld.ProjectTree.RootID);
+            SGWorld.AttachEvent("OnInputModeChanged", OnInputModeChanged);
+            SGWorld.AttachEvent("OnSGWorldMessage", OnSGWorldMessage);
+            SGWorld.AttachEvent("OnFrame", OnFrame);
+
+            $("#SizeSlider").slider({
+                value: 15,
+                min: 1,
+                max: 100,
+                slide: function (event, ui) {
+                    setSize();
+                },
+                change: function (event, ui) {
+                    setSize();
+                }
+            });
+            $("#DirectionSlider").slider({
+                value: 0,
+                min: 0,
+                max: 360,
+                slide: function (event, ui) {
+                    setDirection();
+                },
+                change: function (event, ui) {
+                    setDirection();
+                }
+            });
+            Reset(1, 0);
+        }
+
+        //------------------
+        // Reset
+        //------------------
+        function Reset(FirstTime, FromMouseInputMode) {
+
+            try {
+                if (gBoxObj != null && SGWorld.ProjectTree.GetNextItem(gBoxObj.ID, 15) == SGWorld.ProjectTree.HiddenGroupID)
+                    SGWorld.Creator.DeleteObject(gBoxObj.ID);
+                if (gBoxObj != null)
+                    SGWorld.Analysis.HideCrossSectionBox();
+            }
+            catch (err) { if (gDebug) alert(err.message); }
+
+            try {
+                gBoxObj = null;
+                gDeletePlane = true;
+
+                $("#AddRemoveBtn").removeClass("MenuButtonHighlight");
+                $("#EditBtn").removeClass("MenuButtonHighlight");
+                $("#SaveImg").attr("src", "./img/SaveObjectDisabled.png");
+                $("#StartStop").text(SGLang.i18n("Add"));
+
+
+                SGWorld.ProjectTree.EnableRedraw(1);
+                SGWorld.Window.HideMessageBarText();
+
+                if (gCrossActivate > 0) {
+                    SGWorld.DetachEvent("OnLButtonClicked", OnLButtonClicked);
+                    SGWorld.DetachEvent("OnRButtonUp", OnRButtonUp);
+                }
+                gCrossActivate = 0;
+                bEditOn = false;
+
+                if (FirstTime != 1 && FromMouseInputMode == 0)
+                    SGWorld.Window.SetInputMode(0);
+                if (gPopup != null) {
+                    SGWorld.Window.RemovePopup(gPopup);
+                    gPopup = null;
+                }
+            }
+            catch (err) { if (gDebug) alert(err.message); }
+        }
+
+        //--------------
+        // Start
+        //--------------
+        function Start() {
+            if (gCrossActivate == 0) {
+                gCrossActivate = 1;
+                bEditOn = true;
+
+                SGWorld.AttachEvent("OnLButtonClicked", OnLButtonClicked);
+                SGWorld.AttachEvent("OnRButtonUp", OnRButtonUp);
+
+
+                SGWorld.Window.SetInputMode(1, abspath() + "/cursor_m.cur", true);
+                SGWorld.Window.ShowMessageBarText(SGLang.i18n("ClickToAdd"));
+
+                $("#AddRemoveBtn").addClass("MenuButtonHighlight");
+                $("#EditBtn").addClass("MenuButtonHighlight");
+                //$("#MoveSlider").slider("value",0);
+            }
+            else {
+                Reset(false, false)
+            }
+        }
+
+        //-------------------
+        function OnFrame() {
+            try {
+                if (gCrossActivate == 1)
+                    createBox(false);
+                if (gCrossActivate == 2)
+                    showCrossSection();
+            }
+            catch (err) { }
+        }
+
+        //--------------
+        function OnLButtonClicked(Flags, X, Y) {
+            try {
+                if (gCrossActivate == 1) {
+                    createBox(true);
+
+                }
+            }
+            catch (err) { if (gDebug) alert(err.message); }
+        }
+
+        //--------------
+        function ChangeMode() {
+            if (gCrossActivate != 2 || gBoxObj == null)
+                return;
+            createBox(true);
+        }
+
+        // createBox
+        function createBox(fromClick) {
+            try {
+                if (fromClick && gBoxObj != null) { // From Click or change mode
+                    gCursorPos = gBoxObj.Position.Copy();
+                    if ($("#DirectionMode").val() == 1)
+                        gCursorPos.Pitch = 180;
+                    if ($("#DirectionMode").val() == 2)
+                        gCursorPos.Pitch = 90;
+
+                }
+                else { // from OnFrame
+                    var cursor = SGWorld.Window.GetMouseInfo();
+                    var CursorPitch = 180;  // Horizontal
+                    var CursorYaw = SGWorld.Navigate.GetPosition(3).Yaw + 180;
+                    gCursorPos = SGWorld.Window.pixelToWorld(cursor.X, cursor.Y, -1 & ~(128 | 1024)).Position;
+                    var DistanceFromCamera = SGWorld.Navigate.GetPosition(3).DistanceTo(gCursorPos);
+                    if (cursor.X > 10 && cursor.X < SGWorld.Window.Rect.Width && cursor.Y > 10 && cursor.Y < SGWorld.Window.Rect.Height) {
+                        var Pos1 = SGWorld.Window.pixelToWorld(cursor.X - 10, cursor.Y - 10, -1 & ~(128 | 1024)).Position;
+                        var Pos2 = SGWorld.Window.pixelToWorld(cursor.X - 10, cursor.Y + 10, -1 & ~(128 | 1024)).Position;
+                        var Pos3 = SGWorld.Window.pixelToWorld(cursor.X + 10, cursor.Y - 10, -1 & ~(128 | 1024)).Position;
+                        var Pos4 = SGWorld.Window.pixelToWorld(cursor.X + 10, cursor.Y + 10, -1 & ~(128 | 1024)).Position;
+                        if ($("#DirectionMode").val() == 2 || ((Math.abs(Pos1.AimTo(Pos4).Pitch) > 20 || Math.abs(Pos2.AimTo(Pos3).Pitch) > 20) && $("#DirectionMode").val() != 1)) {
+                            CursorPitch = 90;
+                            if (Math.abs(Pos1.AimTo(Pos4).Pitch) > 20 || Math.abs(Pos2.AimTo(Pos3).Pitch) > 20)
+                                CursorYaw = Pos1.AimTo(Pos4).Yaw + 90;
+                            gCursorPos = gCursorPos.Move(DistanceFromCamera / 100, CursorYaw, 0);
+                        }
+                        else {
+                            gCursorPos.Altitude += DistanceFromCamera / 100;
+                        }
+                    }
+                    else {
+                        return;
+                    }
+                    gCursorPos.Pitch = CursorPitch;
+                    gCursorPos.Yaw = CursorYaw;
+                    gOriginBoxSize = DistanceFromCamera;
+                }
+
+                if (gBoxObj != null)
+                    SGWorld.Creator.DeleteObject(gBoxObj.ID);
+                gBoxObj = SGWorld.Creator.CreateBox(gCursorPos, 1, 1, 0, "#ffffff", "#ffffff", SGWorld.ProjectTree.HiddenGroupID, "CrossSection");
+                gBoxObj.SaveInFlyFile = false;
+                gOrigPos = gBoxObj.Position.Copy();
+                gBoxObj.SetParam(5450, 1);
+                setTransparency();
+                setSize();
+                $("#StartStop").text(SGLang.i18n("Stop"));
+
+                if (fromClick) {
+                    gCrossActivate = 2;
+                    if (gPopup != null)
+                        SGWorld.Window.RemovePopup(gPopup);
+                    var url = abspath() + "/CrossSectionPopup.html?ObjID=" + gBoxObj.ID + "&lang=" + SGLang.getCode();
+                    gPopup = SGWorld.Creator.CreatePopupMessage(SGLang.i18n("ToolName"), url, 20, 265, 400, 50, -1);
+                    gPopup.Flags = 2 + 32;
+                    $("#DirectionSlider").slider("value", gCursorPos.Yaw % 360);
+                    SGWorld.Window.ShowPopup(gPopup);
+                    //gDoubleSide = SGWorld.GetParam(7700); // Double Side Rendering
+                    //SGWorld.SetParam(7700,1);
+                }
+            }
+            catch (err) { }
+        }
+
+        //--------------
+        function OnRButtonUp(Flags, X, Y) {
+            if (gCrossActivate == 1) {
+                Reset(false, false);
+                return true;
+            }
+            return false;
+        }
+
+        //--------------
+        function setColor() {
+            //    try {
+            //        if (gBoxObj != null) {
+            //            gBoxObj.FillStyle.Color.FromHTMLColor("#" + $("#color").val());
+            //            gBoxObj.LineStyle.Color.FromHTMLColor("#" + $("#color").val());
+            //            setTransparency();
+            //        }
+            //    }
+            //    catch (err) { if (gDebug) alert(err.message); }
+        }
+
+        //--------------
+        function setTransparency() {
+
+            var a = $("#TransparencySlider").slider("value");
+            try {
+                gBoxObj.FillStyle.Color.SetAlpha(0);
+                //        if (gBoxObj != null) {
+                //            gBoxObj.FillStyle.Color.SetAlpha(a/200);
+                //        }
+            }
+            catch (err) { if (gDebug) alert(err.message); }
+        }
+
+        //--------------
+        function setSize() {
+
+            var size = $("#SizeSlider").slider("value");
+            try {
+                if (gBoxObj != null) {
+                    var boxSize = gOriginBoxSize / 50 * $("#SizeSlider").slider("value");
+                    gBoxObj.Width = boxSize;
+                    gBoxObj.Depth = boxSize;
+                    gBoxObj.Height = boxSize / 100;
+                }
+            }
+            catch (err) { if (gDebug) alert(err.message); }
+        }
+
+        //--------------
+        function setDirection() {
+            var direction = $("#DirectionSlider").slider("value");
+            try {
+                if (gBoxObj != null && gCrossActivate == 2) {
+                    gBoxObj.Position.Yaw = direction;
+                }
+            }
+            catch (err) { if (gDebug) alert(err.message); }
+        }
+
+        //--------------
+        function SavePlane() {
+            try {
+                if (gBoxObj == null)
+                    return;
+
+                var savedPos = gBoxObj.Position.Copy();
+                var savedObj = SGWorld.Creator.CreateBox(savedPos, gBoxObj.Width, gBoxObj.Depth, gBoxObj.Height, gBoxObj.LineStyle.Color, gBoxObj.FillStyle.Color, SGWorld.ProjectTree.RootID, SGLang.i18n("ToolName"));
+                savedObj.SetParam(5450, 1);
+                savedObj.FillStyle.Color.SetAlpha(0);
+
+                var messageURL = SGWorld.Application.ExecutablePath + "tools/CrossSection/CrossSectionPopup.html?ObjID=" + savedObj.ID + "&lang=" + SGLang.getCode();
+                var message = SGWorld.Creator.CreatePopupMessage(SGLang.i18n("ToolName"), messageURL, 1, 10, 300, 50, -1);
+                message.Flags = 2 + 32 + 512;
+                savedObj.Message.MessageID = message.ID;
+
+                SGWorld.Window.ShowMessageBarText(SGLang.i18n("ObjectSaved"));
+            }
+            catch (err) { if (gDebug) alert(err.message); }
+        }
+
+
+        //--------------
+        function OnInputModeChanged(mode) {
+        }
+
+        //------------
+        function OnSGWorldMessage(MessageID, SounrceID) {
+
+            try {
+                if (SounrceID == "MessageBarText" && MessageID.indexOf("##CrossSectionExit:") == 0) {
+                    var objID = MessageID.substring(MessageID.indexOf(":") + 1);
+                    if (objID == gBoxObj.ID)
+                        Reset(false, false);
+                    return true;
+                }
+            }
+            catch (err) { return true; }
+
+            return false;
+        }
+
+        //------------
+        function showCrossSection() {
+        }
+    </script>
+</body>
+</html>
\ No newline at end of file
diff --git a/TEWin/Resources/CrossSection/CrossSectionPopup.html b/TEWin/Resources/CrossSection/CrossSectionPopup.html
new file mode 100644
index 0000000..1066b70
--- /dev/null
+++ b/TEWin/Resources/CrossSection/CrossSectionPopup.html
@@ -0,0 +1,161 @@
+锘�<!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 href="../Style.css" rel="StyleSheet" type="text/css">
+    <link href="../jquery/slider.css" type="text/css" rel="StyleSheet" />
+    <link href="../jquery/css/dark-hive/jquery-ui-1.10.4.custom.css" rel="stylesheet" />
+    <link href="../jquery/jquery-ui-Override.css" rel="stylesheet" />
+
+    <script src="../jquery/jquery-1.10.2.js" type="text/javascript"></script>
+    <script src="../jquery/jquery-ui-1.10.4.custom.js" type="text/javascript"></script>
+    <script src="../ToolsCommon70.js" language="javascript"></script>
+    <script src="../jquery/slider.js" type="text/javascript"></script>
+    <style>
+    </style>
+</head>
+<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" style="border: 0px" id="Body" class="hideUntillTranslated" onload="Init()" onunload="Exit();">
+    <!--oncontextmenu="return false;">  onclick="bHide=true;HideOptionsNow()" > -->
+    <table border="0" width="100%" cellspacing="0" cellpadding="10">
+        <tr>
+            <td align="center">
+                <div id="MoveSlider" style="display:block; width:250px;height:1px; margin:3px;"></div>
+            </td>
+        </tr>
+    </table>
+
+    <script language="JavaScript">
+        var gDebug = false;
+        var gObjID = "";
+        var gBoxObj = null;
+        var gOrigPos = null;
+        var gLastPos = null;
+        var MoveSlider;
+        var gLastWidth = null;
+        var gOriginBoxSize = 0;
+        var gGeometry;
+
+        var SGWorld = new ActiveXObject("TerraExplorerX.SGWorld70");
+
+        //--------------
+        // Init
+        function Init() {
+            try {
+
+                gObjID = GetParamValue("ObjID", "0");
+
+                gBoxObj = SGWorld.ProjectTree.GetObject(gObjID);
+                gOrigPos = gBoxObj.Position.Copy();
+                gOriginBoxSize = gBoxObj.Width;
+                SGWorld.AttachEvent("OnFrame", showCrossSection);
+
+                $("#MoveSlider").slider({
+                    value: 0,
+                    min: -50,
+                    max: 200,
+                    slide: function (event, ui) {
+                        setMove();
+                    },
+                    change: function (event, ui) {
+                        setMove();
+                    }
+                });
+
+            }
+            catch (err) { }
+        }
+        //------------------
+        function Exit() {
+
+            try {
+                SGWorld.Analysis.HideCrossSectionBox();
+
+                SGWorld.Window.ShowMessageBarText("##CrossSectionExit:" + gBoxObj.ID);
+
+            }
+            catch (err) { if (gDebug) alert(err.message); }
+
+        }
+
+        //--------------
+        function setMove() {
+            try {
+
+                var distanceVal = $("#MoveSlider").slider("value") * gBoxObj.Width / 100;
+                if (gBoxObj.Position.Pitch == 90) { // vertical
+                    //gBoxObj.Position = gOrigPos.Move(-distanceVal.toFixed(2), gBoxObj.Position.Yaw.toFixed(2), 0);
+                    gBoxObj.Position = gOrigPos.Move(parseFloat(-distanceVal.toFixed(2)), parseFloat(gBoxObj.Position.Yaw.toFixed(2)), 0);// parseFloat - fix #23020, decimal symbol = comma seperator french OS
+
+                    gBoxObj.Position.Pitch = 90;
+                }
+                else gBoxObj.Position.Altitude = gOrigPos.Altitude - distanceVal;
+
+            }
+            catch (err) { }
+        }
+        //-------------------
+        function showCrossSection() {
+            setMove();
+
+            try {
+                if (gBoxObj == null)
+                    return;
+
+                if (gLastPos == null || !gLastPos.IsEqual(gBoxObj.Position) || gLastWidth != gBoxObj.Width) {
+                    var vertices = [];
+                    var sectionSize = gBoxObj.Width * 5;
+                    gLastPos = gBoxObj.Position.Copy();
+                    gLastWidth = gBoxObj.Width;
+                    var pos = gBoxObj.Position;
+                    var planeTolarance = gOriginBoxSize / 100;
+                    if (gBoxObj.Position.Pitch == 90) {
+                        var yaw = gBoxObj.Position.Yaw - 180;
+                        pos = pos.Move(planeTolarance, yaw - 180, 0);  // make sure the cut area doesn't include the box
+                        pos = pos.Move(gBoxObj.Width / 2, 0, -90);
+                        pos = pos.Move(gBoxObj.Width / 2, yaw + 90, 0);
+                        vertices[0] = pos;
+                        pos = pos.Move(sectionSize, yaw - 180, 0);
+                        vertices[1] = pos;
+                        pos = pos.Move(gBoxObj.Width, yaw - 90, 0);
+                        vertices[2] = pos;
+                        pos = pos.Move(sectionSize, yaw, 0);
+                        vertices[3] = pos;
+                        vertices[4] = vertices[0].Move(gBoxObj.Width, 0, 90);
+                        vertices[5] = vertices[1].Move(gBoxObj.Width, 0, 90);
+                        vertices[6] = vertices[2].Move(gBoxObj.Width, 0, 90);
+                        vertices[7] = vertices[3].Move(gBoxObj.Width, 0, 90);
+                    }
+                    else {
+                        pos = pos.Move(planeTolarance, 0, 90);  // make sure the cut area doesn't include the box
+                        pos = pos.Move(gBoxObj.Width / 2, gBoxObj.Position.Yaw, 0);
+                        pos = pos.Move(gBoxObj.Width / 2, gBoxObj.Position.Yaw + 90, 0);
+                        vertices[0] = pos;
+                        pos = pos.Move(gBoxObj.Width, gBoxObj.Position.Yaw - 180, 0);
+                        vertices[1] = pos;
+                        pos = pos.Move(gBoxObj.Width, gBoxObj.Position.Yaw - 90, 0);
+                        vertices[2] = pos;
+                        pos = pos.Move(gBoxObj.Width, gBoxObj.Position.Yaw, 0);
+                        vertices[3] = pos;
+                        vertices[4] = vertices[0].Move(sectionSize, 0, 90);
+                        vertices[5] = vertices[1].Move(sectionSize, 0, 90);
+                        vertices[6] = vertices[2].Move(sectionSize, 0, 90);
+                        vertices[7] = vertices[3].Move(sectionSize, 0, 90);
+                    }
+
+                    gGeometry = SGWorld.Creator.GeometryCreator.CreateLineStringGeometry(vertices);
+                    // tmpBox = SGWorld.Creator.CreatePolyline(geometry, $("#color").val(), 3, "", "dd");
+                    SGWorld.Analysis.ShowCrossSectionBox(gGeometry, false, "#ff" + $("#color").val()); //
+                }
+            }
+            catch (err) { }
+        }
+
+    </script>
+
+</body>
+</html>
+
+
+<!--Sig:000000409fE#CpGDY6uwO81Zcfp2fwQbGN0zw1HJw#r#9mzj52KsWdNyv8pRS4S2N0qaeNht0akAFaBHPcTTOY#x3RhFJvJJ-->
diff --git a/TEWin/Resources/CrossSection/Lang.js b/TEWin/Resources/CrossSection/Lang.js
new file mode 100644
index 0000000..2464c48
--- /dev/null
+++ b/TEWin/Resources/CrossSection/Lang.js
@@ -0,0 +1,27 @@
+锘縎GLang.lang = $.extend(SGLang.lang,{
+    ToolTitle: "鍓栧垏宸ュ叿",
+    ToolName: "鍓栧垏宸ュ叿",
+    help: "甯姪",
+    Mode: "妯″紡",
+    Auto: "鑷姩",
+    Vertical: "鍨傜洿鍓栧垏",
+    Horizontal: "姘村钩鍓栧垏",
+    modeIn: "鍐呭垏",
+    modeOut: "澶栧垏",
+    Color: "骞抽潰鑹插僵",
+    Transparency: "骞抽潰閫忔槑搴�",
+    Size: "骞抽潰澶у皬",
+    Direction: "骞抽潰鏂瑰悜",
+    Move: "绉诲姩",
+    Add: "寮�濮�",
+    Stop: "鍋滄",
+    SaveTitle: "淇濆瓨鍒伴」鐩�",
+    Save: "淇濆瓨",
+    Remove: "绉婚櫎<br>骞抽潰",
+    EditOn: "缂栬緫<br>鎵撳紑",
+    EditOff: "缂栬緫<br>鍏抽棴",
+    ClickToAdd: "鍓栧垏锛氬乏閿崟鍑讳笁缁寸獥鍙d互鏀剧疆鍓栧垏骞抽潰锛屽彸閿崟鍑绘垨鍋滄鎸夐挳浠ュ彇娑堟搷浣溿��",
+    ObjectSaved: "淇濆瓨鍓栧垏骞抽潰锛屽弻鍑诲钩闈互婵�娲诲垎鏋�",
+    OpenTool: "鍓栧垏锛氳鎵撳紑宸ュ叿锛屽啀娆″弻鍑诲璞�",
+    Text999: ""
+});
\ No newline at end of file
diff --git a/TEWin/Resources/CrossSection/ToolIcon.png b/TEWin/Resources/CrossSection/ToolIcon.png
new file mode 100644
index 0000000..f50f094
--- /dev/null
+++ b/TEWin/Resources/CrossSection/ToolIcon.png
Binary files differ
diff --git a/TEWin/Resources/CrossSection/cursor_m.cur b/TEWin/Resources/CrossSection/cursor_m.cur
new file mode 100644
index 0000000..4e0076c
--- /dev/null
+++ b/TEWin/Resources/CrossSection/cursor_m.cur
Binary files differ
diff --git a/TEWin/Resources/CrossSection/help.html b/TEWin/Resources/CrossSection/help.html
new file mode 100644
index 0000000..349be25
--- /dev/null
+++ b/TEWin/Resources/CrossSection/help.html
@@ -0,0 +1,112 @@
+<html class="helpHtml">
+<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>
+			Cross Section 
+		</tD></tr>
+		<tr><td>
+		<br>
+
+<div class=WordSection1>
+
+
+<p class=MsoNormal>The Cross Section tool makes a horizontal or vertical straight cut to expose obscured sections of the 3D View. </p>
+
+<p class=ProcedureHeader style='margin-left:0in;text-indent:0in'><span dir=LTR></span>To use the Cross Section tool:</p>
+
+<p class=ListFirstLevel>1.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;
+</span><span dir=LTR></span>Enter the following parameters:</p>
+
+<table class=SkyTable border=1 cellspacing=0 cellpadding=0 
+ style='width:550.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:white;padding:1.45pt 5.75pt 4.3pt 5.75pt'>
+  <p class=MsoNormal style='margin-left:.25in;text-indent:-.25in'><b>Parameter</b></p>
+  </td>
+  <td  valign=top style='width:414.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'><b>Description</b></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:0in;text-indent:0in'>Mode </p>
+  </td>
+  <td width=420 valign=top style='width:414.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:0in;text-indent:0in'>Select the mode</p>
+  <ul>
+  <li><b>Auto</b> 锟� The direction of the cross section is automatically determined based on what the cursor is currently pointing at.</li>
+  <ul>
+    <li>  A vertical surface (e.g. side of a building) 锟� Vertical cross section   </li>
+    <li>  The terrain or any horizontal flat surface (e.g. roof tops) 锟� Horizontal cross section   </li>
+  </ul>
+  <li><b>Horizontal</b> 锟� Create horizontal cross sections</li>
+  <li><b>Vertical</b> 锟� Create vertical cross sections</li>
+  </ul>
+  </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:0in;text-indent:0in'>Plane Size</p>
+  </td>
+  <td width=420 valign=top style='width:414.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:0in;text-indent:0in'>Determines the size of the cross section plane. Slide the slider to the right to increase the plane size, and left to decrease. </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:0in;text-indent:0in'>Plane Direction</p>
+  </td>
+  <td width=420 valign=top style='width:414.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:0in;text-indent:0in'>Determines the direction of the cross section plane. Slide the slider to the right or left to rotate the plane.</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:0in;text-indent:0in'>Save to Project</p>
+  </td>
+  <td width=420 valign=top style='width:414.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:0in;text-indent:0in'>Click the <b>Save</b> button to create a Project Tree entry that reopens the Cross Section tool with the selected location.</p>
+  </td>
+ </tr>
+ </table>
+
+<p class=ListFirstLevel>2.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;
+</span><span dir=LTR></span>Click <b>Start</b> </p>
+
+<p class=ListFirstLevel>3.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;
+</span><span dir=LTR></span>In the <b>3D Window</b>, click where you want to create a cross section. Then use the Cross Section slider to adjust the position of the cross section plane. When cutting a horizontal cross section, slide the slider to the left to lower the plane (increasing the section being clipped), and right to raise it. When cutting a vertical cross section, slide the slider to the left to move the cross section plane forward, and right to move it backward. </p>
+
+
+<p class=ListFirstLevel>4.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;
+</span><span dir=LTR></span>Click <b>Stop</b> to exit the current cross section </p>
+
+
+
+</div>
+
+			</td></tr>
+		</table>
+</body>
+</html>
+
+
+<!--Sig:0000004037Jcz4CpwuVwuf9Df4vV4wM7W4KHbc4BwMRbEZMdnxjRnBKOLEs1l4.FjCY3HBiUyqA.BLVkf#vzOyF03faRXAJJ-->
diff --git a/TEWin/Resources/CrossSection/img/Add.png b/TEWin/Resources/CrossSection/img/Add.png
new file mode 100644
index 0000000..0033b05
--- /dev/null
+++ b/TEWin/Resources/CrossSection/img/Add.png
Binary files differ
diff --git a/TEWin/Resources/CrossSection/img/SaveObject.png b/TEWin/Resources/CrossSection/img/SaveObject.png
new file mode 100644
index 0000000..7e33237
--- /dev/null
+++ b/TEWin/Resources/CrossSection/img/SaveObject.png
Binary files differ
diff --git a/TEWin/Resources/CrossSection/img/SaveObjectDisabled.png b/TEWin/Resources/CrossSection/img/SaveObjectDisabled.png
new file mode 100644
index 0000000..e0432d9
--- /dev/null
+++ b/TEWin/Resources/CrossSection/img/SaveObjectDisabled.png
Binary files differ
diff --git a/TEWin/Resources/DistanceMeasurement/Hourglass.cur b/TEWin/Resources/DistanceMeasurement/Hourglass.cur
new file mode 100644
index 0000000..54e82ba
--- /dev/null
+++ b/TEWin/Resources/DistanceMeasurement/Hourglass.cur
Binary files differ
diff --git a/TEWin/Resources/DistanceMeasurement/Lang.js b/TEWin/Resources/DistanceMeasurement/Lang.js
new file mode 100644
index 0000000..dcc837d
--- /dev/null
+++ b/TEWin/Resources/DistanceMeasurement/Lang.js
@@ -0,0 +1,25 @@
+锘縎GLang.lang = $.extend(SGLang.lang,{
+    ToolTitle: "娴嬮噺宸ュ叿",
+    ToolName: "鍦板舰鍓栭潰",
+    help: "甯姪",
+    //Text0: "Cancel",
+    //Text1: "Delete Last Point",
+    //Text2: "Aerial",
+    //Text3: "Horizontal",
+    //Text4: "Vertical",
+    //Text5: "OnGround",
+    Text6: "鍒涘缓娴嬮噺瀵硅薄",
+    Text7: "鎹曟崏",
+	//Text19: "Calculating query points",
+    //Text16: "Left click on the terrain to draw a polygon/Polyline. Right click to finish operation.",
+    Text17: "鍗曚綅",
+    Text18: "鍒犻櫎娴嬮噺鍊笺��",
+    Text19: "鍒犻櫎鏈�鍚庝竴涓祴閲忕偣銆�",
+    Text20: "灏嗘祴閲忕偣鎹曟崏鍒拌竟銆佸璞″拰椤剁偣銆�",
+    //Text21: "Calculate aerial distance, i.e., the actual distance between points in the 3D Window.",
+    //Text22: "Calculate horizontal distance between points in the 3D Window.",
+    Text23: "鍦ㄧ┖涓樉绀哄湴褰㈤珮绋嬨��",
+    Text24: "鏄剧ず绌轰腑璺濈",
+    Text25: "鏄剧ず姘村钩璺濈",
+    Text26: "鏄剧ず鍨傜洿璺濈",
+});
\ No newline at end of file
diff --git a/TEWin/Resources/DistanceMeasurement/cursor_m.cur b/TEWin/Resources/DistanceMeasurement/cursor_m.cur
new file mode 100644
index 0000000..4e0076c
--- /dev/null
+++ b/TEWin/Resources/DistanceMeasurement/cursor_m.cur
Binary files differ
diff --git a/TEWin/Resources/DistanceMeasurement/dis.html b/TEWin/Resources/DistanceMeasurement/dis.html
new file mode 100644
index 0000000..992e67a
--- /dev/null
+++ b/TEWin/Resources/DistanceMeasurement/dis.html
@@ -0,0 +1,435 @@
+锘�<!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; overflow: hidden;" id="Body" class="hideUntillTranslated ToolButtonsArea" onload="Init()" onunload="OnUnload()">
+  <!--oncontextmenu="return false;">  onclick="bHide=true;HideOptionsNow()" > -->
+  <table border="0" width="100%" class="s8w" cellspacing="0" cellpadding="0">
+    <tr class="s8">
+      <td colspan="2" align="left" class="ToolButtonsArea" style="border-bottom: 2px solid #ffffff;">
+        <button id="deleteMeasure" class="MenuButton2" style="border: none;" onclick="OnDeleteMeasure();">
+          <img src="./img/delete.png" /><br />
+          <!--  <span class="i18n">Text0</span> -->
+        </button>
+        <button id="deleteLastPoint" class="MenuButton2" style="border: none;" onclick="OnDeleteLastPoint()">
+          <img src="./img/delete_last_point.png" /><br />
+          <!-- <span class="i18n">Text1</span> -->
+        </button>
+        <button id="snapping" class="MenuButton2" style="border: none;" onclick="OnSnapping()">
+          <img src="./img/snap.png" /><br />
+          <!-- <span class="i18n" style="font:#2A4EA5">Text7</span>-->
+        </button>
+        <button id="onGroundDistance" class="MenuButton2" style="border-left: 2px solid #ffffff; border-right: none; display: none;" onclick="OnGroundDistance()">
+          <img src="./img/TerrainProfile.png" /><!--<br /><span class="i18n" style="font:#2A4EA5">Text5</span>-->
+        </button>
+      </td>
+    </tr>
+  </table>
+
+  <table border="0" width="100%" class="s8w ToolButtonsArea" cellspacing="0" cellpadding="3pt">
+    <tr id="createTRId" style="display: none;">
+      <td>
+        <span class="i18n s8w" style="vertical-align: top;">Text6</span>
+        <input type="checkbox" align="bottom" id="createMeasurementObject" style="width: 25px;" onclick="CreateMeasurementObject();" />
+      </td>
+    </tr>
+    <tr>
+      <td>
+        <span class="i18n s8w" style="vertical-align: top; color: yellow;">Text24</span>
+        <input type="checkbox" id="showAerialDistance" checked align="bottom" style="width: 25px;" onclick="OnShowAerial();" />
+      </td>
+    </tr>
+    <tr>
+      <td>
+        <span class="i18n s8w" style="vertical-align: top; color: white;">Text25</span>
+        <input type="checkbox" id="showHorizontalDistance" align="bottom" style="width: 25px;" onclick="OnShowHorizontal();" />
+      </td>
+    </tr>
+    <tr>
+      <td>
+        <span class="i18n s8w" style="vertical-align: top; color: #FF49E6;">Text26</span>
+        <input type="checkbox" id="showVerticalDistance" align="bottom" style="width: 25px;" onclick="OnShowVertical();" />
+      </td>
+    </tr>
+    <tr>
+      <td class="textarea-container">
+        <style>
+          div.textarea-size {
+            font-size: 12px;
+          }
+        </style>
+        <div class="textarea-size  s8w"></div>
+      </td>
+    </tr>
+    <tr id="unitTRId" style="display: none;">
+      <td>
+        <span id="changeMeasurementUnits" onclick="OnChangeMeasurementUnits()" class="i18n s9w link">Text17</span>
+      </td>
+    </tr>
+  </table>
+
+  <object id="SGWorld" style="display: none" classid="CLSID:3a4f919d-65a8-11d5-85c1-0001023952c1"></object>
+  <script language="javascript" src="../jquery/jquery-3.1.1.min.js"></script>
+  <script language="javascript" src="../ToolsCommon70.js"></script>
+  <script language="JavaScript">
+    //** this is a global variables for the polyline/polygon drawings
+    //var gPolygonText = SGLang.i18n("Text35");
+    //var gPolylineText = SGLang.i18n("Text36");
+    var gDrawPolyClick = null;
+    var gEndDrawPoly = DrawPoly;
+    var gPopupCaption = "";
+
+    var _AERIAL_REG_NAME = "DistanceMeasurementShowAerial";
+    var _HORIZONTAL_REG_NAME = "DistanceMeasurementShowHorizontal";
+    var _VERTICAL_REG_NAME = "DistanceMeasurementShowVertical";
+
+    var bInEdit;
+    var Type = 3;
+    var gGeometry = null;
+    //----------------
+    function Init() {
+      SGWorld.AttachEvent("OnMeasurementDistanceResult", OnMeasurementResult);
+      SGWorld.AttachEvent("OnInputModeChanged", OnInputModeChanged);
+      SGWorld.AttachEvent("OnEndDrawMeasurement", OnEndDrawMeasurement);
+      SGWorld.AttachEvent("OnLButtonUp", OnLButtonUp);
+
+      var isPM = GetParamValue("pm", "0");
+      if (isPM == "1") {
+        $("#unitTRId").hide();
+        $("#createTRId").hide();
+        $("#onGroundDistance").hide();
+      }
+      document.getElementById("changeMeasurementUnits").value = SGLang.i18n("");
+      document.getElementById("deleteMeasure").title = SGLang.i18n("Text18");
+      document.getElementById("deleteLastPoint").title = SGLang.i18n("Text19");
+      document.getElementById("snapping").title = SGLang.i18n("Text20");
+      document.getElementById("onGroundDistance").title = SGLang.i18n("Text23");
+
+      ////Turn off CreateMeasurementObject
+      //SGWorld.Command.Execute(2225,0);
+
+      //var bCreateMeasurementObject = (isPM == "1") ? false : SGWorld.GetOptionParam("CreateMeasurementObjects");
+      //document.getElementById("createMeasurementObject").checked = bCreateMeasurementObject;
+      document.getElementById("createMeasurementObject").checked = false;
+      CreateMeasurementObject();
+
+      Reset(1, 0);
+
+      //SGWorld.Command.Execute(2356, 0);//__TEC_MEASURE_AERIAL_DIST
+      SGWorld.Command.Execute(1035, 0);
+
+      SetSnapping();
+
+      //document.getElementById("showAerialDistance").checked = SGWorld.GetOptionParam(_AERIAL_REG_NAME);
+      //document.getElementById("showHorizontalDistance").checked = SGWorld.GetOptionParam(_HORIZONTAL_REG_NAME);
+      //document.getElementById("showVerticalDistance").checked = SGWorld.GetOptionParam(_VERTICAL_REG_NAME);
+
+      Type = getQueryStr("type");
+      if (Type == "1") {
+        document.getElementById("showHorizontalDistance").checked = true;
+        document.getElementById("showVerticalDistance").checked = false;
+        document.getElementById("showAerialDistance").checked = false;
+      } else if (Type == "2") {
+        document.getElementById("showHorizontalDistance").checked = false;
+        document.getElementById("showVerticalDistance").checked = true;
+        document.getElementById("showAerialDistance").checked = false;
+      } else {
+        document.getElementById("showHorizontalDistance").checked = true;
+        document.getElementById("showVerticalDistance").checked = true;
+        document.getElementById("showAerialDistance").checked = true;
+      }
+      OnShowAerial();
+      OnShowHorizontal();
+      OnShowVertical();
+
+      //////////////OnShow();
+      EnableDisableButtons();
+      //showVerticalDistance
+    }
+
+    function getQueryStr(name) {
+      var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
+      var r = window.location.search.substr(1).match(reg);
+      if (r != null) {
+        return unescape(r[2]);
+      }
+      return null;
+    }
+
+    //----------------
+    function ShowPopup(ProfileType, ObjID) {
+      var CompareStr = "";
+      var CompareMode = 0;
+      var Density = 2;
+
+      // Remove previos popup
+      SGWorld.Window.RemovePopupByCaption(gPopupCaption);
+
+      gPopupCaption = SGLang.i18n("Text14") + " " + Date().toString();
+      var url = abspath() + "/../TerrainProfile/TerrainProfilePopup.html?Type=" + ProfileType + "&ObjID=" + ObjID + "&DisableChangeInputMode=1" + "&Density=" + Density + "&Compare=" + CompareMode + CompareStr + "&Caption=" + gPopupCaption + "&lang=" + SGLang.getCode();
+
+      //var path = location.href.substring(0, location.href.lastIndexOf("/") + 1);
+      //var url = path + "../TerrainProfile/TerrainProfilePopup.html?Type=" + ProfileType + "&ObjID=" + ObjID + "&DisableChangeInputMode=1" + "&Density=" + Density + "&Compare=" + CompareMode + CompareStr + "&Caption=" + gPopupCaption + "&lang=" + SGLang.getCode();
+
+      //    var popupMsg = SGWorld.Creator.CreatePopupMessage(gPopupCaption, url, 1, SGWorld.Window.Rect.Height * 2 / 3, SGWorld.Window.Rect.Width - 2, SGWorld.Window.Rect.Height / 3 - 55, -1);
+      var popupMsg = SGWorld.Creator.CreatePopupMessage(gPopupCaption, url, 1, -1000, 100, 100, -1);
+
+      popupMsg.Flags = 2 + 32;
+      SGWorld.Window.ShowPopup(popupMsg);
+    }
+
+    function OnShowAerial() {
+      SGWorld.SetOptionParam(_AERIAL_REG_NAME, document.getElementById("showAerialDistance").checked);
+    }
+
+    function OnShowHorizontal() {
+
+      SGWorld.SetOptionParam(_HORIZONTAL_REG_NAME, document.getElementById("showHorizontalDistance").checked);
+    }
+
+    function OnShowVertical() {
+      SGWorld.SetOptionParam(_VERTICAL_REG_NAME, document.getElementById("showVerticalDistance").checked);
+    }
+
+    function OnUnload() {
+      var measurementMode = SGWorld.GetParam(9916);
+      if (measurementMode == 33326/*ID_MEASURE_HDIST*/ || measurementMode == 33327/*ID_MEASURE_ADIST*/)
+        SGWorld.Window.SetInputMode(0);
+    }
+
+    //-------------
+    // DrawPoly
+    function DrawPoly(geometry, type, altitudeType) {
+      // create a polyline, under the hidden group, using this geometry and send the objID to the popup
+      var lineGroup = SGWorld.ProjectTree.CreateGroup(SGLang.i18n("Text28"), SGWorld.ProjectTree.HiddenGroupID);       // SGWorld.ProjectTree.RootID
+      var line = SGWorld.Creator.CreatePolyline(geometry, "#FC8220", 3, lineGroup, "ProfileLine");
+
+      //line.LineStyle.Width = -4;
+      //line.SetParam(5440, 1);
+      line.Visibility.Show = false;
+
+      ShowPopup(0, lineGroup);
+      return true;
+    }
+
+    function OnDeleteMeasure() {
+      //alert("aa");
+      Reset(0, 0);
+
+      //SGWorld.Command.Execute(2356, 0);//__TEC_MEASURE_AERIAL_DIST
+      SGWorld.Command.Execute(1035, 0);
+
+      EnableDisableButtons();
+      //alert("bb");
+    }
+
+    function OnInputModeChanged(mode) {
+      if (mode == 0) {
+        Reset(0, 0);
+        //SGWorld.Window.RemovePopupByCaption("Distance Measurement");
+      }
+    }
+
+    function OnLButtonUp(Flags, X, Y) {
+      if ((Flags & 0x0400) == 0) {
+        gGeometry = null;
+      }
+      return false;
+    }
+
+    function OnEndDrawMeasurement(geometry) {
+      gGeometry = geometry;
+      EnableDisableButtons();
+    }
+
+    function EnableDisableButtons() {
+      var numPoints = SGWorld.GetParam(9915);
+
+      if (numPoints > 0) {
+        document.getElementById("deleteMeasure").style.opacity = 1;
+      }
+      else {
+        document.getElementById("deleteMeasure").style.opacity = 0.3;
+      }
+
+      if (gGeometry == null) {
+        document.getElementById("deleteLastPoint").style.opacity = 1;
+      }
+      else {
+        document.getElementById("deleteLastPoint").style.opacity = 0.3;
+      }
+
+      var bEnableTerrainProfile = gGeometry != null;
+
+      if (bEnableTerrainProfile) {
+        document.getElementById("onGroundDistance").style.opacity = 1;
+      }
+      else {
+        document.getElementById("onGroundDistance").style.opacity = 0.3;
+      }
+    }
+
+    function OnMeasurementResult(rs, SounrceID) {
+      rs = rs.replace("Total Aerial Distance:", "鎬荤┖涓窛绂伙細")
+        .replace("Total Horizontal Distance:", "鎬绘按骞宠窛绂伙細")
+        .replace("Total Vertical Distance:", "鎬诲瀭鐩磋窛绂伙細")
+        .replace("Total Vertical Distance (First point to last point):", "鎬诲瀭鐩磋窛绂伙紙浠庣涓�鐐瑰埌鏈�鍚庝竴鐐癸級锛�")
+        .replace("Slope:", "鍧″害锛�")
+        .replace("Slope (First point to last point):", "鍧″害锛堜粠绗竴鐐瑰埌鏈�鍚庝竴鐐癸級锛�")
+        .replace(/km/g, " 鍗冪背")
+        .replace(/cm/g, " 鍘樼背")
+        .replace(/mm/g, " 姣背")
+        .replace(/m/g, " 绫�")
+
+      textContainer = document.querySelector('.textarea-container');
+      textareaSize = textContainer.querySelector('.textarea-size');
+      //input = textContainer.querySelector('textarea');
+      //input.value = measurementResult;
+      textareaSize.innerText = rs;
+
+      window.strs = rs.replace(/\t/g, "").replace(/s+/g, "").split("\n"); //.replace(/\\r/g, "")
+      switch (Type) {
+        case "1":
+          var dis = strs[1].split("锛�")[1].replace("\r", "").split(" ")[0];
+          setText(2, dis);
+          break;
+        case "2":
+          var ver = strs[2].split("锛�")[1].replace("\r", "").split(" ")[0];
+          setText(3, ver);
+          break;
+        default:
+          var angle = strs[3].split("锛�")[1].replace("掳", "");
+          setText(4, angle);
+          break;
+      }
+
+      EnableDisableButtons();
+      return true;
+    }
+
+    function setText(idx, val) {
+      var txtId = SGWorld.ProjectTree.FindItem("瀹氫綅鐐筡\Text");
+      if (txtId) {
+        var obj = SGWorld.ProjectTree.GetObject(txtId);
+        var strs = obj.Text.split(","); // 0,0,0,0,0,0
+        strs[idx] = val;
+        obj.Text = strs.join(",");
+      }
+    }
+
+    function OnChangeMeasurementUnits() {
+      SGWorld.Command.Execute(1011, 3);
+    }
+
+    function CreateMeasurementObject() {
+      var bCreateMeasurementObject = document.getElementById("createMeasurementObject").checked == true;
+      SGWorld.SetOptionParam("CreateMeasurementObjects", bCreateMeasurementObject);
+    }
+
+    function ResetButtons() {
+      //$("#verticalDistance").removeClass("MenuButtonHighlight");
+      $("#onGroundDistance").removeClass("MenuButtonHighlight");
+    }
+
+    //------------------
+    // Reset
+    //------------------
+    function Reset(FirstTime, FromMouseInputMode) {
+      ResetButtons();
+      gGeometry = null;
+      try {
+        if (gPolyObj != null)
+          SGWorld.Creator.DeleteObject(gPolyObj.ID);
+      } catch (e) { }
+
+      gPolyObj = null;
+      GroupID = null;
+
+      bDontAskme = false;
+
+      $("#lineButton").removeClass("MenuButtonHighlight");
+      $("#areaButton").removeClass("MenuButtonHighlight");
+      $("#groupButton").removeClass("MenuButtonHighlight");
+      $("#clipboardButton").removeClass("MenuButtonHighlight");
+
+      SGWorld.ProjectTree.EnableRedraw(1);
+      SGWorld.Window.HideMessageBarText();
+
+      if (bInEdit) {
+        SGWorld.DetachEvent("OnLButtonClicked", DrawPolyLButtonClicked);
+        SGWorld.DetachEvent("OnRButtonUp", DrawPolyRButtonUp);
+        SGWorld.DetachEvent("OnFrame", DrawPolyOnFrame);
+        SGWorld.DetachEvent("OnInputModeChanged", DrawPolyInputModeChanged);
+      }
+      bInEdit = false;
+
+      //if (FirstTime != 1 && FromMouseInputMode == 0)
+      // SGWorld.Window.SetInputMode(0);
+    }
+
+    function OnEndDrawMeasurement(geometry) {
+      gGeometry = geometry;
+      EnableDisableButtons();
+    }
+
+    //--------------
+    // CreateObjects
+    //--------------
+    function OnGroundDistance() {
+
+      DrawPoly(gGeometry, 0, 0);
+      return;
+    }
+
+    function SetSnapping() {
+      if ($("#snapping").hasClass("MenuButtonHighlight"))
+        SGWorld.SetParam(9912, 1);
+      else
+        SGWorld.SetParam(9912, 0);
+    }
+
+    function OnSnapping() {
+      //$("#snapping").removeClass("MenuButtonHighlight");
+
+      if ($(event.srcElement).hasClass("MenuButtonHighlight")) {
+        $("#snapping").removeClass("MenuButtonHighlight");
+        SGWorld.SetParam(9912, 0);
+      }
+      else {
+        SGWorld.SetParam(9912, 1);
+        $(event.srcElement).addClass("MenuButtonHighlight");
+      }
+    }
+
+    /*
+    function OnVerticalDistance()
+    {
+        if( $(event.srcElement).hasClass("MenuButtonHighlight"))
+        {
+            Reset(0,0);
+            return;
+        }
+
+        Reset(0,0);
+        $(event.srcElement).addClass("MenuButtonHighlight");
+        SGWorld.Command.Execute(1036,0);
+
+        SetSnapping();
+    }
+    */
+
+    function OnDeleteLastPoint() {
+      SGWorld.SetParam(8335, 0);
+      EnableDisableButtons();
+    }
+  </script>
+</body>
+</html>
+
+<!--Sig:000000408JYdtBwnEhYwKwSHBToL4ROTBsQ92IumwfiHRg2dcUb.aSdjqmR2hWrrJjiq7xBbYr6MVX764LIe8a6004zvXaJJ-->
diff --git a/TEWin/Resources/DistanceMeasurement/distanceMeasurement.html b/TEWin/Resources/DistanceMeasurement/distanceMeasurement.html
new file mode 100644
index 0000000..9eace7b
--- /dev/null
+++ b/TEWin/Resources/DistanceMeasurement/distanceMeasurement.html
@@ -0,0 +1,384 @@
+锘�<!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; overflow: hidden;" id="Body" class="hideUntillTranslated ToolButtonsArea" onload="Init()" onunload="OnUnload()">
+  <!--oncontextmenu="return false;">  onclick="bHide=true;HideOptionsNow()" > -->
+  <table border="0" width="100%" class="s8w" cellspacing="0" cellpadding="0">
+    <tr class="s8">
+      <td colspan="2" align="left" class="ToolButtonsArea" style="border-bottom: 2px solid #ffffff;">
+        <button id="deleteMeasure" class="MenuButton2" style="border: none;" onclick="OnDeleteMeasure();">
+          <img src="./img/delete.png" /><br />
+          <!--  <span class="i18n">Text0</span> -->
+        </button>
+        <button id="deleteLastPoint" class="MenuButton2" style="border: none;" onclick="OnDeleteLastPoint()">
+          <img src="./img/delete_last_point.png" /><br />
+          <!-- <span class="i18n">Text1</span> -->
+        </button>
+        <button id="snapping" class="MenuButton2" style="border: none;" onclick="OnSnapping()">
+          <img src="./img/snap.png" /><br />
+          <!-- <span class="i18n" style="font:#2A4EA5">Text7</span>-->
+        </button>
+        <button id="onGroundDistance" class="MenuButton2" style="border-left: 2px solid #ffffff; border-right: none; display: none;" onclick="OnGroundDistance()">
+          <img src="./img/TerrainProfile.png" /><!--<br /><span class="i18n" style="font:#2A4EA5">Text5</span>-->
+        </button>
+      </td>
+    </tr>
+  </table>
+
+  <table border="0" width="100%" class="s8w ToolButtonsArea" cellspacing="0" cellpadding="3pt">
+    <tr id="createTRId" style="display: none;">
+      <td>
+        <span class="i18n s8w" style="vertical-align: top;">Text6</span>
+        <input type="checkbox" align="bottom" id="createMeasurementObject" style="width: 25px;" onclick="CreateMeasurementObject();" />
+      </td>
+    </tr>
+    <tr>
+      <td>
+        <span class="i18n s8w" style="vertical-align: top; color: yellow;">Text24</span>
+        <input type="checkbox" id="showAerialDistance" checked align="bottom" style="width: 25px;" onclick="OnShowAerial();" />
+      </td>
+    </tr>
+    <tr>
+      <td>
+        <span class="i18n s8w" style="vertical-align: top; color: white;">Text25</span>
+        <input type="checkbox" id="showHorizontalDistance" align="bottom" style="width: 25px;" onclick="OnShowHorizontal();" />
+      </td>
+    </tr>
+    <tr>
+      <td>
+        <span class="i18n s8w" style="vertical-align: top; color: #FF49E6;">Text26</span>
+        <input type="checkbox" id="showVerticalDistance" align="bottom" style="width: 25px;" onclick="OnShowVertical();" />
+      </td>
+    </tr>
+    <tr>
+      <td class="textarea-container">
+        <style>
+          div.textarea-size {
+            font-size: 12px;
+          }
+        </style>
+        <div class="textarea-size  s8w"></div>
+      </td>
+    </tr>
+    <tr id="unitTRId" style="display: none;">
+      <td>
+        <span id="changeMeasurementUnits" onclick="OnChangeMeasurementUnits()" class="i18n s9w link">Text17</span>
+      </td>
+    </tr>
+  </table>
+
+  <object id="SGWorld" style="display: none" classid="CLSID:3a4f919d-65a8-11d5-85c1-0001023952c1"></object>
+  <script language="javascript" src="../jquery/jquery-3.1.1.min.js"></script>
+  <script language="javascript" src="../ToolsCommon70.js"></script>
+  <script language="JavaScript">
+    //** this is a global variables for the polyline/polygon drawings
+    //var gPolygonText = SGLang.i18n("Text35");
+    //var gPolylineText = SGLang.i18n("Text36");
+    var gDrawPolyClick = null;
+    var gEndDrawPoly = DrawPoly;
+    var gPopupCaption = "";
+
+    var _AERIAL_REG_NAME = "DistanceMeasurementShowAerial";
+    var _HORIZONTAL_REG_NAME = "DistanceMeasurementShowHorizontal";
+    var _VERTICAL_REG_NAME = "DistanceMeasurementShowVertical";
+
+    var bInEdit;
+    var gGeometry = null;
+    //----------------
+    function Init() {
+      SGWorld.AttachEvent("OnMeasurementDistanceResult", OnMeasurementResult);
+      SGWorld.AttachEvent("OnInputModeChanged", OnInputModeChanged);
+      SGWorld.AttachEvent("OnEndDrawMeasurement", OnEndDrawMeasurement);
+      SGWorld.AttachEvent("OnLButtonUp", OnLButtonUp);
+
+      var isPM = GetParamValue("pm", "0");
+      if (isPM == "1") {
+        $("#unitTRId").hide();
+        $("#createTRId").hide();
+        $("#onGroundDistance").hide();
+      }
+      document.getElementById("changeMeasurementUnits").value = SGLang.i18n("");
+      document.getElementById("deleteMeasure").title = SGLang.i18n("Text18");
+      document.getElementById("deleteLastPoint").title = SGLang.i18n("Text19");
+      document.getElementById("snapping").title = SGLang.i18n("Text20");
+      document.getElementById("onGroundDistance").title = SGLang.i18n("Text23");
+
+      ////Turn off CreateMeasurementObject
+      //SGWorld.Command.Execute(2225,0);
+
+      var bCreateMeasurementObject = (isPM == "1") ? false : SGWorld.GetOptionParam("CreateMeasurementObjects");
+      document.getElementById("createMeasurementObject").checked = bCreateMeasurementObject;
+      CreateMeasurementObject();
+
+      Reset(1, 0);
+
+      //SGWorld.Command.Execute(2356, 0);//__TEC_MEASURE_AERIAL_DIST
+      SGWorld.Command.Execute(1035, 0);
+
+      SetSnapping();
+
+      //document.getElementById("showAerialDistance").checked = SGWorld.GetOptionParam(_AERIAL_REG_NAME);
+      //document.getElementById("showHorizontalDistance").checked = SGWorld.GetOptionParam(_HORIZONTAL_REG_NAME);
+      //document.getElementById("showVerticalDistance").checked = SGWorld.GetOptionParam(_VERTICAL_REG_NAME);
+
+      document.getElementById("showHorizontalDistance").checked = true;
+      document.getElementById("showVerticalDistance").checked = true;
+      document.getElementById("showAerialDistance").checked = true;
+
+      //////////////OnShow();
+      EnableDisableButtons();
+      //showVerticalDistance
+    }
+
+    //----------------
+    function ShowPopup(ProfileType, ObjID) {
+      var CompareStr = "";
+      var CompareMode = 0;
+      var Density = 2;
+
+      // Remove previos popup
+      SGWorld.Window.RemovePopupByCaption(gPopupCaption);
+
+      gPopupCaption = SGLang.i18n("Text14") + " " + Date().toString();
+      var url = abspath() + "/../TerrainProfile/TerrainProfilePopup.html?Type=" + ProfileType + "&ObjID=" + ObjID + "&DisableChangeInputMode=1" + "&Density=" + Density + "&Compare=" + CompareMode + CompareStr + "&Caption=" + gPopupCaption + "&lang=" + SGLang.getCode();
+
+      //var path = location.href.substring(0, location.href.lastIndexOf("/") + 1);
+      //var url = path + "../TerrainProfile/TerrainProfilePopup.html?Type=" + ProfileType + "&ObjID=" + ObjID + "&DisableChangeInputMode=1" + "&Density=" + Density + "&Compare=" + CompareMode + CompareStr + "&Caption=" + gPopupCaption + "&lang=" + SGLang.getCode();
+
+      //    var popupMsg = SGWorld.Creator.CreatePopupMessage(gPopupCaption, url, 1, SGWorld.Window.Rect.Height * 2 / 3, SGWorld.Window.Rect.Width - 2, SGWorld.Window.Rect.Height / 3 - 55, -1);
+      var popupMsg = SGWorld.Creator.CreatePopupMessage(gPopupCaption, url, 1, -1000, 100, 100, -1);
+
+      popupMsg.Flags = 2 + 32;
+      SGWorld.Window.ShowPopup(popupMsg);
+    }
+
+    function OnShowAerial() {
+      SGWorld.SetOptionParam(_AERIAL_REG_NAME, document.getElementById("showAerialDistance").checked);
+    }
+
+    function OnShowHorizontal() {
+
+      SGWorld.SetOptionParam(_HORIZONTAL_REG_NAME, document.getElementById("showHorizontalDistance").checked);
+    }
+
+    function OnShowVertical() {
+      SGWorld.SetOptionParam(_VERTICAL_REG_NAME, document.getElementById("showVerticalDistance").checked);
+    }
+
+    function OnUnload() {
+      var measurementMode = SGWorld.GetParam(9916);
+      if (measurementMode == 33326/*ID_MEASURE_HDIST*/ || measurementMode == 33327/*ID_MEASURE_ADIST*/)
+        SGWorld.Window.SetInputMode(0);
+    }
+
+    //-------------
+    // DrawPoly
+    function DrawPoly(geometry, type, altitudeType) {
+      // create a polyline, under the hidden group, using this geometry and send the objID to the popup
+      var lineGroup = SGWorld.ProjectTree.CreateGroup(SGLang.i18n("Text28"), SGWorld.ProjectTree.HiddenGroupID);       // SGWorld.ProjectTree.RootID
+      var line = SGWorld.Creator.CreatePolyline(geometry, "#FC8220", 3, lineGroup, "ProfileLine");
+
+      //line.LineStyle.Width = -4;
+      //line.SetParam(5440, 1);
+      line.Visibility.Show = false;
+
+      ShowPopup(0, lineGroup);
+      return true;
+    }
+
+    function OnDeleteMeasure() {
+      //alert("aa");
+      Reset(0, 0);
+
+      //SGWorld.Command.Execute(2356, 0);//__TEC_MEASURE_AERIAL_DIST
+      SGWorld.Command.Execute(1035, 0);
+
+      EnableDisableButtons();
+      //alert("bb");
+    }
+
+    function OnInputModeChanged(mode) {
+      if (mode == 0) {
+        Reset(0, 0);
+        //SGWorld.Window.RemovePopupByCaption("Distance Measurement");
+      }
+    }
+
+    function OnLButtonUp(Flags, X, Y) {
+      if ((Flags & 0x0400) == 0) {
+        gGeometry = null;
+      }
+      return false;
+    }
+
+    function OnEndDrawMeasurement(geometry) {
+      gGeometry = geometry;
+      EnableDisableButtons();
+    }
+
+    function EnableDisableButtons() {
+      var numPoints = SGWorld.GetParam(9915);
+
+      if (numPoints > 0) {
+        document.getElementById("deleteMeasure").style.opacity = 1;
+      }
+      else {
+        document.getElementById("deleteMeasure").style.opacity = 0.3;
+      }
+
+      if (gGeometry == null) {
+        document.getElementById("deleteLastPoint").style.opacity = 1;
+      }
+      else {
+        document.getElementById("deleteLastPoint").style.opacity = 0.3;
+      }
+
+      var bEnableTerrainProfile = gGeometry != null;
+
+      if (bEnableTerrainProfile) {
+        document.getElementById("onGroundDistance").style.opacity = 1;
+      }
+      else {
+        document.getElementById("onGroundDistance").style.opacity = 0.3;
+      }
+    }
+
+    function OnMeasurementResult(rs, SounrceID) {
+      rs = rs.replace("Total Aerial Distance:", "鎬荤┖涓窛绂伙細")
+        .replace("Total Horizontal Distance:", "鎬绘按骞宠窛绂伙細")
+        .replace("Total Vertical Distance:", "鎬诲瀭鐩磋窛绂伙細")
+        .replace("Total Vertical Distance (First point to last point):", "鎬诲瀭鐩磋窛绂伙紙浠庣涓�鐐瑰埌鏈�鍚庝竴鐐癸級锛�")
+        .replace("Slope:", "鍧″害锛�")
+        .replace("Slope (First point to last point):", "鍧″害锛堜粠绗竴鐐瑰埌鏈�鍚庝竴鐐癸級锛�")
+        .replace(/km/g, " 鍗冪背")
+        .replace(/cm/g, " 鍘樼背")
+        .replace(/mm/g, " 姣背")
+        .replace(/m/g, " 绫�")
+
+      textContainer = document.querySelector('.textarea-container');
+      textareaSize = textContainer.querySelector('.textarea-size');
+      //input = textContainer.querySelector('textarea');
+      //input.value = measurementResult;
+      textareaSize.innerText = rs;
+
+      EnableDisableButtons();
+      return true;
+    }
+
+    function OnChangeMeasurementUnits() {
+      SGWorld.Command.Execute(1011, 3);
+    }
+
+    function CreateMeasurementObject() {
+      var bCreateMeasurementObject = document.getElementById("createMeasurementObject").checked == true;
+      SGWorld.SetOptionParam("CreateMeasurementObjects", bCreateMeasurementObject);
+    }
+
+    function ResetButtons() {
+      //$("#verticalDistance").removeClass("MenuButtonHighlight");
+      $("#onGroundDistance").removeClass("MenuButtonHighlight");
+    }
+
+    //------------------
+    // Reset
+    //------------------
+    function Reset(FirstTime, FromMouseInputMode) {
+      ResetButtons();
+      gGeometry = null;
+      try {
+        if (gPolyObj != null)
+          SGWorld.Creator.DeleteObject(gPolyObj.ID);
+      } catch (e) { }
+
+      gPolyObj = null;
+      GroupID = null;
+
+      bDontAskme = false;
+
+      $("#lineButton").removeClass("MenuButtonHighlight");
+      $("#areaButton").removeClass("MenuButtonHighlight");
+      $("#groupButton").removeClass("MenuButtonHighlight");
+      $("#clipboardButton").removeClass("MenuButtonHighlight");
+
+      SGWorld.ProjectTree.EnableRedraw(1);
+      SGWorld.Window.HideMessageBarText();
+
+      if (bInEdit) {
+        SGWorld.DetachEvent("OnLButtonClicked", DrawPolyLButtonClicked);
+        SGWorld.DetachEvent("OnRButtonUp", DrawPolyRButtonUp);
+        SGWorld.DetachEvent("OnFrame", DrawPolyOnFrame);
+        SGWorld.DetachEvent("OnInputModeChanged", DrawPolyInputModeChanged);
+      }
+      bInEdit = false;
+
+      //if (FirstTime != 1 && FromMouseInputMode == 0)
+      // SGWorld.Window.SetInputMode(0);
+    }
+
+    function OnEndDrawMeasurement(geometry) {
+      gGeometry = geometry;
+      EnableDisableButtons();
+    }
+
+    //--------------
+    // CreateObjects
+    //--------------
+    function OnGroundDistance() {
+
+      DrawPoly(gGeometry, 0, 0);
+      return;
+    }
+
+    function SetSnapping() {
+      if ($("#snapping").hasClass("MenuButtonHighlight"))
+        SGWorld.SetParam(9912, 1);
+      else
+        SGWorld.SetParam(9912, 0);
+    }
+
+    function OnSnapping() {
+      //$("#snapping").removeClass("MenuButtonHighlight");
+
+      if ($(event.srcElement).hasClass("MenuButtonHighlight")) {
+        $("#snapping").removeClass("MenuButtonHighlight");
+        SGWorld.SetParam(9912, 0);
+      }
+      else {
+        SGWorld.SetParam(9912, 1);
+        $(event.srcElement).addClass("MenuButtonHighlight");
+      }
+    }
+
+    /*
+    function OnVerticalDistance()
+    {
+        if( $(event.srcElement).hasClass("MenuButtonHighlight"))
+        {
+            Reset(0,0);
+            return;
+        }
+
+        Reset(0,0);
+        $(event.srcElement).addClass("MenuButtonHighlight");
+        SGWorld.Command.Execute(1036,0);
+
+        SetSnapping();
+    }
+    */
+
+    function OnDeleteLastPoint() {
+      SGWorld.SetParam(8335, 0);
+      EnableDisableButtons();
+    }
+  </script>
+</body>
+</html>
+
+<!--Sig:000000408JYdtBwnEhYwKwSHBToL4ROTBsQ92IumwfiHRg2dcUb.aSdjqmR2hWrrJjiq7xBbYr6MVX764LIe8a6004zvXaJJ-->
diff --git a/TEWin/Resources/DistanceMeasurement/height.html b/TEWin/Resources/DistanceMeasurement/height.html
new file mode 100644
index 0000000..94b17a5
--- /dev/null
+++ b/TEWin/Resources/DistanceMeasurement/height.html
@@ -0,0 +1,435 @@
+锘�<!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; overflow: hidden;" id="Body" class="hideUntillTranslated ToolButtonsArea" onload="Init()" onunload="OnUnload()">
+  <!--oncontextmenu="return false;">  onclick="bHide=true;HideOptionsNow()" > -->
+  <table border="0" width="100%" class="s8w" cellspacing="0" cellpadding="0">
+    <tr class="s8">
+      <td colspan="2" align="left" class="ToolButtonsArea" style="border-bottom: 2px solid #ffffff;">
+        <button id="deleteMeasure" class="MenuButton2" style="border: none;" onclick="OnDeleteMeasure();">
+          <img src="./img/delete.png" /><br />
+          <!--  <span class="i18n">Text0</span> -->
+        </button>
+        <button id="deleteLastPoint" class="MenuButton2" style="border: none;" onclick="OnDeleteLastPoint()">
+          <img src="./img/delete_last_point.png" /><br />
+          <!-- <span class="i18n">Text1</span> -->
+        </button>
+        <button id="snapping" class="MenuButton2" style="border: none;" onclick="OnSnapping()">
+          <img src="./img/snap.png" /><br />
+          <!-- <span class="i18n" style="font:#2A4EA5">Text7</span>-->
+        </button>
+        <button id="onGroundDistance" class="MenuButton2" style="border-left: 2px solid #ffffff; border-right: none; display: none;" onclick="OnGroundDistance()">
+          <img src="./img/TerrainProfile.png" /><!--<br /><span class="i18n" style="font:#2A4EA5">Text5</span>-->
+        </button>
+      </td>
+    </tr>
+  </table>
+
+  <table border="0" width="100%" class="s8w ToolButtonsArea" cellspacing="0" cellpadding="3pt">
+    <tr id="createTRId" style="display: none;">
+      <td>
+        <span class="i18n s8w" style="vertical-align: top;">Text6</span>
+        <input type="checkbox" align="bottom" id="createMeasurementObject" style="width: 25px;" onclick="CreateMeasurementObject();" />
+      </td>
+    </tr>
+    <tr>
+      <td>
+        <span class="i18n s8w" style="vertical-align: top; color: yellow;">Text24</span>
+        <input type="checkbox" id="showAerialDistance" checked align="bottom" style="width: 25px;" onclick="OnShowAerial();" />
+      </td>
+    </tr>
+    <tr>
+      <td>
+        <span class="i18n s8w" style="vertical-align: top; color: white;">Text25</span>
+        <input type="checkbox" id="showHorizontalDistance" align="bottom" style="width: 25px;" onclick="OnShowHorizontal();" />
+      </td>
+    </tr>
+    <tr>
+      <td>
+        <span class="i18n s8w" style="vertical-align: top; color: #FF49E6;">Text26</span>
+        <input type="checkbox" id="showVerticalDistance" align="bottom" style="width: 25px;" onclick="OnShowVertical();" />
+      </td>
+    </tr>
+    <tr>
+      <td class="textarea-container">
+        <style>
+          div.textarea-size {
+            font-size: 12px;
+          }
+        </style>
+        <div class="textarea-size  s8w"></div>
+      </td>
+    </tr>
+    <tr id="unitTRId" style="display: none;">
+      <td>
+        <span id="changeMeasurementUnits" onclick="OnChangeMeasurementUnits()" class="i18n s9w link">Text17</span>
+      </td>
+    </tr>
+  </table>
+
+  <object id="SGWorld" style="display: none" classid="CLSID:3a4f919d-65a8-11d5-85c1-0001023952c1"></object>
+  <script language="javascript" src="../jquery/jquery-3.1.1.min.js"></script>
+  <script language="javascript" src="../ToolsCommon70.js"></script>
+  <script language="JavaScript">
+    //** this is a global variables for the polyline/polygon drawings
+    //var gPolygonText = SGLang.i18n("Text35");
+    //var gPolylineText = SGLang.i18n("Text36");
+    var gDrawPolyClick = null;
+    var gEndDrawPoly = DrawPoly;
+    var gPopupCaption = "";
+
+    var _AERIAL_REG_NAME = "DistanceMeasurementShowAerial";
+    var _HORIZONTAL_REG_NAME = "DistanceMeasurementShowHorizontal";
+    var _VERTICAL_REG_NAME = "DistanceMeasurementShowVertical";
+
+    var bInEdit;
+    var Type = 3;
+    var gGeometry = null;
+    //----------------
+    function Init() {
+      SGWorld.AttachEvent("OnMeasurementDistanceResult", OnMeasurementResult);
+      SGWorld.AttachEvent("OnInputModeChanged", OnInputModeChanged);
+      SGWorld.AttachEvent("OnEndDrawMeasurement", OnEndDrawMeasurement);
+      SGWorld.AttachEvent("OnLButtonUp", OnLButtonUp);
+
+      var isPM = GetParamValue("pm", "0");
+      if (isPM == "1") {
+        $("#unitTRId").hide();
+        $("#createTRId").hide();
+        $("#onGroundDistance").hide();
+      }
+      document.getElementById("changeMeasurementUnits").value = SGLang.i18n("");
+      document.getElementById("deleteMeasure").title = SGLang.i18n("Text18");
+      document.getElementById("deleteLastPoint").title = SGLang.i18n("Text19");
+      document.getElementById("snapping").title = SGLang.i18n("Text20");
+      document.getElementById("onGroundDistance").title = SGLang.i18n("Text23");
+
+      ////Turn off CreateMeasurementObject
+      //SGWorld.Command.Execute(2225,0);
+
+      //var bCreateMeasurementObject = (isPM == "1") ? false : SGWorld.GetOptionParam("CreateMeasurementObjects");
+      //document.getElementById("createMeasurementObject").checked = bCreateMeasurementObject;
+      document.getElementById("createMeasurementObject").checked = false;
+      CreateMeasurementObject();
+
+      Reset(1, 0);
+
+      //SGWorld.Command.Execute(2356, 0);//__TEC_MEASURE_AERIAL_DIST
+      SGWorld.Command.Execute(1035, 0);
+
+      SetSnapping();
+
+      //document.getElementById("showAerialDistance").checked = SGWorld.GetOptionParam(_AERIAL_REG_NAME);
+      //document.getElementById("showHorizontalDistance").checked = SGWorld.GetOptionParam(_HORIZONTAL_REG_NAME);
+      //document.getElementById("showVerticalDistance").checked = SGWorld.GetOptionParam(_VERTICAL_REG_NAME);
+
+      Type = getQueryStr("type");
+      if (Type == "1") {
+        document.getElementById("showHorizontalDistance").checked = true;
+        document.getElementById("showVerticalDistance").checked = false;
+        document.getElementById("showAerialDistance").checked = false;
+      } else if (Type == "2") {
+        document.getElementById("showHorizontalDistance").checked = false;
+        document.getElementById("showVerticalDistance").checked = true;
+        document.getElementById("showAerialDistance").checked = false;
+      } else {
+        document.getElementById("showHorizontalDistance").checked = true;
+        document.getElementById("showVerticalDistance").checked = true;
+        document.getElementById("showAerialDistance").checked = true;
+      }
+      OnShowAerial();
+      OnShowHorizontal();
+      OnShowVertical();
+
+      //////////////OnShow();
+      EnableDisableButtons();
+      //showVerticalDistance
+    }
+
+    function getQueryStr(name) {
+      var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
+      var r = window.location.search.substr(1).match(reg);
+      if (r != null) {
+        return unescape(r[2]);
+      }
+      return null;
+    }
+
+    //----------------
+    function ShowPopup(ProfileType, ObjID) {
+      var CompareStr = "";
+      var CompareMode = 0;
+      var Density = 2;
+
+      // Remove previos popup
+      SGWorld.Window.RemovePopupByCaption(gPopupCaption);
+
+      gPopupCaption = SGLang.i18n("Text14") + " " + Date().toString();
+      var url = abspath() + "/../TerrainProfile/TerrainProfilePopup.html?Type=" + ProfileType + "&ObjID=" + ObjID + "&DisableChangeInputMode=1" + "&Density=" + Density + "&Compare=" + CompareMode + CompareStr + "&Caption=" + gPopupCaption + "&lang=" + SGLang.getCode();
+
+      //var path = location.href.substring(0, location.href.lastIndexOf("/") + 1);
+      //var url = path + "../TerrainProfile/TerrainProfilePopup.html?Type=" + ProfileType + "&ObjID=" + ObjID + "&DisableChangeInputMode=1" + "&Density=" + Density + "&Compare=" + CompareMode + CompareStr + "&Caption=" + gPopupCaption + "&lang=" + SGLang.getCode();
+
+      //    var popupMsg = SGWorld.Creator.CreatePopupMessage(gPopupCaption, url, 1, SGWorld.Window.Rect.Height * 2 / 3, SGWorld.Window.Rect.Width - 2, SGWorld.Window.Rect.Height / 3 - 55, -1);
+      var popupMsg = SGWorld.Creator.CreatePopupMessage(gPopupCaption, url, 1, -1000, 100, 100, -1);
+
+      popupMsg.Flags = 2 + 32;
+      SGWorld.Window.ShowPopup(popupMsg);
+    }
+
+    function OnShowAerial() {
+      SGWorld.SetOptionParam(_AERIAL_REG_NAME, document.getElementById("showAerialDistance").checked);
+    }
+
+    function OnShowHorizontal() {
+
+      SGWorld.SetOptionParam(_HORIZONTAL_REG_NAME, document.getElementById("showHorizontalDistance").checked);
+    }
+
+    function OnShowVertical() {
+      SGWorld.SetOptionParam(_VERTICAL_REG_NAME, document.getElementById("showVerticalDistance").checked);
+    }
+
+    function OnUnload() {
+      var measurementMode = SGWorld.GetParam(9916);
+      if (measurementMode == 33326/*ID_MEASURE_HDIST*/ || measurementMode == 33327/*ID_MEASURE_ADIST*/)
+        SGWorld.Window.SetInputMode(0);
+    }
+
+    //-------------
+    // DrawPoly
+    function DrawPoly(geometry, type, altitudeType) {
+      // create a polyline, under the hidden group, using this geometry and send the objID to the popup
+      var lineGroup = SGWorld.ProjectTree.CreateGroup(SGLang.i18n("Text28"), SGWorld.ProjectTree.HiddenGroupID);       // SGWorld.ProjectTree.RootID
+      var line = SGWorld.Creator.CreatePolyline(geometry, "#FC8220", 3, lineGroup, "ProfileLine");
+
+      //line.LineStyle.Width = -4;
+      //line.SetParam(5440, 1);
+      line.Visibility.Show = false;
+
+      ShowPopup(0, lineGroup);
+      return true;
+    }
+
+    function OnDeleteMeasure() {
+      //alert("aa");
+      Reset(0, 0);
+
+      //SGWorld.Command.Execute(2356, 0);//__TEC_MEASURE_AERIAL_DIST
+      SGWorld.Command.Execute(1035, 0);
+
+      EnableDisableButtons();
+      //alert("bb");
+    }
+
+    function OnInputModeChanged(mode) {
+      if (mode == 0) {
+        Reset(0, 0);
+        //SGWorld.Window.RemovePopupByCaption("Distance Measurement");
+      }
+    }
+
+    function OnLButtonUp(Flags, X, Y) {
+      if ((Flags & 0x0400) == 0) {
+        gGeometry = null;
+      }
+      return false;
+    }
+
+    function OnEndDrawMeasurement(geometry) {
+      gGeometry = geometry;
+      EnableDisableButtons();
+    }
+
+    function EnableDisableButtons() {
+      var numPoints = SGWorld.GetParam(9915);
+
+      if (numPoints > 0) {
+        document.getElementById("deleteMeasure").style.opacity = 1;
+      }
+      else {
+        document.getElementById("deleteMeasure").style.opacity = 0.3;
+      }
+
+      if (gGeometry == null) {
+        document.getElementById("deleteLastPoint").style.opacity = 1;
+      }
+      else {
+        document.getElementById("deleteLastPoint").style.opacity = 0.3;
+      }
+
+      var bEnableTerrainProfile = gGeometry != null;
+
+      if (bEnableTerrainProfile) {
+        document.getElementById("onGroundDistance").style.opacity = 1;
+      }
+      else {
+        document.getElementById("onGroundDistance").style.opacity = 0.3;
+      }
+    }
+
+    function OnMeasurementResult(rs, SounrceID) {
+      rs = rs.replace("Total Aerial Distance:", "鎬荤┖涓窛绂伙細")
+        .replace("Total Horizontal Distance:", "鎬绘按骞宠窛绂伙細")
+        .replace("Total Vertical Distance:", "鎬诲瀭鐩磋窛绂伙細")
+        .replace("Total Vertical Distance (First point to last point):", "鎬诲瀭鐩磋窛绂伙紙浠庣涓�鐐瑰埌鏈�鍚庝竴鐐癸級锛�")
+        .replace("Slope:", "鍧″害锛�")
+        .replace("Slope (First point to last point):", "鍧″害锛堜粠绗竴鐐瑰埌鏈�鍚庝竴鐐癸級锛�")
+        .replace(/km/g, " 鍗冪背")
+        .replace(/cm/g, " 鍘樼背")
+        .replace(/mm/g, " 姣背")
+        .replace(/m/g, " 绫�")
+
+      textContainer = document.querySelector('.textarea-container');
+      textareaSize = textContainer.querySelector('.textarea-size');
+      //input = textContainer.querySelector('textarea');
+      //input.value = measurementResult;
+      textareaSize.innerText = rs;
+
+      window.strs = rs.replace(/\t/g, "").replace(/s+/g, "").split("\n"); //.replace(/\\r/g, "")
+      switch (Type) {
+        //case "1":
+        //  var dis = strs[1].split("锛�")[1].replace("\r", "").split(" ")[0];
+        //  setText(2, dis);
+        //  break;
+        case "2":
+          var ver = strs[2].split("锛�")[1].replace("\r", "").split(" ")[0];
+          setText(5, ver);
+          break;
+        //default:
+        //  var angle = strs[3].split("锛�")[1].replace("掳", "");
+        //  setText(4, angle);
+        //  break;
+      }
+
+      EnableDisableButtons();
+      return true;
+    }
+
+    function setText(idx, val) {
+      var txtId = SGWorld.ProjectTree.FindItem("瀹氫綅鐐筡\Text");
+      if (txtId) {
+        var obj = SGWorld.ProjectTree.GetObject(txtId);
+        var strs = obj.Text.split(","); // 0,0,0,0,0,0,0
+        strs[idx] = val;
+        obj.Text = strs.join(",");
+      }
+    }
+
+    function OnChangeMeasurementUnits() {
+      SGWorld.Command.Execute(1011, 3);
+    }
+
+    function CreateMeasurementObject() {
+      var bCreateMeasurementObject = document.getElementById("createMeasurementObject").checked == true;
+      SGWorld.SetOptionParam("CreateMeasurementObjects", bCreateMeasurementObject);
+    }
+
+    function ResetButtons() {
+      //$("#verticalDistance").removeClass("MenuButtonHighlight");
+      $("#onGroundDistance").removeClass("MenuButtonHighlight");
+    }
+
+    //------------------
+    // Reset
+    //------------------
+    function Reset(FirstTime, FromMouseInputMode) {
+      ResetButtons();
+      gGeometry = null;
+      try {
+        if (gPolyObj != null)
+          SGWorld.Creator.DeleteObject(gPolyObj.ID);
+      } catch (e) { }
+
+      gPolyObj = null;
+      GroupID = null;
+
+      bDontAskme = false;
+
+      $("#lineButton").removeClass("MenuButtonHighlight");
+      $("#areaButton").removeClass("MenuButtonHighlight");
+      $("#groupButton").removeClass("MenuButtonHighlight");
+      $("#clipboardButton").removeClass("MenuButtonHighlight");
+
+      SGWorld.ProjectTree.EnableRedraw(1);
+      SGWorld.Window.HideMessageBarText();
+
+      if (bInEdit) {
+        SGWorld.DetachEvent("OnLButtonClicked", DrawPolyLButtonClicked);
+        SGWorld.DetachEvent("OnRButtonUp", DrawPolyRButtonUp);
+        SGWorld.DetachEvent("OnFrame", DrawPolyOnFrame);
+        SGWorld.DetachEvent("OnInputModeChanged", DrawPolyInputModeChanged);
+      }
+      bInEdit = false;
+
+      //if (FirstTime != 1 && FromMouseInputMode == 0)
+      // SGWorld.Window.SetInputMode(0);
+    }
+
+    function OnEndDrawMeasurement(geometry) {
+      gGeometry = geometry;
+      EnableDisableButtons();
+    }
+
+    //--------------
+    // CreateObjects
+    //--------------
+    function OnGroundDistance() {
+
+      DrawPoly(gGeometry, 0, 0);
+      return;
+    }
+
+    function SetSnapping() {
+      if ($("#snapping").hasClass("MenuButtonHighlight"))
+        SGWorld.SetParam(9912, 1);
+      else
+        SGWorld.SetParam(9912, 0);
+    }
+
+    function OnSnapping() {
+      //$("#snapping").removeClass("MenuButtonHighlight");
+
+      if ($(event.srcElement).hasClass("MenuButtonHighlight")) {
+        $("#snapping").removeClass("MenuButtonHighlight");
+        SGWorld.SetParam(9912, 0);
+      }
+      else {
+        SGWorld.SetParam(9912, 1);
+        $(event.srcElement).addClass("MenuButtonHighlight");
+      }
+    }
+
+    /*
+    function OnVerticalDistance()
+    {
+        if( $(event.srcElement).hasClass("MenuButtonHighlight"))
+        {
+            Reset(0,0);
+            return;
+        }
+
+        Reset(0,0);
+        $(event.srcElement).addClass("MenuButtonHighlight");
+        SGWorld.Command.Execute(1036,0);
+
+        SetSnapping();
+    }
+    */
+
+    function OnDeleteLastPoint() {
+      SGWorld.SetParam(8335, 0);
+      EnableDisableButtons();
+    }
+  </script>
+</body>
+</html>
+
+<!--Sig:000000408JYdtBwnEhYwKwSHBToL4ROTBsQ92IumwfiHRg2dcUb.aSdjqmR2hWrrJjiq7xBbYr6MVX764LIe8a6004zvXaJJ-->
diff --git a/TEWin/Resources/DistanceMeasurement/img/TerrainProfile.png b/TEWin/Resources/DistanceMeasurement/img/TerrainProfile.png
new file mode 100644
index 0000000..39c351c
--- /dev/null
+++ b/TEWin/Resources/DistanceMeasurement/img/TerrainProfile.png
Binary files differ
diff --git a/TEWin/Resources/DistanceMeasurement/img/aerial.png b/TEWin/Resources/DistanceMeasurement/img/aerial.png
new file mode 100644
index 0000000..d90373b
--- /dev/null
+++ b/TEWin/Resources/DistanceMeasurement/img/aerial.png
Binary files differ
diff --git a/TEWin/Resources/DistanceMeasurement/img/delete.png b/TEWin/Resources/DistanceMeasurement/img/delete.png
new file mode 100644
index 0000000..816806b
--- /dev/null
+++ b/TEWin/Resources/DistanceMeasurement/img/delete.png
Binary files differ
diff --git a/TEWin/Resources/DistanceMeasurement/img/delete_last_point.png b/TEWin/Resources/DistanceMeasurement/img/delete_last_point.png
new file mode 100644
index 0000000..92b1e82
--- /dev/null
+++ b/TEWin/Resources/DistanceMeasurement/img/delete_last_point.png
Binary files differ
diff --git a/TEWin/Resources/DistanceMeasurement/img/horizontal.png b/TEWin/Resources/DistanceMeasurement/img/horizontal.png
new file mode 100644
index 0000000..d46a055
--- /dev/null
+++ b/TEWin/Resources/DistanceMeasurement/img/horizontal.png
Binary files differ
diff --git a/TEWin/Resources/DistanceMeasurement/img/snap.png b/TEWin/Resources/DistanceMeasurement/img/snap.png
new file mode 100644
index 0000000..ce82070
--- /dev/null
+++ b/TEWin/Resources/DistanceMeasurement/img/snap.png
Binary files differ
diff --git a/TEWin/Resources/DistanceMeasurement/img/verticle.png b/TEWin/Resources/DistanceMeasurement/img/verticle.png
new file mode 100644
index 0000000..822e64e
--- /dev/null
+++ b/TEWin/Resources/DistanceMeasurement/img/verticle.png
Binary files differ
diff --git a/TEWin/Resources/SlopeMapQuery/2052/Lang.js b/TEWin/Resources/SlopeMapQuery/2052/Lang.js
new file mode 100644
index 0000000..c70e381
--- /dev/null
+++ b/TEWin/Resources/SlopeMapQuery/2052/Lang.js
@@ -0,0 +1,35 @@
+锘縎GLang.lang = $.extend(SGLang.lang,{
+    ToolTitle: "娉扮憺鏁板垱绉戞妧锛堝寳浜級鏈夐檺鍏徃",
+    ToolName: "鍧″害鍒嗘瀽",
+    help: "甯姪",
+    Text0: "鍒涘缓涓�",
+    Text1: "缁�",
+    Text2: "鍥惧眰 (灞傛柟寮�)",
+    Text3: "鍥惧眰 (娴佹柟寮�)",
+    Text8: "闂磋窛",
+    Text9: "绫�",
+    Text13: "鍧″害鍒嗘瀽",
+    Text16: "鍦ㄥ湴褰笂鍗曞嚮宸﹂敭鍒涘缓涓�涓杈瑰舰/鎶樼嚎锛屽彸閿粨鏉熸搷浣溿��",
+    Text18: "璺熼殢 <br>绾�",
+    Text19: "姝e湪璁$畻鏌ヨ鐐�",
+    Text20: "鍧″害鍒嗘瀽宸ュ叿鍗冲皢鍒涘缓澶氫簬 ",
+    Text21: " 瀵硅薄銆傝繖涓繃绋嬩細鑺辫垂寰堥暱鏃堕棿锛屾槸鍚﹁缁х画锛�",
+    Text24: "璇蜂粠宸ョ▼鏍戜笂閫夋嫨涓�涓粍鎴栦竴涓浘灞�",
+    Text25: "璁$畻鍧″害鍊兼椂鍑洪敊銆�",
+    Text26: "姝e湪璁$畻鍧″害鐐�",
+    Text27: "鐐�",
+    Text31: "姝e湪鍒嗘瀽鐐� ",
+    Text32: "鍙璺濈",
+    Text33: "璺熼殢绾�",
+    Text34: "濉厖鍖哄煙",
+    Text35: "閫夋嫨<br>缁�",
+    Text36: "浠�<br>鍓创鏉�",
+    Text43: "鍧″害鍊�",
+    Text44: "鍧″悜",
+    Text45: "楂樺害",
+    Text46: "IconColor",
+    Text47: "鏃犳硶鍒涘缓鍧″害鍒嗘瀽銆傞�夋嫨鐨勭粍涓病鏈夐潰/绾垮璞�",
+    Text48: "鏃犳硶鍒涘缓鍧″害鍒嗘瀽銆傚壀璐存澘涓病鏈夐潰/绾垮璞�",
+
+    Text999: ""
+});
\ No newline at end of file
diff --git a/TEWin/Resources/SlopeMapQuery/SlopeMapQuery.html b/TEWin/Resources/SlopeMapQuery/SlopeMapQuery.html
new file mode 100644
index 0000000..35d2284
--- /dev/null
+++ b/TEWin/Resources/SlopeMapQuery/SlopeMapQuery.html
@@ -0,0 +1,621 @@
+锘�<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+  <meta http-equiv="X-UA-Compatible" content="IE=9" />
+  <title>ToolTitle</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+  <link rel="StyleSheet" href="../Style.css" type="text/css">
+  <style>
+    ol {
+      padding: 0;
+      margin: 5px 0 0 0;
+    }
+  </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 class="s8b">
+              <label for="createAs" class="i18n">Text0</label>
+            </td>
+            <td align="left">
+              &nbsp;<select id="createAs">
+                <option class="i18n" value="Layer">Text2</option>
+                <option class="i18n" value="LayerStreaming" selected="selected">Text3</option>
+              </select>
+            </td>
+          </tr>
+          <tr class='TableOtherLine'>
+            <!-- Distance between points-->
+            <td class="s8b ">
+              <span id="DistanceText" class="i18n">Text8</span>
+            </td>
+            <td align="left">
+              &nbsp;<input id="distance" type="text" value="10" size="7" onchange="CheckNumberEx(distance,10,0.01,999999)" />
+              <span class="i18n">Text9</span>
+            </td>
+          </tr>
+        </table>
+    <tr class="s8">
+      <td colspan="2" align="center" class="ToolButtonsArea">
+        <button id="areaButton" class="MenuButton" onclick="CreateObjects(2);"><img src="../CommonImg/polygon.png" /><br /><span class="i18n">Text34</span></button>
+        <button id="lineButton" class="MenuButton MenuButtonLast" onclick="CreateObjects(1);">               <img src="../CommonImg/polyline.png" /><br />         <span class="i18n">Text33</span></button>
+        <!--<button id="groupButton" class="MenuButton" onclick="SelectGroupObjects()"><img src="../CommonImg/group.png" /><br /><span class="i18n">Text35</span></button>
+        <button id="clipboardButton" class="MenuButton MenuButtonLast" onclick="SelectClipboardObjects()"><img src="../CommonImg/clipboard.png" /><br /><span class="i18n">Text36</span></button>-->
+      </td>
+    </tr>
+  </table>
+  <div>
+    <ol class="msonormal">
+      <li style="list-style-type: none;">鍥句緥璇存槑锛�</li>
+      <li>澶╄摑鑹� = 鍧″害鍊间綆浜�6搴�</li>
+      <li>钃濊壊 = 鍧″害鍊煎湪6-17搴︿箣闂�</li>
+      <li>缁胯壊 = 鍧″害鍊煎湪12-31搴︿箣闂�</li>
+      <li>榛勮壊 = 鍧″害鍊煎湪31-38搴︿箣闂�</li>
+      <li>姗欒壊 = 鍧″害鍊煎湪38-45搴︿箣闂�</li>
+      <li>绾㈣壊 = 鍧″害鍊煎ぇ浜�45搴�</li>
+    </ol>
+  </div>
+
+
+  <script src="../jquery/jquery-1.10.2.js" type="text/javascript"></script>
+  <script language="javascript" src="../ToolsCommon73.js"></script>
+
+  <script language="JavaScript">
+    var SGWorld = new ActiveXObject("TerraExplorerX.SGWorld71");
+
+
+    //** this is a global variables for the polyline/polygon drawings
+    var gPolyObj = null;
+    var gPolygonText = SGLang.i18n("Text35");
+    var gPolylineText = SGLang.i18n("Text36");
+    var gDrawPolyClick = null;
+    var gEndDrawPoly = DrawPoly;
+
+    //**
+
+    var gFoundLine = false;
+    var PointLayer;
+    var gPositionsArray = [];
+    var gSlopeValueArray = [];
+    var gSlopeDirectionArray = [];
+    var gAltitudeArray = [];
+    var gPointsIndex = 0;
+    var gVisibilityDistance;
+
+    var bInEdit;
+    var bFirstTime;
+    var bDontAskme;
+    ///var gTotalHours;
+    var rootId;
+
+    Date.prototype.stdTimezoneOffset = function () {
+      var jan = new Date(this.getFullYear(), 0, 1);
+      var jul = new Date(this.getFullYear(), 6, 1);
+      return Math.max(jan.getTimezoneOffset(), jul.getTimezoneOffset());
+    }
+
+    Date.prototype.dst = function () {
+      return this.getTimezoneOffset() < this.stdTimezoneOffset();
+    }
+
+    //--------------
+    // Init
+    function Init() {
+      if (GetParamValue("inSG", "") == "1") {
+        $("#TopAreaTD").attr("height", "57");
+        $("#TitleTD").attr("align", "left");
+        $("#CloseHelpTd").attr("display", "none");
+      }
+      gDrawPolyAltitudeType = 3; // draw lines and polygon as absolute lines
+      rootId = getGid(); //GetParamValue("rootId", SGWorld.ProjectTree.RootID);
+      Reset(1, 0);
+    }
+    function getGid() {
+      var gid = SGWorld.ProjectTree.FindItem("鐢ㄦ埛鏁版嵁\\涓存椂鏁版嵁");
+      if (!gid) {
+        var pid = SGWorld.ProjectTree.FindItem("鐢ㄦ埛鏁版嵁");
+        if (!pid) {
+          pid = SGWorld.ProjectTree.CreateGroup("鐢ㄦ埛鏁版嵁", "");
+        }
+        gid = SGWorld.ProjectTree.CreateGroup("涓存椂鏁版嵁", pid);
+      }
+
+      return gid;
+    }
+    //------------------
+    // Reset
+    //------------------
+    function Reset(FirstTime, FromMouseInputMode) {
+
+      try {
+        if (gPolyObj != null)
+          SGWorld.Creator.DeleteObject(gPolyObj.ID);
+      } catch (e) { }
+
+      if (gPointsIndex > 0) {
+        if (AnalyzePoints())
+          DrawPoints();
+      }
+
+      if (PointLayer != null) {
+        PointLayer.Save();
+      }
+      gPolyObj = null;
+      GroupID = null;
+      PointLayer = null;
+      gPointsIndex = 0;
+      gPositionsArray = [];
+      gSlopeValueArray = [];
+      gSlopeDirectionArray = [];
+      gAltitudeArray = [];
+
+      //    gSlopeArray = [];
+      gVisibilityDistance = 3000;
+
+      bDontAskme = false;
+
+      $("#lineButton").removeClass("MenuButtonHighlight");
+      $("#areaButton").removeClass("MenuButtonHighlight");
+      $("#groupButton").removeClass("MenuButtonHighlight");
+      $("#clipboardButton").removeClass("MenuButtonHighlight");
+
+      SGWorld.ProjectTree.EnableRedraw(1);
+      SGWorld.Window.HideMessageBarText();
+
+      bInEdit = false;
+
+      if (FirstTime != 1 && FromMouseInputMode == 0)
+        SGWorld.Window.SetInputMode(0);
+    }
+    //--------------
+    // CreateObjects
+    //--------------
+    function CreateObjects(method) {
+      if (!bInEdit) {
+        bInEdit = true;
+
+
+        if (drawing.drawingEditMode != -1) {   // already in drawing . Reset everyting
+          drawing.abort();
+        }
+        else {
+          SGWorld.Window.ShowMessageBarText(SGLang.i18n("Text16"), -1);
+          $(event.srcElement).addClass("MenuButtonHighlight");
+          if (method == 1) {
+            drawing.drawPolyline({
+              style: {
+                lineColor: "#ffffff",
+                lineWidth: 3,
+              },
+              altitudeMethod: 3,   // altitudeMethod - use 2 of "OnTerrain" (drape on terrain) and 3 for "Absolute" (above mean sea level). Currently other methods are not supported
+              deleteWhenExit: true, //
+              //parentGoupID: volumeGroup,
+              saveOnExit: false,  // save the polyline/polygon when exiting the project. Default = false
+              onFinish: DrawPoly,
+              onAbort: Reset
+            });
+          }
+          else {
+            drawing.drawPolygon({
+              style: {
+                lineColor: "#ffffff",
+                lineWidth: 3,
+              },
+              altitudeMethod: 3,   // altitudeMethod - use 2 of "OnTerrain" (drape on terrain) and 3 for "Absolute" (above mean sea level). Currently other methods are not supported
+              deleteWhenExit: true, //
+              //parentGoupID: volumeGroup,
+              saveOnExit: false,  // save the polyline/polygon when exiting the project. Default = false
+              onFinish: DrawPoly,
+              onAbort: Reset
+            });
+          }
+        }
+      }
+    }
+    //-----------
+    // SelectGroupObjects
+    function SelectGroupObjects() {
+      var node = SGWorld.ProjectTree.GetNextItem("", 10);
+      if (node == 0 || !(SGWorld.ProjectTree.IsGroup(node) || SGWorld.ProjectTree.IsLayer(node))) {
+        alert(SGLang.i18n("Text24"));
+        return;
+      }
+      $(event.srcElement).addClass("MenuButtonHighlight");
+      SGWorld.Window.ShowMessageBarText(SGLang.i18n("Text19"));
+      gFoundLine = false;
+      searchGeometries2(node, DrawPoly);
+      if (!gFoundLine)
+        alert(SGLang.i18n("Text47"));
+
+      Reset(0, 0);
+    }
+    //-----------
+    // SelectClipboardObjects
+    function SelectClipboardObjects() {
+
+      $(event.srcElement).addClass("MenuButtonHighlight");
+      SGWorld.Window.ShowMessageBarText(SGLang.i18n("Text19"), -1);
+      gFoundLine = false;
+      searchGeometriesClipboard(DrawPoly);
+      if (!gFoundLine)
+        alert(SGLang.i18n("Text48"));
+      Reset(0, 0);
+    }
+
+    //-------------
+    // DrawPoly
+    function DrawPoly(geometry, type, altitudeType) {
+
+      SGWorld.Window.ShowMessageBarText(SGLang.i18n("Text19"));
+      SGWorld.ProjectTree.EnableRedraw(0);
+
+      if (!ValidateInput())
+        return false;
+
+      if (type == 1) {
+        if (!DrawOnPolyline(geometry, type, altitudeType))
+          return false;
+      }
+      else if (type == 2) {
+        if (!DrawOnPolygon(geometry, type, altitudeType))
+          return false;
+      }
+      else // Selected points
+      {
+        var tmpCoord = geometry.Copy(); // to avoid changes in the CurrCoord value in the DrawObject function
+        //AddPoint(tmpCoord);
+
+      }
+
+
+      return true;
+
+    }
+    //----
+    // DrawOnPolyline
+    function DrawOnPolyline(polylineGeometry, type, altitudeType) {
+      var lastCoord;
+      var currCoord;
+      var tmpCoord;
+      var SegmentLength;
+      var lastSegmentLenght;
+      gFoundLine = true;
+      var distance = validateNumber($("#distance").val());
+      var LeftOver = 0;
+      var totlaDistance = 0;
+
+      for (var k = 1; k < polylineGeometry.Points.count; k++)   // calculate total distance
+      {
+        lastCoord = SGWorld.Creator.CreatePosition(polylineGeometry.Points.Item(k - 1).X, polylineGeometry.Points.Item(k - 1).Y, polylineGeometry.Points.Item(k - 1).Z, altitudeType);
+        currCoord = SGWorld.Creator.CreatePosition(polylineGeometry.Points.Item(k).X, polylineGeometry.Points.Item(k).Y, polylineGeometry.Points.Item(k).Z, altitudeType);
+        totlaDistance += lastCoord.DistanceTo(currCoord);
+      }
+
+      var firstSegment = true;
+      for (var i = 1; i < polylineGeometry.Points.count; i++) {
+        lastCoord = SGWorld.Creator.CreatePosition(polylineGeometry.Points.Item(i - 1).X, polylineGeometry.Points.Item(i - 1).Y, polylineGeometry.Points.Item(i - 1).Z, altitudeType);
+        currCoord = SGWorld.Creator.CreatePosition(polylineGeometry.Points.Item(i).X, polylineGeometry.Points.Item(i).Y, polylineGeometry.Points.Item(i).Z, altitudeType);
+
+        lastCoord.yaw = lastCoord.AimTo(currCoord).yaw;
+        lastCoord = lastCoord.MoveToward(currCoord, -LeftOver);
+
+        if (firstSegment) {
+          tmpCoord = lastCoord.Copy();
+          if (AddToPointsList(tmpCoord) == false)
+            return false;
+        }
+        SegmentLength = lastCoord.DistanceTo(currCoord);
+        lastSegmentLenght = SegmentLength;
+
+        while (SegmentLength >= distance && lastSegmentLenght >= SegmentLength) {
+          lastSegmentLenght = SegmentLength;
+          lastCoord = lastCoord.MoveToward(currCoord, distance);
+          tmpCoord = lastCoord.Copy();
+          if (AddToPointsList(tmpCoord) == false)
+            return false;
+          SegmentLength = lastCoord.DistanceTo(currCoord);
+        }
+
+        LeftOver = SegmentLength;
+
+        firstSegment = false;
+      }
+      // fix for bug #14439
+      //Restore3DModelToGroundObject();
+      return true;
+    }
+    //-----------
+    // DrawOnPolygon
+    function DrawOnPolygon(polygonGeometry, type, altitudeType) {
+      var envelope = polygonGeometry.Envelope; // Multi polygon evnelope (min/max)
+
+      gFoundLine = true;
+      //// var pos = SGWorld.Navigate.GetPosition();
+      CreateTheObjects = true;
+      var MinX = Math.min(envelope.Rings(0).Points(0).x, envelope.Rings(0).Points(2).x);
+      var MaxX = Math.max(envelope.Rings(0).Points(0).x, envelope.Rings(0).Points(2).x);
+      var MinY = Math.min(envelope.Rings(0).Points(0).y, envelope.Rings(0).Points(2).y);
+      var MaxY = Math.max(envelope.Rings(0).Points(0).y, envelope.Rings(0).Points(2).y);
+
+      var XDist = SGWorld.CoordServices.GetDistance(MinX, MinY, MaxX, MinY);
+      var YDist = SGWorld.CoordServices.GetDistance(MinX, MinY, MinX, MaxY);
+      var distanceVal = validateNumber($("#distance").val());
+
+      var currCoord;
+      switch (polygonGeometry.GeometryType) {
+        case 3: // ipolygon
+          currCoord = SGWorld.Creator.CreatePosition(MinX, MinY, polygonGeometry.Rings(0).Points.Item(0).Z, altitudeType, 0);
+          break;
+        case 6: // imultipolygon
+          currCoord = SGWorld.Creator.CreatePosition(MinX, MinY, polygonGeometry.Item(0).Rings(0).Points.Item(0).Z, altitudeType, 0);
+          break;
+      }
+
+      var currCoordAlt = currCoord.Altitude;
+
+      while (currCoord.x < MaxX) {
+        currCoord.y = MinY;
+        while (currCoord.y < MaxY) {
+          var pointGeometry = SGWorld.Creator.GeometryCreator.CreatePointGeometry([currCoord.x, currCoord.y, currCoord.Altitude]);
+          if (polygonGeometry.SpatialRelation.Intersects(pointGeometry)) {
+            var tmpCoord = currCoord.Copy(); // to avoid changes in the CurrCoord value in the DrawObject function
+            if (AddToPointsList(tmpCoord) == false)
+              return false;
+          }
+          currCoord = currCoord.Move(distanceVal, 0, 0);
+          currCoord.Altitude = currCoordAlt;
+        }
+        currCoord = currCoord.Move(distanceVal, 90, 0);
+        currCoord.Altitude = currCoordAlt;
+      }
+
+      return true;
+    }
+    //------------
+    //  AddToPointsList
+    function AddToPointsList(position) {
+      position.Altitude = 0;
+      position.AltitudeType = 0;
+      AddPoint(position);
+    }
+    //-------------
+    // AddPoint
+    function AddPoint(pos) {
+      var position1 = pos.ToAbsolute(0);
+      gPositionsArray[gPointsIndex] = position1;
+      gSlopeValueArray[gPointsIndex] = 0;
+      gSlopeDirectionArray[gPointsIndex] = 0;
+      gAltitudeArray[gPointsIndex] = 0;
+      gPointsIndex += 1;
+      if (gPointsIndex % 10 == 0)
+        SGWorld.Window.ShowMessageBarText(SGLang.i18n("Text19") + ": " + gPointsIndex);
+
+    }
+    //------------
+    //  AnalyzePoints
+    function AnalyzePoints() {
+      var totalPoints = gPointsIndex;
+      var CreateTheObjects = true;
+      if (totalPoints > 20000)
+        CreateTheObjects = confirm(SGLang.i18n("Text20") + totalPoints + SGLang.i18n("Text21"));
+      if (!CreateTheObjects)
+        return false;
+      for (var i = 0; i < gPointsIndex; i++) {
+        CalculateSlope(i);
+      }
+
+      return true;
+    }
+    //------------
+    //CalculateSlope
+    function CalculateSlope(slopeIndex) {
+      try {
+
+        var pos = gPositionsArray[slopeIndex].Copy();
+        var distance = validateNumber($("#distance").val());
+
+        var slopeSampling = 20;
+        var getGroundHeighType = 2;
+
+
+        //Groud height in mouse location
+        var groundInfo = SGWorld.Terrain.GetGroundHeightInfo(pos.X, pos.Y, getGroundHeighType, true);
+        gPositionsArray[slopeIndex].Altitude = groundInfo.Position.Altitude
+        //Ground Height around mouse location
+        var i;
+        var maxPositiveAlt = -9999999;
+        var maxPositivePos;
+        var maxNegativeAlt = 9999999;
+        var maxNegativePos;
+        var destGroundInfo;
+        var headingPos;
+        var newPos = pos.Copy();
+        // find min/max slopes
+        for (i = 0; i < 360; i = i + slopeSampling) {
+          newPos = pos.Copy();
+          newPos.Yaw = i;
+          SGWorld.CoordServices.MoveCoordEx(newPos, distance / 2, 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();
+          }
+        }
+
+
+        maxPositivePos = maxPositivePos.AimTo(maxNegativePos);
+        gSlopeValueArray[slopeIndex] = maxPositivePos.Pitch.toFixed(2);
+        gSlopeDirectionArray[slopeIndex] = maxPositivePos.Yaw.toFixed(2);
+        gAltitudeArray[slopeIndex] = pos.Altitude;
+
+        if (slopeIndex % 10 == 0) {
+          var prec = (slopeIndex / gPointsIndex) * 100;
+          SGWorld.Window.ShowMessageBarText(SGLang.i18n("Text26") + ": " + slopeIndex + "[" + prec.toFixed(1) + "%]");
+        }
+
+      }
+      catch (err) { alert(SGLang.i18n("Text25") + err); Reset(0, 0); }
+    }
+    //------------
+    //  DrawPoints
+    function DrawPoints() {
+      for (var i = 0; i < gPointsIndex; i++) {
+        DrawObject(gPositionsArray[i], i);
+      }
+      return true;
+    }
+
+    //---------
+    // DrawObject
+    function DrawObject(position, index) {
+      var node;
+      var TEObj;
+      var ObjType = "ImageLabel";
+      var distance = validateNumber($("#distance").val());
+      var size = distance / 200;
+
+      var noiseVal = 0;
+      var createAs = $("#createAs").val();
+      var PointVisible;
+
+      SGWorld.Window.ShowMessageBarText(SGLang.i18n("Text31") + " " + index, -1);
+
+      var SlopeValue = Math.round(gSlopeValueArray[index] * 10) / 10;
+      var SlopeValueAbs = Math.abs(SlopeValue);
+      var SlopeDirection = Math.round(gSlopeDirectionArray[index] * 10) / 10;
+      var Altitude = Math.round(position.Altitude * 10) / 10;
+
+      var IconColor = 0; // red + green * 256 + blue * 65536;
+      if (SlopeValueAbs > 45)
+        IconColor = 255 + 0 * 256 + 0 * 65536; // red
+      else if (SlopeValueAbs > 38)
+        IconColor = 244 + 167 * 256 + 68 * 65536; // orange
+      else if (SlopeValueAbs > 31)
+        IconColor = 255 + 255 * 256 + 0 * 65536; // yellow
+      else if (SlopeValueAbs > 17)
+        IconColor = 0 + 255 * 256 + 0 * 65536; // green
+      else if (SlopeValueAbs > 6)
+        IconColor = 0 + 0 * 256 + 255 * 65536; // blue
+      else
+        IconColor = 64 + 255 * 256 + 255 * 65536; // blue
+
+      if (createAs != "Group") {  // Create a feature layer
+        if (PointLayer == null) {
+          CreateGroupOrLayer();
+
+          // style the feature group
+          if (featureLayerStyles[ObjType] != null) {
+            var result = featureLayerStyles[ObjType](size, abspath() + "/arrow.png", "[" + SGLang.i18n("Text46") + "]");
+            if (result === false)
+              return false;
+          }
+        }
+
+        PointLayer.FeatureGroups.Point.CreateFeature([position.X, position.Y, position.Altitude + distance / 20], SlopeValue + ";" + SlopeDirection + ";" + Altitude + ";" + IconColor);
+      }
+
+      return true;
+
+    }
+    //----------
+    //    CreateGroupOrLayer
+    function CreateGroupOrLayer() {
+
+      var distance = validateNumber($("#distance").val());
+
+      if (PointLayer == null) {
+        var postfix = new Date().getTime();
+        var LayerName = SGLang.i18n("Text13");
+        PointLayer = SGWorld.Creator.CreateNewFeatureLayer(LayerName, LayerGeometryType.LGT_POINT, "FileName=SlopeMapQuery" + postfix + ".shp;TEPlugName=OGR;", rootId);
+        PointLayer.Streaming = $("#createAs").val() == "LayerStreaming";
+        PointLayer.BlockWidth = distance * 60;
+        PointLayer.Refresh();
+        PointLayer.DataSourceInfo.Attributes.CreateAttribute(SGLang.i18n("Text43"), 2, 20, 1); // Slope Value
+        PointLayer.DataSourceInfo.Attributes.CreateAttribute(SGLang.i18n("Text44"), 2, 20, 1); // Slope Direction
+        PointLayer.DataSourceInfo.Attributes.CreateAttribute(SGLang.i18n("Text45"), 2, 20, 1); // Altitude
+        PointLayer.DataSourceInfo.Attributes.CreateAttribute(SGLang.i18n("Text46"), 1, 20, 0); // icon color
+        PointLayer.DataSourceInfo.Attributes.ImportAll = true;
+        PointLayer.Visibility.MaxVisibilityDistance = gVisibilityDistance;
+        // style the feature group
+        PointLayer.FeatureGroups.Point.DisplayAs = ObjectTypeCode.OT_LABEL;
+
+      }
+
+    }
+    var featureLayerStyles = {
+
+      "ImageLabel": function (size, param, param2) {
+        PointLayer.FeatureGroups.Point.DisplayAs = ObjectTypeCode.OT_IMAGE_LABEL;
+        PointLayer.FeatureGroups.Point.SetProperty("Image file", param);
+        PointLayer.FeatureGroups.Point.SetProperty("Image Color", param2);
+        PointLayer.FeatureGroups.Point.SetProperty("Lock Mode", 1);
+        PointLayer.FeatureGroups.Point.SetProperty("Limit Growth", false);
+        PointLayer.FeatureGroups.Point.SetProperty("Scale", size);
+        PointLayer.FeatureGroups.Point.SetProperty("Altitude Method", 1);
+        PointLayer.FeatureGroups.Point.SetProperty("Pivot Alignment", 17);
+        PointLayer.FeatureGroups.Point.SetProperty("Yaw", " [" + SGLang.i18n("Text44") + "]");
+        PointLayer.FeatureGroups.Point.SetProperty("Pitch", "<[" + SGLang.i18n("Text43") + "]>");
+
+        PointLayer.FeatureGroups.Point.SetProperty("Altitude Method", 1);
+        PointLayer.FeatureGroups.Point.SetProperty("Tool Tip", SGLang.i18n("Text43") + " [" + SGLang.i18n("Text43") + "]");
+      }
+
+    }
+
+
+    //---------------
+    // ValidateInput
+    function ValidateInput() {
+      if ($("#startTime").val() * 1.0 > $("#endTime").val() * 1.0) {
+        alert(SGLang.i18n("Text23"));
+        return false;
+      }
+
+      return true;
+    }
+    //--------------
+    // CheckNumberEx
+    function CheckNumberEx(field, defVal, MinNum, MaxNum) {
+      try {
+        field.value = validateNumber(field.value);
+
+        if (field.value < MinNum)
+          field.value = MinNum;
+        if (field.value > MaxNum)
+          field.value = MaxNum;
+      }
+      catch (e) { field.value = defVal }
+    }
+
+  </script>
+
+</body>
+</html>
+
+
+<!--Sig:00000040#oa4DumCFgEJvNDGKOCEFv#JWEDM1VlNQuDtp#0Hysawl4ep07#tF7xF4Xrp6yuhabYKIvDl.cqY4o.bBchWJcJJ-->
diff --git a/TEWin/Resources/SlopeMapQuery/ToolIcon.png b/TEWin/Resources/SlopeMapQuery/ToolIcon.png
new file mode 100644
index 0000000..e97e6c6
--- /dev/null
+++ b/TEWin/Resources/SlopeMapQuery/ToolIcon.png
Binary files differ
diff --git a/TEWin/Resources/SlopeMapQuery/arrow.png b/TEWin/Resources/SlopeMapQuery/arrow.png
new file mode 100644
index 0000000..4ed506f
--- /dev/null
+++ b/TEWin/Resources/SlopeMapQuery/arrow.png
Binary files differ
diff --git a/TEWin/Resources/SlopeMapQuery/cursor_m.cur b/TEWin/Resources/SlopeMapQuery/cursor_m.cur
new file mode 100644
index 0000000..4e0076c
--- /dev/null
+++ b/TEWin/Resources/SlopeMapQuery/cursor_m.cur
Binary files differ
diff --git a/TEWin/Resources/SlopeMapQuery/help.html b/TEWin/Resources/SlopeMapQuery/help.html
new file mode 100644
index 0000000..885a4fa
--- /dev/null
+++ b/TEWin/Resources/SlopeMapQuery/help.html
@@ -0,0 +1,112 @@
+<html class="helpHtml">
+<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 Map Query tool
+		</tD></tr>
+		<tr><td>
+		<br>
+
+<div class=WordSection1>
+
+
+
+<p class=MsoNormal>The Slope Map query tool calculates the slope value in a specified area. The area is defined by a drawn line or polygon, or by a selection of points, lines or polygons.</p>
+<p>
+  The output of the analysis is a point feature layer that graphically represents the slope values at different points in the specified area. Each point in the feature layer is color-coded according to the steepness of the elevation model:</P>
+<p class=MsoNormal>
+<li>Sky blue = Slope value is lower than 6 degrees</li>
+<li>Blue = Slope value is between 6 - 17 degrees</li>
+<li>Green = Slope value is between 17 - 31 degrees</li>
+<li>Yellow = Slope value is between 31 - 38 degrees</li>
+<li>Orange = Slope value is between 38 - 45 degrees</li>
+<li>Red = Slope value is greater than 45 degrees</li>
+ </p>
+
+<p class=ProcedureHeader style='margin-left:0in;text-indent:0in'><span dir=LTR></span>To
+use the Slope Map Query tool:</p>
+
+<p class=ListFirstLevel>1.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;
+</span><span dir=LTR></span>Select one of the <b>Create as</b> options:</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:white;padding:1.45pt 5.75pt 4.3pt 5.75pt'>
+  <p class=MsoNormal style='margin-left:.25in;text-indent:-.25in'>Layer (Entire)</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>Create a
+  feature layer under the application's AppData.</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'>Layer
+  (Streaming)</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'>Create a
+  streaming feature layer under the application's AppData.</p>
+  </td>
+ </tr>
+ 
+</table>
+
+<p class=MsoNormal>&nbsp;</p>
+
+<p class=ListFirstLevel>2.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;
+</span><span dir=LTR></span>Enter the following parameters:</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;
+  border-top:none;background:#D2EAF1;padding:1.45pt 5.75pt 4.3pt 5.75pt'>
+  <p class=MsoNormal style='margin-left:.25in;text-indent:-.25in'>Spacing</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 >Determines the horizontal and vertical spacing (in meters) between query points in the area for which the slope is being calculated.</p>
+  </td>
+ </tr>
+ 
+</table>
+
+<p class=ListFirstLevel>3.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;
+</span><span dir=LTR></span> Select one of the following methods of designating the area for which the slope query should be calculated:
+</p>
+<ul>
+<li><b>Follow Line</b> - Query points are created along the drawn line.
+  </li>
+  <li><b>Fill Area</b> - Query points are created inside the drawn polygon.
+  </li>
+
+<li><b>Selected Group</b> - Query points are created at all points, along all lines, or inside all polygons, in the selected group. Select the required group from the Project Tree, and then click <b>Selected Group</b>.
+</li>
+
+<li><b>From Clipboard</b> - Query points are created for all clipboard objects. Copy the required objects to the clipboard, and click <b>From Clipboard</b>.
+</li>
+
+</ul>
+
+</div>
+			</td></tr>
+		</table>
+</body>
+</html>
+
+
+<!--Sig:00000040.s29lMoBvp#OfAWfHxrPyu5M9n9nR7P6LQJBjzkAdKtri1NLepCuxnYhZt5JM0fkMz3hCmjwEuDhkzFQuJKEXMJJ-->
diff --git a/TEWin/Resources/SlopeMapQuery/img/point.gif b/TEWin/Resources/SlopeMapQuery/img/point.gif
new file mode 100644
index 0000000..8e7299f
--- /dev/null
+++ b/TEWin/Resources/SlopeMapQuery/img/point.gif
Binary files differ
diff --git a/TEWin/Resources/TerrainProfile/1033/Lang.js b/TEWin/Resources/TerrainProfile/1033/Lang.js
new file mode 100644
index 0000000..5b814f8
--- /dev/null
+++ b/TEWin/Resources/TerrainProfile/1033/Lang.js
@@ -0,0 +1,62 @@
+锘縎GLang.lang = $.extend(SGLang.lang,{
+    ToolTitle: "SkylineGlobe - Skyline Software Systems, Inc.",
+    ToolName: "Terrain Profile",
+    help: "Help",
+    Text0: "Mode",
+    Text1: "Normal",
+    Text2: "Compare",
+    Text3: "Calculating profile",
+    Text4: "Terrain profile calculation was aborted",
+    Text5: "Elevation Layer",
+    Text8: "Spacing",
+    Text9: "meters",
+    Text10: "Quality",
+    Text11: "Medium",
+    Text12: "High",
+    Text13: "TerrainProfile",
+    Text14: "TerrainProfile",
+    Text15: "line ",
+    Text16: "Left click on the terrain to draw a polygon/Polyline. Right click to finish operation.",
+    Text18: "Follow <br>Line",
+    Text19: "Calculating query points",
+    Text20: "Terrain Profile tool cannot create more than 10 profiles. Operation aborted.",
+    Text21: " objects. This procedure may take considerable time. Do you want to continue?",
+    Text24: "Please select a group or a layer from the project tree",
+    Text25: "Error while calculating elevation values.",
+    Text26: "Please select an elevation layer from the list",
+    Text27: "Point",
+    Text28: "TerrainProfile-FollowLine",
+    Text29: "Cannot generate terrain profile. The clipboard does not contain Polygon/Polyline objects.",
+    Text31: "Analyzing point ",
+    Text32: "Visibility Distance",
+    Text33: "Follow<br>Line",
+    Text34: "Fill <br>Area",
+    Text35: "Selected<br>Group",
+    Text36: "From<br>Clipboard",
+    Text37: "<u>Refesh list</u>",
+    Text40: "<b>Export to Layer</b>",
+    Text43: "Distance",
+    Text44: "Line",
+    Text45: "Elevation",
+    Text46: "Color",
+    Text47: "Slope",
+    Text48: "Min / Max Elevation",
+    Text49: "Min / Max Slope",
+    Text50: "Waypoint",
+    Text51: "Unit:",
+    Text52: "<b>meters</b>",
+    Text53: "<b>feet</b>",
+	Text54: "G_Dist",
+	Text55: "H_Dist",
+	Text56: "Cannot generate terrain profile. The selected group does not contain Polygon/Polyline objects",
+	Text57: "m",
+	Text58: "Surface Distance",
+    Text59: "ft",
+	Text60: "Sampling Length",
+	Text61: "Horizontal Distance",
+    Text62: "Object Name",
+    TextAbort: " (Esc to abort)",
+
+
+    Text999: ""
+});
\ No newline at end of file
diff --git a/TEWin/Resources/TerrainProfile/1033/help.html b/TEWin/Resources/TerrainProfile/1033/help.html
new file mode 100644
index 0000000..33f66e6
--- /dev/null
+++ b/TEWin/Resources/TerrainProfile/1033/help.html
@@ -0,0 +1,103 @@
+锘�
+<HTML lang=en-US><HEAD>
+<META http-equiv=Content-Type content="text/html; charset=utf-8"><TITLE>TerraExplorer Pro - Skyline Software Systems, Inc.</TITLE><LINK 
+href="../Style.css" type=text/css rel=StyleSheet>
+<META content="MSHTML 6.00.2900.5512" name=GENERATOR></HEAD>
+<BODY>
+<TABLE class=s9 cellSpacing=0 cellPadding=0 width="100%" border=0>
+  <TBODY>
+  <TR>
+    <TD class=s12b align=middle>Terrain Profile tool </TD></TR>
+  <TR>
+    <TD><BR>
+      <DIV class=WordSection1>
+      <P class=MsoNormal>The Terrain Profile tool displays the terrain elevation 
+      profile along a defined path, and related information on this profile such 
+      as maximum and minimum elevation values and slope. The terrain profile can 
+      also compare between the base terrain and an elevation layer.</P>
+      <P class=ProcedureHeader style="MARGIN-LEFT: 0in; TEXT-INDENT: 0in"><SPAN 
+      dir=ltr></SPAN>To use the Terrain Profile tool:</P>
+      <P class=ListFirstLevel>1.<SPAN 
+      style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN 
+      dir=ltr></SPAN>Enter the following parameters:</P>
+      <TABLE class=SkyTable 
+      style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; MARGIN-LEFT: 0.35in; BORDER-LEFT: medium none; WIDTH: 401pt; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse" 
+      cellSpacing=0 cellPadding=0 width=535 border=1>
+        <TBODY>
+        <TR>
+          <TD 
+          style="BORDER-RIGHT: #4bacc6 1pt solid; PADDING-RIGHT: 5.75pt; BORDER-TOP: #4bacc6 1pt solid; PADDING-LEFT: 5.75pt; BACKGROUND: white; PADDING-BOTTOM: 4.3pt; BORDER-LEFT: #4bacc6 1pt solid; WIDTH: 86.05pt; PADDING-TOP: 1.45pt; BORDER-BOTTOM: #4bacc6 1pt solid" 
+          vAlign=top width=115>
+            <P class=MsoNormal 
+            style="MARGIN-LEFT: 0.25in; TEXT-INDENT: -0.25in">Mode</P></TD>
+          <TD 
+          style="BORDER-RIGHT: #4bacc6 1pt solid; PADDING-RIGHT: 5.75pt; BORDER-TOP: #4bacc6 1pt solid; PADDING-LEFT: 5.75pt; BACKGROUND: white; PADDING-BOTTOM: 4.3pt; BORDER-LEFT: medium none; WIDTH: 314.95pt; PADDING-TOP: 1.45pt; BORDER-BOTTOM: #4bacc6 1pt solid" 
+          vAlign=top width=420>
+            <P class=MsoNormal>Select the profile mode. </P>
+            <P class=MsoNormal><B>Normal</B> 鈥� Display a profile only for the 
+            selected polyline(s). </P>
+            <P class=MsoNormal><B>Compare</B> 鈥� Compare the selected polyline's 
+            profile to that of a specified elevation layer. </P></TD></TR>
+        <TR>
+          <TD 
+          style="BORDER-RIGHT: #4bacc6 1pt solid; PADDING-RIGHT: 5.75pt; BORDER-TOP: medium none; PADDING-LEFT: 5.75pt; BACKGROUND: #d2eaf1; PADDING-BOTTOM: 4.3pt; BORDER-LEFT: #4bacc6 1pt solid; WIDTH: 86.05pt; PADDING-TOP: 1.45pt; BORDER-BOTTOM: #4bacc6 1pt solid" 
+          vAlign=top width=115>
+            <P class=MsoNormal 
+            style="MARGIN-LEFT: 0.25in; TEXT-INDENT: -0.25in">Quality</P></TD>
+          <TD 
+          style="BORDER-RIGHT: #4bacc6 1pt solid; PADDING-RIGHT: 5.75pt; BORDER-TOP: medium none; PADDING-LEFT: 5.75pt; BACKGROUND: #d2eaf1; PADDING-BOTTOM: 4.3pt; BORDER-LEFT: medium none; WIDTH: 314.95pt; PADDING-TOP: 1.45pt; BORDER-BOTTOM: #4bacc6 1pt solid" 
+          vAlign=top width=420>
+            <P class=MsoNormal 
+            style="MARGIN-LEFT: 0.25in; TEXT-INDENT: -0.25in">Determines the 
+            distance between sample points along the polyline for which the 
+            terrain profile is being calculated. High Quality will yield a more 
+            accurate result, but take longer to calculate.</P></TD></TR>
+        <TR>
+          <TD 
+          style="BORDER-RIGHT: #4bacc6 1pt solid; PADDING-RIGHT: 5.75pt; BORDER-TOP: #4bacc6 1pt solid; PADDING-LEFT: 5.75pt; BACKGROUND: white; PADDING-BOTTOM: 4.3pt; BORDER-LEFT: #4bacc6 1pt solid; WIDTH: 86.05pt; PADDING-TOP: 1.45pt; BORDER-BOTTOM: #4bacc6 1pt solid" 
+          vAlign=top width=115>
+            <P class=MsoNormal 
+            style="MARGIN-LEFT: 0.25in; TEXT-INDENT: -0.25in">Elevation 
+          Layer</P></TD>
+          <TD 
+          style="BORDER-RIGHT: #4bacc6 1pt solid; PADDING-RIGHT: 5.75pt; BORDER-TOP: #4bacc6 1pt solid; PADDING-LEFT: 5.75pt; BACKGROUND: white; PADDING-BOTTOM: 4.3pt; BORDER-LEFT: medium none; WIDTH: 314.95pt; PADDING-TOP: 1.45pt; BORDER-BOTTOM: #4bacc6 1pt solid" 
+          vAlign=top width=420>
+            <P class=MsoNormal>Select the elevation layer to which to compare 
+            the defined polyline. This parameter is only available if Compare is 
+            selected in the Mode field. </P></TD></TR></TBODY></TABLE>
+      <P class=ListFirstLevel>2.<SPAN 
+      style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN 
+      dir=ltr></SPAN>Select one of the following methods of designating the 
+      polyline(s) for which the terrain profile should be calculated:</P>
+      <UL>
+        <LI><B>Follow Line</B> - A terrain profile is created along the drawn 
+        line. In the 3D Window, click the left mouse button to place the line 
+        waypoints, and right-click to complete the line. 
+        <LI><B>Selected Group</B> - A terrain profile is created for each of the 
+        polylines in the selected group. Select the required layer from the 
+        Project Tree, and then click Selected Group. 
+        <LI><B>From Clipboard</B> - A terrain profile is created for each of the 
+        polylines in the clipboard. </LI></UL></DIV></TD></TR></TBODY></TABLE>
+<TABLE>
+  <TBODY>
+  <TR>
+    <TD>
+      <P class=ListFirstLevel>3.<SPAN 
+      style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN 
+      dir=ltr></SPAN>A terrain profile graph opens, displaying the terrain 
+      elevation profile. </P>
+      <P><B>Note: </B>When you click any point on the graph, the corresponding 
+      point on the polyline in the 3D Window is displayed in the center of the 
+      screen. </P>
+      <P class=ListFirstLevel>4.<SPAN 
+      style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN 
+      dir=ltr></SPAN>If you want to export the terrain profile to a shapefile 
+      layer, click <B>Export to Layer</B>. </P>
+      <P><B>Note</B>: When a terrain profile created for multiple lines (in a 
+      group or from clipboard), is exported to a layer, the line color on the 
+      graph corresponds to the color of the points that make up the line in the 
+      layer.</P></TD></TR></TBODY></TABLE><BR><SPAN style="FONT-SIZE: 11px">Flot 
+graph: copyright (c) 2007-2014 IOLA and Ole Laursen</SPAN> </BODY></HTML>
+
+
+<!--Sig:00000040DTezRrGMwwAbCxkRT8o5seAHJZqH.NHMAB0OCoh5RzTuxLdk#h8LCLv6CdCOUkRTEUsrxzI583r#na4QSzuaMxJJ-->
diff --git a/TEWin/Resources/TerrainProfile/2052/Lang.js b/TEWin/Resources/TerrainProfile/2052/Lang.js
new file mode 100644
index 0000000..1961e7a
--- /dev/null
+++ b/TEWin/Resources/TerrainProfile/2052/Lang.js
@@ -0,0 +1,62 @@
+锘縎GLang.lang = $.extend(SGLang.lang,{
+    ToolTitle: "SmartEarth - 娉扮憺鏁板垱绉戞妧锛堝寳浜級鏈夐檺鍏徃",
+    ToolName: "鍦板舰鍓栭潰",
+    help: "甯姪",
+    Text0: "妯″紡",
+    Text1: "甯歌",
+    Text2: "瀵规瘮",
+    Text3: "姝e湪璁$畻鍓栭潰",
+    Text4: "鍦板舰鍓栭潰璁$畻宸插彇娑�",
+    Text5: "楂樼▼鍥惧眰",
+    Text8: "闂磋窛",
+    Text9: "绫�",
+    Text10: "璐ㄩ噺",
+    Text11: "涓�",
+    Text12: "楂�",
+    Text13: "鍦板舰鍓栭潰",
+    Text14: "鍦板舰鍓栭潰",
+    Text15: "绾�",
+    Text16: "鍦ㄥ湴褰笂鍗曞嚮宸﹂敭鍒涘缓涓�涓杈瑰舰/鎶樼嚎. 鍙抽敭缁撴潫鎿嶄綔.",
+    Text18: "璺熼殢 <br>绾�",
+    Text19: "姝e湪璁$畻鏌ヨ鐐�",
+    Text20: "鍦板舰鍓栭潰宸ュ叿涓嶈兘鍒涘缓澶氫簬10涓墫闈�. 鎿嶄綔涓.",
+    Text21: "瀵硅薄. 杩欎釜杩囩▼浼氳姳璐瑰緢闀挎椂闂�. 鏄惁瑕佺户缁紵",
+    Text24: "璇蜂粠宸ョ▼鏍戜笂閫夋嫨涓�涓粍鎴栦竴涓浘灞�",
+    Text25: "璁$畻楂樼▼鍊兼椂鍑洪敊",
+    Text26: "璇蜂粠鍒楄〃閫夋嫨涓�涓珮绋嬪浘灞�",
+    Text27: "鐐�",
+    Text28: "鍦板舰鍓栭潰-璺熼殢绾�",
+    Text29: "鏃犳硶鍒涘缓鍦板舰鍓栭潰. 鍓创鏉夸腑娌℃湁闈�/绾垮璞�",
+    Text31: "姝e湪鍒嗘瀽鐐�",
+    Text32: "鍙璺濈",
+    Text33: "璺熼殢<br>绾�",
+    Text34: "璺熼殢 <br>闈�",
+    Text35: "閫夋嫨<br>缁�",
+    Text36: "浠�<br>鍓创鏉�",
+    Text37: "<u>鍒锋柊鍒楄〃</u>",
+    Text40: "<b>杈撳嚭涓哄浘灞�</b>",
+    Text43: "璺濈",
+    Text44: "绾�",
+    Text45: "楂樼▼",
+    Text46: "棰滆壊",
+    Text47: "鍧″害",
+    Text48: "鏈�灏� / 鏈�澶ч珮绋�",
+    Text49: "鏈�灏� / 鏈�澶у潯搴�",
+    Text50: "璺緞鐐�",
+    Text51: "鍗曚綅:",
+    Text52: "<b>绫�</b>",
+    Text53: "<b>鑻卞昂</b>",
+	Text54: "G_Dist",
+	Text55: "H_Dist",
+	Text56: "鏃犳硶鍒涘缓鍦板舰鍓栭潰. 閫夋嫨鐨勭粍涓病鏈夐潰/绾垮璞�",
+	Text57: "m",
+	Text58: "琛ㄩ潰璺濈",
+    Text59: "ft",
+	Text60: "閲囨牱闀垮害",
+	Text61: "姘村钩璺濈",
+    Text62: "瀵硅薄鍚嶇О",
+    TextAbort: " (鎸塃SC鍙栨秷)",
+
+
+    Text999: ""
+});
\ No newline at end of file
diff --git a/TEWin/Resources/TerrainProfile/2052/help.html b/TEWin/Resources/TerrainProfile/2052/help.html
new file mode 100644
index 0000000..b6bb47f
--- /dev/null
+++ b/TEWin/Resources/TerrainProfile/2052/help.html
@@ -0,0 +1,84 @@
+锘�
+<HTML lang=zh-CN><HEAD>
+<META http-equiv=Content-Type content="text/html; charset=utf-8"><TITLE>TerraExplorer Pro - 娉扮憺鏁板垱绉戞妧锛堝寳浜級鏈夐檺鍏徃</TITLE><LINK 
+href="../Style.css" type=text/css rel=StyleSheet>
+<META content="MSHTML 6.00.2900.5512" name=GENERATOR></HEAD>
+<BODY>
+<TABLE class=s9 cellSpacing=0 cellPadding=0 width="100%" border=0>
+  <TBODY>
+  <TR>
+    <TD class=s12b align=middle>鍦板舰鍓栭潰宸ュ叿</TD></TR>
+  <TR>
+    <TD><BR>
+      <DIV class=WordSection1>
+      <P class=MsoNormal>鍦板舰鍓栭潰宸ュ叿娌跨潃涓�鏉″畾涔夌殑璺緞鏄剧ず鍦板舰楂樼▼鍓栭潰鍜岃繖涓墫闈㈢浉鍏崇殑淇℃伅锛屽鏈�澶с�佹渶灏忛珮绋嬪�煎拰鍧″害. 
+      鍦板舰鍓栭潰涔熷彲浠ュ湪鍩虹鍦板舰鍜屼竴涓珮绋嬪浘灞備箣闂磋繘琛屽姣�. </P>
+      <P class=ProcedureHeader style="MARGIN-LEFT: 0in; TEXT-INDENT: 0in"><SPAN 
+      dir=ltr></SPAN>浣跨敤鍦板舰鍓栭潰宸ュ叿:</P>
+      <P class=ListFirstLevel>1.<SPAN 
+      style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN 
+      dir=ltr></SPAN>杈撳叆浠ヤ笅鍙傛暟:</P>
+      <TABLE class=SkyTable 
+      style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; MARGIN-LEFT: 0.35in; BORDER-LEFT: medium none; WIDTH: 401pt; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse" 
+      cellSpacing=0 cellPadding=0 width=535 border=1>
+        <TBODY>
+        <TR>
+          <TD 
+          style="BORDER-RIGHT: #4bacc6 1pt solid; PADDING-RIGHT: 5.75pt; BORDER-TOP: #4bacc6 1pt solid; PADDING-LEFT: 5.75pt; BACKGROUND: white; PADDING-BOTTOM: 4.3pt; BORDER-LEFT: #4bacc6 1pt solid; WIDTH: 86.05pt; PADDING-TOP: 1.45pt; BORDER-BOTTOM: #4bacc6 1pt solid" 
+          vAlign=top width=115>
+            <P class=MsoNormal 
+            style="MARGIN-LEFT: 0.25in; TEXT-INDENT: -0.25in">妯″紡</P></TD>
+          <TD 
+          style="BORDER-RIGHT: #4bacc6 1pt solid; PADDING-RIGHT: 5.75pt; BORDER-TOP: #4bacc6 1pt solid; PADDING-LEFT: 5.75pt; BACKGROUND: white; PADDING-BOTTOM: 4.3pt; BORDER-LEFT: medium none; WIDTH: 314.95pt; PADDING-TOP: 1.45pt; BORDER-BOTTOM: #4bacc6 1pt solid" 
+          vAlign=top width=420>
+            <P class=MsoNormal>閫夋嫨鍓栭潰妯″紡. </P>
+            <P class=MsoNormal><B>甯歌</B> 鈥� 鍙樉绀烘墍閫夋嫨鎶樼嚎鐨勫墫闈�. </P>
+            <P class=MsoNormal><B>瀵规瘮</B> 鈥� 灏嗛�夋嫨鎶樼嚎鐨勫墫闈㈠悓涓�涓壒瀹氱殑楂樼▼鍥惧眰杩涜瀵规瘮. </P></TD></TR>
+        <TR>
+          <TD 
+          style="BORDER-RIGHT: #4bacc6 1pt solid; PADDING-RIGHT: 5.75pt; BORDER-TOP: medium none; PADDING-LEFT: 5.75pt; BACKGROUND: #d2eaf1; PADDING-BOTTOM: 4.3pt; BORDER-LEFT: #4bacc6 1pt solid; WIDTH: 86.05pt; PADDING-TOP: 1.45pt; BORDER-BOTTOM: #4bacc6 1pt solid" 
+          vAlign=top width=115>
+            <P class=MsoNormal 
+            style="MARGIN-LEFT: 0.25in; TEXT-INDENT: -0.25in">璐ㄩ噺</P></TD>
+          <TD 
+          style="BORDER-RIGHT: #4bacc6 1pt solid; PADDING-RIGHT: 5.75pt; BORDER-TOP: medium none; PADDING-LEFT: 5.75pt; BACKGROUND: #d2eaf1; PADDING-BOTTOM: 4.3pt; BORDER-LEFT: medium none; WIDTH: 314.95pt; PADDING-TOP: 1.45pt; BORDER-BOTTOM: #4bacc6 1pt solid" 
+          vAlign=top width=420>
+            <P class=MsoNormal 
+            style="MARGIN-LEFT: 0.25in; TEXT-INDENT: -0.25in">纭畾琚绠楃殑鍦板舰鍓栭潰涓婃部鐫�鎶樼嚎鐨勯噰鏍风偣闂磋窛. 
+            楂樿川閲忓皢浜х敓鏇寸簿纭殑缁撴灉锛屼絾鏄�楁椂杈冮暱. </P></TD></TR>
+        <TR>
+          <TD 
+          style="BORDER-RIGHT: #4bacc6 1pt solid; PADDING-RIGHT: 5.75pt; BORDER-TOP: #4bacc6 1pt solid; PADDING-LEFT: 5.75pt; BACKGROUND: white; PADDING-BOTTOM: 4.3pt; BORDER-LEFT: #4bacc6 1pt solid; WIDTH: 86.05pt; PADDING-TOP: 1.45pt; BORDER-BOTTOM: #4bacc6 1pt solid" 
+          vAlign=top width=115>
+            <P class=MsoNormal 
+            style="MARGIN-LEFT: 0.25in; TEXT-INDENT: -0.25in">楂樼▼鍥惧眰</P></TD>
+          <TD 
+          style="BORDER-RIGHT: #4bacc6 1pt solid; PADDING-RIGHT: 5.75pt; BORDER-TOP: #4bacc6 1pt solid; PADDING-LEFT: 5.75pt; BACKGROUND: white; PADDING-BOTTOM: 4.3pt; BORDER-LEFT: medium none; WIDTH: 314.95pt; PADDING-TOP: 1.45pt; BORDER-BOTTOM: #4bacc6 1pt solid" 
+          vAlign=top width=420>
+            <P class=MsoNormal>閫夋嫨楂樼▼鍥惧眰鏉ュ姣斿畾涔夌殑鎶樼嚎. 鍙湁褰撳姣斿湪妯″紡瀛楁閲岃閫夋嫨鏃惰鍙傛暟鎵嶆湁鏁�. 
+        </P></TD></TR></TBODY></TABLE>
+      <P class=ListFirstLevel>2.<SPAN 
+      style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN 
+      dir=ltr></SPAN>閫夋嫨濡備笅鏂规硶涓烘寚瀹氭姌绾胯绠楀湴褰㈠墫闈�:</P>
+      <UL>
+        <LI><B>璺熼殢绾�</B> - 鍦板舰鍓栭潰娌跨潃缁樺埗鐨勭嚎杩涜鍒涘缓. 鍦ㄤ笁缁寸獥鍙d腑锛岀偣鍑婚紶鏍囧乏閿潵鏀剧疆绾跨殑璺緞鐐癸紝鍙抽敭缁撴潫绾跨殑鍒涘缓. 
+        <LI><B>閫夋嫨缁�</B> - 鍦板舰鍓栭潰鏍规嵁閫変腑缁勫唴鐨勬瘡涓姌绾胯繘琛屽垱寤�. 浠庡伐绋嬫爲閫夋嫨鎵�闇�鐨勫浘灞傦紝鐒跺悗鐐瑰嚮閫変腑缁�. 
+        <LI><B>浠庡壀璐存澘</B> - 鍦板舰鍓栭潰鏍规嵁鍓创鏉夸笂鐨勬瘡涓姌绾胯繘琛屽垱寤�. 
+</LI></UL></DIV></TD></TR></TBODY></TABLE>
+<TABLE>
+  <TBODY>
+  <TR>
+    <TD>
+      <P class=ListFirstLevel>3.<SPAN 
+      style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN 
+      dir=ltr></SPAN>涓�涓湴褰㈠墫闈㈠浘鎵撳紑锛屾樉绀哄湴褰㈤珮绋嬪墫闈�. </P>
+      <P><B>娉ㄩ噴: </B>褰撲綘鐐瑰嚮鍥捐〃涓婄殑浠绘剰鐐癸紝鍦ㄤ笁缁寸獥鍙d腑鎶樼嚎涓婄殑鐩稿簲鐐瑰氨浼氬湪灞忓箷涓績鏄剧ず. </P>
+      <P class=ListFirstLevel>4.<SPAN 
+      style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN 
+      dir=ltr></SPAN>濡傛灉浣犳兂瑕佹妸鍦板舰鍓栭潰杈撳嚭涓轰竴涓猻hape鏂囦欢鍥惧眰 锛岀偣鍑�<B>杈撳嚭涓哄浘灞�</B>. </P>
+      <P><B>娉ㄩ噴</B>: 褰撳垱寤哄涓嚎锛堝湪涓�涓粍閲屾垨浠庡壀璐存澘锛夌殑鍦板舰鍓栭潰杈撳嚭涓轰竴涓浘灞傦紝鍥捐〃涓婄嚎鐨勯鑹茬浉褰撲簬鍥惧眰閲屾瀯鎴愮嚎鐨勭偣鐨勯鑹�. 
+  </P></TD></TR></TBODY></TABLE><BR><SPAN style="FONT-SIZE: 11px">娴姩鍥捐〃: 鐗堟潈鎵�鏈� (c) 
+娉扮憺鏁板垱绉戞妧锛堝寳浜級鏈夐檺鍏徃</SPAN> </BODY></HTML>
+
+
+<!--Sig:00000040AmHmKczlNhunv0o0bdci5Wa4myuvgatlxxwl3eMrVcdchVC16wRL63lmUjhjJ6oIbMe6OYsqKxj1YLwvmTL9GCJJ-->
diff --git a/TEWin/Resources/TerrainProfile/Hourglass.cur b/TEWin/Resources/TerrainProfile/Hourglass.cur
new file mode 100644
index 0000000..54e82ba
--- /dev/null
+++ b/TEWin/Resources/TerrainProfile/Hourglass.cur
Binary files differ
diff --git a/TEWin/Resources/TerrainProfile/Lang.js b/TEWin/Resources/TerrainProfile/Lang.js
new file mode 100644
index 0000000..5b814f8
--- /dev/null
+++ b/TEWin/Resources/TerrainProfile/Lang.js
@@ -0,0 +1,62 @@
+锘縎GLang.lang = $.extend(SGLang.lang,{
+    ToolTitle: "SkylineGlobe - Skyline Software Systems, Inc.",
+    ToolName: "Terrain Profile",
+    help: "Help",
+    Text0: "Mode",
+    Text1: "Normal",
+    Text2: "Compare",
+    Text3: "Calculating profile",
+    Text4: "Terrain profile calculation was aborted",
+    Text5: "Elevation Layer",
+    Text8: "Spacing",
+    Text9: "meters",
+    Text10: "Quality",
+    Text11: "Medium",
+    Text12: "High",
+    Text13: "TerrainProfile",
+    Text14: "TerrainProfile",
+    Text15: "line ",
+    Text16: "Left click on the terrain to draw a polygon/Polyline. Right click to finish operation.",
+    Text18: "Follow <br>Line",
+    Text19: "Calculating query points",
+    Text20: "Terrain Profile tool cannot create more than 10 profiles. Operation aborted.",
+    Text21: " objects. This procedure may take considerable time. Do you want to continue?",
+    Text24: "Please select a group or a layer from the project tree",
+    Text25: "Error while calculating elevation values.",
+    Text26: "Please select an elevation layer from the list",
+    Text27: "Point",
+    Text28: "TerrainProfile-FollowLine",
+    Text29: "Cannot generate terrain profile. The clipboard does not contain Polygon/Polyline objects.",
+    Text31: "Analyzing point ",
+    Text32: "Visibility Distance",
+    Text33: "Follow<br>Line",
+    Text34: "Fill <br>Area",
+    Text35: "Selected<br>Group",
+    Text36: "From<br>Clipboard",
+    Text37: "<u>Refesh list</u>",
+    Text40: "<b>Export to Layer</b>",
+    Text43: "Distance",
+    Text44: "Line",
+    Text45: "Elevation",
+    Text46: "Color",
+    Text47: "Slope",
+    Text48: "Min / Max Elevation",
+    Text49: "Min / Max Slope",
+    Text50: "Waypoint",
+    Text51: "Unit:",
+    Text52: "<b>meters</b>",
+    Text53: "<b>feet</b>",
+	Text54: "G_Dist",
+	Text55: "H_Dist",
+	Text56: "Cannot generate terrain profile. The selected group does not contain Polygon/Polyline objects",
+	Text57: "m",
+	Text58: "Surface Distance",
+    Text59: "ft",
+	Text60: "Sampling Length",
+	Text61: "Horizontal Distance",
+    Text62: "Object Name",
+    TextAbort: " (Esc to abort)",
+
+
+    Text999: ""
+});
\ No newline at end of file
diff --git a/TEWin/Resources/TerrainProfile/TerrainProfile.html b/TEWin/Resources/TerrainProfile/TerrainProfile.html
new file mode 100644
index 0000000..8e205da
--- /dev/null
+++ b/TEWin/Resources/TerrainProfile/TerrainProfile.html
@@ -0,0 +1,333 @@
+锘�<!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 class="s8b">
+                <label for="Mode"  class="i18n">Text0</label>
+            </td>
+            <td align="left">
+                &nbsp;<select id="CompareMode" onchange="ChangeMode();">
+                    <option class="i18n" value="0" selected="selected">Text1</option>
+                    <option class="i18n" value="1" >Text2</option>
+                </select>
+            </td>     
+        </tr>
+        <tr >
+            <td class="s8b">
+                <label for="Mode"  class="i18n">Text10</label>
+            </td>
+            <td align="left">
+                &nbsp;<select id="DensityID" >
+                    <option class="i18n" value="1" selected="selected">Text11</option>
+                    <option class="i18n" value="2" >Text12</option>
+                </select>
+            </td>     
+        </tr>
+        <tr id="ListTR" class='TableOtherLine' style="display:none;"> <!--Select Elevation Layer -->
+            <td class="s8b">
+                <label for="createAs"  class="i18n">Text5</label>
+            </td>
+            <td align="left">
+<!--          DO NOT REMOVE THE FOCUS CALL IN THE LIST BELOW!!
+              This focus call  minimize the effect of a very strange bug. When you select an entry from the Viewshed list, click on the terrain and then ctrl-click on other list entry the HTML list control do not really recieve this additional selection (although you do see the new line highlighted).
+-->
+                &nbsp;<select id="ElevationsID" multiple="multiple" ondblclick="flyToElevation();" onmouseover="this.focus()"  >
+                </select><br />
+                <span  class="i18n" style="text-decoration:underline;cursor:pointer;" onclick="RefreshElevationList();">Text37</span>
+<!--                <span style="margin-left:40px;"></span>
+                <span  class="i18n" style="text-decoration:underline;cursor:pointer;" onclick="SelectInView();">Text42</span>
+-->            </td>     
+        </tr>
+        </table>
+        <tr class="s8">
+            <td colspan="2"  align="center" class="ToolButtonsArea">
+                <button id="lineButton" class="MenuButton" onclick="CreateObjects(1);">               <img src="../commonimg/polyline.png" /><br />         <span class="i18n">Text33</span></button>
+                <button id="groupButton" class="MenuButton" onclick="SelectGroupObjects()"><img src="../commonimg/group.png" /><br /><span class="i18n">Text35</span></button>
+                <button id="clipboardButton" class="MenuButton MenuButtonLast" onclick="SelectClipboardObjects()"><img src="../commonimg/Clipboard.png" /><br /><span class="i18n" style="font:#2A4EA5">Text36</span></button>
+            </td>
+        </tr>
+    </table>
+   <!-- <object id="SGWorld" classid="CLSID:3a4f9197-65a8-11d5-85c1-0001023952c1">-->
+    </object>
+
+<script language="javascript" src="../jquery/jquery-3.1.1.min.js"></script>
+<script language="javascript" src="../ToolsCommon70.js"></script>
+
+<script language="JavaScript">
+//** this is a global variables for the polyline/polygon drawings
+var gPolygonText = SGLang.i18n("Text35");
+var gPolylineText = SGLang.i18n("Text36");
+var gDrawPolyClick = null;
+var gEndDrawPoly = DrawPoly;
+var gPopupCaption = "";
+//**
+
+var bInEdit;
+var bFirstTime;
+var bDontAskme;
+///var gTotalHours;
+var rootId;
+
+var SGWorld = new ActiveXObject("TerraExplorerX.SGWorld70");
+
+Date.prototype.stdTimezoneOffset = function () {
+    var jan = new Date(this.getFullYear(), 0, 1);
+    var jul = new Date(this.getFullYear(), 6, 1);
+    return Math.max(jan.getTimezoneOffset(), jul.getTimezoneOffset());
+}
+
+Date.prototype.dst = function () {
+    return this.getTimezoneOffset() < this.stdTimezoneOffset();
+}
+
+//--------------
+// Init
+function Init() {
+    if (GetParamValue("inSG", "") == "1") {
+        $("#TopAreaTD").attr("height", "57");
+        $("#TitleTD").attr("align", "left");
+        $("#CloseHelpTd").attr("display", "none");
+    }
+
+    gDrawPolyAltitudeType = 3; // draw lines and polygon as absolute lines
+    rootId = GetParamValue("rootId", SGWorld.ProjectTree.RootID);
+    RefreshElevationList();
+    Reset(1, 0);
+}
+//------------------
+// Reset
+//------------------
+function Reset(FirstTime, FromMouseInputMode) {
+
+    try {
+        if (gPolyObj != null)
+            SGWorld.Creator.DeleteObject(gPolyObj.ID);
+    } catch (e) { }
+
+    gPolyObj = null;
+    GroupID = null;
+
+    bDontAskme = false;
+
+    $("#lineButton").removeClass("MenuButtonHighlight");
+    $("#areaButton").removeClass("MenuButtonHighlight");
+    $("#groupButton").removeClass("MenuButtonHighlight");
+    $("#clipboardButton").removeClass("MenuButtonHighlight");
+
+    SGWorld.ProjectTree.EnableRedraw(1);
+    SGWorld.Window.HideMessageBarText();
+
+    if (bInEdit) {
+        SGWorld.DetachEvent("OnLButtonClicked", DrawPolyLButtonClicked);
+        SGWorld.DetachEvent("OnRButtonUp", DrawPolyRButtonUp);
+        SGWorld.DetachEvent("OnFrame", DrawPolyOnFrame);
+        SGWorld.DetachEvent("OnInputModeChanged", DrawPolyInputModeChanged);
+    }
+    bInEdit = false;
+
+    if (FirstTime != 1 && FromMouseInputMode == 0)
+        SGWorld.Window.SetInputMode(0);
+}
+//-------------------
+// ChangeMode
+function ChangeMode() {
+    var CompareMode = $("#CompareMode").val();
+    if (CompareMode == "1") // Compare
+        $("#ListTR").show();
+    else
+        $("#ListTR").hide();
+
+}
+//-------------------
+// RefreshElevationList
+function RefreshElevationList() {
+    $("#ElevationsID").html("");
+    BuildElevationsList(SGWorld.ProjectTree.RootID);
+}
+//-------------------
+// BuildElevationsList
+function BuildElevationsList(parentNode) {
+
+    try {
+        var node = SGWorld.ProjectTree.GetNextItem(parentNode, 11);
+        while (node != "") {
+
+            if (SGWorld.ProjectTree.IsGroup(node))
+                BuildElevationsList(node);
+
+            else if (SGWorld.ProjectTree.IsLayer(node)) {
+            }
+            else {
+                var a = SGWorld.ProjectTree.GetItemName(node);
+                var Object = SGWorld.Creator.GetObject(node);
+                if (Object != null) {
+                    if (Object.ObjectType == 29)
+                        AddElevationToList(Object);
+                }
+            }
+            node = SGWorld.ProjectTree.GetNextItem(node, 13);
+        }
+    }
+    catch (err) { }
+}
+//---------------
+// AddElevationToList
+function AddElevationToList(Object) {
+    $("#ElevationsID").append("<option value=" + Object.ID + ">" + Object.TreeItem.Name + "</option>");
+}
+//---------------
+// flyToElevation
+function flyToElevation() {
+    $("#ElevationsID option:selected").each(function () {
+        var ElevationID = ($(this).val());
+        SGWorld.Navigate.FlyTo(ElevationID, 10);
+    });
+}
+
+//--------------
+// CreateObjects
+//--------------
+function CreateObjects(method) {
+    if (!bInEdit) {
+        bInEdit = true;
+        SGWorld.AttachEvent("OnLButtonClicked", DrawPolyLButtonClicked);
+        SGWorld.AttachEvent("OnRButtonUp", DrawPolyRButtonUp);
+        SGWorld.AttachEvent("OnFrame", DrawPolyOnFrame);
+        SGWorld.AttachEvent("OnInputModeChanged", DrawPolyInputModeChanged);
+
+
+        gPolyMethod = method;
+        SGWorld.Window.SetInputMode(1, abspath() + "/cursor_m.cur",true);
+        SGWorld.Window.ShowMessageBarText(SGLang.i18n("Text16"));
+        $(event.srcElement).addClass("MenuButtonHighlight");
+
+    }
+    else {
+        DrawPolyRButtonUp(0, 0, 0, 0);
+    }
+}
+//-----------
+// SelectGroupObjects
+function SelectGroupObjects() {
+
+    var node = SGWorld.ProjectTree.GetNextItem("", 10);
+    if (node == 0 || !(SGWorld.ProjectTree.IsGroup(node) || SGWorld.ProjectTree.IsLayer(node))) {
+        alert(SGLang.i18n("Text24"));
+        return;
+    }
+
+    ShowPopup(1,0);
+}
+//-----------
+// SelectClipboardObjects
+function SelectClipboardObjects() {
+
+    ShowPopup(2,0);
+}
+
+//-------------
+// DrawPoly
+function DrawPoly(geometry, type, altitudeType) {
+    // create a polyline, under the hidden group, using this geometry and send the objID to the popup
+    var lineGroup = SGWorld.ProjectTree.CreateGroup(SGLang.i18n("Text28"), SGWorld.ProjectTree.HiddenGroupID);       // SGWorld.ProjectTree.RootID
+    var line = SGWorld.Creator.CreatePolyline(geometry, "#FC8220", 3, lineGroup, "ProfileLine");
+    line.LineStyle.Width = -4;
+    line.SetParam(5440, 1);
+
+    ShowPopup(0, lineGroup);
+    return true;
+
+}
+
+
+//----------------
+//  ShowPopup 
+function ShowPopup(ProfileType, ObjID) {
+
+    
+    if (!ValidateInput())
+        return false;
+    var CompareStr = "";
+    var CompareMode = $("#CompareMode").val();
+    var Density = $("#DensityID").val();
+
+    if (CompareMode == "1")
+    {
+        $("#ElevationsID option:selected").each(function () {
+            CompareStr = "&ElevationID="+$(this).val();
+        });
+        if (CompareStr == "") {
+            alert(SGLang.i18n("Text26"));
+            SGWorld.ProjectTree.DeleteItem(ObjID);
+            Reset(0, 0);
+            return;
+        }
+    }
+    // Remove previos popup
+    SGWorld.Window.RemovePopupByCaption(gPopupCaption);
+
+    gPopupCaption = SGLang.i18n("Text14") + " " + Date().toString();
+    var url = abspath() + "/TerrainProfilePopup.html?Type=" + ProfileType + "&ObjID=" + ObjID + "&Density=" + Density + "&Compare=" + CompareMode + CompareStr + "&Caption=" + gPopupCaption + "&lang=" + SGLang.getCode();
+    //    var popupMsg = SGWorld.Creator.CreatePopupMessage(gPopupCaption, url, 1, SGWorld.Window.Rect.Height * 2 / 3, SGWorld.Window.Rect.Width - 2, SGWorld.Window.Rect.Height / 3 - 55, -1);
+    var popupMsg = SGWorld.Creator.CreatePopupMessage(gPopupCaption, url, 1, -1000, 100, 100, -1);
+
+    popupMsg.Flags = 2 + 32;
+    SGWorld.Window.ShowPopup(popupMsg);        
+
+    Reset(0, 0);
+}
+
+
+//---------------
+// ValidateInput
+function ValidateInput() {
+    return true;
+}
+//--------------
+// CheckNumberEx
+function CheckNumberEx(field, defVal, MinNum, MaxNum) {
+    try {
+        field.value = validateNumber(field.value);
+
+        if (field.value < MinNum)
+            field.value = MinNum;
+        if (field.value > MaxNum)
+            field.value = MaxNum;
+    }
+    catch (e) { field.value = defVal }
+}
+
+</script>
+
+</body>
+</html>
+
+
+<!--Sig:00000040gCDs9m8bCxbziuTHTWvi.9wqY6eqFIP4xbcbTySdT18rgR7ju6KH#aImsTx6#UNxHBfe7NsR4UENRAj.ypshJ2JJ-->
diff --git a/TEWin/Resources/TerrainProfile/TerrainProfile.ico b/TEWin/Resources/TerrainProfile/TerrainProfile.ico
new file mode 100644
index 0000000..3563204
--- /dev/null
+++ b/TEWin/Resources/TerrainProfile/TerrainProfile.ico
Binary files differ
diff --git a/TEWin/Resources/TerrainProfile/TerrainProfilePopup.html b/TEWin/Resources/TerrainProfile/TerrainProfilePopup.html
new file mode 100644
index 0000000..6753e39
--- /dev/null
+++ b/TEWin/Resources/TerrainProfile/TerrainProfilePopup.html
@@ -0,0 +1,919 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+    <title>ToolTitle</title>
+    <meta http-equiv="X-UA-Compatible" content="IE=9"/>
+
+    <link rel="StyleSheet" href="../Style.css" type="text/css">
+    <style>
+        .MenuButton
+        {
+            height: 78px;
+            width: 64px;
+            margin: 3px;
+			padding: 0px;
+            white-space: normal;
+        }
+        .MenuButtonHighlight
+        {
+            color: Red;
+            font-weight: bold;
+        }
+        html, body
+        {
+            height:100%;
+        }
+        html, body {
+    height: 100%;
+    margin: 0px;
+    padding: 0px;
+}
+
+#wrapper {
+    width: 100%;
+    height: 100%;
+    margin: auto;
+    position: relative;
+}
+
+#header {
+    height: 40px;
+    
+}
+
+#content {
+    position:absolute;
+    bottom:0px;
+    top: 40px;
+    width:100%;
+    overflow: auto;
+    
+}
+    </style>
+</head>
+<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" style="border: 0;
+    overflow: auto; height:100%;overflow:hidden" id="Body" onload="Init()" onunload="Exit();" oncontextmenu_="return false;">
+    
+<div id="abortDiv" style="display:none;">
+<table border=0 style="width:100%; height:100%;" id="Table1" style="display:none;" cellspacing=0 cellpadding=1>
+    <tr tyle="width:100%">
+    <td align="center">
+    <span class="i18n" style="font-size:24px">Text4</span> 
+</td>
+</tr>
+</table>
+</div> 
+<div id="header">
+<table border=0 style="width:100%;display:none; " id="mainTbl" cellspacing=0 cellpadding=1>
+    <tr style="width:100%; height:40px;">
+    <td align="left">
+        <span style="padding-left:30px;" />
+        <img src="img/ZoomOut.png" style="cursor:pointer;" onclick="gPlot.zoomOut();" align="absmiddle" />
+        <img src="img/ZoomIn.png" style="cursor:pointer;" onclick="gPlot.zoom();"  align="absmiddle" /> 
+        <img src="img/Zoomall.png" style="cursor:pointer;" onclick="DrawGraph();"  align="absmiddle" /> 
+        <span style="padding-left:30px;" />
+        <input type="checkbox" id= "WaypointsID" style="width:15px;  vertical-align:middle;" onclick="DrawGraph();"  /><img src="img/waypoint.jpg" align="absmiddle" /><span class="i18n">Text50</span>
+        <span style="padding-left:10px;" />
+        <input type="checkbox" id="MinMaxAltID" style="width:15px;  vertical-align:middle;"  onclick="DrawGraph();"/><img src="img/minmaxAlt.jpg" align="absmiddle" /><span class="i18n">Text48</span>
+        <span style="padding-left:10px;" />
+        <input type="checkbox" id="MinMaxSlopeID" style="width:15px;  vertical-align:middle;" onclick="DrawGraph();"/><img src="img/minmaxSlope.jpg" align="absmiddle" /><span class="i18n">Text49</span>
+        <span style="padding-left:10px;" />
+        <span class="i18n">Text51</span> <span class="i18n" id="UnitID"></span>
+    </td>
+    <td align="right">
+        <button style="background-color:#2b2b2b; border:0px solid black; color:White; height:25px;" id="CreateLayerButton" onclick="CreateLayer();"><span class="i18n">Text40</span></button>
+        <span style="padding-left:10px;" />
+    </td>
+</tr>
+</table>
+</div>
+<div id="content">
+    <div class="demo-container" style="height:100%;width:100%; ">
+      <div id="chartdiv" style="height:100%;width:99%; "></div>
+      </div>
+    </div>
+</div>
+    <object id="SGWorld" style="display:none" classid="CLSID:3A4F9199-65A8-11D5-85C1-0001023952C1">    </object>
+
+<script language="javascript" src="../ToolsCommon65.js"></script>
+
+
+	    <script language="javascript" type="text/javascript" src="../jquery/jquery.min.js"></script>
+	    <script language="javascript" type="text/javascript" src="../jquery/jquery.flot.min.js"></script>
+    	<script language="javascript" type="text/javascript" src="../jquery/jquery.flot.navigate.min.js"></script>
+      	<script language="javascript" type="text/javascript" src="../jquery/jquery-ui-1.10.4.custom.min.js"></script>
+        <script language="javascript" type="text/javascript" src="../jquery/jquery.flot.resize.min.js"></script>
+        <script language="javascript" type="text/javascript" src="../jquery/jquery.flot.symbol.min.js"></script>
+
+
+<script language="JavaScript">
+  
+//** this is a global variables for the polyline/polygon drawings
+var gPolyObj =null;
+var gPolyMethod;
+var gPolygonText = SGLang.i18n("Text35");
+var gPolylineText = SGLang.i18n("Text36");
+var gDrawPolyClick = null;
+var gEndDrawPoly = DrawPoly;
+var gAbort = false;
+//**
+
+var isGroupFlag = false;
+var lineCounter = 0;
+var objectNameIndex = 0;
+var gSamplingInterval = [];
+var gObjectName = [];
+var gFollowLineGroup ;
+
+var isPolyline = true;              // Decided to switch to PolylineLayer. If we want to switch to the point layer in the future, we can change the true condition.
+//var gPointLayer;                  // gPointLayer has been changed in order to create a polyline layer with the same code
+var gLayer;
+
+var tmpGroundDistance = 0;
+var gPositionsArray = [];
+var gAltitudeArray = [];
+var gPointsArray = [];
+var gMaxAltitudeArray = [];
+var gMinAltitudeArray = [];
+var gMaxSlopeArray = [];
+var gMinSlopeArray = [];
+var gWaypointsArray = [];
+
+var gLinePointsArray = [];
+var gTotalDistance = [];
+var gGroundDistance = [];
+var gHorizontalDistance = [];
+var gNumPoints = 0;
+var gPointsIndex = 0;
+var gNumLines = 0;
+var gWaypointIndex = 0;
+var gVisibilityDistance;
+var gSpacing = 1;
+var gDensity = 1;
+var gGraphReady = false;
+var gFoundLine = false;
+var gExtraLines = 0;
+var gUnit = 1.0;
+var unitMethod = SGLang.i18n("Text57");
+var gColorArray = ["#ff0000", "#00ff00", "#0000FF", "#FF00FF", "#C0FFFF", "#FFFF00", "#FFC119", "#B16CF8", "#D2FF01", "#AD8943"];
+var gColorArray2 = [255, 65280, 16711680, 12583104, 16777152, 65535, 4499444, 16280753, 65490, 4426157];
+
+var gCaption;
+var gActionType;
+
+var bInEdit;
+var bFirstTime;
+var bDontAskme;
+var gPlot;
+///var gTotalHours;
+
+var gDisableChangeInputMode = 0;
+//--------------
+// Init
+function Init() {
+}
+
+
+$(document).ready(function() { setTimeout(StartQuery, 500); });
+//------------
+// StartQuery
+function StartQuery() {
+    try {
+        Reset(1, 0);
+        gActionType = GetParamValue("Type", "0");
+        gFollowLineGroup = GetParamValue("ObjID", "0");
+		gDisableChangeInputMode = GetParamValue("DisableChangeInputMode", "0");
+        var Compare = GetParamValue("Compare", "0");
+        gCaption = GetParamValue("Caption", "");
+        gDensity = parseInt(GetParamValue("Density", "1"));
+        if (SGWorld.GetOptionParam("AltitudeAndDistance") == 1) {       // Feet
+            gUnit = 3.28084;
+            $("#UnitID").html(SGLang.i18n("Text53"));
+            unitMethod = SGLang.i18n("Text59");
+        }
+        else {      // meters
+            $("#UnitID").html(SGLang.i18n("Text52"));
+        }
+
+
+
+        if (Compare == "1") {
+            var ElevationID = GetParamValue("ElevationID", "0");
+            var ElevationObj = SGWorld.Creator.GetObject(ElevationID);
+
+            ElevationObj.Visibility.Show = false;
+            StartProfile(gActionType);
+            ElevationObj.Visibility.Show = true;
+            StartProfile(gActionType);
+        }
+        else
+            StartProfile(gActionType);
+
+
+        setTimeout ("resizePopup();",500);
+    }
+    catch (e) { alert(e); }
+}
+//------------
+// resizePopup
+function resizePopup() {
+    if (!gFoundLine)
+        return;
+
+    var popupMsg = SGWorld.Window.GetPopupByCaption(gCaption);
+    popupMsg.Left = 1;
+    popupMsg.Top =    SGWorld.Window.Rect.Height * 2 / 3;
+    popupMsg.Height = SGWorld.Window.Rect.Height / 3;
+    popupMsg.Width =  SGWorld.Window.Rect.Width - 2;
+
+    if (gPointsIndex > 0) {
+        CalcMinMax();
+        gGraphReady = true;
+        DrawGraph();
+    }
+
+    Reset(0, 0);
+    /// setTimeout("$('<span> </span>').appendTo(document.body);", 100);  // Do not remove this line. It fixes a redraw problem.
+
+
+    if (gAbort){
+        $("#abortDiv").show();
+        $("#header").hide();
+        $("#content").hide();
+    }
+    $("#mainTbl").css('display', 'inline');
+
+   setTimeout("resizePopup1();", 1000);
+}
+//-------
+// resizePopup1
+function resizePopup1() {
+    var popupMsg = SGWorld.Window.GetPopupByCaption(gCaption);
+    popupMsg.Height = popupMsg.Height+1 ;
+}
+//------------
+// Exit
+function Exit()
+{
+    try {
+        if (gFollowLineGroup != "0" && gActionType != "3")      // && !$("#CreateLayerButton")[0].disabled     - include this condition to the if if you don't want to remove the FollowLine
+            SGWorld.ProjectTree.DeleteItem(gFollowLineGroup);
+    }
+    catch (e) { }
+    
+}
+//----------------
+//--  StartProfile
+function StartProfile(ActionType) {
+        switch (ActionType) {
+            case "0": // Manual drawing
+                DrawGroup(gFollowLineGroup);
+                break;
+            case "1":   // Group selection
+                SelectGroupObjects();
+                break;
+            case "2":   // Clipboard
+                SelectClipboardObjects();
+                break;
+            case "3":   // 3D line (from Threat Dome analysis)
+                for (var i = 0; i < 10; i++) {
+                    var a = "ObjID" + i;
+                    var objID = GetParamValue(a, "0");
+                    if (objID != "0")
+                        if (Draw3DLine(objID)== false){
+                            gAbort = true;
+                        }
+                }
+                break;
+        }
+}
+
+//------------------
+// Reset
+//------------------
+function Reset(FirstTime, FromMouseInputMode) {
+
+
+    gPolyObj = null;
+    gLayer = null;
+    bDontAskme = false;
+    gVisibilityDistance = 4000;
+
+    $("#lineButton").removeClass("MenuButtonHighlight");
+    $("#areaButton").removeClass("MenuButtonHighlight");
+    $("#groupButton").removeClass("MenuButtonHighlight");
+    $("#clipboardButton").removeClass("MenuButtonHighlight");
+
+    SGWorld.ProjectTree.EnableRedraw(1);
+    SGWorld.Window.HideMessageBarText();
+
+    bInEdit = false;
+
+    if (FirstTime != 1 && FromMouseInputMode == 0)
+	{
+		if(gDisableChangeInputMode==0)
+			SGWorld.Window.SetInputMode(0);
+	}
+}
+//-----------
+// DrawGroup
+function DrawGroup(node) {
+    SGWorld.Window.ShowMessageBarText(SGLang.i18n("Text19"));
+
+    searchGeometries2(node, DrawPoly);
+
+    //   Reset(0, 0);
+}
+//-------------
+// Draw3DLine
+function Draw3DLine(node) {
+    gPointsIndex = 0;
+    gPositionsArray[gNumLines] = [];
+    gAltitudeArray[gNumLines] = [];
+    var lineWaypointPositions = [];
+    gFoundLine = true;
+    var totlaDistance = 0;
+
+    var line = SGWorld.Creator.GetObject(node);
+    gNumPoints = line.Geometry.Points.count;
+    for (var k = 0; k < line.Geometry.Points.count; k++)   // calculate total distance
+        lineWaypointPositions[k] = SGWorld.Creator.CreatePosition(line.Geometry.Points.Item(k).X, line.Geometry.Points.Item(k).Y, line.Geometry.Points.Item(k).Z, 3, 0, 0, 0, 0);
+
+    for (var k = 1; k < line.Geometry.Points.count; k++)   // calculate total distance
+        totlaDistance += lineWaypointPositions[k - 1].DistanceTo(lineWaypointPositions[k]);
+
+    gSpacing = totlaDistance / 1000 / gDensity;
+
+    for (var k = 0; k < line.Geometry.Points.count; k++)   // calculate total distance
+        if (AddPoint(lineWaypointPositions[k], false, true)==false)
+            return false;
+
+    gTotalDistance[gNumLines] = totlaDistance;
+    gSamplingInterval[gNumLines] = gSpacing;
+
+    gNumLines += 1;
+
+}
+//-----------
+// SelectGroupObjects
+function SelectGroupObjects() {
+    var node = SGWorld.ProjectTree.GetNextItem("", 10);
+    if (node == 0 || !(SGWorld.ProjectTree.IsGroup(node) || SGWorld.ProjectTree.IsLayer(node))) {
+        alert(SGLang.i18n("Text24"));
+        return;
+    }
+    SGWorld.Window.ShowMessageBarText(SGLang.i18n("Text19"));
+    gFoundLine = false;
+    searchGeometries2(node, DrawPoly);
+    GetFunctionName(node);
+    isGroupFlag = true;
+    if (!gFoundLine)
+        alert(SGLang.i18n("Text56"));
+}
+//-----------
+// SelectClipboardObjects
+function SelectClipboardObjects() {
+
+    SGWorld.Window.ShowMessageBarText(SGLang.i18n("Text19"), -1);
+    gFoundLine = false;
+    searchGeometriesClipboard(DrawPoly);
+    if (!gFoundLine)
+        alert(SGLang.i18n("Text29"));
+}
+
+//-------------
+// DrawPoly
+function DrawPoly(geometry, type, altitudeType) {
+    SGWorld.Window.ShowMessageBarText(SGLang.i18n("Text19"));
+    SGWorld.ProjectTree.EnableRedraw(0);
+
+    if (!ValidateInput())
+        return false;
+    if (gNumLines > 9) {
+        alert(SGLang.i18n("Text20"));
+        return false;
+    }
+    if (type == 1) {
+        if (!DrawOnPolyline(geometry, type, altitudeType)){
+            gAbort = true;
+            return false;
+        }
+    }
+
+    return true;
+
+}
+//----
+// DrawOnPolyline
+function DrawOnPolyline(polylineGeometry, type, altitudeType) {
+    var lastCoord;
+    var currCoord;
+    var tmpCoord;
+    var SegmentLength;
+    var lastSegmentLenght;
+    var totlaDistance = 0;
+    var tmpHorizontal = 0;
+    gPointsIndex = 0;
+    gFoundLine = true;
+    gPositionsArray[gNumLines] = [];
+    gAltitudeArray[gNumLines] = [];
+    var lineWaypointPositions = [];
+
+    // Houre glass cursor
+	if(gDisableChangeInputMode==0)
+		SGWorld.Window.SetInputMode(1, abspath()+"/hourglass.cur", true);
+
+    for (var k = 0; k < polylineGeometry.Points.count; k++)   // calculate total distance
+    {
+        // We must convert the altitudes to absolute to avoid problems related to terrain changes during the loops below
+        //var Altitude = SGWorld.Terrain.GetGroundHeightInfo(polylineGeometry.Points.Item(k).X, polylineGeometry.Points.Item(k).Y, 2, true).Position.Altitude;
+        var Altitude = 0;       // According to bug #20540 we decided to flat the polyline by setting all altitdutes to 0
+        lineWaypointPositions[k] = SGWorld.Creator.CreatePosition(polylineGeometry.Points.Item(k).X, polylineGeometry.Points.Item(k).Y, Altitude, 3);
+        if (k > 0) {
+            totlaDistance += lineWaypointPositions[k - 1].DistanceTo(lineWaypointPositions[k]);
+            tmpHorizontal += SGWorld.CoordServices.GetDistance(polylineGeometry.Points(k - 1).X, polylineGeometry.Points(k - 1).Y, polylineGeometry.Points(k).X, polylineGeometry.Points(k).Y);
+        }
+    }
+
+    //gSpacing = Math.max(totlaDistance / 1000 / gDensity, 1 / gDensity);
+    gSpacing = totlaDistance / 1000 / gDensity;
+
+    gNumPoints = totlaDistance / gSpacing;
+    var firstSegment = true;
+
+    for (var i = 1; i < polylineGeometry.Points.count; i++) {
+        lastCoord = lineWaypointPositions[i-1].copy();
+        currCoord = lineWaypointPositions[i].copy();
+
+        lastCoord.yaw = lastCoord.AimTo(currCoord).yaw;
+
+        // AddWaypoint(lastCoord);
+        var Waypoint = true;
+        if (firstSegment) {
+            tmpCoord = lastCoord.Copy();
+            if (AddPoint(tmpCoord, Waypoint,false) == false)
+                return false;
+            Waypoint = false;
+        }
+        SegmentLength = lastCoord.DistanceTo(currCoord);
+        lastSegmentLenght = SegmentLength;
+
+        while (SegmentLength > 0.00001 && lastSegmentLenght >= SegmentLength) {
+            lastSegmentLenght = SegmentLength;
+            if (SegmentLength < gSpacing)
+                lastCoord = lastCoord.MoveToward(currCoord, SegmentLength);
+            else lastCoord = lastCoord.MoveToward(currCoord, gSpacing);
+            tmpCoord = lastCoord.Copy();
+            if (AddPoint(tmpCoord, Waypoint,false) == false)
+                return false;
+            Waypoint = false;
+            SegmentLength = lastCoord.DistanceTo(currCoord);
+        }
+
+        firstSegment = false;
+    }
+
+    //// Add lst point
+    tmpCoord = currCoord.Copy();
+    if (AddPoint(tmpCoord, true,false) == false)
+        return false;
+
+    // fix for bug #14439
+    //Restore3DModelToGroundObject();
+
+    gNumLines += 1;
+
+    gTotalDistance[lineCounter] = totlaDistance;
+    gSamplingInterval[lineCounter] = gSpacing;
+    gHorizontalDistance[lineCounter] = (tmpHorizontal * gUnit).toFixed(2);
+    gGroundDistance[lineCounter] = (tmpGroundDistance * gUnit).toFixed(2);
+    //var a = (SGWorld.Analysis.MeasureTerrainGroundDistance(polylineGeometry, gSamplingInterval, true) * gUnit).toFixed(2);
+    tmpGroundDistance = 0;
+    lineCounter++;
+    return true;
+}
+
+//-------------
+// AddPoint
+function AddPoint(pos, waypoint, fromThreatDome) {
+    if(SGWorld.GetParam(9901)) // user click on the ESC button in TE
+        return false;
+
+    var position1 = pos.ToAbsolute(0);
+    if (!fromThreatDome) {
+        var Altitude = SGWorld.Terrain.GetGroundHeightInfo(position1.X, position1.Y, 2, true).Position.Altitude;
+        position1.Altitude = Altitude;
+    }
+    else
+        Altitude = pos.Altitude;
+
+    gPointsArray[gNumLines] = gPointsIndex;
+    gPositionsArray[gNumLines][gPointsIndex] = position1;
+    gAltitudeArray[gNumLines][gPointsIndex] = [gPointsIndex * gSpacing * gUnit, Altitude * gUnit];
+    if (waypoint) {
+        gWaypointsArray[gWaypointIndex] = [gPointsIndex * gSpacing * gUnit, Altitude * gUnit];
+        gWaypointIndex += 1;
+    }
+
+    SGWorld.Window.ShowMessageBarText(SGLang.i18n("Text3") + " [" + (gNumLines + 1) + "] : " + Math.floor((gPointsIndex / gNumPoints) * 100) + "%"+ SGLang.i18n("TextAbort"));
+    if (gPointsIndex >= 1)
+        tmpGroundDistance += gPositionsArray[gNumLines][gPointsIndex - 1].DistanceTo(gPositionsArray[gNumLines][gPointsIndex]);
+    gPointsIndex += 1;
+    return true;
+}
+//-------------
+// CalcMinMax
+function CalcMinMax() {
+
+    for (var Line = 0; Line < gNumLines; Line++) {
+        gMaxAltitudeArray[Line] = [0, -9999999];
+        gMinAltitudeArray[Line] = [0, 9999999];
+        var maxSlope = -999999;
+        var minSlope = 999999;
+
+        for (var Point = 0; Point <= gPointsArray[Line]; Point++) {
+            var Altitude = gPositionsArray[Line][Point].Altitude * gUnit;
+            // Min / Max altitude
+            if (Altitude > gMaxAltitudeArray[Line][1])
+                gMaxAltitudeArray[Line] = gAltitudeArray[Line][Point];
+
+            if (Altitude < gMinAltitudeArray[Line][1])
+                gMinAltitudeArray[Line] = gAltitudeArray[Line][Point];
+
+            // Min / Max Slope
+            var Slope = CalcSlope(Line, Point);
+            if (Slope > maxSlope) {
+                gMaxSlopeArray[Line] = gAltitudeArray[Line][Point];
+                maxSlope = Slope;
+            }
+
+            if (Slope < minSlope) {
+                gMinSlopeArray[Line] = gAltitudeArray[Line][Point];
+                minSlope = Slope;
+            }
+            
+    
+        }
+    }
+
+}
+
+//------------
+//  DrawGraph
+function DrawGraph() {
+    if (!gGraphReady)
+        return;
+    gExtraLines = 0;
+    lineCounter = 0;
+    var data = [];
+    if ($("#MinMaxAltID").attr('checked')) {
+        data.push({ data: gMaxAltitudeArray, points: { show: true, symbol: "square", radius: 4 }, color: "#ff00ff" });
+        data.push({ data: gMinAltitudeArray, points: { show: true, symbol: "square", radius: 4 }, color: "#ff00ff" });
+        gExtraLines += 2;
+    }
+    if ($("#MinMaxSlopeID").attr('checked')) {
+        data.push({ data: gMaxSlopeArray, points: { show: true, symbol: "diamond", radius: 4 }, lines: { show: false }, color: "#0000ff" });
+        data.push({ data: gMinSlopeArray, points: { show: true, symbol: "diamond", radius: 4 }, lines: { show: false }, color: "#0000ff" });
+        gExtraLines += 2;
+    }
+    if ($("#WaypointsID").attr('checked')) {
+        data.push({ data: gWaypointsArray, points: { show: true, symbol: "circle", radius: 2 }, lines: { show: false }, color: "#000000" });
+        gExtraLines += 1;
+    }
+    // 
+    for (var i = 0; i < gNumLines; i++)
+    {
+        data.push({ data: gAltitudeArray[i], label: SGLang.i18n("Text15") + ": " + (i + 1) + "   " + SGLang.i18n("Text58") + ": " + gGroundDistance[i] + unitMethod, lines: { show: true, fill: false }, color: gColorArray[i] });
+    }
+
+    gPlot = $.plot("#chartdiv", data,
+    {
+        xaxis: { zoomRange: [0, ], panRange: [0, ] },
+
+        grid: {
+            hoverable: true,
+            clickable: true
+        },
+        zoom: {
+            interactive: true
+        },
+        pan: {
+            interactive: true
+        },
+        legend: {
+            labelFormatter: function (label, series) {
+                if (lineCounter >= gNumLines)
+                    lineCounter = 0;
+                lineCounter++;
+                if (isGroupFlag)
+                    return '<div id="labelTooltip" style="cursor:pointer" title="' + SGLang.i18n("Text60") + ': ' + gSamplingInterval[lineCounter - 1].toFixed(1) + '&#13;' + SGLang.i18n("Text62") +': ' + gObjectName[lineCounter - 1] + '&#13;' + SGLang.i18n("Text61") +': ' + gHorizontalDistance[lineCounter - 1] + '" style=BORDER:1px solid #fdd;font-size:12px;padding:2px;opacity:0.8;>' + label + '</div>';
+                else return '<div id="labelTooltip" style="cursor:pointer" title="' + SGLang.i18n("Text60") + ': ' + gSamplingInterval[lineCounter - 1].toFixed(1) + '&#13;' + SGLang.i18n("Text61") +': ' + gHorizontalDistance[lineCounter - 1] + '" style=BORDER:1px solid #fdd;font-size:12px;padding:2px;opacity:0.8;>' + label + '</div>';
+            }
+        }
+    });
+
+    $("<div id='tooltip'></div>").css({
+        position: "absolute",
+        display: "none",
+        border: "1px solid #fdd",
+        padding: "2px",
+        "background-color": "#fee",
+        opacity: 0.80,
+        fontSize: "12px"
+    }).appendTo("body");
+
+
+    // Tooltip
+    $("#chartdiv").bind("plothover", function (event, pos, item) {
+        if (item) {
+            ToolTip(item, item.seriesIndex - gExtraLines, item.dataIndex);
+        } else {
+            $("#tooltip").hide();
+        }
+    });
+
+    // Click the graph
+    $("#chartdiv").bind("plotclick", function (event, pos, item) {
+        if (item) {
+            JumpToPoint(item.seriesIndex - gExtraLines, item.dataIndex);
+        }
+    });
+
+}
+//-------------
+// Tool tip
+function ToolTip(item, Line, Point) {
+
+    if (Line >= gNumLines)  // Max/Min altitude/slope
+        return;
+
+
+    var htmlStr = "";
+    var Slope = CalcSlope(Line, Point);
+    if (SGWorld.GetOptionParam("ShowMGRS"))         // if MGRS checkbox is checked
+        htmlStr = "X: " + gPositionsArray[Line][Point].X.toFixed(5) + "<br/>Y: " + gPositionsArray[Line][Point].Y.toFixed(5) + "<br/>MGRS: " + SGWorld.CoordServices.ConvertCoordinateToMGRS(gPositionsArray[Line][Point].X, gPositionsArray[Line][Point].Y) + "<br/>" + SGLang.i18n("Text45") + ": " + gAltitudeArray[Line][Point][1].toFixed(2) + "<br/>" + SGLang.i18n("Text47") + ": " + Slope.toFixed(2) + "\u00B0";
+    else htmlStr = "X: " + gPositionsArray[Line][Point].X.toFixed(5) + "<br/>Y: " + gPositionsArray[Line][Point].Y.toFixed(5) + "<br/>" + SGLang.i18n("Text45") + ": " + gAltitudeArray[Line][Point][1].toFixed(2) + "<br/>" + SGLang.i18n("Text47") + ": " + Slope.toFixed(2) + "\u00B0";
+
+    $("#tooltip").html(htmlStr)
+					.css({ top: item.pageY + 5, left: item.pageX + 5 })
+					.fadeIn(200);
+
+}
+
+//-------------
+// Tool tip
+function LineToolTip(item) {
+    var htmlStr = "";
+    htmlStr = "X: " + item;
+
+    $("#labelTooltip").html(htmlStr)
+					.css({ top: item.pageY + 5, left: item.pageX + 5 })
+					.fadeIn(200);
+
+}
+//-------------
+//  CalcSlope
+function CalcSlope (Line, Point) {
+    var tmpPos = gPositionsArray[Line][Point].Copy();
+    var Slope;
+
+    if (Point >= gPointsArray[Line] ) {
+        nextPoint = gPositionsArray[Line][Point - 1].Copy();
+        Slope = nextPoint.AimTo(tmpPos).Pitch;
+    }
+    else {
+        nextPoint = gPositionsArray[Line][Point + 1].Copy();
+        Slope = tmpPos.AimTo(nextPoint).Pitch;
+    }
+
+    return Slope;
+}
+//-------------
+// JumpToPoint
+function JumpToPoint (Line, Point)
+{
+    if (Line >= gNumLines)  // Max/Min altitude/slope
+        return;
+
+    var nextPoint;
+    var nextSign;
+
+    if (Point >= gPointsArray[Line]) {
+        nextPoint = gPositionsArray[Line][Point - 1].Copy();
+        nextSign = 1;
+    }
+    else {
+        nextPoint = gPositionsArray[Line][Point + 1].Copy();
+        nextSign = -1;
+    }
+
+    var jumpPos = gPositionsArray[Line][Point].Copy();
+    var tmpPos = gPositionsArray[Line][Point].Copy();
+    jumpPos.Distance = 250;
+    jumpPos.Pitch = -60;
+    jumpPos.Yaw = tmpPos.AimTo(nextPoint).Yaw + 90*nextSign;
+
+    SGWorld.Navigate.JumpTo(jumpPos);
+}
+//-----------
+// Create Layer
+function CreateLayer() {
+    var cLineString = [];
+    for (var i = 0; i < gNumLines; i++) {
+        for (var j = 0; j < gPointsArray[i]; j++) {
+            cLineString.push(gPositionsArray[i][j].X, gPositionsArray[i][j].Y, gPositionsArray[i][j].Altitude);
+            DrawObject(gPositionsArray[i][j], i , j);
+        }
+        if (isPolyline)
+        {
+            DrawPolyline(cLineString, i);
+            cLineString = [];
+        }
+    }
+    gLayer.Save();
+    if (gFollowLineGroup != "0" && gActionType != "3") {
+        //var groupID = SGWorld.ProjectTree.CreateGroup(gLayer.TreeItem.Name, "");
+        var groupID = selectGid();
+        SGWorld.ProjectTree.SetParent(gLayer.ID, groupID);
+        //SGWorld.ProjectTree.SetParent(gFollowLineGroup, groupID);
+    }
+
+    $("#CreateLayerButton").attr("disabled", true);
+}
+// selectGid
+function selectGid() {
+  var gid = SGWorld.ProjectTree.FindItem("用户数据\\临时数据");
+  if (!gid) {
+    var pid = SGWorld.ProjectTree.FindItem("用户数据");
+    if (!pid) {
+      pid = SGWorld.ProjectTree.CreateGroup("用户数据", "");
+    }
+    gid = SGWorld.ProjectTree.CreateGroup("临时数据", pid);
+  }
+
+  return gid;
+}
+//---------------
+function DrawObject(position, i, j) {
+    var ObjType;
+    var LayerColor;
+    if (isPolyline)
+        ObjType = "Polyline";
+    else ObjType = "ImageLabel";
+
+    LayerColor = LayerColorFunction(i);
+
+    var size = -2;
+
+    if (gLayer == null) {
+        CreateGroupOrLayer();
+
+            // style the feature group
+            if (featureLayerStyles[ObjType] != null) {
+                var result = featureLayerStyles[ObjType](size, abspath() + "/img/point.gif"); // ,"[Color]");
+                if (result === false)
+                    return false;
+            }
+    }
+    try {
+        if (!isPolyline)
+            gLayer.FeatureGroups.Point.CreateFeature([position.X, position.Y, position.Altitude], (i + 1) + ";" + Altitude + ";" + LayerColor);
+    }
+    catch (ex)
+    {
+        alert(ex);
+    }
+
+    return true;
+
+}
+
+    // -------------- 
+function DrawPolyline(cLineString, i)
+{
+    layerColor = LayerColorFunction(i);
+
+    try {
+        var cLineStringGeometry = SGWorld.Creator.GeometryCreator.CreateLineStringGeometry(cLineString);
+        gLayer.FeatureGroups.Polyline.CreateFeature(cLineStringGeometry, gGroundDistance[i] + ";" + gHorizontalDistance[i] + ";" + layerColor);
+    }
+    catch (err) {
+        alert(err.description);
+    }
+}
+
+// ------------
+function LayerColorFunction(i)
+{
+    if (i < 10)
+        return gColorArray2[i];
+    else
+        return (255 + 0 * 256 + 0 * 65536); // red
+
+}
+
+//----------
+//    CreateGroupOrLayer
+function CreateGroupOrLayer() {
+
+
+    if (gLayer == null) {
+        var postfix = new Date().getTime();
+        var LayerName = SGLang.i18n("Text13") + " - " + postfix;
+        if (isPolyline) {
+            gLayer = SGWorld.Creator.CreateNewFeatureLayer(LayerName, LayerGeometryType.LGT_POLYLINE, "FileName=TerrainProfile" + postfix + ".shp;TEPlugName=OGR;", SGWorld.ProjectTree.RootID);
+        }
+        else
+            gLayer = SGWorld.Creator.CreateNewFeatureLayer(LayerName, LayerGeometryType.LGT_POINT, "FileName=TerrainProfile" + postfix + ".shp;TEPlugName=OGR;", SGWorld.ProjectTree.RootID);
+        gLayer.Streaming = $("#createAs").val() == "LayerStreaming";
+        gLayer.BlockWidth = gSpacing * 60;
+        gLayer.Refresh();
+        if (isPolyline)
+        {
+            gLayer.DataSourceInfo.Attributes.CreateAttribute(SGLang.i18n("Text54"), 2, 20, 2);       // Ground Distance = Total Slope
+            gLayer.DataSourceInfo.Attributes.CreateAttribute(SGLang.i18n("Text55"), 2, 20, 2);       // Total Horizontal
+        }
+        else
+        {
+            gLayer.DataSourceInfo.Attributes.CreateAttribute(SGLang.i18n("Text44"), 1, 20, 1);      // Line
+            gLayer.DataSourceInfo.Attributes.CreateAttribute(SGLang.i18n("Text45"), 2, 20, 1);      // Elevation        
+        }
+        gLayer.DataSourceInfo.Attributes.CreateAttribute(SGLang.i18n("Text46"), 1, 20, 0);          // Color
+        try {
+            gLayer.DataSourceInfo.Attributes.ImportAll = true;
+            gLayer.Visibility.MaxVisibilityDistance = gVisibilityDistance;
+        }
+        catch (err) {
+            alert(err);
+        }
+        // style the feature group
+        if (isPolyline)
+            gLayer.FeatureGroups.Polyline.DisplayAs = ObjectTypeCode.OT_POLYLINE;
+        else gLayer.FeatureGroups.Point.DisplayAs = ObjectTypeCode.OT_LABEL;
+
+    }
+
+}
+var featureLayerStyles = {
+
+    "ImageLabel": function (size, param) {
+        gLayer.FeatureGroups.Point.DisplayAs = ObjectTypeCode.OT_IMAGE_LABEL;
+        gLayer.FeatureGroups.Point.SetProperty("Image file", param)
+        gLayer.FeatureGroups.Point.SetProperty("Image Color", "[" + SGLang.i18n("Text46") + "]")
+        gLayer.FeatureGroups.Point.SetProperty("Scale", size);
+        gLayer.FeatureGroups.Point.SetProperty("Altitude Method", 1);
+        gLayer.FeatureGroups.Point.SetProperty("Limit growth", true);
+        gLayer.FeatureGroups.Point.SetProperty("Tool Tip", SGLang.i18n("Text45") + ": [" + SGLang.i18n("Text45") + "]");
+    },
+    "Polyline": function (size) {
+        gLayer.FeatureGroups.Polyline.SetProperty("Line Color", "[" + SGLang.i18n("Text46") + "]");
+        gLayer.FeatureGroups.Polyline.SetProperty("Altitude Method", 1);
+        gLayer.FeatureGroups.Polyline.SetProperty("Line Width", size);
+    }
+}
+
+
+//---------------
+// ValidateInput
+    function ValidateInput() {
+    return true;
+}
+//--------------
+// CheckNumberEx
+function CheckNumberEx(field, defVal, MinNum, MaxNum) {
+    try {
+        field.value = validateNumber(field.value);
+
+        if (field.value < MinNum)
+            field.value = MinNum;
+        if (field.value > MaxNum)
+            field.value = MaxNum;
+    }
+    catch (e) { field.value = defVal }
+}
+
+function GetFunctionName(node) {
+    var getFunctionNameNode = SGWorld.ProjectTree.GetNextItem(node, 11);
+    while (getFunctionNameNode != "") {
+        if (SGWorld.ProjectTree.IsGroup(getFunctionNameNode) || SGWorld.ProjectTree.IsLayer(getFunctionNameNode))
+            GetFunctionName(getFunctionNameNode);
+        else {
+            var Object = SGWorld.Creator.GetObject(getFunctionNameNode);
+            if (Object != null)
+                if (Object.ObjectType == 1 || Object.ObjectType == 2)
+                {
+                    gObjectName[objectNameIndex] = SGWorld.ProjectTree.GetItemName(getFunctionNameNode);
+                    objectNameIndex++;
+                }
+            }
+            getFunctionNameNode = SGWorld.ProjectTree.GetNextItem(getFunctionNameNode, 13);
+    }
+}
+</script>
+
+</body>
+</html>
+
+
+
+<!--Sig:00000040fRlM10W#5PHcUWSmKcVMuS9XHCwFU2mZ94XDDskmtDR6MBjAhT4DyEnmc1FK3uJzaRUBH0ePc0enxZ3HCL7jGAJJ-->
diff --git a/TEWin/Resources/TerrainProfile/ToolIcon.png b/TEWin/Resources/TerrainProfile/ToolIcon.png
new file mode 100644
index 0000000..fb7b867
--- /dev/null
+++ b/TEWin/Resources/TerrainProfile/ToolIcon.png
Binary files differ
diff --git a/TEWin/Resources/TerrainProfile/cursor_m.cur b/TEWin/Resources/TerrainProfile/cursor_m.cur
new file mode 100644
index 0000000..4e0076c
--- /dev/null
+++ b/TEWin/Resources/TerrainProfile/cursor_m.cur
Binary files differ
diff --git a/TEWin/Resources/TerrainProfile/help.html b/TEWin/Resources/TerrainProfile/help.html
new file mode 100644
index 0000000..ec816c4
--- /dev/null
+++ b/TEWin/Resources/TerrainProfile/help.html
@@ -0,0 +1,108 @@
+<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>
+			Terrain Profile tool
+		</tD></tr>
+		<tr><td>
+		<br>
+
+<div class=WordSection1>
+
+
+
+<p class=MsoNormal>The Terrain Profile tool displays the terrain elevation profile along a defined path, and related information on this profile such as maximum and minimum elevation values and slope. The terrain profile can also compare between the base terrain and an elevation layer.</p>
+
+<p class=ProcedureHeader style='margin-left:0in;text-indent:0in'><span dir=LTR></span>To use the Terrain Profile tool:</p>
+
+<p class=ListFirstLevel>1.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;
+
+</span><span dir=LTR></span>Enter the following parameters:</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:white;padding:1.45pt 5.75pt 4.3pt 5.75pt'>
+  <p class=MsoNormal style='margin-left:.25in;text-indent:-.25in'>Mode</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 >Select the profile mode. </p>
+  <p class=MsoNormal ><b>Normal</b> � Display a profile only for the selected polyline(s). </p>
+  <p class=MsoNormal ><b>Compare</b> � Compare the selected polyline's profile to that of a specified elevation layer. </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'>Quality</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'>Determines the distance between sample points along the polyline for which the terrain profile is being calculated. High Quality will yield a more accurate result, but take longer to calculate.</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'>Elevation Layer</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 >Select the elevation layer to which to compare the defined polyline. This parameter is only available if Compare is selected in the Mode field. </p>
+
+  </td>
+ </tr>
+
+</table>
+
+
+<p class=ListFirstLevel>2.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;
+</span><span dir=LTR></span> Select one of the following methods of designating the polyline(s) for which the terrain profile should be calculated:</p>
+<ul>
+<li><b>Follow Line</b> - A terrain profile is created along the drawn line. In the 3D Window, click the left mouse button to place the line waypoints, and right-click to complete the line.
+  </li>
+
+<li><b>Selected Group</b> - A terrain profile is created for each of the polylines in the selected group. Select the required layer from the Project Tree, and then click Selected Group.
+</li>
+
+<li><b>From Clipboard</b> - A terrain profile is created for each of the polylines in the clipboard.
+</li>
+
+</ul>
+
+</div>
+			</td></tr>
+		</table>
+
+<table>
+<tr>
+<td>
+<p class=ListFirstLevel>3.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;
+</span><span dir=LTR></span> A terrain profile graph opens, displaying the terrain elevation profile. </p>
+
+<p><b>Note:	</b>When you click any point on the graph, the corresponding point on the polyline in the 3D Window is displayed in the center of the screen. </p>
+
+<p class=ListFirstLevel>4.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;
+</span><span dir=LTR></span> If you want to export the terrain profile to a shapefile layer, click <b>Export to Layer</b>.  </p>
+<p><b>Note</b>:	When a terrain profile created for multiple lines (in a group or from clipboard), is exported to a layer, the line color on the graph corresponds to the color of the points that make up the line in the layer.</p>
+
+
+
+</td>
+</tr>
+</table>
+<br />
+<span style="font-size:11px;">Flot graph: copyright (c) 2007-2014 IOLA and Ole Laursen</span>
+</body>
+</html>
+
+
+<!--Sig:00000040VyxGyMzDNk7gMtBfLnOCA2eh9d59#PPFXEd4k.rcqCzKBKrVoknYHT7CUCJKaEah4NeucE6WJwDR2vfOFmnUGpJJ-->
diff --git a/TEWin/Resources/TerrainProfile/img/ButtonBackground.jpg b/TEWin/Resources/TerrainProfile/img/ButtonBackground.jpg
new file mode 100644
index 0000000..8f015d5
--- /dev/null
+++ b/TEWin/Resources/TerrainProfile/img/ButtonBackground.jpg
Binary files differ
diff --git a/TEWin/Resources/TerrainProfile/img/minmaxAlt.jpg b/TEWin/Resources/TerrainProfile/img/minmaxAlt.jpg
new file mode 100644
index 0000000..f071ae0
--- /dev/null
+++ b/TEWin/Resources/TerrainProfile/img/minmaxAlt.jpg
Binary files differ
diff --git a/TEWin/Resources/TerrainProfile/img/minmaxSlope.jpg b/TEWin/Resources/TerrainProfile/img/minmaxSlope.jpg
new file mode 100644
index 0000000..2d64770
--- /dev/null
+++ b/TEWin/Resources/TerrainProfile/img/minmaxSlope.jpg
Binary files differ
diff --git a/TEWin/Resources/TerrainProfile/img/point.gif b/TEWin/Resources/TerrainProfile/img/point.gif
new file mode 100644
index 0000000..8e7299f
--- /dev/null
+++ b/TEWin/Resources/TerrainProfile/img/point.gif
Binary files differ
diff --git a/TEWin/Resources/TerrainProfile/img/waypoint.jpg b/TEWin/Resources/TerrainProfile/img/waypoint.jpg
new file mode 100644
index 0000000..80c0596
--- /dev/null
+++ b/TEWin/Resources/TerrainProfile/img/waypoint.jpg
Binary files differ
diff --git a/TEWin/Resources/TerrainProfile/img/zoomall.png b/TEWin/Resources/TerrainProfile/img/zoomall.png
new file mode 100644
index 0000000..c0cd0e5
--- /dev/null
+++ b/TEWin/Resources/TerrainProfile/img/zoomall.png
Binary files differ
diff --git a/TEWin/Resources/TerrainProfile/img/zoomin.png b/TEWin/Resources/TerrainProfile/img/zoomin.png
new file mode 100644
index 0000000..b519975
--- /dev/null
+++ b/TEWin/Resources/TerrainProfile/img/zoomin.png
Binary files differ
diff --git a/TEWin/Resources/TerrainProfile/img/zoomout.png b/TEWin/Resources/TerrainProfile/img/zoomout.png
new file mode 100644
index 0000000..91babe7
--- /dev/null
+++ b/TEWin/Resources/TerrainProfile/img/zoomout.png
Binary files differ
diff --git a/TEWin/Resources/Volume/Hourglass.cur b/TEWin/Resources/Volume/Hourglass.cur
new file mode 100644
index 0000000..54e82ba
--- /dev/null
+++ b/TEWin/Resources/Volume/Hourglass.cur
Binary files differ
diff --git a/TEWin/Resources/Volume/Lang.js b/TEWin/Resources/Volume/Lang.js
new file mode 100644
index 0000000..8a24389
--- /dev/null
+++ b/TEWin/Resources/Volume/Lang.js
@@ -0,0 +1,61 @@
+锘縎GLang.lang = $.extend(SGLang.lang, {
+    ToolTitle: "SkylineGlobe - Skyline Software Systems, Inc.",
+    ToolName: "Volume Analysis",
+    resultHeader: "Volume Analysis Results",
+    help: "Help",
+    compare: "Compare",
+    select: "Select",
+    aboveSurface: "Horizontal Plane",
+    modifySelect: "Modify Terrain 鈥� Select Existing",
+    selectModifyFromlist: "Select modify terrain object(s) ",
+    selectElevationFromlist: "Select elevation layer",
+    modifyNew: "Modify Terrain 鈥� Draw New",
+    elevationLayer: "Elevation Layer",
+    quality: "Quality",
+    low: "Low",
+    medium: "Medium",
+    high: "High",
+    refresh: "Refresh list",
+    drawObjects: "Results Layer",
+    startCalculate: "Start<br\>Calculation",
+    TextAbort: " (Esc to abort)",
+    createModify: "Create<br\>Modify",
+    drawArea: "Draw<br\>Area",
+    fromClipboard: "From<br>Clipboard",
+    noPolygon: "No polygon objects were detected on the clipboard",
+    OnTerrainIgnore:"The Volume Analysis tool does not support 'On terrain' polygons",
+    sqm: "square meters",
+    cubicm: "cubic meters",
+    sqft: "square feet",
+    cubicf: "cubic feet",
+    volume: "Volume",
+    volumeResult: "Volume Analysis Result",
+    volumeType: "VolumeType",
+    volumeArea: "VolumeArea",
+    volumeAreaTitle: "Cell Area",
+    volumePlane: "Volume Horizontal Plane",
+    volumeChange: "Volume Change",
+    volumeDiff: "VolumeDiff",
+    volumeAdded: "Volume Fill",
+    volumeRemoved: "Volume Cut",
+    volumeEqual: "No Change",
+    objectVolumeAdded: "Volume <b>fill: </b>",
+    objectVolumeRemoved: "Volume <b>cut: </b>",
+    totalNetVolume: "Total net volume: ",
+    Area: "Area",
+    cut: "(cut)",
+    fill: "(fill)",
+    totalVolumeAdded: "Total volume <b>fill: </b>",
+    totalVolumeRemoved: "Total volume <b>cut: </b>",
+    PrepareClaculation: "Generating elevation buffers...",
+    calculatingVolume: "Calculating volume of object ",
+    drawPolygon: "Draw polygon around area to measure. First point defines the polygon's elevation. Right click to start the volume measurement.",
+    selectModify: "Select one or more Modify Terrain objects from the list",
+    selectElevation: "Select an Elevation Layer from the list",
+    color: "Color",
+    noElevation: "Could not find elevation layer overlap with the selected polygon",
+    Text_AlertCaption: "TerraExplorer",
+
+    Text999: ""
+});
+
diff --git a/TEWin/Resources/Volume/ToolIcon.png b/TEWin/Resources/Volume/ToolIcon.png
new file mode 100644
index 0000000..33e9ecf
--- /dev/null
+++ b/TEWin/Resources/Volume/ToolIcon.png
Binary files differ
diff --git a/TEWin/Resources/Volume/Volume.html b/TEWin/Resources/Volume/Volume.html
new file mode 100644
index 0000000..2392251
--- /dev/null
+++ b/TEWin/Resources/Volume/Volume.html
@@ -0,0 +1,647 @@
+锘�<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<script src="..\Jquery\jquery.min.js"></script>
+<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 class="s8b" >
+                <label for="Mode"  class="i18n">compare</label>
+            </td>
+            <td align="left">
+                &nbsp;<select id="CompareModeID" onchange="ChangeMode();" style="width:155pt;">
+                    <option class="i18n" value="3" selected="selected">aboveSurface</option>
+                    <option class="i18n" value="1" >modifyNew</option>
+                    <option class="i18n" value="0" >modifySelect</option>
+                    <!-- <option class="i18n" value="2" >elevationLayer</option> -->
+                    
+                </select>
+            </td>     
+        </tr>
+
+
+        <tr id="modifyListDiv">
+                <td class="s8b">
+                 <label for="Mode"  class="i18n">select</label>
+                </td>
+                <td>
+                <!--          DO NOT REMOVE THE FOCUS CALL IN THE LIST BELOW!!
+              This focus call  minimize the effect of a very strange bug. When you select an entry from the Viewshed list, click on the terrain and then ctrl-click on other list entry the HTML list control do not really recieve this additional selection (although you do see the new line highlighted).
+-->
+                <!-- <span class="i18n">selectModifyFromlist</span> -->
+                &nbsp;<select id="ModifyID" size='5' multiple onmouseover="this.focus()" ondblclick="flyToSelected('ModifyID');" style="width:100%;" >  </select> </br>
+                &nbsp;&nbsp;<span id="refresh" onclick="RefreshList('ModifyID',30);" style="text-decoration:underline;cursor:pointer;" class="i18n">refresh</span>             
+
+                </td>
+        </tr>
+<!--     
+        <tr id="elevationListDiv">
+            <td class="s8b">
+             <label for="Mode"  class="i18n">select</label>
+            </td>
+            <td>    -->
+            <!--          DO NOT REMOVE THE FOCUS CALL IN THE LIST BELOW!!
+          This focus call  minimize the effect of a very strange bug. When you select an entry from the Viewshed list, click on the terrain and then ctrl-click on other list entry the HTML list control do not really recieve this additional selection (although you do see the new line highlighted).-->
+            <!-- <span class="i18n">selectElevationFromlist</span>
+             <span  class="i18n" style="text-decoration:underline;cursor:pointer;" onclick="RefreshList('ElevationsID',38);">refresh</span> <br />
+            &nbsp;<select id="ElevationsID" size="5" ondblclick="flyToSelected('ElevationsID');" onmouseover="this.focus()" style="width:100%;" >
+            </select>
+           
+            </td>
+        </tr>
+  -->
+        <tr >
+            <td class="s8b">
+                <label for="Mode"  class="i18n">quality</label>
+            </td>
+            <td align="left">
+                &nbsp;<select id="DensityID" >
+                    <option class="i18n" value="0" >low</option>
+                    <option class="i18n" value="1" selected="selected">medium</option>
+                    <option class="i18n" value="2" >high</option>
+                </select>
+            </td>     
+        </tr>
+        <tr >
+            <td class="s8b">
+                <label for="Mode"  class="i18n">drawObjects</label>
+            </td>
+            <td align="left">
+                <label class="switch">
+					<input type="checkbox" id="showObjectsID">
+					<span class="slider round"></span>
+				</label>		                
+                <!-- &nbsp; <input type="checkbox" id="showObjectsID" /> -->
+            </td>     
+        </tr>       
+       
+        </table>
+        <tr class="s8">
+            <td colspan="2"  align="center" class="ToolButtonsArea">
+            <div id="selectModifyDiv">
+                <button id="selectModifyBtn" class="MenuButton MenuButtonLast" onclick="startCalculate();">  <img src="./img/Calculate.png" /><br /><span class="i18n">startCalculate</span></button>
+            </div>
+            
+            <div id="ModifyDiv"  style="display:none">
+                <button id="DrawModifyBtn" class="MenuButton MenuButtonLast" onclick="startCalculate();">  <img src="./img/ModifyTerrain.png" /><br /><span class="i18n">createModify</span></button>
+            </div>
+
+            <div id="SurfaceDiv" style="display:none">
+                <button id="DrawPlaneBtn" class="MenuButton" onclick="startCalculate();">               <img  src="../commonImg/polygon.png" /><br />         <span class="i18n">drawArea</span></button>
+                <button id="clipboardButton" class="MenuButton MenuButtonLast" onclick="SelectClipboardObjects()">    <img src="../commonImg/Clipboard.png" /><br />   <span class="i18n">fromClipboard</span></button>
+            </div>
+
+            </td>
+        </tr>
+    </table>
+   <!-- <object id="SGWorld" classid="CLSID:3a4f9197-65a8-11d5-85c1-0001023952c1">    </object> -->
+   <object id="SGWorld" classid="CLSID:3a4f9199-65a8-11d5-85c1-0001023952c1">    </object>
+
+
+<script language="javascript" src="../ToolsCommon71.js"></script>
+
+<script language="JavaScript">
+    //** this is a global variables for the polyline/polygon drawings
+var gDebug = false;
+var gPopupCaption = "";
+var gFoundPolygon = false;
+
+var gObjectsList = [];
+var gGeometryList = [];
+var gVolumeResultHTML = "";
+var gTotalVolumeAdded = 0;
+var gTotalVolumeRemoved = 0;
+var gLayer;
+var gCreateModifyMode = false;
+//var gElevationBuffer=[];
+var gQuaryResolution = 1024;
+var ResolutionsArray= { "0": 8, "1":4, "2":2 };
+var gOnTerrainMessageDisplayed = false;
+
+
+//var SGWorld = new ActiveXObject("TerraExplorerX.SGWorld70");
+
+Date.prototype.stdTimezoneOffset = function () {
+    var jan = new Date(this.getFullYear(), 0, 1);
+    var jul = new Date(this.getFullYear(), 6, 1);
+    return Math.max(jan.getTimezoneOffset(), jul.getTimezoneOffset());
+}
+
+Date.prototype.dst = function () {
+    return this.getTimezoneOffset() < this.stdTimezoneOffset();
+}
+
+//--------------
+// Init
+function Init() {
+    window.ondragstart = function() { return false; } 
+
+    ChangeMode();
+    gPolyObj = null;
+
+    if (SGWorld.Version.Type == 2)  // if TE Viewer remove the "Add New Modify Terrain" option because it is not available even via the API
+        $("#CompareModeID option[value='1']").detach();
+    Reset();
+}
+//------------------
+// Reset
+//------------------
+function Reset() {
+
+    GroupID = null;
+    gCreateModifyMode = false;
+    bDontAskme = false;
+    gObjectsList = [];
+    gGeometryList = [];
+    gTotalVolumeAdded = 0;
+    gTotalVolumeRemoved = 0;
+    gOnTerrainMessageDisplayed = false;
+    gVolumeResultHTML = "";
+
+    $("#DrawModifyBtn").removeClass("MenuButtonHighlight");
+    $("#DrawPlaneBtn").removeClass("MenuButtonHighlight");
+
+    SGWorld.ProjectTree.EnableRedraw(1);
+    SGWorld.Window.HideMessageBarText();
+   
+}
+//-------------------
+// ChangeMode
+function ChangeMode() {
+
+    $("#modifyListDiv").hide();
+    $("#elevationListDiv").hide();
+    $("#selectModifyDiv").hide();
+    $("#ModifyDiv").hide();
+    $("#SurfaceDiv").hide();
+
+    var CompareMode = $("#CompareModeID").val();
+
+    if (CompareMode == "0") { // Modify list
+        $("#selectModifyDiv").show();
+        $("#modifyListDiv").show();
+        RefreshList("ModifyID", 30);
+    }
+    if (CompareMode == "1") { // Modify new
+        $("#ModifyDiv").show();
+    }
+
+    if (CompareMode == "3") { // Polygon Surface
+        $("#SurfaceDiv").show();
+    }
+}
+//-------------------
+// RefreshList
+function RefreshList(list, objectType) {
+    var ModifyObjects=[];
+
+    $("#"+list).html("");
+   // BuildList(SGWorld.ProjectTree.RootID, list, objectType);
+   BuildObjectsList(SGWorld.ProjectTree.RootID, ModifyObjects, objectType);
+
+    ModifyObjects.forEach (function (val){
+        var name = SGWorld.ProjectTree.GetItemName (val);
+        $("#"+list).append("<option value=" + val + ">" + name + "</option>");
+    });
+}
+
+//---------------
+// flyToSelected
+function flyToSelected(list) {
+    $("#"+list+" option:selected").each(function () {
+        var ElevationID = ($(this).val());
+        SGWorld.Navigate.FlyTo(ElevationID, 10);
+    });
+}
+
+//--------------
+// startCalculate
+//--------------
+function startCalculate() {
+    var compareMode = $("#CompareModeID").val();
+
+    if (compareMode == 0) {   // Select existing Modify Terrain object(s)
+            if ($("#ModifyID option:selected").length == 0) {
+                TEAlert (SGLang.i18n("Text_AlertCaption"),SGLang.i18n("selectModify"));
+                return;
+            }
+            $("#ModifyID option:selected").each(function () {
+                gObjectsList.push ($(this).val());
+                gGeometryList.push(null);
+            });
+            CalculateList();
+            Reset();
+    }
+
+    if (compareMode == 1) {   // create new Modify Terrain
+        gCreateModifyMode = true;
+        SGWorld.Command.Execute(1012, 15);
+        SGWorld.AttachEvent("OnObjectAction", OnObjectAction);
+    }
+
+    if ( compareMode == 3) {   // Draw polygon (for volume above plane)
+        if (drawing.drawingEditMode !=-1) {   // already in drawing . Reset everyting
+            drawing.abort();
+        }
+        else {
+            SGWorld.Window.ShowMessageBarText(SGLang.i18n("drawPolygon"));
+            $(event.srcElement).addClass("MenuButtonHighlight");
+            drawing.drawPolygon ({
+                style: {    
+                    lineColor:"#ffffff",
+                    lineWidth: 3,
+                    fillColor: "#FFD800",
+                    fillOpacity: 0.1 // fill opacity (0-1). Default = 0
+                },
+                horizontal: true,
+                altitudeMethod:3,   // altitudeMethod - use 2 of "OnTerrain" (drape on terrain) and 3 for "Absolute" (above mean sea level). Currently other methods are not supported
+                deleteWhenExit: true, // 
+                //parentGoupID: volumeGroup,
+                saveOnExit: false,  // save the polyline/polygon when exiting the project. Default = false
+                onFinish: endDrawPolygon,
+                onAbort: Reset
+            });
+        }
+
+    }
+}
+//-------------
+// OnObjectAction
+function OnObjectAction(ObjID, action) {
+    
+    if (gCreateModifyMode && action.Code == 16) {   // Push  the new Modify Terrain object to the list and calculate the volume
+        try {
+            gCreateModifyMode = false;
+            gObjectsList.push(ObjID);
+            gGeometryList.push(null);
+            CalculateList();
+        }
+        catch (err) { if (gDebug) alert(err.message); } 
+        Reset();
+    }
+    return false;
+}
+
+//-----------
+// SelectClipboardObjects
+function SelectClipboardObjects() {
+    var compareMode = $("#CompareModeID").val();
+    gFoundPolygon = false;
+
+    searchGeometriesClipboard(calculatePolygon);
+    if (!gFoundPolygon)
+        TEAlert (SGLang.i18n("Text_AlertCaption"),SGLang.i18n("noPolygon"));
+    else {
+        if (compareMode==3)
+            CalculateListSurface();
+    }   
+
+    Reset();
+}
+//-------------
+// endDrawPolygon
+function endDrawPolygon(geometry, type, altitudeType,ObjID) {
+    var compareMode = $("#CompareModeID").val();
+    try {
+        if (calculatePolygon(geometry, type, altitudeType)){
+            if (compareMode==3)
+                CalculateListSurface();
+        }    
+       
+    }
+    catch (err) { if (gDebug) alert(err.message); } 
+
+}
+//-------------
+// calculatePolygon
+function calculatePolygon(geometry, type, altitudeType) {
+    var compareMode = $("#CompareModeID").val();
+
+    if (type != 2)
+        return true;
+    gFoundPolygon = true;
+  
+    if (compareMode==3){  // compare surface polygon
+        if (altitudeType==2){  // Ignore OnTerrain polygons
+            if (!gOnTerrainMessageDisplayed)
+                TEAlert (SGLang.i18n("Text_AlertCaption"),SGLang.i18n("OnTerrainIgnore"));
+            gOnTerrainMessageDisplayed = true;
+
+        }
+        else {
+            gObjectsList.push(altitudeType);
+            gGeometryList.push(geometry);
+        }
+    }
+    return true;
+}
+
+//-------------------
+//   CalculateList
+function CalculateList ( ) {
+    try {
+            setUnits();
+            var resultHTML="";
+            $(gObjectsList).each(function (index, value) {
+                var volumeGeometry;
+                var MeasuredObject = SGWorld.ProjectTree.GetObject(value);
+                if (gGeometryList[index]!=null)
+                    volumeGeometry = gGeometryList[index];
+                else
+                    volumeGeometry = MeasuredObject.Geometry;
+
+                var origVisability = SGWorld.ProjectTree.GetVisibility(value);
+                var qualityStep = ResolutionsArray[$("#DensityID").val()];
+
+                SGWorld.Window.ShowMessageBarText(SGLang.i18n("PrepareClaculation"), 1,-1);
+                SGWorld.ProjectTree.SetVisibility(value, false);
+                var elevationBufferBefore = getElevationBuffer (volumeGeometry, gQuaryResolution);
+
+                SGWorld.ProjectTree.SetVisibility(value, true);
+                var elevationBufferAfter = getElevationBuffer (volumeGeometry, gQuaryResolution);
+                if (calculateVolume(volumeGeometry,qualityStep, SGLang.i18n("Area")+index,elevationBufferBefore,elevationBufferAfter,-999)==false){
+                    Reset ();
+                    return false;
+                }
+                resultHTML += gVolumeResultHTML;
+                SGWorld.ProjectTree.SetVisibility(value, origVisability);
+            });
+
+            showResultPopup (resultHTML);
+        }
+        catch (err) { if (gDebug) alert(err.message); } 
+}
+//-------------------
+//   CalculateList
+// Special function to handle volume above flat surface 
+function CalculateListSurface ( ) {
+try {
+        setUnits();
+        var resultHTML="";
+
+        $(gGeometryList).each(function (index, value) {
+            var pos = SGWorld.Creator.CreatePosition (value.Rings(0).Points(0).x,value.Rings(0).Points(0).y,value.Rings(0).Points(0).z,gObjectsList[index],0,0,0,0);
+            var absPos = pos.ToAbsolute(2);
+            var qualityStep = ResolutionsArray[$("#DensityID").val()];
+
+            SGWorld.Window.ShowMessageBarText(SGLang.i18n("PrepareClaculation"), 1,-1);
+            var elevationBuffer = getElevationBuffer (value, gQuaryResolution);
+            if (calculateVolume(value,qualityStep, SGLang.i18n("Area")+index,elevationBuffer,null,absPos.Altitude)==false){
+                Reset();
+                return false; 
+            }
+            resultHTML += gVolumeResultHTML;
+
+            AddResultPolygon (value,absPos.Altitude,gVolumeResultHTML);
+        });
+
+        showResultPopup (resultHTML);
+    }
+    catch (err) { if (gDebug) alert(err.message);  } 
+}
+
+//------------------
+function showResultPopup (resultHTML){
+    var netStr = (gTotalVolumeAdded>gTotalVolumeRemoved)?SGLang.i18n("fill"):SGLang.i18n("cut");
+    resultHTML += "<br/>" + SGLang.i18n("totalNetVolume") + "<b>" + (Math.abs(gTotalVolumeAdded-gTotalVolumeRemoved)).toFixed(3) + "</b> "+ netStr+" " + gVolumeUnit + "<br/>";
+    if (gGeometryList.length > 0) 
+        DisplayMessagePopup(SGLang.i18n("ToolName"), SGLang.i18n("resultHeader"), abspath() + "/img/volumeblack.png", resultHTML, 100, 100, 400, 300, true);
+}
+//-------------
+// calculateVolume
+function calculateVolume(geometry, qualityStep,  ObjName, elevationBuffer0, elevationBuffer1, flatAltitude) {
+
+
+    var polygonGeometry = geometry.Clone(); // to enable edit geometry (ref) when geometry type is RelativeToPivot. Navon.
+    var envelope = polygonGeometry.Envelope; // Multi polygon evnelope (min/max)
+    var MinX = Math.min(envelope.Rings(0).Points(0).x, envelope.Rings(0).Points(2).x);
+    var MaxX = Math.max(envelope.Rings(0).Points(0).x, envelope.Rings(0).Points(2).x);
+    var MinY = Math.min(envelope.Rings(0).Points(0).y, envelope.Rings(0).Points(2).y);
+    var MaxY = Math.max(envelope.Rings(0).Points(0).y, envelope.Rings(0).Points(2).y);
+
+    var stepX = Math.abs(MaxX - MinX) / gQuaryResolution;
+    var stepY = Math.abs(MaxY - MinY) / gQuaryResolution;
+
+    // calculate cell 2D size
+    var cellPos0= SGWorld.Creator.CreatePosition(MinX, MaxY, 0, 3, 0, 0, 0, 1);
+    var cellPos1 = SGWorld.Creator.CreatePosition(MinX , MaxY - stepY, 0, 3, 0, 0, 0, 1);
+    var cellPos2 = SGWorld.Creator.CreatePosition(MinX + stepX, MaxY, 0, 3, 0, 0, 0, 1);
+    var cellWidth = cellPos0.DistanceTo(cellPos1) * qualityStep;
+    var cellArea = cellPos0.DistanceTo(cellPos1) * cellPos0.DistanceTo(cellPos2) * qualityStep * qualityStep * gAreaUnitFactor;
+
+//var startDate = new Date();
+    var drawObjects = $("#showObjectsID").is(':checked') ? true : false;
+    if (drawObjects) {
+        CreateLayer(cellWidth * 100, ObjName);
+        var result = featureLayerStyles["ImageLabel"](cellWidth/40, abspath() + "/img/point.png"); // ,"[Color]");
+    }
+
+    var VolumeAdded = 0;
+    var VolumeRemoved = 0;
+    var MessageBarIndex = 0;
+    var GeoIntersect= [];
+    var x,y;
+    try{
+     for (var i = qualityStep/2; i < gQuaryResolution-qualityStep; i = i + qualityStep) {
+        if(SGWorld.GetParam(9901)){ // user click on the ESC button in TE
+            if (drawObjects)
+                SGWorld.ProjectTree.DeleteItem(gLayer.ID);
+            return false;
+        }
+
+        // Build line geometry WKT
+        var WKT = "";
+        for (var j = qualityStep / 2; j < gQuaryResolution-qualityStep; j = j + qualityStep){
+            x = MinX + i * stepX;
+            y = MaxY - j * stepY;
+            WKT += "("+x+" "+y+"), ";
+        }
+        var fullWKT = "MULTIPOINT ("+ WKT.substr(0,WKT.length -2)+")";
+        var pointGeometryArry =  SGWorld.Creator.GeometryCreator.CreateGeometryFromWKT (fullWKT); // "MULTIPOINT ((10 40), (40 30), (20 20), (30 10))");
+        var GeoIntersectTmp = polygonGeometry.SpatialOperator.Intersection(pointGeometryArry);
+        var GeoIntersectCount = GeoIntersectTmp.Count;
+        if (GeoIntersectTmp.GeometryType == 0) // single point
+            GeoIntersectCount = 1;
+        else  // Multiple Points
+            GeoIntersect = GeoIntersectTmp;
+
+        for (var jj = 0; jj < GeoIntersectCount; jj++){
+            if (GeoIntersectCount==1){
+                x = GeoIntersectTmp.x;
+                y = GeoIntersectTmp.y;
+            }
+            else{
+                x = GeoIntersect(jj).x;
+                y = GeoIntersect(jj).y;
+            }
+            var objColor = "#000000";
+            var volumeType = 0;
+
+                var j = Math.round((MaxY-y)/stepY);
+                var altitude = (elevationBuffer1 != null)?  elevationBuffer1[j * gQuaryResolution + i] : flatAltitude;
+                var elevationDiff = altitude - elevationBuffer0[j * gQuaryResolution + i];
+                var volumeDiff = cellArea * elevationDiff * gDistanceUnitFactor;
+                if (elevationDiff > 0) { // Added
+                    volumeType = 1;
+                    VolumeAdded += Math.abs(volumeDiff);
+                    objColor = 65280; //  "#00ff00"; // green
+                }
+                else if (elevationDiff < 0) { // Removed
+                    volumeType = 2;
+                    VolumeRemoved += Math.abs(volumeDiff);
+                    objColor = 255; //  "#ff0000";    // red
+                }
+                else {
+                    volumeType = 0;
+                    objColor = 0; //  "#000000"; // black
+                }
+                if (drawObjects) { // && i % ObjInterval == 0 && j % ObjInterval == 0) {
+                    var altitude = (elevationBuffer1 != null)?  elevationBuffer1[j * gQuaryResolution + i] : flatAltitude;
+                    var pos = SGWorld.Creator.CreatePosition(x, y, altitude, 3, 0, 0, 0, 1);
+                    gLayer.FeatureGroups.Point.CreateFeature([pos.X, pos.Y, pos.Altitude], volumeType + ";" + cellArea.toFixed(3) + ";" + volumeDiff.toFixed(3) + ";" + objColor);
+                    //SGWorld.Creator.CreateSphere(pos, 2, 0, objColor, objColor, 2, group, "sphere");
+                }
+            } // for jj
+            MessageBarIndex++;
+            if (MessageBarIndex % 10 == 0) {
+                var progress = (i / gQuaryResolution) * 100;
+                htmlStr = SGLang.i18n("calculatingVolume") + ObjName + ": " + progress.toFixed(0) + "%"+SGLang.i18n("TextAbort");
+                SGWorld.Window.ShowMessageBarText(htmlStr, 1, -1);
+            }
+        } // for i
+    }
+    catch (err) { if (gDebug) alert(err.message);  } 
+
+//alert ((new Date() - startDate)/1000);
+    SGWorld.Window.HideMessageBarText();
+    gVolumeResultHTML = "<br/><u>" + ObjName + " ("+(polygonGeometry.Area).toFixed(3)+" "+ gAreaUnit+") :</u><br/>" + SGLang.i18n("objectVolumeAdded") + "<b>" + VolumeAdded.toFixed(3) + "</b> " + gVolumeUnit + "  <br/> " + SGLang.i18n("objectVolumeRemoved") + "<b>" + VolumeRemoved.toFixed(3) + "</b> " + gVolumeUnit + "<br/>";
+    gTotalVolumeAdded += VolumeAdded;
+    gTotalVolumeRemoved += VolumeRemoved;
+    if (drawObjects)
+        gLayer.Save();
+
+    return true;
+}
+
+//----------
+//    AddResultPolygon
+function AddResultPolygon(geometry,flatAltitude,resultHTML) {
+    try {
+        // Clear altitude values from geomerty and set it as "Relative to Pivot" with Altitude=flatAltitude
+        var WKB = geometry.Wks.ExportToWKB(false);
+        var geometryFlat = SGWorld.Creator.GeometryCreator.CreateGeometryFromWKB (WKB);
+
+        var volumeGroup = getVolumeGroup();
+
+        var PlaneObj = SGWorld.Creator.createPolygon(geometryFlat, SGWorld.Creator.CreateColor(255, 255, 255, 1), SGWorld.Creator.CreateColor(255, 255, 0, 128),3, getVolumeGroup(), SGLang.i18n("volumePlane"));
+        PlaneObj.Position.Altitude = flatAltitude;
+        var popupMsg = SGWorld.Creator.CreatePopupMessage(SGLang.i18n("volume"), "", 0,0, 400, 200, -1);
+        popupMsg.Flags = 2 + 32;
+        popupMsg.InnerText = "<html><body>"+resultHTML;
+        PlaneObj.Message.MessageID = popupMsg.ID;
+    }
+    catch (err) { if (gDebug) alert(err.message);  } 
+}
+//----------
+//    getVolumeGroup
+function getVolumeGroup() {
+    try {
+        var volumeGroup= SGWorld.ProjectTree.FindItem(SGLang.i18n("volumeResult"));
+        if (volumeGroup ==0) 
+        volumeGroup = SGWorld.ProjectTree.CreateGroup (SGLang.i18n("volumeResult"),SGWorld.ProjectTree.RootID);
+        return volumeGroup;
+    }
+    catch (err) { return SGWorld.ProjectTree.RootID;  } 
+}
+//----------
+//    CreateLayer
+function CreateLayer(blockWidth, ObjName) {
+    try {
+        var postfix = new Date().getMilliseconds();
+        var LayerName = SGLang.i18n("volume")+"-"+ObjName+"-"+ postfix;
+
+        gLayer = SGWorld.Creator.CreateNewFeatureLayer(LayerName, LayerGeometryType.LGT_POINT, "FileName=VolumeAnalysis" + postfix + ".shp;TEPlugName=OGR;", getVolumeGroup());
+        gLayer.Streaming = true;
+        gLayer.BlockWidth = blockWidth;
+        gLayer.Refresh();
+
+        gLayer.DataSourceInfo.Attributes.CreateAttribute(SGLang.i18n("volumeType"), 1, 10, 0);          // Integer (0=no change, 1=Added, 2=Removed)
+        gLayer.DataSourceInfo.Attributes.CreateAttribute(SGLang.i18n("volumeArea"), 2, 20, 2);          // Double
+        gLayer.DataSourceInfo.Attributes.CreateAttribute(SGLang.i18n("volumeDiff"), 2, 20, 2);          // Double
+        gLayer.DataSourceInfo.Attributes.CreateAttribute(SGLang.i18n("color"), 1, 20, 0);               // Integer (color)
+
+        gLayer.DataSourceInfo.Attributes.ImportAll = true;
+        gLayer.Visibility.MaxVisibilityDistance = blockWidth*50;
+        gLayer.FeatureGroups.Point.DisplayAs = ObjectTypeCode.OT_LABEL; 
+    }
+    catch (err) { if (gDebug) alert(err.message); } 
+
+}
+var featureLayerStyles = {
+
+    "ImageLabel": function (size, icon) {
+        gLayer.FeatureGroups.Point.DisplayAs = ObjectTypeCode.OT_IMAGE_LABEL;
+        gLayer.FeatureGroups.Point.SetProperty("Image file", icon)
+        gLayer.FeatureGroups.Point.SetProperty("Image Color", "[" + SGLang.i18n("color") + "]")
+        gLayer.FeatureGroups.Point.SetProperty("Scale", size);
+        gLayer.FeatureGroups.Point.SetProperty("Lock Mode", 1);
+        gLayer.FeatureGroups.Point.SetProperty("Altitude Method", 1);
+        gLayer.FeatureGroups.Point.SetProperty("Limit growth", false);
+        gLayer.FeatureGroups.Point.SetProperty("Smallest Visible Size", 1);
+        gLayer.FeatureGroups.Point.SetProperty("Tool Tip", SGLang.i18n("volumeAreaTitle") + ": [" + SGLang.i18n("volumeArea") + "] " + gAreaUnit + ", " + SGLang.i18n("volumeChange") + ": [" + SGLang.i18n("volumeDiff") + "] " + gVolumeUnit);
+    }
+}
+var gAreaUnitFactor = 1;
+var gDistanceUnitFactor = 1;
+var gAreaUnit = "";
+var gVolumeUnit = "";
+//--------------
+//setUnits
+function setUnits() {
+    if (SGWorld.GetOptionParam("AltitudeAndDistance") == 0) {
+        gAreaUnitFactor = 1;
+        gDistanceUnitFactor = 1;
+        gAreaUnit = SGLang.i18n("sqm"); ;
+        gVolumeUnit = SGLang.i18n("cubicm");
+    }
+    else {
+        gDistanceUnitFactor = 3.28084;
+        gAreaUnitFactor = gDistanceUnitFactor*gDistanceUnitFactor;
+        gAreaUnit = SGLang.i18n("sqft"); ;
+        gVolumeUnit = SGLang.i18n("cubicf");
+    }
+
+}
+
+</script>
+
+</body>
+</html>
+
+
+<!--Sig:00000040A4D6tC7Zom5gxtxWpTemnbB5tB4ONWWklxGtYL74Gk8af.GyjC6c2WZEJmRsLUMH0cRACFIY2P2B1iQRzM0NMRJJ-->
diff --git a/TEWin/Resources/Volume/cursor_m.cur b/TEWin/Resources/Volume/cursor_m.cur
new file mode 100644
index 0000000..4e0076c
--- /dev/null
+++ b/TEWin/Resources/Volume/cursor_m.cur
Binary files differ
diff --git a/TEWin/Resources/Volume/help.html b/TEWin/Resources/Volume/help.html
new file mode 100644
index 0000000..d8e2c9f
--- /dev/null
+++ b/TEWin/Resources/Volume/help.html
@@ -0,0 +1,115 @@
+锘�<html  class="helpHtml" >
+<HEAD>
+<TITLE>TerraExplorer Pro - Skyline Software Systems, Inc.</TITLE>
+<LINK REL=StyleSheet HREF="../Style.css" TYPE="text/css">
+</head>
+<body class="s8">
+		<table border=0 cellPadding=0 CELLSPACING=0 class="s8" width=100%>
+		<tr><td class="s12b" align=center>
+			Volume Analysis
+		</tD></tr>
+		<tr><td>
+		<br>
+
+<div class="s8" >
+
+
+<p class="s8">The Volume Analysis tool analyzes the volume of the terrain or model removed or added by selected horizontal planes or modify terrain/3DML objects. </p>
+
+<p class=ProcedureHeader style='margin-left:0in;text-indent:0in'><span dir=LTR></span>To use the Volume Analysis tool:</p>
+
+<p class="s8">1.<span >&nbsp;&nbsp;&nbsp;&nbsp;
+</span><span dir=LTR></span>In the <b>Compare </b>field, select one of the following analysis modes:</p>
+
+<ul  >
+  <li class="s8"><b>Horizontal Plane</b> 鈥� Calculate the volume added or removed by a horizontal plane defined either by a polygon you now draw or by polygons already on the clipboard.</li>
+  <li class="s8"><b>Modify Terrain 鈥� Draw New</b> 鈥� Calculate the volume added or removed by a new Modify Terrain object that you now create.</li>
+  <li class="s8"><b>Modify Terrain 鈥� Select Existing</b> 鈥� Calculate the volume added or removed by the Modify Terrain object(s) selected from the list.</li>
+</ul>
+<p class="s8">2.<span  >&nbsp;&nbsp;&nbsp;&nbsp;
+</span><span dir=LTR></span>Enter the required parameters</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:white;padding:1.45pt 5.75pt 4.3pt 5.75pt'>
+  <p class="s8" style='margin-left:.25in;text-indent:-.25in'>Compare</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="s8" style=''>
+  This field is displayed only when <b>Modify Terrain 鈥� Select Existing</b> mode is selected.<br />
+  Select one or more Modify Terrain objects from the list. Use CTRL-click or SHIFT-click to multi-select.<br /> 
+  Click <b> Refresh </b>to update the list if changes were made to the project.</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="s8" style='margin-left:.25in;text-indent:-.25in'>Quality</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="s8" >
+  Determines the accuracy level by which the analysis is performed. Select one of the following options:
+<ul>
+<li class="s8">Low  鈥� Performs 16K samples </li>
+<li class="s8">Medium 鈥� Performs 65K samples</li>
+<li class="s8">High 鈥� Performs 260K samples</li>
+</ul>
+  </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="s8" style='margin-left:.25in;text-indent:-.25in'>Results Layer</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="s8" >Select this option to create a point feature layer representing each volume analysis result. The area and volume (removed or added) of each sample in the feature layer is stored in attribute fields of the feature that represents the sample.</p>
+  </td>
+ </tr>
+</table>
+
+<p class="s8">&nbsp;</p>
+
+<p class="s8">3.<span >&nbsp;&nbsp;&nbsp;&nbsp;
+</span><span dir=LTR></span>Perform the steps relevant to the selected mode:</p>
+
+<p style='margin-left:.25in;' class="s8b">Horizontal Plane Mode<br /></p>
+<ul  >
+<li class="s8">Select either of the following methods to mark your area of interest:</li>
+<ul>
+<li class="s8"><b>Draw Area 鈥�</b> The area is marked by drawing a polygon in the 3D Window. If this option is selected, left-click in the 3D Window to place the polygon waypoints, and right-click to complete. </li>
+<li class="s8"><b>From Clipboard 鈥�</b> Analysis is performed in the locations of all polygon clipboard objects. The polygons must be on the clipboard before selecting this option. </li>
+</ul>
+</ul>
+<p style='margin-left:.25in;'>
+<span class="s8b">Modify Terrain 鈥� New Object Mode</span><br />
+<br />
+a.	&nbsp;&nbsp;&nbsp;&nbsp;Click Create Modify. The Modify Terrain property sheet is displayed.<br />
+b.	&nbsp;&nbsp;&nbsp;&nbsp;In the 3D Window, left-click to place the polygon waypoints, and right-click to complete.<br />
+c.	&nbsp;&nbsp;&nbsp;&nbsp;Close the property sheet to start calculation.<br />
+<br />
+<span class="s8b">Modify Terrain 鈥� Select Mode</span><br />
+</p>
+<ul><li class="s8">Click Start Calculate.</li></ul>	
+
+
+
+<p class="s8">4.<span >&nbsp;&nbsp;&nbsp;&nbsp;
+</span><span dir=LTR></span>When calculation is complete, a dialog box is displayed with the analysis results.</p>
+
+</div>
+
+			</td></tr>
+		</table>
+</body>
+</html>
+
+
+<!--Sig:00000040MUqfpTINZl1hd8e7yoILHPbXZKwTurHEKJZCrY9ndju8VoP58hwAv1xUsBZXw9T5VDIxwhLiXZYF7A6L3ba7XtJJ-->
diff --git a/TEWin/Resources/Volume/img/Calculate.png b/TEWin/Resources/Volume/img/Calculate.png
new file mode 100644
index 0000000..3323aec
--- /dev/null
+++ b/TEWin/Resources/Volume/img/Calculate.png
Binary files differ
diff --git a/TEWin/Resources/Volume/img/ModifyTerrain.png b/TEWin/Resources/Volume/img/ModifyTerrain.png
new file mode 100644
index 0000000..0bf22b0
--- /dev/null
+++ b/TEWin/Resources/Volume/img/ModifyTerrain.png
Binary files differ
diff --git a/TEWin/Resources/Volume/img/VolumeBlack.png b/TEWin/Resources/Volume/img/VolumeBlack.png
new file mode 100644
index 0000000..6a3b05b
--- /dev/null
+++ b/TEWin/Resources/Volume/img/VolumeBlack.png
Binary files differ
diff --git a/TEWin/Resources/Volume/img/point.png b/TEWin/Resources/Volume/img/point.png
new file mode 100644
index 0000000..203477e
--- /dev/null
+++ b/TEWin/Resources/Volume/img/point.png
Binary files differ
diff --git a/TEWin/TEWin.csproj b/TEWin/TEWin.csproj
index 37f219b..cf52400 100644
--- a/TEWin/TEWin.csproj
+++ b/TEWin/TEWin.csproj
@@ -170,6 +170,210 @@
     </COMReference>
   </ItemGroup>
   <ItemGroup>
+    <EmbeddedResource Include="Resources\AreaMeasurement\area.html">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\AreaMeasurement\AreaMeasurement.html">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\AreaMeasurement\img\3d_palne_area.png">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\AreaMeasurement\img\delete.png">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\AreaMeasurement\img\delete_last_point.png">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\AreaMeasurement\img\horizontal.png">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\AreaMeasurement\img\snap.png">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\AreaMeasurement\img\surface.png">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\AreaMeasurement\Lang.js">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\DistanceMeasurement\cursor_m.cur">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\DistanceMeasurement\dis.html">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\DistanceMeasurement\distanceMeasurement.html">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\DistanceMeasurement\height.html">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\DistanceMeasurement\Hourglass.cur">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\DistanceMeasurement\img\aerial.png">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\DistanceMeasurement\img\delete.png">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\DistanceMeasurement\img\delete_last_point.png">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\DistanceMeasurement\img\horizontal.png">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\DistanceMeasurement\img\snap.png">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\DistanceMeasurement\img\TerrainProfile.png">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\DistanceMeasurement\img\verticle.png">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\DistanceMeasurement\Lang.js">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\SlopeMapQuery\2052\Lang.js">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\SlopeMapQuery\arrow.png">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\SlopeMapQuery\cursor_m.cur">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\SlopeMapQuery\help.html">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\SlopeMapQuery\img\point.gif">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\SlopeMapQuery\SlopeMapQuery.html">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\SlopeMapQuery\ToolIcon.png">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\TerrainProfile\1033\help.html">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\TerrainProfile\1033\Lang.js">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\TerrainProfile\2052\help.html">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\TerrainProfile\2052\Lang.js">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\TerrainProfile\cursor_m.cur">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\TerrainProfile\help.html">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\TerrainProfile\Hourglass.cur">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\TerrainProfile\img\ButtonBackground.jpg">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\TerrainProfile\img\minmaxAlt.jpg">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\TerrainProfile\img\minmaxSlope.jpg">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\TerrainProfile\img\point.gif">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\TerrainProfile\img\waypoint.jpg">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\TerrainProfile\img\zoomall.png">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\TerrainProfile\img\zoomin.png">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\TerrainProfile\img\zoomout.png">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\TerrainProfile\Lang.js">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\TerrainProfile\TerrainProfile.html">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\TerrainProfile\TerrainProfile.ico">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\TerrainProfile\TerrainProfilePopup.html">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\TerrainProfile\ToolIcon.png">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\Volume\cursor_m.cur">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\Volume\help.html">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\Volume\Hourglass.cur">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\Volume\img\Calculate.png">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\Volume\img\ModifyTerrain.png">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\Volume\img\point.png">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\Volume\img\VolumeBlack.png">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\Volume\Lang.js">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\Volume\ToolIcon.png">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\Volume\Volume.html">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\CrossSection\CrossSection.html">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\CrossSection\CrossSectionPopup.html">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\CrossSection\cursor_m.cur">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\CrossSection\help.html">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\CrossSection\img\Add.png">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\CrossSection\img\SaveObject.png">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\CrossSection\img\SaveObjectDisabled.png">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\CrossSection\Lang.js">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\CrossSection\ToolIcon.png">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
     <Content Include="Resources\log4net4.dll" />
     <Content Include="Resources\Newtonsoft.Json.dll" />
   </ItemGroup>

--
Gitblit v1.9.3