管道基础大数据平台系统开发-【CS】-ExportMap
13693261870
2024-01-03 b138834384e977cfc93cff1c66f70676cd4e7e18
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
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-->