Quellcode durchsuchen

地形填挖方分析

zpf vor 11 Monaten
Ursprung
Commit
e67dfc247f

+ 1 - 1
src/components/Combinations/terrainCombination/TerrainCombination.vue

@@ -7,7 +7,7 @@
         <span :class="{ titleColor: floodShow }" class="title-txt" @click="choose(1)">{{ Resource.FloodAnalysis }}</span>
         <span :class="{ titleColor: slopeShow }" class="title-txt" @click="choose(2)">{{ Resource.terrainSlope }}</span>
         <span :class="{ titleColor: isolineShow }" class="title-txt" @click="choose(3)">{{ Resource.isoline }}</span>
-        <span :class="{ titleColor: isCutFillShow }" class="title-txt" @click="choose(4)">地形平整估算</span>
+        <span :class="{ titleColor: isCutFillShow }" class="title-txt" @click="choose(4)">地形修改分析</span>
 
         <span class="closeBtn" @click="toggleVisibility">&times;</span>
       </div>

+ 61 - 18
src/components/TerrainAnalysis/TerrainCutFillAnalysis/TerrainCutFillAnalysis.vue

@@ -1,18 +1,25 @@
 <template>
   <div v-show="isCutFill" class="cut_fill_box">
-    <div class="cut_fill_centent1">
-      设计深度(米):
-      <el-input class="cut_fill_input" v-model="height" placeholder=""></el-input>
-      <br>
-      土石方量(立方米):
-      <el-input class="cut_fill_input" v-model="result" placeholder=""></el-input>
-
+    <el-radio v-model="radio" label="cut">地形填挖方分析</el-radio>
+    <el-radio v-model="radio" label="smooth">地形平整分析</el-radio>
+
+    <div v-show="radio == 'cut'">
+      <div class="cut_fill_centent1">
+        设计深度(米):
+        <el-input class="cut_fill_input" v-model="height" placeholder=""></el-input>
+        <br>
+        土石方量(立方米):
+        <el-input class="cut_fill_input" v-model="result" placeholder=""></el-input>
+
+      </div>
+      <div class="cut_fill_Buttons">
+        <el-button size="mini" type="primary" @click="draw">绘制</el-button>
+        <el-button size="mini" type="primary" @click="clear">清除</el-button>
+      </div>
     </div>
-    <div class="cut_fill_Buttons">
-      <el-button size="mini" type="primary" @click="draw">绘制</el-button>
-      <el-button size="mini" type="primary" @click="clear">清除</el-button>
-
 
+    <div v-show="radio == 'smooth'">
+      asd
     </div>
   </div>
 </template>
@@ -27,6 +34,7 @@ export default {
   data() {
 
     return {
+      radio: 'cut',
       input: '', sharedState: store.state,
       height: 300,
       result: null,
@@ -45,6 +53,18 @@ export default {
   watch: {},
   //方法集合
   methods: {
+    //地形抽出部分
+    extract(positions) {
+      viewer.scene.globe.removeAllExtractRegion();
+      viewer.scene.globe.addExtractRegion({
+        name: 'extract', //名称
+        position: positions, //区域
+        height: this.height, //开挖深度
+        transparent: false, //封边是否透明
+        extractHeight: this.height, //抽出高度
+        granularity: 1 //精度
+      });
+    },
     draw() {
 
 
@@ -120,13 +140,19 @@ export default {
 
         }
 
-        viewer.scene.globe.removeAllExcavationRegion();
-        viewer.scene.globe.addExcavationRegion({
-          name: 'ggg',
-          position: threeArray,
-          height: Number(that.height),
-          transparent: false
-        });
+        if (that.height < 0) {
+          viewer.scene.globe.removeAllExcavationRegion();
+          viewer.scene.globe.addExcavationRegion({
+            name: 'ggg',
+            position: threeArray,
+            height: Number(-that.height),
+            transparent: false
+          });
+        } else {
+          that.extract(threeArray);
+        }
+
+
 
         that.handler_Cut_fill.polygon.show = false;
         that.handler_Cut_fill.polyline.show = false;
@@ -148,6 +174,8 @@ export default {
       if (that.handler_Cut_fill != null) {
         that.handler_Cut_fill.clear();
         viewer.scene.globe.removeAllExcavationRegion();
+        viewer.scene.globe.removeAllExtractRegion();
+
         that.handler_Cut_fill.deactivate();
         that.handler_Cut_fill = null
         that.result = null;
@@ -205,6 +233,17 @@ export default {
         80,
       );
       viewer.scene.globe.depthTestAgainstTerrain = false;
+
+
+
+      const terrainP = new Cesium.CesiumTerrainProvider({
+        url: 'http://192.168.60.3:8099/iserver/services/3D-local3DCache-SanYaDSMHuanCun/rest/realspace/datas/dsm@dsm',
+        isSct: true//地形服务源自SuperMap iServer发布时需设置isSct为true
+      });
+
+
+      viewer.terrainProvider = terrainP;
+
     })
 
   }, //生命周期 - 挂在完成
@@ -217,6 +256,10 @@ export default {
 };
 </script>
 <style lang="scss" scoped>
+.el-radio {
+  color: white;
+}
+
 .cut_fill_centent1 {
   width: 100%;
   text-align: left;